title: Pass class as generic parameter Typescript
body: <p>im trying to instance a class passed as parameter to another, I have this in one file, ImportedClass.ts:</p>
  
  <pre><code>export default class ImportedClass {
    public constructor(something: any) {
    }
    public async exampleMethod() {
      return "hey";
    }
  }
  </code></pre>
  
  <p>And this in another, InstanceClass.ts:</p>
  
  <pre><code>interface GenericInterface&lt;T&gt; {
    new(something: any): T;
  }
  
  export default class InstanceClass &lt;T&gt; {
    private c: GenericInterface&lt;T&gt;;
    public constructor(c: T) {
    }
    async work() {
      const instanceTry = new this.c("hello");
      instanceTry.exampleMethod();
    }
  }
  </code></pre>
  
  <p>And this in another, ClassCaller.ts: &lt;--EDITED--></p>
  
  <pre><code>import ImportedClass from './ImportedClass';
  import ImportedClass from './InstanceClass';
  
  const simulator = new InstanceClass &lt;ImportedClass&gt;(ImportedClass);
  </code></pre>
  
  <p>Then when I call it like this:</p>
  
  <pre><code>simulator.work();
  </code></pre>
  
  <p>It throw this error:</p>
  
  <pre><code>error TS2339: Property 'exampleMethod' does not exist on type 'T'.
  </code></pre>
  
  <p>Any help is welcome, thanks.</p>