TypeScript Version: 4.0.0-dev.20200512
Search Terms: implements, jsdoc, declaration
Code
file.js:
/**
* @implements {Global.Dispatcher}
*/
export class Dispatcher {
foobar() {
return 42;
};
}
defs.d.ts:
declare namespace Global {
export interface Dispatcher {
foobar(): number;
}
}
tsconfig.json:
{
"compilerOptions": {
"module": "esnext",
"target": "esnext",
"outDir": "lib",
"declaration": true,
"allowJs": true,
"checkJs": true
},
"files": [
"file.js",
"defs.d.ts"
]
}
Expected behavior:
Output declaration file file.d.ts:
/**
* @implements {Global.Dispatcher}
*/
export class Dispatcher implements Global.Dispatcher {
foobar(): number;
}
export {};
Actual behavior:
declare const Dispatcher_base: undefined;
/**
* @implements {Global.Dispatcher}
*/
export class Dispatcher implements Dispatcher_base {
foobar(): number;
}
export {};
The syntax in this declaration file is broken and shows the following error:
'Dispatcher_base' refers to a value, but is being used as a type here.ts(2749)
Playground Link: n/a
Related Issues: #35629 implemented in #36292 CC @sandersn @dragomirtitian
TypeScript Version: 4.0.0-dev.20200512
Search Terms: implements, jsdoc, declaration
Code
file.js:defs.d.ts:tsconfig.json:{ "compilerOptions": { "module": "esnext", "target": "esnext", "outDir": "lib", "declaration": true, "allowJs": true, "checkJs": true }, "files": [ "file.js", "defs.d.ts" ] }Expected behavior:
Output declaration file
file.d.ts:Actual behavior:
The syntax in this declaration file is broken and shows the following error:
Playground Link: n/a
Related Issues: #35629 implemented in #36292 CC @sandersn @dragomirtitian