-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Milestone
Description
π 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 */
class Test {}
export default Test;
Test.js
/** @module Test */
class Test {}
export default Test;
X.js
import Test from './test/Test.js'
/**
* @typedef {Object} Options
* @property {typeof import("./Test.js").default} [test]
*/
class X extends Test {
/**
* @param {Options} options
*/
constructor(options) {
super();
if (options.test) {
this.test = new options.test();
}
}
}
export default X;
π Actual behavior
In the generate file there is a reference to a wrong class name (Test_1
)
X.d.ts
export default X;
export type Options = {
test?: typeof import("./Test.js").default | undefined;
};
/**
* @typedef {Object} Options
* @property {typeof import("./Test.js").default} [test]
*/
declare class X extends Test {
/**
* @param {Options} options
*/
constructor(options: Options);
test: import("./Test.js").default | undefined;
}
import Test_1 from './test/Test.js';
//# sourceMappingURL=X.d.ts.map
π Expected behavior
The class in the import statement should be named Test
.
Metadata
Metadata
Assignees
Labels
Fix AvailableA PR has been opened for this issueA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.