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

namespace-private #7277

Closed
JonathanMEdwards opened this issue Feb 28, 2016 · 2 comments
Closed

namespace-private #7277

JonathanMEdwards opened this issue Feb 28, 2016 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@JonathanMEdwards
Copy link

When building a large library many classes need to define fields and methods that are meant only for use by other classes within the library, not the client. There is no simple way to express this in TypeScript. One can duplicate the entire public API in a set of mirror interfaces classes, but that creates a lot of duplicated code & doc maintenance, and sometime you really want to expose class names to the client. There appears to be a common convention of using the @internal JSDoc tag in this situation but it is not enforced by the compiler nor recognized by JSDoc.

The solution in Java is package-private access. The analogous mechanism in TS would be namespace-private access.

@DanielRosenwasser
Copy link
Member

but it is not enforced by the compiler nor recognized by JSDoc.

The compiler flag you're looking for is --stripInternal, but it's not fully supported.

Is it fair to say this is a duplicate of #321?

@JonathanMEdwards
Copy link
Author

Ah thanks. Perhaps more closely a duplicate of #5228
A fully supported --stripInternal would solve the problem. An 'internal' declaration modifier is a cleaner way to provide that without the noisy @internal JSDoc flag.

@mhegazy mhegazy closed this as completed Mar 3, 2016
@mhegazy mhegazy added the Duplicate An existing issue was already created label Mar 3, 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
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants