From fc628f15ad1f9a4681ff1c80bcb8f07574f0fa76 Mon Sep 17 00:00:00 2001 From: Junle Li Date: Wed, 11 Jun 2014 00:50:36 +0800 Subject: [PATCH] Write defition for JQueryXHR.then method. Working on borisyankov/DefinitelyTyped#2314 --- jquery/jquery.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index d6a6a792e..62b1a3fea 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -168,6 +168,10 @@ interface JQueryXHR extends XMLHttpRequest, JQueryPromise { */ overrideMimeType(mimeType: string): any; abort(statusText?: string): void; + /** + * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details. + */ + then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => void, failCallback: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise; } /**