DefinitelyTyped(import * as alias 语法不适用于 export = class)

DefinitelyTyped ( import * as alias syntax doesn't work with export = class)

我正在尝试为库创建 DefinitelyTyped,但是当我作为别名导入时 import * as f from "foo"; 我收到这条消息

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

文件index.d.ts

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

添加命名空间后就可以了

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