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

Hide private classes #116

Open
wangyan-9067 opened this issue Nov 1, 2018 · 3 comments
Open

Hide private classes #116

wangyan-9067 opened this issue Nov 1, 2018 · 3 comments

Comments

@wangyan-9067
Copy link

Is there any way to hide private classes? I would like dts-generator only generate declarations based on index.ts exports, and I don't want my users to see private classes.

@dylans
Copy link
Contributor

dylans commented Nov 5, 2018

Not that I'm aware of, but it would be a welcomed improvement.

@manwithafox
Copy link

Do you mean some kind of "tree shaking"?
In terms of exported types, only the exported types of the given input files, plus all recursively reachable types from those top-level types should be included in output. This is different from considering all exported types from all (recursively) imported modules.

That would be a really great feature!
I bundle my package (with esbuild) and have a facade file which exports only those types needed for external users - the public api. Everything else is not reachable anyway via the bundle. The d.ts file should reflect this.

@manwithafox
Copy link

Set up a demo repo which shows the issue: https://github.com/manwithafox/demo-dts-facade

  1. [severe] generated d.ts does NOT contain module address.ts: https://github.com/manwithafox/demo-dts-facade/blob/96a226fa41e306c2f5f319ef446b3817b116cae6/foo.d.ts#L2
  2. [above feature request]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants