title: How to make a class implement a call signature in Typescript?
body: <p>I have defined the following interface in typescript:</p>
  
  <pre><code>interface MyInterface {
      () : string;
  }
  </code></pre>
  
  <p>This interface simply introduces a call signature that takes no parameters and returns a string. How do I implement this type in a class? I have tried the following:</p>
  
  <pre><code>class MyType implements MyInterface {
      function () : string {
          return "Hello World.";
      }
  }
  </code></pre>
  
  <p>The compiler keeps telling me that </p>
  
  <blockquote>
    <p>Class 'MyType' declares interface 'MyInterface' but does not implement it: Type 'MyInterface' requires a call signature, but Type 'MyType' lacks one</p>
  </blockquote>
  
  <p>How can I implement the call signature?</p>