dominicbirch / bundle-declarations-webpack-plugin

Webpack wrapper around dts-bundle
MIT License
8 stars 1 forks source link

how to show only explicitly classes in .d.ts #28

Closed shushenghong closed 1 week ago

shushenghong commented 2 months ago

i write a library, many inner classes and functions, i only explicitly export few in the entry index.ts, and i only want show this definations in .d.ts, how to?

dominicbirch commented 2 weeks ago

Hi,

Sorry for not replying sooner!

I this case, it probably wouldn't make sense to use this plug in or a bundle to do it as the intention in this case is to combine the exported types by crawling the imports and producing all exports as 1 . d. ts.

If your index was only using these classes this would be what you get, and if there's nothing to bundle up you could use tsc to emit just the declaration of 1 file.

dominicbirch commented 2 weeks ago

There might also be options of the bundle generator you could take advantage of in order to get a shorter list of exports