From 8ac5e5b4ecb93c70ce14eeec1baea412171f272f Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Fri, 26 May 2017 20:06:57 -0400 Subject: [PATCH] Define type for JQueryStatic.fn. --- types/jquery/index.d.ts | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index ca799f21e5..d9841c1185 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -1,6 +1,26 @@ // Type definitions for jQuery 1.10.x / 2.0.x // Project: http://jquery.com/ -// Definitions by: Boris Yankov , Christian Hoffmeister , Steve Fenton , Diullei Gomes , Tass Iliopoulos , Jason Swearingen , Sean Hill , Guus Goossens , Kelly Summerlin , Basarat Ali Syed , Nicholas Wolverson , Derek Cicerone , Andrew Gaspar , Seikichi Kondo , Benjamin Jackman , Poul Sorensen , Josh Strobl , John Reilly , Dick van den Brink , Thomas Schulz +// Definitions by: Boris Yankov +// Christian Hoffmeister +// Steve Fenton +// Diullei Gomes +// Tass Iliopoulos +// Jason Swearingen +// Sean Hill +// Guus Goossens +// Kelly Summerlin +// Basarat Ali Syed +// Nicholas Wolverson +// Derek Cicerone +// Andrew Gaspar +// Seikichi Kondo +// Benjamin Jackman +// Poul Sorensen +// Josh Strobl +// John Reilly +// Dick van den Brink +// Thomas Schulz +// Leonard Thieu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /* ***************************************************************************** @@ -1146,7 +1166,7 @@ interface JQueryStatic { error(message: any): JQuery; expr: any; - fn: any; //TODO: Decide how we want to type this + readonly fn: JQuery; isReady: boolean; @@ -3781,6 +3801,14 @@ interface JQuery { * @see {@link https://api.jquery.com/queue/#queue-queueName-callback} */ queue(queueName: string, callback: Function): JQuery; + + /** + * Merge the contents of an object onto the jQuery prototype to provide new jQuery instance methods. + * + * @param object An object to merge onto the jQuery prototype. + * @see {@link https://api.jquery.com/jQuery.fn.extend/#jQuery-fn-extend-object} + */ + extend(object: { [method: string]: (...args: any[]) => any; }): JQuery; } declare module "jquery" { export = $;