title: How do I implement an interface which is both callable, and has properties in TypeScript?
body: <p>Given the interface </p>
  
  <pre><code>interface FooWithBar {
      ():void;
      bar():void;
  }
  </code></pre>
  
  <p>how do I write the implementation?</p>
  
  <pre><code>function foo(){
  
  }
  foo.bar = function(){
  
  };
  </code></pre>
  
  <p>does not work, as it throws the error, "Property 'bar' does not exist on type '() => void". But, if I declare the type of <code>foo</code> to be <code>FooWithBar</code></p>
  
  <p>````
      var foo: FooWithBar = function () {</p>
  
  <pre><code>};
  foo.bar = function () {
  
  };
  </code></pre>
  
  <p>````</p>
  
  <p>I get another error, "Type '() => void' is not assignable to type 'FooWithBar'. Property 'bar' is missing in type '() => void'".</p>
  
  <p>How do I solve this catch-22?</p>