Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Private class members show up in d.ts files. #10414

Closed
dbaeumer opened this issue Aug 18, 2016 · 3 comments
Closed

Private class members show up in d.ts files. #10414

dbaeumer opened this issue Aug 18, 2016 · 3 comments
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug

Comments

@dbaeumer
Copy link
Member

TypeScript Version: 1.8.x
Code

export class CancellationTokenSource {

    private _token: CancellationToken;

    get token(): CancellationToken {
            ....
    }
}

The generated d.ts file looks like this:

export declare class CancellationTokenSource {
    private _token;
    token: CancellationToken;
}

The d.ts file shouldn't list private _token;

@kitsonk
Copy link
Contributor

kitsonk commented Aug 18, 2016

Yes it should, because if the class is used an extension the private member is still there, since private is really just a run-time convention. How would someone consuming the typings know that they had a property name conflict that would lead to undesirable behaviour?

@DanielRosenwasser DanielRosenwasser added Working as Intended The behavior described is the intended behavior; this is not a bug Design Limitation Constraints of the existing architecture prevent this from being fixed labels Aug 18, 2016
@DanielRosenwasser
Copy link
Member

See #1867 as well.

@dbaeumer
Copy link
Member Author

Closing since the explanation makes sense to me.

@RyanCavanaugh RyanCavanaugh removed the Design Limitation Constraints of the existing architecture prevent this from being fixed label Aug 18, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug
Projects
None yet
Development

No branches or pull requests

4 participants