-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts filesHelp WantedYou can do thisYou can do this
Milestone
Description
π Search Terms
import export class declarations
π Version & Regression Information
This changed in PR #55472, commit 5ce34ca, version 5.3.0-dev.20230829.
β― Playground Link
No response
π» Code
index.js:
import { Something } from './something';
export { Something } from './something';
export const something = new Something();something.ts (or something.js):
export class Something {}tsconfig.json:
{
"compilerOptions": {
"checkJs": true,
"declaration": true,
"outDir": "dist"
}
}π Actual behavior
The import of Something is missing in the emitted declarations file index.d.ts:
export { Something } from "./something";
export const something: Something;π Expected behavior
The import of Something should be included in the emitted declarations file index.d.ts:
export { Something } from "./something";
export const something: Something;
import { Something } from './something';Additional information about the issue
The problem does not occur if
- the file name is
index.tsinstead ofindex.js export const somethingincludes an explicit JSDoc type annotation (/** @type {Something} */)
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts filesHelp WantedYou can do thisYou can do this