title: Typescript static methods in interfaces
body: <p>I'm looking for a way to require a class to own some static methods without having to implement them by myself (like an interface can define normal methods). Since interfaces do not support static methods, the following code does not work.</p>
  <pre><code>interface MyInterface {
    static fromJSON(json: string): MyInterface
    toJSON(): object
  }
  </code></pre>
  <p>Abstract classes are not the thing I want, because they do not require the developer to write the method himself, but I have to implement it.<br />
  Is there something similar to this, without having to write lots of custom logic?</p>
  <p>Using the interface from above, the following implementation should not be accepted:</p>
  <pre><code>class MyClass implements MyInterface {
    // Missing static method &quot;fromJSON&quot;
    toJSON() {
      return {}
    }
  }
  </code></pre>
  <p>Neither should this one:</p>
  <pre><code>class MyClass implements MyInterface {
    static fromJSON(json: string) {
      return 123 // Wrong type
    }
  
    toJSON() {
      return {}
    }
  }
  </code></pre>
  <p>But this one should be accepted:</p>
  <pre><code>class MyClass implements MyInterface {
    static fromJSON(json: string) {
      return new MyClass()
    }
  
    toJSON() {
      return {}
    }
  }
  </code></pre>