Open
Description
TypeScript Version: 3.0.1
Search Terms: Cannot find name import default
Code
// fetch.d.ts
declare function fetch(url: string): Promise<any>;
export = fetch;
declare namespace fetch {
export { fetch as default };
}
// index.ts
import f from "./fetch";
f("url"); // error TS2304: Cannot find name 'f'
Expected behavior: Name should be found
Actual behavior: Cannot find name. Interestingly import { default as f } from "./fetch";
works.
Playground Link: (It doesn't support modules :/)
Related Issues: Couldn't find one