title: Class constructor type in typescript?
body: <p>How can I declare a <code>class</code> type, so that I ensure the object is a constructor of a general class? </p>
  
  <p>In the following example, I want to know which type should I give to <code>AnimalClass</code> so that it could either be <code>Penguin</code> or <code>Lion</code>:</p>
  
  <pre><code>class Animal {
      constructor() {
          console.log("Animal");
      }
  }
  
  class Penguin extends Animal {
      constructor() {
          super();
          console.log("Penguin");
      }
  }
  
  class Lion extends Animal {
      constructor() {
          super();
          console.log("Lion");
      }
  }
  
  class Zoo {
      AnimalClass: class // AnimalClass could be 'Lion' or 'Penguin'
  
      constructor(AnimalClass: class) {
          this.AnimalClass = AnimalClass
          let Hector = new AnimalClass();
      }
  }
  </code></pre>
  
  <p>Of course, the <code>class</code> type does not work, and it would be too general anyway.</p>