1
我有2個定義文件:foo.d.ts和bar.d.tsES6進口隱藏打字稿定義文件
// 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 {
}
我缺少什麼?