title: Extending a generic parameter in Typescript
body: <p>I want to create a utility function which creates a checklist by adding an <code>isChecked</code> knockout observable property to each item in an array. This function should look like this:</p>
  
  <pre><code>createCheckList&lt;T&gt;(allEntities: T[], selected: T[]) : CheckListItem&lt;T&gt; {
      ...
  }
  </code></pre>
  
  <p>I am returning a <code>CheckListItem&lt;T&gt;</code> because this interface should extend T to add the <code>isChecked</code> property. However, typescript will not allow me to do this:</p>
  
  <pre><code>interface CheckListItem&lt;T&gt; extends T {
      isChecked: KnockoutObservable&lt;boolean&gt;;
  }
  </code></pre>
  
  <p>Gives me the error:</p>
  
  <blockquote>
    <p>An interface may only extend another class or interface.</p>
  </blockquote>
  
  <p>Is there any way to do this?</p>