Skip to content

namespace-private #7277

Closed
Closed
@JonathanMEdwards

Description

@JonathanMEdwards

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions