如何从模块中重新导出所有类型?

Ram*_*zar 7 typescript

我想重新导出模块中的所有类型。有办法实现这一点吗?

我确实尝试过:

export type * from 'react-router-dom';
Run Code Online (Sandbox Code Playgroud)

但它不起作用:

只有命名导出可以使用“导出类型”。TS(1383)

Jus*_*ple 6

Typescript 5.0 现在支持此功能:

\n
export type * from "external-module"\n\n//OR\n\nexport type * as ns from "external-module".\n
Run Code Online (Sandbox Code Playgroud)\n

更新打字稿,你\xe2\x80\x99就可以了!

\n