title: Typescript Create Generic Object
body: <p>I'm trying to create an object in typescript.
  I want to do this generically so that it automatically gets it's default based off of its type</p>
  
  <pre><code>interface IModal {
      content: string;
      count: number
   }
  </code></pre>
  
  <p>Normally I would declare an Instance of it like so:</p>
  
  <pre><code>var modal: IModal = {
      content: '',
      count: 0
  };
  </code></pre>
  
  <p>I don't want to have to do this everytime. I want to do this so that the it automatically create an instance of the interface with Typed default i.e </p>
  
  <pre><code>number = 0,
  string = '',
  boolean = false,
  MyCustom = new MyCustom
  </code></pre>
  
  <p>I want to do something like this:</p>
  
  <pre><code>export class MakeObject {
  
       Make&lt;T&gt; : T = function(iInterface) =&gt; {
          return default(T);
       }     
  }
  </code></pre>
  
  <p>But I don't think that will work</p>