TypeScript - Error calling jQuery getJSON() function
<p>I am using TypeScript 1.7.5 and the latest jQuery type definition. The following call to $.getJSON() fails with "error TS2346: Supplied parameters do not match any signature of call target"</p>

<pre><code>let url: string = api + '/orgs/' + orgname + '/repos?per_page=100';
$.getJSON(url, function(repos: Repo[]) {
    ...
});
</code></pre>

<p>Repo is defined as:</p>

<pre><code>export interface Repo {
    name: string;
    stargazers_count: number;
    forks_count: number;
}
</code></pre>

<p>The type definition for getJSON() is:</p>

<pre><code>getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) =&gt; any): JQueryXHR;
</code></pre>

<p>What am I missing?</p>

<p><strong>Update</strong></p>

<p>I found that the error is really coming from chaining a call to <code>error()</code>, which is perfectly legal in regular jQuery. If I remove this call to <code>error()</code> the error goes away. Any idea how I could handle the error from <code>getJSON()</code> in TypeScript?</p>

<pre><code>interface Repo {
    name: string;
    stargazers_count: number;
    forks_count: number;
}
var url = "/echo/json/";

$.getJSON(url, (data: any, textStatus: string, jqXHR: JQueryXHR) =&gt; {
    var repos: Repo[] = data;
    //...
    alert(JSON.stringify(repos));
})
.error(function() {
    callback([]);
});
</code></pre>