Note that using export default in your .d.ts files requires esModuleInterop: true to work. If you can’t have esModuleInterop: true in your project, such as when you’re submitting a PR to Definitely Typed, you’ll have to use the export= syntax instead. This older syntax is harder to use but works everywhere. Here’s how the above example would have to be written using export=:
Changing the
.d.ts
file default export syntax to be more compatible.https://www.typescriptlang.org/docs/handbook/declaration-files/templates/module-d-ts.html#default-exports