0
votes

I m trying to create a DefinitelyTyped for a library, but when I import as alias import * as f from "foo"; I'm having this message

This module can only be referenced with ECMAScript imports/exports by turning on the 'allowSyntheticDefaultImports' flag and referencing its default export.

File index.d.ts

declare module "foo" {
  function test(): void;
  export = test;
}
1

1 Answers

0
votes

After adding namespace it's work

declare module "foo" {
  function test(): void;
  namespace test{}
  export = test;
}