【发布时间】:2017-02-02 14:36:13
【问题描述】:
我有 2 个定义文件:foo.d.ts 和 bar.d.ts
// foo.d.ts
interface IBaseInterface {
// stuff
}
// bar.d.ts
interface IDerivedInterface extends IBaseInterface {
// more stuff
}
这很好用。我将 ES6 导入添加到 foo.d.ts 的那一刻,我的整个应用程序不再能够“看到”它的内容。
例如,将 foo.d.ts 修改为以下内容:
// foo.d.ts
import { SomeClass } from 'my-module';
interface IBaseInterface {
baz: SomeClass;
}
对 bar.d.ts 执行以下操作:
// bar.d.ts
// ERROR: Cannot find name IBaseInterface
interface IDerivedInterface extends IBaseInterface {
}
我错过了什么?
【问题讨论】:
标签: typescript visual-studio-2015 typescript1.8 typescript-typings