title: How to use underscore lib from DefinitelyTyped with typescript?
body: <p><a href="https://github.com/borisyankov/DefinitelyTyped" rel="noreferrer">DefinitelyTyped</a> has provided a underscore declaration file, which defines a <code>List</code> interface, and used it heavily in the code.</p>
  
  <pre><code>// Common interface between Arrays and jQuery objects
  interface List {
      [index: number]: any;
      length: number;
  }
  
  interface UnderscoreStatic {
      sortBy(list: List, iterator?: any, context?: any): any;
      groupBy(list: List, iterator: any): any;
      countBy(list: List, iterator: any): any;
  }
  </code></pre>
  
  <p>I'm trying to use the <code>countBy</code> function:</p>
  
  <pre><code>// &lt;reference path="../DefinitelyTyped/underscore/underscore.d.ts" /&gt;
  
  declare var _: UnderscoreStatic;
  
  _.countBy([1,2,3], function(item) {
      return item%2;
  });
  </code></pre>
  
  <p>When I compile the file, it throws error:</p>
  
  <pre><code>&gt; tsc commons.ts
  
  &gt; E:/commons.ts(5,0): Supplied parameters do not match any signature of call target:
      Could not apply type 'List' to argument 1, which is of type 'number[]'
  </code></pre>
  
  <p>I don't know why this error happened, since <code>number[]</code> fit the interface <code>List</code>.</p>
  
  <p>Where is wrong, and how to fix it?</p>