How to define static property in TypeScript interface

前端 未结 14 1232
你的背包
你的背包 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:15

    You can merge interface with namespace using the same name:

    interface myInterface { }
    
    namespace myInterface {
      Name:string;
    }
    

    But this interface is only useful to know that its have property Name. You can not implement it.

提交回复
热议问题