所以我有
declare module "test" {
declare export type running = number;
}
在一个lib文件中,我想知道如何使用这个模块,它到底有什么用。
如果我试着做这样的事情。
async function testMe (testing_stuff /* : test.running */) {
}
它不知道什么 test
是。
但如果我没有在一个模块中使用它,我可以直接使用 running
如
declare type running = number;
那就用它作为。
async function testMe (testing_stuff /* : running */) {
}
那么这里的模块有什么用呢?
你应该可以做到
/*:: import type { running } from "test"; */
async function testMe (testing_stuff /* : running */) {
}
从模块中导入类型。