How to define static property in TypeScript interface

前端 未结 14 1240
你的背包
你的背包 2020-11-28 05:49

I just want to declare a static property in typescript interface? I have not found anywhere regarding this.

interface myInterface {
  static         


        
14条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-28 06:00

    @duncan's solution above specifying new() for the static type works also with interfaces:

    interface MyType {
        instanceMethod();
    }
    
    interface MyTypeStatic {
        new():MyType;
        staticMethod();
    }
    

提交回复
热议问题