title: Typescript inherited classes as function parameters
body: <p>I have a typescript question here.</p>
  
  <p>I have many model classes, that are all inherited from BaseModel</p>
  
  <pre><code>class BaseModel {
      public isChecked: boolean;
  }
  
  class Animal extends BaseModel {
      public id: number;
  }
  
  class Car extends BaseModel {
      public hasHotWheels: boolean;
  }
  </code></pre>
  
  <p>Now I need to write a function that accepts arguments that are classes that inherit from the BaseModel. I can explicitly list all the classes, but I have more than 50 models that inherit from the BaseModel class, so my question is, can I somehow state that I expect the function parameter to inherit from a said class like so</p>
  
  <pre><code>function foo( _input: inherits from BaseModel ) {} 
  </code></pre>