title: TypeScript - obtaining generic type information after a type has been erased
body: <p>Since TypeScript uses type erasure for generics, I'm working on an alternative solution for gathering type information at runtime. </p>
  
  <p>The solution I've come up with is similar to that in Java, using a <code>Class&lt;T&gt;</code>. </p>
  
  <p>It works, but it doesn't feel...<em>complete</em></p>
  
  <pre><code>type Class&lt;T&gt; = { prototype: T }
  
  function passMeAClass&lt;T&gt;(cls: Class&lt;T&gt;): void {
      console.log(cls);
  }
  
  passMeAClass(String)
  </code></pre>
  
  <ul>
  <li>Is <code>type Class&lt;T&gt; = { prototype: T }</code> <em>complete</em> enough?</li>
  <li>Is there a better approach to do this?</li>
  </ul>