How to define static property in TypeScript interface

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

    Yes, it is possible. Here is the solution

    export interface Foo {
    
        test(): void;
    }
    
    export namespace Foo {
    
        export function statMethod(): void {
            console.log(2);
        }
    
    }
    

提交回复
热议问题