Output files are not recognized without exports
See original GitHub issueSorry if I’m understanding something wrong here. I’m still learning TypeScript (or rather exporting TypeScript definitions from a JavaScript project).
The generated d.ts
files don’t have any export
statements. Your readme states that the JSDoc @exports
annotation is not needed as everything is exported, but I’m not sure how the generated definitions are supposed to work without export
statements.
VSCode
VSCode uses the DefinitelyTyped repository in order to automatically fetch TypeScript definitions for auto completion and documentation tooltips.
Every single of them has export
statements and they don’t seem to work without them.
fast-deep-equal
fast-deep-equal is distributed with its own definition file and VSCode recognizes that one and displays basic typing info.
resource-loader
Your module resource-loader also gets distributed with its own definition file, but that one doesn’t have export
statement as it comes from tsd-jsdoc
.
Trying with module.default
.
Trying with new module.default()
.
Trying with new module.Loader()
.
Question
Do you think tsd-jsdoc
could need the option to create a TypeScript definition file that contains export
statements? If not, I guess I will have to write a post processor that takes tsd-jsdoc
-generated files as input and outputs TypeScript definitions with export
statements.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
I’m currently leaning towards marking anything within a “declare module” as export, and letting you use
@ignore
, etc to skip things.Depends on what you mean, I definitely want to support ES6 but there is only so much that can be done on this side of jsdoc. I’m open to changes to work around jsdoc limitations though.
@englercj,
When using the TypeScript compiler to generate definitions, the following:
Results in:
Is it not possible for this library to do the same?
(I’m unable to use the TS compiler because of the issues mentioned here.)
Edit: I guess that might require a separate output file to be generated for each input file?