diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index 486df86e0..c3be009d5 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -2461,7 +2461,7 @@ function test_isNumeric() { $.isNumeric("8e5"); $.isNumeric(3.1415); $.isNumeric(+10); - $.isNumeric(0144); + $.isNumeric(144); $.isNumeric(""); $.isNumeric({}); $.isNumeric(NaN); diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 064f6f51a..8b9964287 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -307,6 +307,11 @@ interface JQueryPromiseCallback { (value?: T, ...args: any[]): void; } +interface JQueryPromiseOperator { + (callback: JQueryPromiseCallback, ...callbacks: JQueryPromiseCallback[]): JQueryPromise; + (callback: JQueryPromiseCallback[], ...callbacks: JQueryPromiseCallback[]): JQueryPromise; +} + /** * Interface for the JQuery promise, part of callbacks */ @@ -317,52 +322,28 @@ interface JQueryPromise { * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. */ - always(alwaysCallbacks1?: JQueryPromiseCallback, ...alwaysCallbacks2: JQueryPromiseCallback[]): JQueryDeferred; + always: JQueryPromiseOperator; /** * Add handlers to be called when the Deferred object is resolved. * * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. */ - done(doneCallbacks1?: JQueryPromiseCallback, ...doneCallbacks2: JQueryPromiseCallback[]): JQueryDeferred; + done: JQueryPromiseOperator; /** * Add handlers to be called when the Deferred object is rejected. * * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. */ - fail(failCallbacks1?: JQueryPromiseCallback, ...failCallbacks2: JQueryPromiseCallback[]): JQueryDeferred; + fail: JQueryPromiseOperator; /** * Add handlers to be called when the Deferred object generates progress notifications. * * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. */ - progress(...progressCallbacks: JQueryPromiseCallback[]): JQueryDeferred; - - /** - * Add handlers to be called when the Deferred object is either resolved or rejected. - * - * @param alwaysCallbacks A function, or array of functions, that is called when the Deferred is resolved or rejected. - */ - always(...alwaysCallbacks: any[]): JQueryPromise; - /** - * Add handlers to be called when the Deferred object is resolved. - * - * @param doneCallbacks A function, or array of functions, that are called when the Deferred is resolved. - */ - done(...doneCallbacks: any[]): JQueryPromise; - /** - * Add handlers to be called when the Deferred object is rejected. - * - * @param failCallbacks A function, or array of functions, that are called when the Deferred is rejected. - */ - fail(...failCallbacks: any[]): JQueryPromise; - /** - * Add handlers to be called when the Deferred object generates progress notifications. - * - * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. - */ - progress(...progressCallbacks: any[]): JQueryPromise; + progress(progressCallback: JQueryPromiseCallback): JQueryPromise; + progress(progressCallbacks: JQueryPromiseCallback[]): JQueryPromise; /** * Determine the current state of a Deferred object. @@ -479,8 +460,9 @@ interface JQueryDeferred extends JQueryPromise { * * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. */ - progress(...progressCallbacks: JQueryPromiseCallback[]): JQueryDeferred; - + progress(progressCallback: JQueryPromiseCallback): JQueryDeferred; + progress(progressCallbacks: JQueryPromiseCallback[]): JQueryDeferred; + /** * Call the progressCallbacks on a Deferred object with the given args. *