在此声明中,我希望接口(interface) ITest 具有来自外部模块“modA”的类型为“ModA”的属性“modA”:
declare module foo {
interface ITest {
str: string;
modA: ModA;
}
}
declare module "modA" {
class ModA {
num: number;
}
export = ModA;
}
最佳答案
在任何地方使用外部模块,然后使用 RequireJS 包中的 r.js 对其进行优化。
关于typescript - 有没有办法让环境声明中的内部模块使用外部模块的类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21208879/