From dc067ac82c686e0cd11bdcf5190510ef14bf97b2 Mon Sep 17 00:00:00 2001 From: Bobdina Date: Mon, 23 Mar 2015 11:15:22 +0100 Subject: [PATCH] Update jquery.d.ts - deferred.fail() always returns the deferred object, ergo the failfilter can return anything - taking in the value parameter for a donefilter is optional - if a donefilter does not return anything, then the 'then' function continues with a void promise --- jquery/jquery.d.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 2452ec3773..61fd624422 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -276,7 +276,15 @@ interface JQueryGenericPromise { * @param doneFilter A function that is called when the Deferred is resolved. * @param failFilter An optional function that is called when the Deferred is rejected. */ - then(doneFilter: (value: T, ...values: any[]) => U|JQueryPromise, failFilter?: (...reasons: any[]) => U|JQueryPromise, progressFilter?: (...progression: any[]) => any): JQueryPromise; + then(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; + + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + */ + then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; } /**