🔎 Search Terms
type definitions invalid name
🕗 Version & Regression Information
- This is the behavior since TypeScript 4.0, worked in 3.9.10
⏯ Playground Link
https://github.com/MoonE/ts-types-bug
💻 Code
test/Test.js
/** @module test/Test */classTest{}exportdefaultTest;Test.js
/** @module Test */classTest{}exportdefaultTest;X.js
importTestfrom'./test/Test.js'/** * @typedef {Object} Options * @property {typeof import("./Test.js").default} [test] */classXextendsTest{/** * @param {Options} options */constructor(options){super();if(options.test){this.test=newoptions.test();}}}exportdefaultX;🙁 Actual behavior
In the generate file there is a reference to a wrong class name (Test_1)
X.d.ts
exportdefaultX;exporttypeOptions={test?: typeofimport("./Test.js").default|undefined;};/** * @typedef {Object} Options * @property {typeof import("./Test.js").default} [test] */declareclassXextendsTest{/** * @param {Options} options */constructor(options: Options);test: import("./Test.js").default|undefined;}importTest_1from'./test/Test.js';//# sourceMappingURL=X.d.ts.map🙂 Expected behavior
The class in the import statement should be named Test.
🔎 Search Terms
type definitions invalid name
🕗 Version & Regression Information
⏯ Playground Link
https://github.com/MoonE/ts-types-bug
💻 Code
🙁 Actual behavior
In the generate file there is a reference to a wrong class name (
Test_1)🙂 Expected behavior
The class in the import statement should be named
Test.