I am using TypeScript 0.8.2 and the latest jQuery 1.9.d.ts definitions from https://github.com/borisyankov/DefinitelyTyped/tree/master/jquery
To isolate the problem, I have a simple TypeScript class definition that tries to make a single call to $ .ajax using the syntax .when () and .then (). Here is my code:
/// <reference path="../../jquery.d.ts" /> module Demo { // Class export class TestDeferred { // Constructor constructor() { $.when(this.testAjaxCall()).then((data, status, jqXHR: JQueryXHR) => { alert(jqXHR.statusText); }); $.when($.ajax("test.htm")).then(() => { console.log("yay"); }); } testAjaxCall() { return $.ajax("Test.aspx"); } } }
In both of these test cases, I get a compile-time error that reads:
The supplied parameters do not correspond to any signature of the target call, and red squiggly - according to the first parameter of the .when () method. He screenshot:

As far as I can tell, the .when () method in the .d.ts file has an overload of .when (options: any), and .ajax is defined as a JQueryXHR type that implements the JQueryPromise interface.
In theory, this should work fine, as it reflects the jQuery documentation for .when () http://api.jquery.com/jQuery.when/
$.when( $.ajax("test.aspx") ).then(function(data, textStatus, jqXHR){ alert( jqXHR.status );
So what am I missing? Did I spot something wrong?
source share