title: Add function to type in TypeScript
body: <p>I'm trying to extend the functionality of a type in TypeScript, and it seems to work OK so long as it's a "real" type, but if I try to declare a function for an interface that is implemented by other types in the same way, I get compiler errors.</p>
  
  <p>Here's an example that works:</p>
  
  <pre><code>interface Set&lt;T&gt; {
      min(): T;
  }
  
  Set.prototype.min = function() {
      return 0;
  }
  </code></pre>
  
  <p>But this one doesn't:</p>
  
  <pre><code>interface IterableIterator&lt;T&gt; {
      min(): T;
  }
  
  IterableIterator.prototype.min = function() {
      return 0;
  }
  </code></pre>
  
  <p>Here I get a compiler error on the implementation <code>error TS2693: 'IterableIterator' only refers to a type, but is being used as a value here.</code>.</p>
  
  <p>What would be the correct way to define and implement a function that would apply to/be available for all interfaces implementing <code>IterableIterator</code>?</p>