title: Infer constructor type in TypeScript
body: <p>Is it possible to infer the constructor type of a class in TypeScript?
  I tried this but it seems not to work:</p>
  
  <pre><code>type Constructor&lt;K&gt; = K extends { new: infer T } ? T : any;
  </code></pre>