-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Invalid d.ts file generated from valid input #361
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
Comments
|
It might make more sense when combined with |
However, currently an NPM package "dts-bundle" exists for converting the tsc-generated typings to external-module-applicable typings. And that works perfectly but for this issue. If this were solved, then the use case for external modules has a proper workaround. Sounds pretty cheap to me. |
dts-bundle is a huge hack that relies on crude text transforms of regular .d.ts files. This functionality should be a feature of the compiler. Having this properly solved and being able to bundle .d.ts files in npm packages would help TS adoption in node.js space a lot. |
@Bartvds I totally agree with you. And for the time being it would already be nice if the workaround worked. |
Confirmed in new compiler |
Fixed with 875d0c0 |
Great, thank you! I'm looking forward to the next release. |
tsc generates a .d.ts file that it subsequently cannot parse anymore.
Input file: myfile.ts
Input file: used.d.ts
Typescript command, tsc version 1.0.3.0:
Output file myfile.d.ts
This output file cannot be used, it generates a compile error: TS1008: Unexpected token; 'type name' expected. It does so on the quoted "some_used_module".SomeClass.
Expected output file myfile.d.ts:
A workaround is exporting bar from used.d.ts. However this breaks encapsulation unnecessarily, as ALL of bar is now exposed.
The text was updated successfully, but these errors were encountered: