3 ms·
I think what you're looking for is an `internal` modifier. This allows class members to be public within a library, but private outside it. It's been proposed
by mubou 1y ago
I think what you're looking for is an `internal` modifier. This allows class members to be public within a library, but private outside it.
It's been proposed since 2015: https://github.com/microsoft/TypeScript/issues/5228 https://github.com/microsoft/TypeScript/issues/5228
Currently, you can use `@internal` in jsdoc, which with the `stripInternal` option in tsconfig will cause it to be omitted from the type declarations for a similar effect.
https://www.typescriptlang.org/tsconfig/#stripInternal https://www.typescriptlang.org/tsconfig/#stripInternal
Edit: I've also seen libraries abuse `@deprecated` to inform users not to use an internal API:
https://www.typescriptlang.org/play/?#example/jsdoc-deprecated https://www.typescriptlang.org/play/?#example/jsdoc-deprecat...
- noduerme 1y agoThanks! This is a great answer and starting point. Wish I could upvote you more.