我如何在typescript中的接口属性上定义一个类?

时间:2015-12-02 17:06:01

标签: typescript definitelytyped tsd

我试图为第三方(Skuid)提供的API创建定义文件,并遇到代表skuid.ui.Editor的问题,其中Editor是Skuid在其他地方定义的类。我如何通知typescript编译器new skuid.ui.Editor()确实有效?

1 个答案:

答案 0 :(得分:0)

你通常会写这样的东西:

declare namespace skuid.ui {
    class Editor {
        constructor();
        // Methods and properties here
    }
}