Have the @parcel/transformer-typescript-types ignore methods mark with /** @internal */
🙋 feature request
Have the @parcel/transformer-typescript-types package ignore classes, methods, etc. that are marked as /** @internal */.
🤔 Expected Behavior
When a method is marked as @internal I expect it to be omitted from the resulting types.d.ts
😯 Current Behavior
There is currently no way for me to skip something when generating type definition files.
💁 Possible Solution
The collect.js file could detect the @internal tag on symbols and skip them.
🔦 Context
I'm creating a typescript library and I want to export the type definitions but when I do that with Parcel it includes all kinds of internal types and classes because I have some 'public' methods on public classes that are only used internally (I mark those methods with an underscore prefix). If I (for the test) remove those methods the extra internal types/classes are neatly omitted.
💻 Examples
This is an example of an internal method: peer.ts#L227. It's prefixed with an underscore to note that users of the library should not use it (typescript doesnt have an 'internal' access modifier). When I add the "types" directive to the package.json and build the project I get a netlib.d.ts file exporting including all the subtypes that are used by the argument of this internal method. I would love if I could annotate that method somehow and that then the package @parcel/transformer-typescript-types skips it.
I could possibly make a pull-request if needed. 👍🏻
Isn't this basically solved by setting stripInternal to true in tsconfig.json?
hey! sorry for the late reply. We finally go to testing stripInternal: true and that is exactly what we needed. 👍🏻
Thanks! Closing the issue now.