Private types are exported
See original GitHub issueBug report This bundler exports private types. (“Private” as in “not exported”. This has nothing to do with private fields.)
This is a problem because this means that you can no longer split one complex type into many simpler types.
Input code
This is a very simple example. In reality, B
is reused across different exported types but kept private because it doesn’t make sense on its own. Users of my library shouldn’t be able to refer to B
, hence it is not exported.
export type A = string | B;
type B = number;
Expected output
// Generated by dts-bundle-generator v5.8.0
export declare type A = string | B;
declare type B = number;
export {};
Actual output
// Generated by dts-bundle-generator v5.8.0
export declare type A = string | B;
export declare type B = number;
export {};
Additional context
CLI: npx dts-bundle-generator -o my.d.ts src/foo.ts
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
private type with exported fields - Stack Overflow
It seems to me, that in order to have access to one of the exported fields, you would have to be able to...
Read more >Documentation - TypeScript 3.8
TypeScript 3.8 adds a new syntax for type-only imports and exports. ... TypeScript 3.8 brings support for ECMAScript's private fields, part of the...
Read more >Return type of exported function has or is using private name ...
Return type of exported function has or is using private name 'PaginatedResponseClass'. Issue #670 · MichalLytek/type-graphql · GitHub.
Read more >Public vs. private · YourBasic Go
Exported and unexported identifiers are used to describe the public interface of a package and to guard against certain programming errors.
Read more >Export Clauses - Scala 3 - EPFL
An export clause defines aliases for selected members of an object. ... new Printer { type PrinterType = InkJet } private val scanUnit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The new version 5.9 has been published with the fix.
I just tested it out and it worked beautifully as expected.