title: Build a function object with properties in TypeScript
body: <p>I want to create a function object, which also has some properties held on it. For example in JavaScript I would do:</p>
  
  <pre><code>var f = function() { }
  f.someValue = 3;
  </code></pre>
  
  <p>Now in TypeScript I can describe the type of this as:</p>
  
  <pre><code>var f: { (): any; someValue: number; };
  </code></pre>
  
  <p>However I can't actually build it, without requiring a cast. Such as:</p>
  
  <pre><code>var f: { (): any; someValue: number; } =
      &lt;{ (): any; someValue: number; }&gt;(
          function() { }
      );
  f.someValue = 3;
  </code></pre>
  
  <p>How would you build this without a cast?</p>