Closed
Description
TypeScript Version: 3.8.2
Search Terms: allowJs declaration 'async' modifier cannot be used in an ambient context.ts
Code
see code
when run tsc with allowJs and declaration flags enabled the code below
export class TestJS {
callAsync() {
return Promise.resolve(1);
}
async test() {
await this.callAsync();
}
}
produce the declaretion:
export class TestJS {
callAsync(): Promise<number>;
async test(): Promise<void>; --> error
}
but when a try to use this class I receive 'async' modifier cannot be used in an ambient context.ts(1040)
Expected behavior:
the TestJS.d.ts shouldn't contain async
Actual behavior:
TestJS.d.ts conteins async
Playground Link: code
Related Issues: