jquery.d.ts (370970B)
1 // Type definitions for jquery 3.2 2 // Project: https://jquery.com 3 // Definitions by: Leonard Thieu <https://github.com/leonard-thieu> 4 // Boris Yankov <https://github.com/borisyankov> 5 // Christian Hoffmeister <https://github.com/choffmeister> 6 // Steve Fenton <https://github.com/Steve-Fenton> 7 // Diullei Gomes <https://github.com/Diullei> 8 // Tass Iliopoulos <https://github.com/tasoili> 9 // Jason Swearingen <https://github.com/jasons-novaleaf> 10 // Sean Hill <https://github.com/seanski> 11 // Guus Goossens <https://github.com/Guuz> 12 // Kelly Summerlin <https://github.com/ksummerlin> 13 // Basarat Ali Syed <https://github.com/basarat> 14 // Nicholas Wolverson <https://github.com/nwolverson> 15 // Derek Cicerone <https://github.com/derekcicerone> 16 // Andrew Gaspar <https://github.com/AndrewGaspar> 17 // Seikichi Kondo <https://github.com/seikichi> 18 // Benjamin Jackman <https://github.com/benjaminjackman> 19 // Poul Sorensen <https://github.com/s093294> 20 // Josh Strobl <https://github.com/JoshStrobl> 21 // John Reilly <https://github.com/johnnyreilly> 22 // Dick van den Brink <https://github.com/DickvdBrink> 23 // Thomas Schulz <https://github.com/King2500> 24 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped 25 // TypeScript Version: 2.3 26 27 declare module 'jquery' { 28 export = jQuery; 29 } 30 31 declare module 'jquery/dist/jquery.slim' { 32 export = jQuery; 33 } 34 35 declare const jQuery: JQueryStatic; 36 declare const $: JQueryStatic; 37 38 // Used by JQuery.Event 39 type _Event = Event; 40 // Used by JQuery.Promise3 and JQuery.Promise 41 type _Promise<T> = Promise<T>; 42 43 interface JQueryStatic<TElement extends Node = HTMLElement> { 44 /** 45 * @see {@link http://api.jquery.com/jquery.ajax/#jQuery-ajax1} 46 * @deprecated Use jQuery.ajaxSetup(options) 47 */ 48 ajaxSettings: JQuery.AjaxSettings; 49 /** 50 * A factory function that returns a chainable utility object with methods to register multiple 51 * callbacks into callback queues, invoke callback queues, and relay the success or failure state of 52 * any synchronous or asynchronous function. 53 * 54 * @param beforeStart A function that is called just before the constructor returns. 55 * @see {@link https://api.jquery.com/jQuery.Deferred/} 56 * @since 1.5 57 */ 58 Deferred: JQuery.DeferredStatic; 59 Event: JQuery.EventStatic<TElement>; 60 /** 61 * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize 62 * CSS property naming, or create custom properties. 63 * 64 * @see {@link https://api.jquery.com/jQuery.cssHooks/} 65 * @since 1.4.3 66 */ 67 cssHooks: JQuery.PlainObject<JQuery.CSSHook<TElement>>; 68 /** 69 * An object containing all CSS properties that may be used without a unit. The .css() method uses this 70 * object to see if it may append px to unitless values. 71 * 72 * @see {@link https://api.jquery.com/jQuery.cssNumber/} 73 * @since 1.4.3 74 */ 75 cssNumber: JQuery.PlainObject<boolean>; 76 readonly fn: JQuery<TElement>; 77 fx: { 78 /** 79 * The rate (in milliseconds) at which animations fire. 80 * 81 * @see {@link https://api.jquery.com/jQuery.fx.interval/} 82 * @since 1.4.3 83 * @deprecated 3.0 84 */ 85 interval: number; 86 /** 87 * Globally disable all animations. 88 * 89 * @see {@link https://api.jquery.com/jQuery.fx.off/} 90 * @since 1.3 91 */ 92 off: boolean; 93 step: JQuery.PlainObject<JQuery.AnimationHook<Node>>; 94 }; 95 /** 96 * A Promise-like object (or "thenable") that resolves when the document is ready. 97 * 98 * @see {@link https://api.jquery.com/jQuery.ready/} 99 * @since 1.8 100 */ 101 ready: JQuery.Thenable<JQueryStatic<TElement>>; 102 /** 103 * A collection of properties that represent the presence of different browser features or bugs. 104 * Intended for jQuery's internal use; specific properties may be removed when they are no longer 105 * needed internally to improve page startup performance. For your own project's feature-detection 106 * needs, we strongly recommend the use of an external library such as Modernizr instead of dependency 107 * on properties in jQuery.support. 108 * 109 * @see {@link https://api.jquery.com/jQuery.support/} 110 * @since 1.3 111 * @deprecated 1.9 112 */ 113 support: JQuery.PlainObject; 114 valHooks: JQuery.PlainObject<JQuery.ValHook<TElement>>; 115 /** 116 * Creates DOM elements on the fly from the provided string of raw HTML. 117 * 118 * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML. 119 * A string defining a single, standalone, HTML element (e.g. <div/> or <div></div>). 120 * @param ownerDocument_attributes A document in which the new elements will be created. 121 * An object of attributes, events, and methods to call on the newly-created element. 122 * @see {@link https://api.jquery.com/jQuery/} 123 * @since 1.0 124 * @since 1.4 125 */ 126 (html: JQuery.htmlString, ownerDocument_attributes: Document | JQuery.PlainObject): JQuery<TElement>; 127 /** 128 * Accepts a string containing a CSS selector which is then used to match a set of elements. 129 * 130 * @param selector A string containing a selector expression 131 * @param context A DOM Element, Document, or jQuery to use as context 132 * @see {@link https://api.jquery.com/jQuery/} 133 * @since 1.0 134 */ 135 (selector: JQuery.Selector, context: Element | Document | JQuery | undefined): JQuery<TElement>; 136 // HACK: This is the factory function returned when importing jQuery without a DOM. Declaring it separately breaks using the type parameter on JQueryStatic. 137 // HACK: The discriminator parameter handles the edge case of passing a Window object to JQueryStatic. It doesn't actually exist on the factory function. 138 <FElement extends Node = HTMLElement>(window: Window, discriminator: boolean): JQueryStatic<FElement>; 139 /** 140 * Creates DOM elements on the fly from the provided string of raw HTML. 141 * 142 * Binds a function to be executed when the DOM has finished loading. 143 * 144 * @param selector_object_callback A string containing a selector expression 145 * A DOM element to wrap in a jQuery object. 146 * An array containing a set of DOM elements to wrap in a jQuery object. 147 * A plain object to wrap in a jQuery object. 148 * An existing jQuery object to clone. 149 * The function to execute when the DOM is ready. 150 * @see {@link https://api.jquery.com/jQuery/} 151 * @since 1.0 152 * @since 1.4 153 */ 154 (selector_object_callback?: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray<Element> | JQuery | 155 JQuery.PlainObject | 156 ((this: Document, $: JQueryStatic<TElement>) => void)): JQuery<TElement>; 157 /** 158 * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. 159 * 160 * @param flags An optional list of space-separated flags that change how the callback list behaves. 161 * @see {@link https://api.jquery.com/jQuery.Callbacks/} 162 * @since 1.7 163 */ 164 Callbacks<T extends Function>(flags?: string): JQuery.Callbacks<T>; 165 /** 166 * Perform an asynchronous HTTP (Ajax) request. 167 * 168 * @param url A string containing the URL to which the request is sent. 169 * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can 170 * be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings. 171 * @see {@link https://api.jquery.com/jQuery.ajax/} 172 * @since 1.5 173 */ 174 ajax(url: string, settings?: JQuery.AjaxSettings): JQuery.jqXHR; 175 /** 176 * Perform an asynchronous HTTP (Ajax) request. 177 * 178 * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can 179 * be set for any option with $.ajaxSetup(). 180 * @see {@link https://api.jquery.com/jQuery.ajax/} 181 * @since 1.0 182 */ 183 ajax(settings?: JQuery.AjaxSettings): JQuery.jqXHR; 184 /** 185 * Handle custom Ajax options or modify existing options before each request is sent and before they 186 * are processed by $.ajax(). 187 * 188 * @param dataTypes An optional string containing one or more space-separated dataTypes 189 * @param handler A handler to set default values for future Ajax requests. 190 * @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/} 191 * @since 1.5 192 */ 193 ajaxPrefilter(dataTypes: string, 194 handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void; 195 /** 196 * Handle custom Ajax options or modify existing options before each request is sent and before they 197 * are processed by $.ajax(). 198 * 199 * @param handler A handler to set default values for future Ajax requests. 200 * @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/} 201 * @since 1.5 202 */ 203 ajaxPrefilter(handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void; 204 /** 205 * Set default values for future Ajax requests. Its use is not recommended. 206 * 207 * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. 208 * @see {@link https://api.jquery.com/jQuery.ajaxSetup/} 209 * @since 1.1 210 */ 211 ajaxSetup(options: JQuery.AjaxSettings): JQuery.AjaxSettings; 212 /** 213 * Creates an object that handles the actual transmission of Ajax data. 214 * 215 * @param dataType A string identifying the data type to use 216 * @param handler A handler to return the new transport object to use with the data type provided in the first argument. 217 * @see {@link https://api.jquery.com/jQuery.ajaxTransport/} 218 * @since 1.5 219 */ 220 ajaxTransport(dataType: string, 221 handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => JQuery.Transport | void): void; 222 /** 223 * Check to see if a DOM element is a descendant of another DOM element. 224 * 225 * @param container The DOM element that may contain the other element. 226 * @param contained The DOM element that may be contained by (a descendant of) the other element. 227 * @see {@link https://api.jquery.com/jQuery.contains/} 228 * @since 1.4 229 */ 230 contains(container: Element, contained: Element): boolean; 231 css(elem: Element, unknown: any): any; 232 /** 233 * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or 234 * the full data store for the element. 235 * 236 * @param element The DOM element to query for the data. 237 * @param key Name of the data stored. 238 * @see {@link https://api.jquery.com/jQuery.data/} 239 * @since 1.2.3 240 */ 241 data(element: Element, key: string, undefined: undefined): any; // tslint:disable-line:unified-signatures 242 /** 243 * Store arbitrary data associated with the specified element. Returns the value that was set. 244 * 245 * @param element The DOM element to associate with the data. 246 * @param key A string naming the piece of data to set. 247 * @param value The new data value; this can be any Javascript type except undefined. 248 * @see {@link https://api.jquery.com/jQuery.data/} 249 * @since 1.2.3 250 */ 251 data<T>(element: Element, key: string, value: T): T; 252 /** 253 * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or 254 * the full data store for the element. 255 * 256 * @param element The DOM element to query for the data. 257 * @param key Name of the data stored. 258 * @see {@link https://api.jquery.com/jQuery.data/} 259 * @since 1.2.3 260 * @since 1.4 261 */ 262 data(element: Element, key?: string): any; 263 /** 264 * Execute the next function on the queue for the matched element. 265 * 266 * @param element A DOM element from which to remove and execute a queued function. 267 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. 268 * @see {@link https://api.jquery.com/jQuery.dequeue/} 269 * @since 1.3 270 */ 271 dequeue(element: Element, queueName?: string): void; 272 /** 273 * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. 274 * Arrays and array-like objects with a length property (such as a function's arguments object) are 275 * iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. 276 * 277 * @param array The array to iterate over. 278 * @param callback The function that will be executed on every object. 279 * @see {@link https://api.jquery.com/jQuery.each/} 280 * @since 1.0 281 */ 282 each<T>(array: ArrayLike<T>, callback: (this: T, indexInArray: number, value: T) => false | any): ArrayLike<T>; 283 /** 284 * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. 285 * Arrays and array-like objects with a length property (such as a function's arguments object) are 286 * iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. 287 * 288 * @param obj The object to iterate over. 289 * @param callback The function that will be executed on every object. 290 * @see {@link https://api.jquery.com/jQuery.each/} 291 * @since 1.0 292 */ 293 each<T, K extends keyof T>(obj: T, callback: (this: T[K], propertyName: K, valueOfProperty: T[K]) => false | any): T; 294 /** 295 * Takes a string and throws an exception containing it. 296 * 297 * @param message The message to send out. 298 * @see {@link https://api.jquery.com/jQuery.error/} 299 * @since 1.4.1 300 */ 301 error(message: string): any; 302 /** 303 * Escapes any character that has a special meaning in a CSS selector. 304 * 305 * @param selector A string containing a selector expression to escape. 306 * @see {@link https://api.jquery.com/jQuery.escapeSelector/} 307 * @since 3.0 308 */ 309 escapeSelector(selector: JQuery.Selector): JQuery.Selector; 310 /** 311 * Merge the contents of two or more objects together into the first object. 312 * 313 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. 314 * @param target The object to extend. It will receive the new properties. 315 * @see {@link https://api.jquery.com/jQuery.extend/} 316 * @since 1.1.4 317 */ 318 extend<T, U, V, W, X, Y, Z>(deep: true, target: T, object1: U, object2: V, object3: W, object4: X, object5: Y, object6: Z): T & U & V & W & X & Y & Z; 319 /** 320 * Merge the contents of two or more objects together into the first object. 321 * 322 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. 323 * @param target The object to extend. It will receive the new properties. 324 * @see {@link https://api.jquery.com/jQuery.extend/} 325 * @since 1.1.4 326 */ 327 extend<T, U, V, W, X, Y>(deep: true, target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T & U & V & W & X & Y; 328 /** 329 * Merge the contents of two or more objects together into the first object. 330 * 331 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. 332 * @param target The object to extend. It will receive the new properties. 333 * @see {@link https://api.jquery.com/jQuery.extend/} 334 * @since 1.1.4 335 */ 336 extend<T, U, V, W, X>(deep: true, target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X; 337 /** 338 * Merge the contents of two or more objects together into the first object. 339 * 340 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. 341 * @param target The object to extend. It will receive the new properties. 342 * @see {@link https://api.jquery.com/jQuery.extend/} 343 * @since 1.1.4 344 */ 345 extend<T, U, V, W>(deep: true, target: T, object1: U, object2: V, object3: W): T & U & V & W; 346 /** 347 * Merge the contents of two or more objects together into the first object. 348 * 349 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. 350 * @param target The object to extend. It will receive the new properties. 351 * @see {@link https://api.jquery.com/jQuery.extend/} 352 * @since 1.1.4 353 */ 354 extend<T, U, V>(deep: true, target: T, object1: U, object2: V): T & U & V; 355 /** 356 * Merge the contents of two or more objects together into the first object. 357 * 358 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. 359 * @param target The object to extend. It will receive the new properties. 360 * @see {@link https://api.jquery.com/jQuery.extend/} 361 * @since 1.1.4 362 */ 363 extend<T, U>(deep: true, target: T, object1: U): T & U; 364 /** 365 * Merge the contents of two or more objects together into the first object. 366 * 367 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported. 368 * @param target The object to extend. It will receive the new properties. 369 * @see {@link https://api.jquery.com/jQuery.extend/} 370 * @since 1.1.4 371 */ 372 extend(deep: true, target: any, object1: any, ...objects: any[]): any; 373 /** 374 * Merge the contents of two or more objects together into the first object. 375 * 376 * @param target An object that will receive the new properties if additional objects are passed in or that will 377 * extend the jQuery namespace if it is the sole argument. 378 * @see {@link https://api.jquery.com/jQuery.extend/} 379 * @since 1.0 380 */ 381 extend<T, U, V, W, X, Y, Z>(target: T, object1: U, object2: V, object3: W, object4: X, object5: Y, object6: Z): T & U & V & W & X & Y & Z; 382 /** 383 * Merge the contents of two or more objects together into the first object. 384 * 385 * @param target An object that will receive the new properties if additional objects are passed in or that will 386 * extend the jQuery namespace if it is the sole argument. 387 * @see {@link https://api.jquery.com/jQuery.extend/} 388 * @since 1.0 389 */ 390 extend<T, U, V, W, X, Y>(target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T & U & V & W & X & Y; 391 /** 392 * Merge the contents of two or more objects together into the first object. 393 * 394 * @param target An object that will receive the new properties if additional objects are passed in or that will 395 * extend the jQuery namespace if it is the sole argument. 396 * @see {@link https://api.jquery.com/jQuery.extend/} 397 * @since 1.0 398 */ 399 extend<T, U, V, W, X>(target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X; 400 /** 401 * Merge the contents of two or more objects together into the first object. 402 * 403 * @param target An object that will receive the new properties if additional objects are passed in or that will 404 * extend the jQuery namespace if it is the sole argument. 405 * @see {@link https://api.jquery.com/jQuery.extend/} 406 * @since 1.0 407 */ 408 extend<T, U, V, W>(target: T, object1: U, object2: V, object3: W): T & U & V & W; 409 /** 410 * Merge the contents of two or more objects together into the first object. 411 * 412 * @param target An object that will receive the new properties if additional objects are passed in or that will 413 * extend the jQuery namespace if it is the sole argument. 414 * @see {@link https://api.jquery.com/jQuery.extend/} 415 * @since 1.0 416 */ 417 extend<T, U, V>(target: T, object1: U, object2: V): T & U & V; 418 /** 419 * Merge the contents of two or more objects together into the first object. 420 * 421 * @param target An object that will receive the new properties if additional objects are passed in or that will 422 * extend the jQuery namespace if it is the sole argument. 423 * @see {@link https://api.jquery.com/jQuery.extend/} 424 * @since 1.0 425 */ 426 extend<T, U>(target: T, object1: U): T & U; 427 /** 428 * Merge the contents of two or more objects together into the first object. 429 * 430 * @param target An object that will receive the new properties if additional objects are passed in or that will 431 * extend the jQuery namespace if it is the sole argument. 432 * @see {@link https://api.jquery.com/jQuery.extend/} 433 * @since 1.0 434 */ 435 extend(target: any, object1: any, ...objects: any[]): any; 436 /** 437 * Load data from the server using a HTTP GET request. 438 * 439 * @param url A string containing the URL to which the request is sent. 440 * @param data A plain object or string that is sent to the server with the request. 441 * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but 442 * you can use null or jQuery.noop as a placeholder. 443 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). 444 * @see {@link https://api.jquery.com/jQuery.get/} 445 * @since 1.0 446 */ 447 get(url: string, 448 data: JQuery.PlainObject | string, 449 success: JQuery.jqXHR.DoneCallback | null, 450 dataType?: string): JQuery.jqXHR; 451 /** 452 * Load data from the server using a HTTP GET request. 453 * 454 * @param url A string containing the URL to which the request is sent. 455 * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but 456 * you can use null or jQuery.noop as a placeholder. 457 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). 458 * @see {@link https://api.jquery.com/jQuery.get/} 459 * @since 1.0 460 */ 461 get(url: string, 462 success: JQuery.jqXHR.DoneCallback | null, 463 dataType: string): JQuery.jqXHR; 464 /** 465 * Load data from the server using a HTTP GET request. 466 * 467 * @param url A string containing the URL to which the request is sent. 468 * @param success_data A callback function that is executed if the request succeeds. Required if dataType is provided, but 469 * you can use null or jQuery.noop as a placeholder. 470 * A plain object or string that is sent to the server with the request. 471 * @see {@link https://api.jquery.com/jQuery.get/} 472 * @since 1.0 473 */ 474 get(url: string, 475 success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; 476 /** 477 * Load data from the server using a HTTP GET request. 478 * 479 * @param url_settings A string containing the URL to which the request is sent. 480 * A set of key/value pairs that configure the Ajax request. All properties except for url are 481 * optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a 482 * complete list of all settings. The type option will automatically be set to GET. 483 * @see {@link https://api.jquery.com/jQuery.get/} 484 * @since 1.0 485 * @since 1.12 486 * @since 2.2 487 */ 488 get(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR; 489 /** 490 * Load JSON-encoded data from the server using a GET HTTP request. 491 * 492 * @param url A string containing the URL to which the request is sent. 493 * @param data A plain object or string that is sent to the server with the request. 494 * @param success A callback function that is executed if the request succeeds. 495 * @see {@link https://api.jquery.com/jQuery.getJSON/} 496 * @since 1.0 497 */ 498 getJSON(url: string, 499 data: JQuery.PlainObject | string, 500 success: JQuery.jqXHR.DoneCallback): JQuery.jqXHR; 501 /** 502 * Load JSON-encoded data from the server using a GET HTTP request. 503 * 504 * @param url A string containing the URL to which the request is sent. 505 * @param success_data A callback function that is executed if the request succeeds. 506 * A plain object or string that is sent to the server with the request. 507 * @see {@link https://api.jquery.com/jQuery.getJSON/} 508 * @since 1.0 509 */ 510 getJSON(url: string, 511 success_data?: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; 512 /** 513 * Load a JavaScript file from the server using a GET HTTP request, then execute it. 514 * 515 * @param url A string containing the URL to which the request is sent. 516 * @param success A callback function that is executed if the request succeeds. 517 * @see {@link https://api.jquery.com/jQuery.getScript/} 518 * @since 1.0 519 */ 520 getScript(url: string, 521 success?: JQuery.jqXHR.DoneCallback<string | undefined>): JQuery.jqXHR<string | undefined>; 522 /** 523 * Execute some JavaScript code globally. 524 * 525 * @param code The JavaScript code to execute. 526 * @see {@link https://api.jquery.com/jQuery.globalEval/} 527 * @since 1.0.4 528 */ 529 globalEval(code: string): void; 530 /** 531 * Finds the elements of an array which satisfy a filter function. The original array is not affected. 532 * 533 * @param array The array-like object to search through. 534 * @param fn The function to process each item against. The first argument to the function is the item, and the 535 * second argument is the index. The function should return a Boolean value. this will be the global window object. 536 * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements 537 * for which "callback" returns true. If "invert" is true, then the function returns an array 538 * consisting of all elements for which "callback" returns false. 539 * @see {@link https://api.jquery.com/jQuery.grep/} 540 * @since 1.0 541 */ 542 grep<T>(array: ArrayLike<T>, 543 fn: (elementOfArray: T, indexInArray: number) => boolean, 544 invert?: boolean): T[]; 545 /** 546 * Determine whether an element has any jQuery data associated with it. 547 * 548 * @param element A DOM element to be checked for data. 549 * @see {@link https://api.jquery.com/jQuery.hasData/} 550 * @since 1.5 551 */ 552 hasData(element: Element): boolean; 553 /** 554 * Holds or releases the execution of jQuery's ready event. 555 * 556 * @param hold Indicates whether the ready hold is being requested or released 557 * @see {@link https://api.jquery.com/jQuery.holdReady/} 558 * @since 1.6 559 * @deprecated 3.2 560 */ 561 holdReady(hold: boolean): void; 562 /** 563 * Modify and filter HTML strings passed through jQuery manipulation methods. 564 * 565 * @param html The HTML string on which to operate. 566 * @see {@link https://api.jquery.com/jQuery.htmlPrefilter/} 567 * @since 1.12/2.2 568 */ 569 htmlPrefilter(html: JQuery.htmlString): JQuery.htmlString; 570 /** 571 * Search for a specified value within an array and return its index (or -1 if not found). 572 * 573 * @param value The value to search for. 574 * @param array An array through which to search. 575 * @param fromIndex The index of the array at which to begin the search. The default is 0, which will search the whole array. 576 * @see {@link https://api.jquery.com/jQuery.inArray/} 577 * @since 1.2 578 */ 579 inArray<T>(value: T, array: T[], fromIndex?: number): number; 580 /** 581 * Determine whether the argument is an array. 582 * 583 * @param obj Object to test whether or not it is an array. 584 * @see {@link https://api.jquery.com/jQuery.isArray/} 585 * @since 1.3 586 * @deprecated 3.2 587 */ 588 isArray(obj: any): obj is any[]; 589 /** 590 * Check to see if an object is empty (contains no enumerable properties). 591 * 592 * @param obj The object that will be checked to see if it's empty. 593 * @see {@link https://api.jquery.com/jQuery.isEmptyObject/} 594 * @since 1.4 595 */ 596 isEmptyObject(obj: any): boolean; 597 /** 598 * Determine if the argument passed is a JavaScript function object. 599 * 600 * @param obj Object to test whether or not it is a function. 601 * @see {@link https://api.jquery.com/jQuery.isFunction/} 602 * @since 1.2 603 */ 604 isFunction(obj: any): obj is Function; 605 /** 606 * Determines whether its argument represents a JavaScript number. 607 * 608 * @param value The value to be tested. 609 * @see {@link https://api.jquery.com/jQuery.isNumeric/} 610 * @since 1.7 611 */ 612 isNumeric(value: any): value is number; 613 /** 614 * Check to see if an object is a plain object (created using "{}" or "new Object"). 615 * 616 * @param obj The object that will be checked to see if it's a plain object. 617 * @see {@link https://api.jquery.com/jQuery.isPlainObject/} 618 * @since 1.4 619 */ 620 isPlainObject(obj: any): obj is JQuery.PlainObject; 621 /** 622 * Determine whether the argument is a window. 623 * 624 * @param obj Object to test whether or not it is a window. 625 * @see {@link https://api.jquery.com/jQuery.isWindow/} 626 * @since 1.4.3 627 */ 628 isWindow(obj: any): obj is Window; 629 /** 630 * Check to see if a DOM node is within an XML document (or is an XML document). 631 * 632 * @param node The DOM node that will be checked to see if it's in an XML document. 633 * @see {@link https://api.jquery.com/jQuery.isXMLDoc/} 634 * @since 1.1.4 635 */ 636 isXMLDoc(node: Node): boolean; 637 /** 638 * Convert an array-like object into a true JavaScript array. 639 * 640 * @param obj Any object to turn into a native Array. 641 * @see {@link https://api.jquery.com/jQuery.makeArray/} 642 * @since 1.2 643 */ 644 makeArray<T>(obj: ArrayLike<T>): T[]; 645 /** 646 * Translate all items in an array or object to new array of items. 647 * 648 * @param array The Array to translate. 649 * @param callback The function to process each item against. The first argument to the function is the array item, the 650 * second argument is the index in array The function can return any value. A returned array will be 651 * flattened into the resulting array. Within the function, this refers to the global (window) object. 652 * @see {@link https://api.jquery.com/jQuery.map/} 653 * @since 1.0 654 */ 655 map<T, R>(array: T[], callback: (elementOfArray: T, indexInArray: number) => R): R[]; 656 /** 657 * Translate all items in an array or object to new array of items. 658 * 659 * @param obj The Object to translate. 660 * @param callback The function to process each item against. The first argument to the function is the value; the 661 * second argument is the key of the object property. The function can return any value to add to the 662 * array. A returned array will be flattened into the resulting array. Within the function, this refers 663 * to the global (window) object. 664 * @see {@link https://api.jquery.com/jQuery.map/} 665 * @since 1.6 666 */ 667 map<T, K extends keyof T, R>(obj: T, callback: (propertyOfObject: T[K], key: K) => R): R[]; 668 /** 669 * Merge the contents of two arrays together into the first array. 670 * 671 * @param first The first array-like object to merge, the elements of second added. 672 * @param second The second array-like object to merge into the first, unaltered. 673 * @see {@link https://api.jquery.com/jQuery.merge/} 674 * @since 1.0 675 */ 676 merge<T, U>(first: ArrayLike<T>, second: ArrayLike<U>): Array<T | U>; 677 /** 678 * Relinquish jQuery's control of the $ variable. 679 * 680 * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). 681 * @see {@link https://api.jquery.com/jQuery.noConflict/} 682 * @since 1.0 683 */ 684 noConflict(removeAll?: boolean): this; 685 /** 686 * An empty function. 687 * 688 * @see {@link https://api.jquery.com/jQuery.noop/} 689 * @since 1.4 690 */ 691 noop(): undefined; 692 /** 693 * Return a number representing the current time. 694 * 695 * @see {@link https://api.jquery.com/jQuery.now/} 696 * @since 1.4.3 697 */ 698 now(): number; 699 /** 700 * Create a serialized representation of an array, a plain object, or a jQuery object suitable for use 701 * in a URL query string or Ajax request. In case a jQuery object is passed, it should contain input 702 * elements with name/value properties. 703 * 704 * @param obj An array, a plain object, or a jQuery object to serialize. 705 * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. 706 * @see {@link https://api.jquery.com/jQuery.param/} 707 * @since 1.2 708 * @since 1.4 709 */ 710 param(obj: any[] | JQuery.PlainObject | JQuery, traditional?: boolean): string; 711 /** 712 * Parses a string into an array of DOM nodes. 713 * 714 * @param data HTML string to be parsed 715 * @param context Document element to serve as the context in which the HTML fragment will be created 716 * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string 717 * @see {@link https://api.jquery.com/jQuery.parseHTML/} 718 * @since 1.8 719 */ 720 parseHTML(data: string, context: Document | null | undefined, keepScripts: boolean): JQuery.Node[]; 721 /** 722 * Parses a string into an array of DOM nodes. 723 * 724 * @param data HTML string to be parsed 725 * @param context_keepScripts Document element to serve as the context in which the HTML fragment will be created 726 * A Boolean indicating whether to include scripts passed in the HTML string 727 * @see {@link https://api.jquery.com/jQuery.parseHTML/} 728 * @since 1.8 729 */ 730 parseHTML(data: string, context_keepScripts?: Document | null | boolean): JQuery.Node[]; 731 /** 732 * Takes a well-formed JSON string and returns the resulting JavaScript value. 733 * 734 * @param json The JSON string to parse. 735 * @see {@link https://api.jquery.com/jQuery.parseJSON/} 736 * @since 1.4.1 737 * @deprecated 3.0 738 */ 739 parseJSON(json: string): any; 740 /** 741 * Parses a string into an XML document. 742 * 743 * @param data a well-formed XML string to be parsed 744 * @see {@link https://api.jquery.com/jQuery.parseXML/} 745 * @since 1.5 746 */ 747 parseXML(data: string): XMLDocument; 748 /** 749 * Load data from the server using a HTTP POST request. 750 * 751 * @param url A string containing the URL to which the request is sent. 752 * @param data A plain object or string that is sent to the server with the request. 753 * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but 754 * can be null in that case. 755 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). 756 * @see {@link https://api.jquery.com/jQuery.post/} 757 * @since 1.0 758 */ 759 post(url: string, 760 data: JQuery.PlainObject | string, 761 success: JQuery.jqXHR.DoneCallback | null, 762 dataType?: string): JQuery.jqXHR; 763 /** 764 * Load data from the server using a HTTP POST request. 765 * 766 * @param url A string containing the URL to which the request is sent. 767 * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but 768 * can be null in that case. 769 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). 770 * @see {@link https://api.jquery.com/jQuery.post/} 771 * @since 1.0 772 */ 773 post(url: string, 774 success: JQuery.jqXHR.DoneCallback | null, 775 dataType: string): JQuery.jqXHR; 776 /** 777 * Load data from the server using a HTTP POST request. 778 * 779 * @param url A string containing the URL to which the request is sent. 780 * @param success_data A callback function that is executed if the request succeeds. Required if dataType is provided, but 781 * can be null in that case. 782 * A plain object or string that is sent to the server with the request. 783 * @see {@link https://api.jquery.com/jQuery.post/} 784 * @since 1.0 785 */ 786 post(url: string, 787 success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR; 788 /** 789 * Load data from the server using a HTTP POST request. 790 * 791 * @param url_settings A string containing the URL to which the request is sent. 792 * A set of key/value pairs that configure the Ajax request. All properties except for url are 793 * optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a 794 * complete list of all settings. Type will automatically be set to POST. 795 * @see {@link https://api.jquery.com/jQuery.post/} 796 * @since 1.0 797 * @since 1.12 798 * @since 2.2 799 */ 800 post(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR; 801 802 // region proxy 803 804 // region (fn, null | undefined) 805 806 // region 0 to 7 arguments 807 808 // region 0 parameters 809 810 /** 811 * Takes a function and returns a new one that will always have a particular context. 812 * 813 * @param fn The function whose context will be changed. 814 * @param context The object to which the context (this) of the function should be set. 815 * @see {@link https://api.jquery.com/jQuery.proxy/} 816 * @since 1.9 817 */ 818 proxy<TReturn, 819 A, B, C, D, E, F, G>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => TReturn, 820 context: null | undefined, 821 a: A, b: B, c: C, d: D, e: E, f: F, g: G): () => TReturn; 822 /** 823 * Takes a function and returns a new one that will always have a particular context. 824 * 825 * @param fn The function whose context will be changed. 826 * @param context The object to which the context (this) of the function should be set. 827 * @see {@link https://api.jquery.com/jQuery.proxy/} 828 * @since 1.9 829 */ 830 proxy<TReturn, 831 A, B, C, D, E, F>(fn: (a: A, b: B, c: C, d: D, e: E, f: F) => TReturn, 832 context: null | undefined, 833 a: A, b: B, c: C, d: D, e: E, f: F): () => TReturn; 834 /** 835 * Takes a function and returns a new one that will always have a particular context. 836 * 837 * @param fn The function whose context will be changed. 838 * @param context The object to which the context (this) of the function should be set. 839 * @see {@link https://api.jquery.com/jQuery.proxy/} 840 * @since 1.9 841 */ 842 proxy<TReturn, 843 A, B, C, D, E>(fn: (a: A, b: B, c: C, d: D, e: E) => TReturn, 844 context: null | undefined, 845 a: A, b: B, c: C, d: D, e: E): () => TReturn; 846 /** 847 * Takes a function and returns a new one that will always have a particular context. 848 * 849 * @param fn The function whose context will be changed. 850 * @param context The object to which the context (this) of the function should be set. 851 * @see {@link https://api.jquery.com/jQuery.proxy/} 852 * @since 1.9 853 */ 854 proxy<TReturn, 855 A, B, C, D>(fn: (a: A, b: B, c: C, d: D) => TReturn, 856 context: null | undefined, 857 a: A, b: B, c: C, d: D): () => TReturn; 858 /** 859 * Takes a function and returns a new one that will always have a particular context. 860 * 861 * @param fn The function whose context will be changed. 862 * @param context The object to which the context (this) of the function should be set. 863 * @see {@link https://api.jquery.com/jQuery.proxy/} 864 * @since 1.9 865 */ 866 proxy<TReturn, 867 A, B, C>(fn: (a: A, b: B, c: C) => TReturn, 868 context: null | undefined, 869 a: A, b: B, c: C): () => TReturn; 870 /** 871 * Takes a function and returns a new one that will always have a particular context. 872 * 873 * @param fn The function whose context will be changed. 874 * @param context The object to which the context (this) of the function should be set. 875 * @see {@link https://api.jquery.com/jQuery.proxy/} 876 * @since 1.9 877 */ 878 proxy<TReturn, 879 A, B>(fn: (a: A, b: B) => TReturn, 880 context: null | undefined, 881 a: A, b: B): () => TReturn; 882 /** 883 * Takes a function and returns a new one that will always have a particular context. 884 * 885 * @param fn The function whose context will be changed. 886 * @param context The object to which the context (this) of the function should be set. 887 * @see {@link https://api.jquery.com/jQuery.proxy/} 888 * @since 1.4` 889 * @since 1.6 890 */ 891 proxy<TReturn, 892 A>(fn: (a: A) => TReturn, 893 context: null | undefined, 894 a: A): () => TReturn; 895 /** 896 * Takes a function and returns a new one that will always have a particular context. 897 * 898 * @param fn The function whose context will be changed. 899 * @param context The object to which the context (this) of the function should be set. 900 * @see {@link https://api.jquery.com/jQuery.proxy/} 901 * @since 1.9 902 */ 903 proxy<TReturn>(fn: () => TReturn, 904 context: null | undefined): () => TReturn; 905 906 // endregion 907 908 // region 1 parameters 909 910 /** 911 * Takes a function and returns a new one that will always have a particular context. 912 * 913 * @param fn The function whose context will be changed. 914 * @param context The object to which the context (this) of the function should be set. 915 * @see {@link https://api.jquery.com/jQuery.proxy/} 916 * @since 1.9 917 */ 918 proxy<TReturn, 919 A, B, C, D, E, F, G, 920 T>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, 921 t: T) => TReturn, 922 context: null | undefined, 923 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T) => TReturn; 924 /** 925 * Takes a function and returns a new one that will always have a particular context. 926 * 927 * @param fn The function whose context will be changed. 928 * @param context The object to which the context (this) of the function should be set. 929 * @see {@link https://api.jquery.com/jQuery.proxy/} 930 * @since 1.9 931 */ 932 proxy<TReturn, 933 A, B, C, D, E, F, 934 T>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, 935 t: T) => TReturn, 936 context: null | undefined, 937 a: A, b: B, c: C, d: D, e: E, f: F): (t: T) => TReturn; 938 /** 939 * Takes a function and returns a new one that will always have a particular context. 940 * 941 * @param fn The function whose context will be changed. 942 * @param context The object to which the context (this) of the function should be set. 943 * @see {@link https://api.jquery.com/jQuery.proxy/} 944 * @since 1.9 945 */ 946 proxy<TReturn, 947 A, B, C, D, E, 948 T>(fn: (a: A, b: B, c: C, d: D, e: E, 949 t: T) => TReturn, 950 context: null | undefined, 951 a: A, b: B, c: C, d: D, e: E): (t: T) => TReturn; 952 /** 953 * Takes a function and returns a new one that will always have a particular context. 954 * 955 * @param fn The function whose context will be changed. 956 * @param context The object to which the context (this) of the function should be set. 957 * @see {@link https://api.jquery.com/jQuery.proxy/} 958 * @since 1.9 959 */ 960 proxy<TReturn, 961 A, B, C, D, 962 T>(fn: (a: A, b: B, c: C, d: D, 963 t: T) => TReturn, 964 context: null | undefined, 965 a: A, b: B, c: C, d: D): (t: T) => TReturn; 966 /** 967 * Takes a function and returns a new one that will always have a particular context. 968 * 969 * @param fn The function whose context will be changed. 970 * @param context The object to which the context (this) of the function should be set. 971 * @see {@link https://api.jquery.com/jQuery.proxy/} 972 * @since 1.9 973 */ 974 proxy<TReturn, 975 A, B, C, 976 T>(fn: (a: A, b: B, c: C, 977 t: T) => TReturn, 978 context: null | undefined, 979 a: A, b: B, c: C): (t: T) => TReturn; 980 /** 981 * Takes a function and returns a new one that will always have a particular context. 982 * 983 * @param fn The function whose context will be changed. 984 * @param context The object to which the context (this) of the function should be set. 985 * @see {@link https://api.jquery.com/jQuery.proxy/} 986 * @since 1.9 987 */ 988 proxy<TReturn, 989 A, B, 990 T>(fn: (a: A, b: B, 991 t: T) => TReturn, 992 context: null | undefined, 993 a: A, b: B): (t: T) => TReturn; 994 /** 995 * Takes a function and returns a new one that will always have a particular context. 996 * 997 * @param fn The function whose context will be changed. 998 * @param context The object to which the context (this) of the function should be set. 999 * @see {@link https://api.jquery.com/jQuery.proxy/} 1000 * @since 1.9 1001 */ 1002 proxy<TReturn, 1003 A, 1004 T>(fn: (a: A, 1005 t: T) => TReturn, 1006 context: null | undefined, 1007 a: A): (t: T) => TReturn; 1008 /** 1009 * Takes a function and returns a new one that will always have a particular context. 1010 * 1011 * @param fn The function whose context will be changed. 1012 * @param context The object to which the context (this) of the function should be set. 1013 * @see {@link https://api.jquery.com/jQuery.proxy/} 1014 * @since 1.9 1015 */ 1016 proxy<TReturn, 1017 T>(fn: (t: T) => TReturn, 1018 context: null | undefined): (t: T) => TReturn; 1019 1020 // endregion 1021 1022 // region 2 parameters 1023 1024 /** 1025 * Takes a function and returns a new one that will always have a particular context. 1026 * 1027 * @param fn The function whose context will be changed. 1028 * @param context The object to which the context (this) of the function should be set. 1029 * @see {@link https://api.jquery.com/jQuery.proxy/} 1030 * @since 1.9 1031 */ 1032 proxy<TReturn, 1033 A, B, C, D, E, F, G, 1034 T, U>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, 1035 t: T, u: U) => TReturn, 1036 context: null | undefined, 1037 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U) => TReturn; 1038 /** 1039 * Takes a function and returns a new one that will always have a particular context. 1040 * 1041 * @param fn The function whose context will be changed. 1042 * @param context The object to which the context (this) of the function should be set. 1043 * @see {@link https://api.jquery.com/jQuery.proxy/} 1044 * @since 1.9 1045 */ 1046 proxy<TReturn, 1047 A, B, C, D, E, F, 1048 T, U>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, 1049 t: T, u: U) => TReturn, 1050 context: null | undefined, 1051 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U) => TReturn; 1052 /** 1053 * Takes a function and returns a new one that will always have a particular context. 1054 * 1055 * @param fn The function whose context will be changed. 1056 * @param context The object to which the context (this) of the function should be set. 1057 * @see {@link https://api.jquery.com/jQuery.proxy/} 1058 * @since 1.9 1059 */ 1060 proxy<TReturn, 1061 A, B, C, D, E, 1062 T, U>(fn: (a: A, b: B, c: C, d: D, e: E, 1063 t: T, u: U) => TReturn, 1064 context: null | undefined, 1065 a: A, b: B, c: C, d: D, e: E): (t: T, u: U) => TReturn; 1066 /** 1067 * Takes a function and returns a new one that will always have a particular context. 1068 * 1069 * @param fn The function whose context will be changed. 1070 * @param context The object to which the context (this) of the function should be set. 1071 * @see {@link https://api.jquery.com/jQuery.proxy/} 1072 * @since 1.9 1073 */ 1074 proxy<TReturn, 1075 A, B, C, D, 1076 T, U>(fn: (a: A, b: B, c: C, d: D, 1077 t: T, u: U) => TReturn, 1078 context: null | undefined, 1079 a: A, b: B, c: C, d: D): (t: T, u: U) => TReturn; 1080 /** 1081 * Takes a function and returns a new one that will always have a particular context. 1082 * 1083 * @param fn The function whose context will be changed. 1084 * @param context The object to which the context (this) of the function should be set. 1085 * @see {@link https://api.jquery.com/jQuery.proxy/} 1086 * @since 1.9 1087 */ 1088 proxy<TReturn, 1089 A, B, C, 1090 T, U>(fn: (a: A, b: B, c: C, 1091 t: T, u: U) => TReturn, 1092 context: null | undefined, 1093 a: A, b: B, c: C): (t: T, u: U) => TReturn; 1094 /** 1095 * Takes a function and returns a new one that will always have a particular context. 1096 * 1097 * @param fn The function whose context will be changed. 1098 * @param context The object to which the context (this) of the function should be set. 1099 * @see {@link https://api.jquery.com/jQuery.proxy/} 1100 * @since 1.9 1101 */ 1102 proxy<TReturn, 1103 A, B, 1104 T, U>(fn: (a: A, b: B, 1105 t: T, u: U) => TReturn, 1106 context: null | undefined, 1107 a: A, b: B): (t: T, u: U) => TReturn; 1108 /** 1109 * Takes a function and returns a new one that will always have a particular context. 1110 * 1111 * @param fn The function whose context will be changed. 1112 * @param context The object to which the context (this) of the function should be set. 1113 * @see {@link https://api.jquery.com/jQuery.proxy/} 1114 * @since 1.9 1115 */ 1116 proxy<TReturn, 1117 A, 1118 T, U>(fn: (a: A, 1119 t: T, u: U) => TReturn, 1120 context: null | undefined, 1121 a: A): (t: T, u: U) => TReturn; 1122 /** 1123 * Takes a function and returns a new one that will always have a particular context. 1124 * 1125 * @param fn The function whose context will be changed. 1126 * @param context The object to which the context (this) of the function should be set. 1127 * @see {@link https://api.jquery.com/jQuery.proxy/} 1128 * @since 1.9 1129 */ 1130 proxy<TReturn, 1131 T, U>(fn: (t: T, u: U) => TReturn, 1132 context: null | undefined): (t: T, u: U) => TReturn; 1133 1134 // endregion 1135 1136 // region 3 parameters 1137 1138 /** 1139 * Takes a function and returns a new one that will always have a particular context. 1140 * 1141 * @param fn The function whose context will be changed. 1142 * @param context The object to which the context (this) of the function should be set. 1143 * @see {@link https://api.jquery.com/jQuery.proxy/} 1144 * @since 1.9 1145 */ 1146 proxy<TReturn, 1147 A, B, C, D, E, F, G, 1148 T, U, V>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, 1149 t: T, u: U, v: V) => TReturn, 1150 context: null | undefined, 1151 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V) => TReturn; 1152 /** 1153 * Takes a function and returns a new one that will always have a particular context. 1154 * 1155 * @param fn The function whose context will be changed. 1156 * @param context The object to which the context (this) of the function should be set. 1157 * @see {@link https://api.jquery.com/jQuery.proxy/} 1158 * @since 1.9 1159 */ 1160 proxy<TReturn, 1161 A, B, C, D, E, F, 1162 T, U, V>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, 1163 t: T, u: U, v: V) => TReturn, 1164 context: null | undefined, 1165 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V) => TReturn; 1166 /** 1167 * Takes a function and returns a new one that will always have a particular context. 1168 * 1169 * @param fn The function whose context will be changed. 1170 * @param context The object to which the context (this) of the function should be set. 1171 * @see {@link https://api.jquery.com/jQuery.proxy/} 1172 * @since 1.9 1173 */ 1174 proxy<TReturn, 1175 A, B, C, D, E, 1176 T, U, V>(fn: (a: A, b: B, c: C, d: D, e: E, 1177 t: T, u: U, v: V) => TReturn, 1178 context: null | undefined, 1179 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V) => TReturn; 1180 /** 1181 * Takes a function and returns a new one that will always have a particular context. 1182 * 1183 * @param fn The function whose context will be changed. 1184 * @param context The object to which the context (this) of the function should be set. 1185 * @see {@link https://api.jquery.com/jQuery.proxy/} 1186 * @since 1.9 1187 */ 1188 proxy<TReturn, 1189 A, B, C, D, 1190 T, U, V>(fn: (a: A, b: B, c: C, d: D, 1191 t: T, u: U, v: V) => TReturn, 1192 context: null | undefined, 1193 a: A, b: B, c: C, d: D): (t: T, u: U, v: V) => TReturn; 1194 /** 1195 * Takes a function and returns a new one that will always have a particular context. 1196 * 1197 * @param fn The function whose context will be changed. 1198 * @param context The object to which the context (this) of the function should be set. 1199 * @see {@link https://api.jquery.com/jQuery.proxy/} 1200 * @since 1.9 1201 */ 1202 proxy<TReturn, 1203 A, B, C, 1204 T, U, V>(fn: (a: A, b: B, c: C, 1205 t: T, u: U, v: V) => TReturn, 1206 context: null | undefined, 1207 a: A, b: B, c: C): (t: T, u: U, v: V) => TReturn; 1208 /** 1209 * Takes a function and returns a new one that will always have a particular context. 1210 * 1211 * @param fn The function whose context will be changed. 1212 * @param context The object to which the context (this) of the function should be set. 1213 * @see {@link https://api.jquery.com/jQuery.proxy/} 1214 * @since 1.9 1215 */ 1216 proxy<TReturn, 1217 A, B, 1218 T, U, V>(fn: (a: A, b: B, 1219 t: T, u: U, v: V) => TReturn, 1220 context: null | undefined, 1221 a: A, b: B): (t: T, u: U, v: V) => TReturn; 1222 /** 1223 * Takes a function and returns a new one that will always have a particular context. 1224 * 1225 * @param fn The function whose context will be changed. 1226 * @param context The object to which the context (this) of the function should be set. 1227 * @see {@link https://api.jquery.com/jQuery.proxy/} 1228 * @since 1.9 1229 */ 1230 proxy<TReturn, 1231 A, 1232 T, U, V>(fn: (a: A, 1233 t: T, u: U, v: V) => TReturn, 1234 context: null | undefined, 1235 a: A): (t: T, u: U, v: V) => TReturn; 1236 /** 1237 * Takes a function and returns a new one that will always have a particular context. 1238 * 1239 * @param fn The function whose context will be changed. 1240 * @param context The object to which the context (this) of the function should be set. 1241 * @see {@link https://api.jquery.com/jQuery.proxy/} 1242 * @since 1.9 1243 */ 1244 proxy<TReturn, 1245 T, U, V>(fn: (t: T, u: U, v: V) => TReturn, 1246 context: null | undefined): (t: T, u: U, v: V) => TReturn; 1247 1248 // endregion 1249 1250 // region 4 parameters 1251 1252 /** 1253 * Takes a function and returns a new one that will always have a particular context. 1254 * 1255 * @param fn The function whose context will be changed. 1256 * @param context The object to which the context (this) of the function should be set. 1257 * @see {@link https://api.jquery.com/jQuery.proxy/} 1258 * @since 1.9 1259 */ 1260 proxy<TReturn, 1261 A, B, C, D, E, F, G, 1262 T, U, V, W>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, 1263 t: T, u: U, v: V, w: W) => TReturn, 1264 context: null | undefined, 1265 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W) => TReturn; 1266 /** 1267 * Takes a function and returns a new one that will always have a particular context. 1268 * 1269 * @param fn The function whose context will be changed. 1270 * @param context The object to which the context (this) of the function should be set. 1271 * @see {@link https://api.jquery.com/jQuery.proxy/} 1272 * @since 1.9 1273 */ 1274 proxy<TReturn, 1275 A, B, C, D, E, F, 1276 T, U, V, W>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, 1277 t: T, u: U, v: V, w: W) => TReturn, 1278 context: null | undefined, 1279 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W) => TReturn; 1280 /** 1281 * Takes a function and returns a new one that will always have a particular context. 1282 * 1283 * @param fn The function whose context will be changed. 1284 * @param context The object to which the context (this) of the function should be set. 1285 * @see {@link https://api.jquery.com/jQuery.proxy/} 1286 * @since 1.9 1287 */ 1288 proxy<TReturn, 1289 A, B, C, D, E, 1290 T, U, V, W>(fn: (a: A, b: B, c: C, d: D, e: E, 1291 t: T, u: U, v: V, w: W) => TReturn, 1292 context: null | undefined, 1293 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W) => TReturn; 1294 /** 1295 * Takes a function and returns a new one that will always have a particular context. 1296 * 1297 * @param fn The function whose context will be changed. 1298 * @param context The object to which the context (this) of the function should be set. 1299 * @see {@link https://api.jquery.com/jQuery.proxy/} 1300 * @since 1.9 1301 */ 1302 proxy<TReturn, 1303 A, B, C, D, 1304 T, U, V, W>(fn: (a: A, b: B, c: C, d: D, 1305 t: T, u: U, v: V, w: W) => TReturn, 1306 context: null | undefined, 1307 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W) => TReturn; 1308 /** 1309 * Takes a function and returns a new one that will always have a particular context. 1310 * 1311 * @param fn The function whose context will be changed. 1312 * @param context The object to which the context (this) of the function should be set. 1313 * @see {@link https://api.jquery.com/jQuery.proxy/} 1314 * @since 1.9 1315 */ 1316 proxy<TReturn, 1317 A, B, C, 1318 T, U, V, W>(fn: (a: A, b: B, c: C, 1319 t: T, u: U, v: V, w: W) => TReturn, 1320 context: null | undefined, 1321 a: A, b: B, c: C): (t: T, u: U, v: V, w: W) => TReturn; 1322 /** 1323 * Takes a function and returns a new one that will always have a particular context. 1324 * 1325 * @param fn The function whose context will be changed. 1326 * @param context The object to which the context (this) of the function should be set. 1327 * @see {@link https://api.jquery.com/jQuery.proxy/} 1328 * @since 1.9 1329 */ 1330 proxy<TReturn, 1331 A, B, 1332 T, U, V, W>(fn: (a: A, b: B, 1333 t: T, u: U, v: V, w: W) => TReturn, 1334 context: null | undefined, 1335 a: A, b: B): (t: T, u: U, v: V, w: W) => TReturn; 1336 /** 1337 * Takes a function and returns a new one that will always have a particular context. 1338 * 1339 * @param fn The function whose context will be changed. 1340 * @param context The object to which the context (this) of the function should be set. 1341 * @see {@link https://api.jquery.com/jQuery.proxy/} 1342 * @since 1.9 1343 */ 1344 proxy<TReturn, 1345 A, 1346 T, U, V, W>(fn: (a: A, 1347 t: T, u: U, v: V, w: W) => TReturn, 1348 context: null | undefined, 1349 a: A): (t: T, u: U, v: V, w: W) => TReturn; 1350 /** 1351 * Takes a function and returns a new one that will always have a particular context. 1352 * 1353 * @param fn The function whose context will be changed. 1354 * @param context The object to which the context (this) of the function should be set. 1355 * @see {@link https://api.jquery.com/jQuery.proxy/} 1356 * @since 1.9 1357 */ 1358 proxy<TReturn, 1359 T, U, V, W>(fn: (t: T, u: U, v: V, w: W) => TReturn, 1360 context: null | undefined): (t: T, u: U, v: V, w: W) => TReturn; 1361 1362 // endregion 1363 1364 // region 5 parameters 1365 1366 /** 1367 * Takes a function and returns a new one that will always have a particular context. 1368 * 1369 * @param fn The function whose context will be changed. 1370 * @param context The object to which the context (this) of the function should be set. 1371 * @see {@link https://api.jquery.com/jQuery.proxy/} 1372 * @since 1.9 1373 */ 1374 proxy<TReturn, 1375 A, B, C, D, E, F, G, 1376 T, U, V, W, X>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, 1377 t: T, u: U, v: V, w: W, x: X) => TReturn, 1378 context: null | undefined, 1379 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X) => TReturn; 1380 /** 1381 * Takes a function and returns a new one that will always have a particular context. 1382 * 1383 * @param fn The function whose context will be changed. 1384 * @param context The object to which the context (this) of the function should be set. 1385 * @see {@link https://api.jquery.com/jQuery.proxy/} 1386 * @since 1.9 1387 */ 1388 proxy<TReturn, 1389 A, B, C, D, E, F, 1390 T, U, V, W, X>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, 1391 t: T, u: U, v: V, w: W, x: X) => TReturn, 1392 context: null | undefined, 1393 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X) => TReturn; 1394 /** 1395 * Takes a function and returns a new one that will always have a particular context. 1396 * 1397 * @param fn The function whose context will be changed. 1398 * @param context The object to which the context (this) of the function should be set. 1399 * @see {@link https://api.jquery.com/jQuery.proxy/} 1400 * @since 1.9 1401 */ 1402 proxy<TReturn, 1403 A, B, C, D, E, 1404 T, U, V, W, X>(fn: (a: A, b: B, c: C, d: D, e: E, 1405 t: T, u: U, v: V, w: W, x: X) => TReturn, 1406 context: null | undefined, 1407 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X) => TReturn; 1408 /** 1409 * Takes a function and returns a new one that will always have a particular context. 1410 * 1411 * @param fn The function whose context will be changed. 1412 * @param context The object to which the context (this) of the function should be set. 1413 * @see {@link https://api.jquery.com/jQuery.proxy/} 1414 * @since 1.9 1415 */ 1416 proxy<TReturn, 1417 A, B, C, D, 1418 T, U, V, W, X>(fn: (a: A, b: B, c: C, d: D, 1419 t: T, u: U, v: V, w: W, x: X) => TReturn, 1420 context: null | undefined, 1421 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X) => TReturn; 1422 /** 1423 * Takes a function and returns a new one that will always have a particular context. 1424 * 1425 * @param fn The function whose context will be changed. 1426 * @param context The object to which the context (this) of the function should be set. 1427 * @see {@link https://api.jquery.com/jQuery.proxy/} 1428 * @since 1.9 1429 */ 1430 proxy<TReturn, 1431 A, B, C, 1432 T, U, V, W, X>(fn: (a: A, b: B, c: C, 1433 t: T, u: U, v: V, w: W, x: X) => TReturn, 1434 context: null | undefined, 1435 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X) => TReturn; 1436 /** 1437 * Takes a function and returns a new one that will always have a particular context. 1438 * 1439 * @param fn The function whose context will be changed. 1440 * @param context The object to which the context (this) of the function should be set. 1441 * @see {@link https://api.jquery.com/jQuery.proxy/} 1442 * @since 1.9 1443 */ 1444 proxy<TReturn, 1445 A, B, 1446 T, U, V, W, X>(fn: (a: A, b: B, 1447 t: T, u: U, v: V, w: W, x: X) => TReturn, 1448 context: null | undefined, 1449 a: A, b: B): (t: T, u: U, v: V, w: W, x: X) => TReturn; 1450 /** 1451 * Takes a function and returns a new one that will always have a particular context. 1452 * 1453 * @param fn The function whose context will be changed. 1454 * @param context The object to which the context (this) of the function should be set. 1455 * @see {@link https://api.jquery.com/jQuery.proxy/} 1456 * @since 1.9 1457 */ 1458 proxy<TReturn, 1459 A, 1460 T, U, V, W, X>(fn: (a: A, 1461 t: T, u: U, v: V, w: W, x: X) => TReturn, 1462 context: null | undefined, 1463 a: A): (t: T, u: U, v: V, w: W, x: X) => TReturn; 1464 /** 1465 * Takes a function and returns a new one that will always have a particular context. 1466 * 1467 * @param fn The function whose context will be changed. 1468 * @param context The object to which the context (this) of the function should be set. 1469 * @see {@link https://api.jquery.com/jQuery.proxy/} 1470 * @since 1.9 1471 */ 1472 proxy<TReturn, 1473 T, U, V, W, X>(fn: (t: T, u: U, v: V, w: W, x: X) => TReturn, 1474 context: null | undefined): (t: T, u: U, v: V, w: W, x: X) => TReturn; 1475 1476 // endregion 1477 1478 // region 6 parameters 1479 1480 /** 1481 * Takes a function and returns a new one that will always have a particular context. 1482 * 1483 * @param fn The function whose context will be changed. 1484 * @param context The object to which the context (this) of the function should be set. 1485 * @see {@link https://api.jquery.com/jQuery.proxy/} 1486 * @since 1.9 1487 */ 1488 proxy<TReturn, 1489 A, B, C, D, E, F, G, 1490 T, U, V, W, X, Y>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, 1491 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, 1492 context: null | undefined, 1493 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; 1494 /** 1495 * Takes a function and returns a new one that will always have a particular context. 1496 * 1497 * @param fn The function whose context will be changed. 1498 * @param context The object to which the context (this) of the function should be set. 1499 * @see {@link https://api.jquery.com/jQuery.proxy/} 1500 * @since 1.9 1501 */ 1502 proxy<TReturn, 1503 A, B, C, D, E, F, 1504 T, U, V, W, X, Y>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, 1505 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, 1506 context: null | undefined, 1507 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; 1508 /** 1509 * Takes a function and returns a new one that will always have a particular context. 1510 * 1511 * @param fn The function whose context will be changed. 1512 * @param context The object to which the context (this) of the function should be set. 1513 * @see {@link https://api.jquery.com/jQuery.proxy/} 1514 * @since 1.9 1515 */ 1516 proxy<TReturn, 1517 A, B, C, D, E, 1518 T, U, V, W, X, Y>(fn: (a: A, b: B, c: C, d: D, e: E, 1519 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, 1520 context: null | undefined, 1521 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; 1522 /** 1523 * Takes a function and returns a new one that will always have a particular context. 1524 * 1525 * @param fn The function whose context will be changed. 1526 * @param context The object to which the context (this) of the function should be set. 1527 * @see {@link https://api.jquery.com/jQuery.proxy/} 1528 * @since 1.9 1529 */ 1530 proxy<TReturn, 1531 A, B, C, D, 1532 T, U, V, W, X, Y>(fn: (a: A, b: B, c: C, d: D, 1533 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, 1534 context: null | undefined, 1535 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; 1536 /** 1537 * Takes a function and returns a new one that will always have a particular context. 1538 * 1539 * @param fn The function whose context will be changed. 1540 * @param context The object to which the context (this) of the function should be set. 1541 * @see {@link https://api.jquery.com/jQuery.proxy/} 1542 * @since 1.9 1543 */ 1544 proxy<TReturn, 1545 A, B, C, 1546 T, U, V, W, X, Y>(fn: (a: A, b: B, c: C, 1547 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, 1548 context: null | undefined, 1549 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; 1550 /** 1551 * Takes a function and returns a new one that will always have a particular context. 1552 * 1553 * @param fn The function whose context will be changed. 1554 * @param context The object to which the context (this) of the function should be set. 1555 * @see {@link https://api.jquery.com/jQuery.proxy/} 1556 * @since 1.9 1557 */ 1558 proxy<TReturn, 1559 A, B, 1560 T, U, V, W, X, Y>(fn: (a: A, b: B, 1561 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, 1562 context: null | undefined, 1563 a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; 1564 /** 1565 * Takes a function and returns a new one that will always have a particular context. 1566 * 1567 * @param fn The function whose context will be changed. 1568 * @param context The object to which the context (this) of the function should be set. 1569 * @see {@link https://api.jquery.com/jQuery.proxy/} 1570 * @since 1.9 1571 */ 1572 proxy<TReturn, 1573 A, 1574 T, U, V, W, X, Y>(fn: (a: A, 1575 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, 1576 context: null | undefined, 1577 a: A): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; 1578 /** 1579 * Takes a function and returns a new one that will always have a particular context. 1580 * 1581 * @param fn The function whose context will be changed. 1582 * @param context The object to which the context (this) of the function should be set. 1583 * @see {@link https://api.jquery.com/jQuery.proxy/} 1584 * @since 1.9 1585 */ 1586 proxy<TReturn, 1587 T, U, V, W, X, Y>(fn: (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, 1588 context: null | undefined): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; 1589 1590 // endregion 1591 1592 // region 7+ parameters 1593 1594 /** 1595 * Takes a function and returns a new one that will always have a particular context. 1596 * 1597 * @param fn The function whose context will be changed. 1598 * @param context The object to which the context (this) of the function should be set. 1599 * @see {@link https://api.jquery.com/jQuery.proxy/} 1600 * @since 1.9 1601 */ 1602 proxy<TReturn, 1603 A, B, C, D, E, F, G, 1604 T, U, V, W, X, Y, Z>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, 1605 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, 1606 context: null | undefined, 1607 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; 1608 /** 1609 * Takes a function and returns a new one that will always have a particular context. 1610 * 1611 * @param fn The function whose context will be changed. 1612 * @param context The object to which the context (this) of the function should be set. 1613 * @see {@link https://api.jquery.com/jQuery.proxy/} 1614 * @since 1.9 1615 */ 1616 proxy<TReturn, 1617 A, B, C, D, E, F, 1618 T, U, V, W, X, Y, Z>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, 1619 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, 1620 context: null | undefined, 1621 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; 1622 /** 1623 * Takes a function and returns a new one that will always have a particular context. 1624 * 1625 * @param fn The function whose context will be changed. 1626 * @param context The object to which the context (this) of the function should be set. 1627 * @see {@link https://api.jquery.com/jQuery.proxy/} 1628 * @since 1.9 1629 */ 1630 proxy<TReturn, 1631 A, B, C, D, E, 1632 T, U, V, W, X, Y, Z>(fn: (a: A, b: B, c: C, d: D, e: E, 1633 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, 1634 context: null | undefined, 1635 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; 1636 /** 1637 * Takes a function and returns a new one that will always have a particular context. 1638 * 1639 * @param fn The function whose context will be changed. 1640 * @param context The object to which the context (this) of the function should be set. 1641 * @see {@link https://api.jquery.com/jQuery.proxy/} 1642 * @since 1.9 1643 */ 1644 proxy<TReturn, 1645 A, B, C, D, 1646 T, U, V, W, X, Y, Z>(fn: (a: A, b: B, c: C, d: D, 1647 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, 1648 context: null | undefined, 1649 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; 1650 /** 1651 * Takes a function and returns a new one that will always have a particular context. 1652 * 1653 * @param fn The function whose context will be changed. 1654 * @param context The object to which the context (this) of the function should be set. 1655 * @see {@link https://api.jquery.com/jQuery.proxy/} 1656 * @since 1.9 1657 */ 1658 proxy<TReturn, 1659 A, B, C, 1660 T, U, V, W, X, Y, Z>(fn: (a: A, b: B, c: C, 1661 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, 1662 context: null | undefined, 1663 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; 1664 /** 1665 * Takes a function and returns a new one that will always have a particular context. 1666 * 1667 * @param fn The function whose context will be changed. 1668 * @param context The object to which the context (this) of the function should be set. 1669 * @see {@link https://api.jquery.com/jQuery.proxy/} 1670 * @since 1.9 1671 */ 1672 proxy<TReturn, 1673 A, B, 1674 T, U, V, W, X, Y, Z>(fn: (a: A, b: B, 1675 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, 1676 context: null | undefined, 1677 a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; 1678 /** 1679 * Takes a function and returns a new one that will always have a particular context. 1680 * 1681 * @param fn The function whose context will be changed. 1682 * @param context The object to which the context (this) of the function should be set. 1683 * @see {@link https://api.jquery.com/jQuery.proxy/} 1684 * @since 1.9 1685 */ 1686 proxy<TReturn, 1687 A, 1688 T, U, V, W, X, Y, Z>(fn: (a: A, 1689 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, 1690 context: null | undefined, 1691 a: A): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; 1692 /** 1693 * Takes a function and returns a new one that will always have a particular context. 1694 * 1695 * @param fn The function whose context will be changed. 1696 * @param context The object to which the context (this) of the function should be set. 1697 * @see {@link https://api.jquery.com/jQuery.proxy/} 1698 * @since 1.9 1699 */ 1700 proxy<TReturn, 1701 T, U, V, W, X, Y, Z>(fn: (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, 1702 context: null | undefined): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; 1703 1704 // endregion 1705 1706 // endregion 1707 1708 // region 8+ arguments 1709 1710 /** 1711 * Takes a function and returns a new one that will always have a particular context. 1712 * 1713 * @param fn The function whose context will be changed. 1714 * @param context The object to which the context (this) of the function should be set. 1715 * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. 1716 * @see {@link https://api.jquery.com/jQuery.proxy/} 1717 * @since 1.9 1718 */ 1719 proxy<TReturn>(fn: (...args: any[]) => TReturn, 1720 context: null | undefined, 1721 ...additionalArguments: any[]): (...args: any[]) => TReturn; 1722 1723 // endregion 1724 1725 // endregion 1726 1727 // region (fn, context) 1728 1729 // region 0 to 7 arguments 1730 1731 // region 0 parameters 1732 1733 /** 1734 * Takes a function and returns a new one that will always have a particular context. 1735 * 1736 * @param fn The function whose context will be changed. 1737 * @param context The object to which the context (this) of the function should be set. 1738 * @see {@link https://api.jquery.com/jQuery.proxy/} 1739 * @since 1.4 1740 * @since 1.6 1741 */ 1742 proxy<TContext extends object, 1743 TReturn, 1744 A, B, C, D, E, F, G>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => TReturn, 1745 context: TContext, 1746 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext) => TReturn; 1747 /** 1748 * Takes a function and returns a new one that will always have a particular context. 1749 * 1750 * @param fn The function whose context will be changed. 1751 * @param context The object to which the context (this) of the function should be set. 1752 * @see {@link https://api.jquery.com/jQuery.proxy/} 1753 * @since 1.4 1754 * @since 1.6 1755 */ 1756 proxy<TContext extends object, 1757 TReturn, 1758 A, B, C, D, E, F>(fn: (a: A, b: B, c: C, d: D, e: E, f: F) => TReturn, 1759 context: TContext, 1760 a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext) => TReturn; 1761 /** 1762 * Takes a function and returns a new one that will always have a particular context. 1763 * 1764 * @param fn The function whose context will be changed. 1765 * @param context The object to which the context (this) of the function should be set. 1766 * @see {@link https://api.jquery.com/jQuery.proxy/} 1767 * @since 1.4 1768 * @since 1.6 1769 */ 1770 proxy<TContext extends object, 1771 TReturn, 1772 A, B, C, D, E>(fn: (a: A, b: B, c: C, d: D, e: E) => TReturn, 1773 context: TContext, 1774 a: A, b: B, c: C, d: D, e: E): (this: TContext) => TReturn; 1775 /** 1776 * Takes a function and returns a new one that will always have a particular context. 1777 * 1778 * @param fn The function whose context will be changed. 1779 * @param context The object to which the context (this) of the function should be set. 1780 * @see {@link https://api.jquery.com/jQuery.proxy/} 1781 * @since 1.4 1782 * @since 1.6 1783 */ 1784 proxy<TContext extends object, 1785 TReturn, 1786 A, B, C, D>(fn: (a: A, b: B, c: C, d: D) => TReturn, 1787 context: TContext, 1788 a: A, b: B, c: C, d: D): (this: TContext) => TReturn; 1789 /** 1790 * Takes a function and returns a new one that will always have a particular context. 1791 * 1792 * @param fn The function whose context will be changed. 1793 * @param context The object to which the context (this) of the function should be set. 1794 * @see {@link https://api.jquery.com/jQuery.proxy/} 1795 * @since 1.4 1796 * @since 1.6 1797 */ 1798 proxy<TContext extends object, 1799 TReturn, 1800 A, B, C>(fn: (a: A, b: B, c: C) => TReturn, 1801 context: TContext, 1802 a: A, b: B, c: C): (this: TContext) => TReturn; 1803 /** 1804 * Takes a function and returns a new one that will always have a particular context. 1805 * 1806 * @param fn The function whose context will be changed. 1807 * @param context The object to which the context (this) of the function should be set. 1808 * @see {@link https://api.jquery.com/jQuery.proxy/} 1809 * @since 1.4 1810 * @since 1.6 1811 */ 1812 proxy<TContext extends object, 1813 TReturn, 1814 A, B>(fn: (a: A, b: B) => TReturn, 1815 context: TContext, 1816 a: A, b: B): (this: TContext) => TReturn; 1817 /** 1818 * Takes a function and returns a new one that will always have a particular context. 1819 * 1820 * @param fn The function whose context will be changed. 1821 * @param context The object to which the context (this) of the function should be set. 1822 * @see {@link https://api.jquery.com/jQuery.proxy/} 1823 * @since 1.4` 1824 * @since 1.6 1825 */ 1826 proxy<TContext extends object, 1827 TReturn, 1828 A>(fn: (a: A) => TReturn, 1829 context: TContext, 1830 a: A): (this: TContext) => TReturn; 1831 /** 1832 * Takes a function and returns a new one that will always have a particular context. 1833 * 1834 * @param fn The function whose context will be changed. 1835 * @param context The object to which the context (this) of the function should be set. 1836 * @see {@link https://api.jquery.com/jQuery.proxy/} 1837 * @since 1.4 1838 * @since 1.6 1839 */ 1840 proxy<TContext extends object, 1841 TReturn>(fn: () => TReturn, 1842 context: TContext): (this: TContext) => TReturn; 1843 1844 // endregion 1845 1846 // region 1 parameters 1847 1848 /** 1849 * Takes a function and returns a new one that will always have a particular context. 1850 * 1851 * @param fn The function whose context will be changed. 1852 * @param context The object to which the context (this) of the function should be set. 1853 * @see {@link https://api.jquery.com/jQuery.proxy/} 1854 * @since 1.4 1855 * @since 1.6 1856 */ 1857 proxy<TContext extends object, 1858 TReturn, 1859 A, B, C, D, E, F, G, 1860 T>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, 1861 t: T) => TReturn, 1862 context: TContext, 1863 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T) => TReturn; 1864 /** 1865 * Takes a function and returns a new one that will always have a particular context. 1866 * 1867 * @param fn The function whose context will be changed. 1868 * @param context The object to which the context (this) of the function should be set. 1869 * @see {@link https://api.jquery.com/jQuery.proxy/} 1870 * @since 1.4 1871 * @since 1.6 1872 */ 1873 proxy<TContext extends object, 1874 TReturn, 1875 A, B, C, D, E, F, 1876 T>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, 1877 t: T) => TReturn, 1878 context: TContext, 1879 a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T) => TReturn; 1880 /** 1881 * Takes a function and returns a new one that will always have a particular context. 1882 * 1883 * @param fn The function whose context will be changed. 1884 * @param context The object to which the context (this) of the function should be set. 1885 * @see {@link https://api.jquery.com/jQuery.proxy/} 1886 * @since 1.4 1887 * @since 1.6 1888 */ 1889 proxy<TContext extends object, 1890 TReturn, 1891 A, B, C, D, E, 1892 T>(fn: (a: A, b: B, c: C, d: D, e: E, 1893 t: T) => TReturn, 1894 context: TContext, 1895 a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T) => TReturn; 1896 /** 1897 * Takes a function and returns a new one that will always have a particular context. 1898 * 1899 * @param fn The function whose context will be changed. 1900 * @param context The object to which the context (this) of the function should be set. 1901 * @see {@link https://api.jquery.com/jQuery.proxy/} 1902 * @since 1.4 1903 * @since 1.6 1904 */ 1905 proxy<TContext extends object, 1906 TReturn, 1907 A, B, C, D, 1908 T>(fn: (a: A, b: B, c: C, d: D, 1909 t: T) => TReturn, 1910 context: TContext, 1911 a: A, b: B, c: C, d: D): (this: TContext, t: T) => TReturn; 1912 /** 1913 * Takes a function and returns a new one that will always have a particular context. 1914 * 1915 * @param fn The function whose context will be changed. 1916 * @param context The object to which the context (this) of the function should be set. 1917 * @see {@link https://api.jquery.com/jQuery.proxy/} 1918 * @since 1.4 1919 * @since 1.6 1920 */ 1921 proxy<TContext extends object, 1922 TReturn, 1923 A, B, C, 1924 T>(fn: (a: A, b: B, c: C, 1925 t: T) => TReturn, 1926 context: TContext, 1927 a: A, b: B, c: C): (this: TContext, t: T) => TReturn; 1928 /** 1929 * Takes a function and returns a new one that will always have a particular context. 1930 * 1931 * @param fn The function whose context will be changed. 1932 * @param context The object to which the context (this) of the function should be set. 1933 * @see {@link https://api.jquery.com/jQuery.proxy/} 1934 * @since 1.4 1935 * @since 1.6 1936 */ 1937 proxy<TContext extends object, 1938 TReturn, 1939 A, B, 1940 T>(fn: (a: A, b: B, 1941 t: T) => TReturn, 1942 context: TContext, 1943 a: A, b: B): (this: TContext, t: T) => TReturn; 1944 /** 1945 * Takes a function and returns a new one that will always have a particular context. 1946 * 1947 * @param fn The function whose context will be changed. 1948 * @param context The object to which the context (this) of the function should be set. 1949 * @see {@link https://api.jquery.com/jQuery.proxy/} 1950 * @since 1.4 1951 * @since 1.6 1952 */ 1953 proxy<TContext extends object, 1954 TReturn, 1955 A, 1956 T>(fn: (a: A, 1957 t: T) => TReturn, 1958 context: TContext, 1959 a: A): (this: TContext, t: T) => TReturn; 1960 /** 1961 * Takes a function and returns a new one that will always have a particular context. 1962 * 1963 * @param fn The function whose context will be changed. 1964 * @param context The object to which the context (this) of the function should be set. 1965 * @see {@link https://api.jquery.com/jQuery.proxy/} 1966 * @since 1.4 1967 * @since 1.6 1968 */ 1969 proxy<TContext extends object, 1970 TReturn, 1971 T>(fn: (t: T) => TReturn, 1972 context: TContext): (this: TContext, t: T) => TReturn; 1973 1974 // endregion 1975 1976 // region 2 parameters 1977 1978 /** 1979 * Takes a function and returns a new one that will always have a particular context. 1980 * 1981 * @param fn The function whose context will be changed. 1982 * @param context The object to which the context (this) of the function should be set. 1983 * @see {@link https://api.jquery.com/jQuery.proxy/} 1984 * @since 1.4 1985 * @since 1.6 1986 */ 1987 proxy<TContext extends object, 1988 TReturn, 1989 A, B, C, D, E, F, G, 1990 T, U>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, 1991 t: T, u: U) => TReturn, 1992 context: TContext, 1993 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U) => TReturn; 1994 /** 1995 * Takes a function and returns a new one that will always have a particular context. 1996 * 1997 * @param fn The function whose context will be changed. 1998 * @param context The object to which the context (this) of the function should be set. 1999 * @see {@link https://api.jquery.com/jQuery.proxy/} 2000 * @since 1.4 2001 * @since 1.6 2002 */ 2003 proxy<TContext extends object, 2004 TReturn, 2005 A, B, C, D, E, F, 2006 T, U>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, 2007 t: T, u: U) => TReturn, 2008 context: TContext, 2009 a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U) => TReturn; 2010 /** 2011 * Takes a function and returns a new one that will always have a particular context. 2012 * 2013 * @param fn The function whose context will be changed. 2014 * @param context The object to which the context (this) of the function should be set. 2015 * @see {@link https://api.jquery.com/jQuery.proxy/} 2016 * @since 1.4 2017 * @since 1.6 2018 */ 2019 proxy<TContext extends object, 2020 TReturn, 2021 A, B, C, D, E, 2022 T, U>(fn: (a: A, b: B, c: C, d: D, e: E, 2023 t: T, u: U) => TReturn, 2024 context: TContext, 2025 a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U) => TReturn; 2026 /** 2027 * Takes a function and returns a new one that will always have a particular context. 2028 * 2029 * @param fn The function whose context will be changed. 2030 * @param context The object to which the context (this) of the function should be set. 2031 * @see {@link https://api.jquery.com/jQuery.proxy/} 2032 * @since 1.4 2033 * @since 1.6 2034 */ 2035 proxy<TContext extends object, 2036 TReturn, 2037 A, B, C, D, 2038 T, U>(fn: (a: A, b: B, c: C, d: D, 2039 t: T, u: U) => TReturn, 2040 context: TContext, 2041 a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U) => TReturn; 2042 /** 2043 * Takes a function and returns a new one that will always have a particular context. 2044 * 2045 * @param fn The function whose context will be changed. 2046 * @param context The object to which the context (this) of the function should be set. 2047 * @see {@link https://api.jquery.com/jQuery.proxy/} 2048 * @since 1.4 2049 * @since 1.6 2050 */ 2051 proxy<TContext extends object, 2052 TReturn, 2053 A, B, C, 2054 T, U>(fn: (a: A, b: B, c: C, 2055 t: T, u: U) => TReturn, 2056 context: TContext, 2057 a: A, b: B, c: C): (this: TContext, t: T, u: U) => TReturn; 2058 /** 2059 * Takes a function and returns a new one that will always have a particular context. 2060 * 2061 * @param fn The function whose context will be changed. 2062 * @param context The object to which the context (this) of the function should be set. 2063 * @see {@link https://api.jquery.com/jQuery.proxy/} 2064 * @since 1.4 2065 * @since 1.6 2066 */ 2067 proxy<TContext extends object, 2068 TReturn, 2069 A, B, 2070 T, U>(fn: (a: A, b: B, 2071 t: T, u: U) => TReturn, 2072 context: TContext, 2073 a: A, b: B): (this: TContext, t: T, u: U) => TReturn; 2074 /** 2075 * Takes a function and returns a new one that will always have a particular context. 2076 * 2077 * @param fn The function whose context will be changed. 2078 * @param context The object to which the context (this) of the function should be set. 2079 * @see {@link https://api.jquery.com/jQuery.proxy/} 2080 * @since 1.4 2081 * @since 1.6 2082 */ 2083 proxy<TContext extends object, 2084 TReturn, 2085 A, 2086 T, U>(fn: (a: A, 2087 t: T, u: U) => TReturn, 2088 context: TContext, 2089 a: A): (this: TContext, t: T, u: U) => TReturn; 2090 /** 2091 * Takes a function and returns a new one that will always have a particular context. 2092 * 2093 * @param fn The function whose context will be changed. 2094 * @param context The object to which the context (this) of the function should be set. 2095 * @see {@link https://api.jquery.com/jQuery.proxy/} 2096 * @since 1.4 2097 * @since 1.6 2098 */ 2099 proxy<TContext extends object, 2100 TReturn, 2101 T, U>(fn: (t: T, u: U) => TReturn, 2102 context: TContext): (this: TContext, t: T, u: U) => TReturn; 2103 2104 // endregion 2105 2106 // region 3 parameters 2107 2108 /** 2109 * Takes a function and returns a new one that will always have a particular context. 2110 * 2111 * @param fn The function whose context will be changed. 2112 * @param context The object to which the context (this) of the function should be set. 2113 * @see {@link https://api.jquery.com/jQuery.proxy/} 2114 * @since 1.4 2115 * @since 1.6 2116 */ 2117 proxy<TContext extends object, 2118 TReturn, 2119 A, B, C, D, E, F, G, 2120 T, U, V>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, 2121 t: T, u: U, v: V) => TReturn, 2122 context: TContext, 2123 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U, v: V) => TReturn; 2124 /** 2125 * Takes a function and returns a new one that will always have a particular context. 2126 * 2127 * @param fn The function whose context will be changed. 2128 * @param context The object to which the context (this) of the function should be set. 2129 * @see {@link https://api.jquery.com/jQuery.proxy/} 2130 * @since 1.4 2131 * @since 1.6 2132 */ 2133 proxy<TContext extends object, 2134 TReturn, 2135 A, B, C, D, E, F, 2136 T, U, V>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, 2137 t: T, u: U, v: V) => TReturn, 2138 context: TContext, 2139 a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U, v: V) => TReturn; 2140 /** 2141 * Takes a function and returns a new one that will always have a particular context. 2142 * 2143 * @param fn The function whose context will be changed. 2144 * @param context The object to which the context (this) of the function should be set. 2145 * @see {@link https://api.jquery.com/jQuery.proxy/} 2146 * @since 1.4 2147 * @since 1.6 2148 */ 2149 proxy<TContext extends object, 2150 TReturn, 2151 A, B, C, D, E, 2152 T, U, V>(fn: (a: A, b: B, c: C, d: D, e: E, 2153 t: T, u: U, v: V) => TReturn, 2154 context: TContext, 2155 a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U, v: V) => TReturn; 2156 /** 2157 * Takes a function and returns a new one that will always have a particular context. 2158 * 2159 * @param fn The function whose context will be changed. 2160 * @param context The object to which the context (this) of the function should be set. 2161 * @see {@link https://api.jquery.com/jQuery.proxy/} 2162 * @since 1.4 2163 * @since 1.6 2164 */ 2165 proxy<TContext extends object, 2166 TReturn, 2167 A, B, C, D, 2168 T, U, V>(fn: (a: A, b: B, c: C, d: D, 2169 t: T, u: U, v: V) => TReturn, 2170 context: TContext, 2171 a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U, v: V) => TReturn; 2172 /** 2173 * Takes a function and returns a new one that will always have a particular context. 2174 * 2175 * @param fn The function whose context will be changed. 2176 * @param context The object to which the context (this) of the function should be set. 2177 * @see {@link https://api.jquery.com/jQuery.proxy/} 2178 * @since 1.4 2179 * @since 1.6 2180 */ 2181 proxy<TContext extends object, 2182 TReturn, 2183 A, B, C, 2184 T, U, V>(fn: (a: A, b: B, c: C, 2185 t: T, u: U, v: V) => TReturn, 2186 context: TContext, 2187 a: A, b: B, c: C): (this: TContext, t: T, u: U, v: V) => TReturn; 2188 /** 2189 * Takes a function and returns a new one that will always have a particular context. 2190 * 2191 * @param fn The function whose context will be changed. 2192 * @param context The object to which the context (this) of the function should be set. 2193 * @see {@link https://api.jquery.com/jQuery.proxy/} 2194 * @since 1.4 2195 * @since 1.6 2196 */ 2197 proxy<TContext extends object, 2198 TReturn, 2199 A, B, 2200 T, U, V>(fn: (a: A, b: B, 2201 t: T, u: U, v: V) => TReturn, 2202 context: TContext, 2203 a: A, b: B): (this: TContext, t: T, u: U, v: V) => TReturn; 2204 /** 2205 * Takes a function and returns a new one that will always have a particular context. 2206 * 2207 * @param fn The function whose context will be changed. 2208 * @param context The object to which the context (this) of the function should be set. 2209 * @see {@link https://api.jquery.com/jQuery.proxy/} 2210 * @since 1.4 2211 * @since 1.6 2212 */ 2213 proxy<TContext extends object, 2214 TReturn, 2215 A, 2216 T, U, V>(fn: (a: A, 2217 t: T, u: U, v: V) => TReturn, 2218 context: TContext, 2219 a: A): (this: TContext, t: T, u: U, v: V) => TReturn; 2220 /** 2221 * Takes a function and returns a new one that will always have a particular context. 2222 * 2223 * @param fn The function whose context will be changed. 2224 * @param context The object to which the context (this) of the function should be set. 2225 * @see {@link https://api.jquery.com/jQuery.proxy/} 2226 * @since 1.4 2227 * @since 1.6 2228 */ 2229 proxy<TContext extends object, 2230 TReturn, 2231 T, U, V>(fn: (t: T, u: U, v: V) => TReturn, 2232 context: TContext): (this: TContext, t: T, u: U, v: V) => TReturn; 2233 2234 // endregion 2235 2236 // region 4 parameters 2237 2238 /** 2239 * Takes a function and returns a new one that will always have a particular context. 2240 * 2241 * @param fn The function whose context will be changed. 2242 * @param context The object to which the context (this) of the function should be set. 2243 * @see {@link https://api.jquery.com/jQuery.proxy/} 2244 * @since 1.4 2245 * @since 1.6 2246 */ 2247 proxy<TContext extends object, 2248 TReturn, 2249 A, B, C, D, E, F, G, 2250 T, U, V, W>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, 2251 t: T, u: U, v: V, w: W) => TReturn, 2252 context: TContext, 2253 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; 2254 /** 2255 * Takes a function and returns a new one that will always have a particular context. 2256 * 2257 * @param fn The function whose context will be changed. 2258 * @param context The object to which the context (this) of the function should be set. 2259 * @see {@link https://api.jquery.com/jQuery.proxy/} 2260 * @since 1.4 2261 * @since 1.6 2262 */ 2263 proxy<TContext extends object, 2264 TReturn, 2265 A, B, C, D, E, F, 2266 T, U, V, W>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, 2267 t: T, u: U, v: V, w: W) => TReturn, 2268 context: TContext, 2269 a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; 2270 /** 2271 * Takes a function and returns a new one that will always have a particular context. 2272 * 2273 * @param fn The function whose context will be changed. 2274 * @param context The object to which the context (this) of the function should be set. 2275 * @see {@link https://api.jquery.com/jQuery.proxy/} 2276 * @since 1.4 2277 * @since 1.6 2278 */ 2279 proxy<TContext extends object, 2280 TReturn, 2281 A, B, C, D, E, 2282 T, U, V, W>(fn: (a: A, b: B, c: C, d: D, e: E, 2283 t: T, u: U, v: V, w: W) => TReturn, 2284 context: TContext, 2285 a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; 2286 /** 2287 * Takes a function and returns a new one that will always have a particular context. 2288 * 2289 * @param fn The function whose context will be changed. 2290 * @param context The object to which the context (this) of the function should be set. 2291 * @see {@link https://api.jquery.com/jQuery.proxy/} 2292 * @since 1.4 2293 * @since 1.6 2294 */ 2295 proxy<TContext extends object, 2296 TReturn, 2297 A, B, C, D, 2298 T, U, V, W>(fn: (a: A, b: B, c: C, d: D, 2299 t: T, u: U, v: V, w: W) => TReturn, 2300 context: TContext, 2301 a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; 2302 /** 2303 * Takes a function and returns a new one that will always have a particular context. 2304 * 2305 * @param fn The function whose context will be changed. 2306 * @param context The object to which the context (this) of the function should be set. 2307 * @see {@link https://api.jquery.com/jQuery.proxy/} 2308 * @since 1.4 2309 * @since 1.6 2310 */ 2311 proxy<TContext extends object, 2312 TReturn, 2313 A, B, C, 2314 T, U, V, W>(fn: (a: A, b: B, c: C, 2315 t: T, u: U, v: V, w: W) => TReturn, 2316 context: TContext, 2317 a: A, b: B, c: C): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; 2318 /** 2319 * Takes a function and returns a new one that will always have a particular context. 2320 * 2321 * @param fn The function whose context will be changed. 2322 * @param context The object to which the context (this) of the function should be set. 2323 * @see {@link https://api.jquery.com/jQuery.proxy/} 2324 * @since 1.4 2325 * @since 1.6 2326 */ 2327 proxy<TContext extends object, 2328 TReturn, 2329 A, B, 2330 T, U, V, W>(fn: (a: A, b: B, 2331 t: T, u: U, v: V, w: W) => TReturn, 2332 context: TContext, 2333 a: A, b: B): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; 2334 /** 2335 * Takes a function and returns a new one that will always have a particular context. 2336 * 2337 * @param fn The function whose context will be changed. 2338 * @param context The object to which the context (this) of the function should be set. 2339 * @see {@link https://api.jquery.com/jQuery.proxy/} 2340 * @since 1.4 2341 * @since 1.6 2342 */ 2343 proxy<TContext extends object, 2344 TReturn, 2345 A, 2346 T, U, V, W>(fn: (a: A, 2347 t: T, u: U, v: V, w: W) => TReturn, 2348 context: TContext, 2349 a: A): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; 2350 /** 2351 * Takes a function and returns a new one that will always have a particular context. 2352 * 2353 * @param fn The function whose context will be changed. 2354 * @param context The object to which the context (this) of the function should be set. 2355 * @see {@link https://api.jquery.com/jQuery.proxy/} 2356 * @since 1.4 2357 * @since 1.6 2358 */ 2359 proxy<TContext extends object, 2360 TReturn, 2361 T, U, V, W>(fn: (t: T, u: U, v: V, w: W) => TReturn, 2362 context: TContext): (this: TContext, t: T, u: U, v: V, w: W) => TReturn; 2363 2364 // endregion 2365 2366 // region 5 parameters 2367 2368 /** 2369 * Takes a function and returns a new one that will always have a particular context. 2370 * 2371 * @param fn The function whose context will be changed. 2372 * @param context The object to which the context (this) of the function should be set. 2373 * @see {@link https://api.jquery.com/jQuery.proxy/} 2374 * @since 1.4 2375 * @since 1.6 2376 */ 2377 proxy<TContext extends object, 2378 TReturn, 2379 A, B, C, D, E, F, G, 2380 T, U, V, W, X>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, 2381 t: T, u: U, v: V, w: W, x: X) => TReturn, 2382 context: TContext, 2383 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; 2384 /** 2385 * Takes a function and returns a new one that will always have a particular context. 2386 * 2387 * @param fn The function whose context will be changed. 2388 * @param context The object to which the context (this) of the function should be set. 2389 * @see {@link https://api.jquery.com/jQuery.proxy/} 2390 * @since 1.4 2391 * @since 1.6 2392 */ 2393 proxy<TContext extends object, 2394 TReturn, 2395 A, B, C, D, E, F, 2396 T, U, V, W, X>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, 2397 t: T, u: U, v: V, w: W, x: X) => TReturn, 2398 context: TContext, 2399 a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; 2400 /** 2401 * Takes a function and returns a new one that will always have a particular context. 2402 * 2403 * @param fn The function whose context will be changed. 2404 * @param context The object to which the context (this) of the function should be set. 2405 * @see {@link https://api.jquery.com/jQuery.proxy/} 2406 * @since 1.4 2407 * @since 1.6 2408 */ 2409 proxy<TContext extends object, 2410 TReturn, 2411 A, B, C, D, E, 2412 T, U, V, W, X>(fn: (a: A, b: B, c: C, d: D, e: E, 2413 t: T, u: U, v: V, w: W, x: X) => TReturn, 2414 context: TContext, 2415 a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; 2416 /** 2417 * Takes a function and returns a new one that will always have a particular context. 2418 * 2419 * @param fn The function whose context will be changed. 2420 * @param context The object to which the context (this) of the function should be set. 2421 * @see {@link https://api.jquery.com/jQuery.proxy/} 2422 * @since 1.4 2423 * @since 1.6 2424 */ 2425 proxy<TContext extends object, 2426 TReturn, 2427 A, B, C, D, 2428 T, U, V, W, X>(fn: (a: A, b: B, c: C, d: D, 2429 t: T, u: U, v: V, w: W, x: X) => TReturn, 2430 context: TContext, 2431 a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; 2432 /** 2433 * Takes a function and returns a new one that will always have a particular context. 2434 * 2435 * @param fn The function whose context will be changed. 2436 * @param context The object to which the context (this) of the function should be set. 2437 * @see {@link https://api.jquery.com/jQuery.proxy/} 2438 * @since 1.4 2439 * @since 1.6 2440 */ 2441 proxy<TContext extends object, 2442 TReturn, 2443 A, B, C, 2444 T, U, V, W, X>(fn: (a: A, b: B, c: C, 2445 t: T, u: U, v: V, w: W, x: X) => TReturn, 2446 context: TContext, 2447 a: A, b: B, c: C): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; 2448 /** 2449 * Takes a function and returns a new one that will always have a particular context. 2450 * 2451 * @param fn The function whose context will be changed. 2452 * @param context The object to which the context (this) of the function should be set. 2453 * @see {@link https://api.jquery.com/jQuery.proxy/} 2454 * @since 1.4 2455 * @since 1.6 2456 */ 2457 proxy<TContext extends object, 2458 TReturn, 2459 A, B, 2460 T, U, V, W, X>(fn: (a: A, b: B, 2461 t: T, u: U, v: V, w: W, x: X) => TReturn, 2462 context: TContext, 2463 a: A, b: B): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; 2464 /** 2465 * Takes a function and returns a new one that will always have a particular context. 2466 * 2467 * @param fn The function whose context will be changed. 2468 * @param context The object to which the context (this) of the function should be set. 2469 * @see {@link https://api.jquery.com/jQuery.proxy/} 2470 * @since 1.4 2471 * @since 1.6 2472 */ 2473 proxy<TContext extends object, 2474 TReturn, 2475 A, 2476 T, U, V, W, X>(fn: (a: A, 2477 t: T, u: U, v: V, w: W, x: X) => TReturn, 2478 context: TContext, 2479 a: A): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; 2480 /** 2481 * Takes a function and returns a new one that will always have a particular context. 2482 * 2483 * @param fn The function whose context will be changed. 2484 * @param context The object to which the context (this) of the function should be set. 2485 * @see {@link https://api.jquery.com/jQuery.proxy/} 2486 * @since 1.4 2487 * @since 1.6 2488 */ 2489 proxy<TContext extends object, 2490 TReturn, 2491 T, U, V, W, X>(fn: (t: T, u: U, v: V, w: W, x: X) => TReturn, 2492 context: TContext): (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn; 2493 2494 // endregion 2495 2496 // region 6 parameters 2497 2498 /** 2499 * Takes a function and returns a new one that will always have a particular context. 2500 * 2501 * @param fn The function whose context will be changed. 2502 * @param context The object to which the context (this) of the function should be set. 2503 * @see {@link https://api.jquery.com/jQuery.proxy/} 2504 * @since 1.4 2505 * @since 1.6 2506 */ 2507 proxy<TContext extends object, 2508 TReturn, 2509 A, B, C, D, E, F, G, 2510 T, U, V, W, X, Y>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, 2511 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, 2512 context: TContext, 2513 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; 2514 /** 2515 * Takes a function and returns a new one that will always have a particular context. 2516 * 2517 * @param fn The function whose context will be changed. 2518 * @param context The object to which the context (this) of the function should be set. 2519 * @see {@link https://api.jquery.com/jQuery.proxy/} 2520 * @since 1.4 2521 * @since 1.6 2522 */ 2523 proxy<TContext extends object, 2524 TReturn, 2525 A, B, C, D, E, F, 2526 T, U, V, W, X, Y>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, 2527 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, 2528 context: TContext, 2529 a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; 2530 /** 2531 * Takes a function and returns a new one that will always have a particular context. 2532 * 2533 * @param fn The function whose context will be changed. 2534 * @param context The object to which the context (this) of the function should be set. 2535 * @see {@link https://api.jquery.com/jQuery.proxy/} 2536 * @since 1.4 2537 * @since 1.6 2538 */ 2539 proxy<TContext extends object, 2540 TReturn, 2541 A, B, C, D, E, 2542 T, U, V, W, X, Y>(fn: (a: A, b: B, c: C, d: D, e: E, 2543 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, 2544 context: TContext, 2545 a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; 2546 /** 2547 * Takes a function and returns a new one that will always have a particular context. 2548 * 2549 * @param fn The function whose context will be changed. 2550 * @param context The object to which the context (this) of the function should be set. 2551 * @see {@link https://api.jquery.com/jQuery.proxy/} 2552 * @since 1.4 2553 * @since 1.6 2554 */ 2555 proxy<TContext extends object, 2556 TReturn, 2557 A, B, C, D, 2558 T, U, V, W, X, Y>(fn: (a: A, b: B, c: C, d: D, 2559 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, 2560 context: TContext, 2561 a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; 2562 /** 2563 * Takes a function and returns a new one that will always have a particular context. 2564 * 2565 * @param fn The function whose context will be changed. 2566 * @param context The object to which the context (this) of the function should be set. 2567 * @see {@link https://api.jquery.com/jQuery.proxy/} 2568 * @since 1.4 2569 * @since 1.6 2570 */ 2571 proxy<TContext extends object, 2572 TReturn, 2573 A, B, C, 2574 T, U, V, W, X, Y>(fn: (a: A, b: B, c: C, 2575 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, 2576 context: TContext, 2577 a: A, b: B, c: C): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; 2578 /** 2579 * Takes a function and returns a new one that will always have a particular context. 2580 * 2581 * @param fn The function whose context will be changed. 2582 * @param context The object to which the context (this) of the function should be set. 2583 * @see {@link https://api.jquery.com/jQuery.proxy/} 2584 * @since 1.4 2585 * @since 1.6 2586 */ 2587 proxy<TContext extends object, 2588 TReturn, 2589 A, B, 2590 T, U, V, W, X, Y>(fn: (a: A, b: B, 2591 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, 2592 context: TContext, 2593 a: A, b: B): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; 2594 /** 2595 * Takes a function and returns a new one that will always have a particular context. 2596 * 2597 * @param fn The function whose context will be changed. 2598 * @param context The object to which the context (this) of the function should be set. 2599 * @see {@link https://api.jquery.com/jQuery.proxy/} 2600 * @since 1.4 2601 * @since 1.6 2602 */ 2603 proxy<TContext extends object, 2604 TReturn, 2605 A, 2606 T, U, V, W, X, Y>(fn: (a: A, 2607 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, 2608 context: TContext, 2609 a: A): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; 2610 /** 2611 * Takes a function and returns a new one that will always have a particular context. 2612 * 2613 * @param fn The function whose context will be changed. 2614 * @param context The object to which the context (this) of the function should be set. 2615 * @see {@link https://api.jquery.com/jQuery.proxy/} 2616 * @since 1.4 2617 * @since 1.6 2618 */ 2619 proxy<TContext extends object, 2620 TReturn, 2621 T, U, V, W, X, Y>(fn: (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn, 2622 context: TContext): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn; 2623 2624 // endregion 2625 2626 // region 7+ parameters 2627 2628 /** 2629 * Takes a function and returns a new one that will always have a particular context. 2630 * 2631 * @param fn The function whose context will be changed. 2632 * @param context The object to which the context (this) of the function should be set. 2633 * @see {@link https://api.jquery.com/jQuery.proxy/} 2634 * @since 1.4 2635 * @since 1.6 2636 */ 2637 proxy<TContext extends object, 2638 TReturn, 2639 A, B, C, D, E, F, G, 2640 T, U, V, W, X, Y, Z>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, 2641 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, 2642 context: TContext, 2643 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; 2644 /** 2645 * Takes a function and returns a new one that will always have a particular context. 2646 * 2647 * @param fn The function whose context will be changed. 2648 * @param context The object to which the context (this) of the function should be set. 2649 * @see {@link https://api.jquery.com/jQuery.proxy/} 2650 * @since 1.4 2651 * @since 1.6 2652 */ 2653 proxy<TContext extends object, 2654 TReturn, 2655 A, B, C, D, E, F, 2656 T, U, V, W, X, Y, Z>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, 2657 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, 2658 context: TContext, 2659 a: A, b: B, c: C, d: D, e: E, f: F): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; 2660 /** 2661 * Takes a function and returns a new one that will always have a particular context. 2662 * 2663 * @param fn The function whose context will be changed. 2664 * @param context The object to which the context (this) of the function should be set. 2665 * @see {@link https://api.jquery.com/jQuery.proxy/} 2666 * @since 1.4 2667 * @since 1.6 2668 */ 2669 proxy<TContext extends object, 2670 TReturn, 2671 A, B, C, D, E, 2672 T, U, V, W, X, Y, Z>(fn: (a: A, b: B, c: C, d: D, e: E, 2673 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, 2674 context: TContext, 2675 a: A, b: B, c: C, d: D, e: E): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; 2676 /** 2677 * Takes a function and returns a new one that will always have a particular context. 2678 * 2679 * @param fn The function whose context will be changed. 2680 * @param context The object to which the context (this) of the function should be set. 2681 * @see {@link https://api.jquery.com/jQuery.proxy/} 2682 * @since 1.4 2683 * @since 1.6 2684 */ 2685 proxy<TContext extends object, 2686 TReturn, 2687 A, B, C, D, 2688 T, U, V, W, X, Y, Z>(fn: (a: A, b: B, c: C, d: D, 2689 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, 2690 context: TContext, 2691 a: A, b: B, c: C, d: D): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; 2692 /** 2693 * Takes a function and returns a new one that will always have a particular context. 2694 * 2695 * @param fn The function whose context will be changed. 2696 * @param context The object to which the context (this) of the function should be set. 2697 * @see {@link https://api.jquery.com/jQuery.proxy/} 2698 * @since 1.4 2699 * @since 1.6 2700 */ 2701 proxy<TContext extends object, 2702 TReturn, 2703 A, B, C, 2704 T, U, V, W, X, Y, Z>(fn: (a: A, b: B, c: C, 2705 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, 2706 context: TContext, 2707 a: A, b: B, c: C): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; 2708 /** 2709 * Takes a function and returns a new one that will always have a particular context. 2710 * 2711 * @param fn The function whose context will be changed. 2712 * @param context The object to which the context (this) of the function should be set. 2713 * @see {@link https://api.jquery.com/jQuery.proxy/} 2714 * @since 1.4 2715 * @since 1.6 2716 */ 2717 proxy<TContext extends object, 2718 TReturn, 2719 A, B, 2720 T, U, V, W, X, Y, Z>(fn: (a: A, b: B, 2721 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, 2722 context: TContext, 2723 a: A, b: B): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; 2724 /** 2725 * Takes a function and returns a new one that will always have a particular context. 2726 * 2727 * @param fn The function whose context will be changed. 2728 * @param context The object to which the context (this) of the function should be set. 2729 * @see {@link https://api.jquery.com/jQuery.proxy/} 2730 * @since 1.4 2731 * @since 1.6 2732 */ 2733 proxy<TContext extends object, 2734 TReturn, 2735 A, 2736 T, U, V, W, X, Y, Z>(fn: (a: A, 2737 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, 2738 context: TContext, 2739 a: A): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; 2740 /** 2741 * Takes a function and returns a new one that will always have a particular context. 2742 * 2743 * @param fn The function whose context will be changed. 2744 * @param context The object to which the context (this) of the function should be set. 2745 * @see {@link https://api.jquery.com/jQuery.proxy/} 2746 * @since 1.4 2747 * @since 1.6 2748 */ 2749 proxy<TContext extends object, 2750 TReturn, 2751 T, U, V, W, X, Y, Z>(fn: (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn, 2752 context: TContext): (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn; 2753 2754 // endregion 2755 2756 // endregion 2757 2758 // region 8+ arguments 2759 2760 /** 2761 * Takes a function and returns a new one that will always have a particular context. 2762 * 2763 * @param fn The function whose context will be changed. 2764 * @param context The object to which the context (this) of the function should be set. 2765 * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. 2766 * @see {@link https://api.jquery.com/jQuery.proxy/} 2767 * @since 1.4 2768 * @since 1.6 2769 */ 2770 proxy<TContext extends object, 2771 TReturn>(fn: (...args: any[]) => TReturn, 2772 context: TContext, 2773 ...additionalArguments: any[]): (this: TContext, ...args: any[]) => TReturn; 2774 2775 // endregion 2776 2777 // endregion 2778 2779 // region (context, name) 2780 2781 /** 2782 * Takes a function and returns a new one that will always have a particular context. 2783 * 2784 * @param context The object to which the context of the function should be set. 2785 * @param name The name of the function whose context will be changed (should be a property of the context object). 2786 * @param additionalArguments Any number of arguments to be passed to the function named in the name argument. 2787 * @see {@link https://api.jquery.com/jQuery.proxy/} 2788 * @since 1.4 2789 * @since 1.6 2790 */ 2791 proxy<TContext extends object>(context: TContext, 2792 name: keyof TContext, 2793 ...additionalArguments: any[]): (this: TContext, ...args: any[]) => any; 2794 2795 // endregion 2796 2797 // endregion 2798 2799 /** 2800 * Manipulate the queue of functions to be executed on the matched element. 2801 * 2802 * @param element A DOM element where the array of queued functions is attached. 2803 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. 2804 * @param newQueue The new function to add to the queue. 2805 * An array of functions to replace the current queue contents. 2806 * @see {@link https://api.jquery.com/jQuery.queue/} 2807 * @since 1.3 2808 */ 2809 queue<T extends Element>(element: T, queueName?: string, newQueue?: JQuery.TypeOrArray<JQuery.QueueFunction<T>>): JQuery.Queue<T>; 2810 /** 2811 * Handles errors thrown synchronously in functions wrapped in jQuery(). 2812 * 2813 * @param error An error thrown in the function wrapped in jQuery(). 2814 * @see {@link https://api.jquery.com/jQuery.readyException/} 2815 * @since 3.1 2816 */ 2817 readyException(error: Error): any; 2818 /** 2819 * Remove a previously-stored piece of data. 2820 * 2821 * @param element A DOM element from which to remove data. 2822 * @param name A string naming the piece of data to remove. 2823 * @see {@link https://api.jquery.com/jQuery.removeData/} 2824 * @since 1.2.3 2825 */ 2826 removeData(element: Element, name?: string): void; 2827 /** 2828 * Creates an object containing a set of properties ready to be used in the definition of custom animations. 2829 * 2830 * @param duration A string or number determining how long the animation will run. 2831 * @param easing A string indicating which easing function to use for the transition. 2832 * @param complete A function to call once the animation is complete, called once per matched element. 2833 * @see {@link https://api.jquery.com/jQuery.speed/} 2834 * @since 1.1 2835 */ 2836 speed(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): JQuery.EffectsOptions<TElement>; 2837 /** 2838 * Creates an object containing a set of properties ready to be used in the definition of custom animations. 2839 * 2840 * @param duration A string or number determining how long the animation will run. 2841 * @param easing_complete A string indicating which easing function to use for the transition. 2842 * A function to call once the animation is complete, called once per matched element. 2843 * @see {@link https://api.jquery.com/jQuery.speed/} 2844 * @since 1.0 2845 * @since 1.1 2846 */ 2847 speed(duration: JQuery.Duration, 2848 easing_complete: string | ((this: TElement) => void)): JQuery.EffectsOptions<TElement>; 2849 /** 2850 * Creates an object containing a set of properties ready to be used in the definition of custom animations. 2851 * 2852 * @param duration_complete_settings A string or number determining how long the animation will run. 2853 * A function to call once the animation is complete, called once per matched element. 2854 * @see {@link https://api.jquery.com/jQuery.speed/} 2855 * @since 1.0 2856 * @since 1.1 2857 */ 2858 speed(duration_complete_settings?: JQuery.Duration | ((this: TElement) => void) | JQuery.SpeedSettings<TElement>): JQuery.EffectsOptions<TElement>; 2859 /** 2860 * Remove the whitespace from the beginning and end of a string. 2861 * 2862 * @param str The string to trim. 2863 * @see {@link https://api.jquery.com/jQuery.trim/} 2864 * @since 1.0 2865 */ 2866 trim(str: string): string; 2867 /** 2868 * Determine the internal JavaScript [[Class]] of an object. 2869 * 2870 * @param obj Object to get the internal JavaScript [[Class]] of. 2871 * @see {@link https://api.jquery.com/jQuery.type/} 2872 * @since 1.4.3 2873 */ 2874 type(obj: any): 'array' | 'boolean' | 'date' | 'error' | 'function' | 'null' | 'number' | 'object' | 'regexp' | 'string' | 'symbol' | 'undefined'; 2875 /** 2876 * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on 2877 * arrays of DOM elements, not strings or numbers. 2878 * 2879 * @param array The Array of DOM elements. 2880 * @see {@link https://api.jquery.com/jQuery.unique/} 2881 * @since 1.1.3 2882 * @deprecated 3.0 2883 */ 2884 unique<T extends Element>(array: T[]): T[]; 2885 /** 2886 * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on 2887 * arrays of DOM elements, not strings or numbers. 2888 * 2889 * @param array The Array of DOM elements. 2890 * @see {@link https://api.jquery.com/jQuery.uniqueSort/} 2891 * @since 1.12 2892 * @since 2.2 2893 */ 2894 uniqueSort<T extends Element>(array: T[]): T[]; 2895 /** 2896 * Provides a way to execute callback functions based on zero or more Thenable objects, usually 2897 * Deferred objects that represent asynchronous events. 2898 * 2899 * @see {@link https://api.jquery.com/jQuery.when/} 2900 * @since 1.5 2901 */ 2902 when<TR1, UR1, VR1, 2903 TJ1 = any, UJ1 = any, VJ1 = any> 2904 (deferredT: JQuery.Promise<TR1, TJ1, any> | JQuery.Thenable<TR1> | TR1, 2905 deferredU: JQuery.Promise<UR1, UJ1, any> | JQuery.Thenable<UR1> | UR1, 2906 deferredV: JQuery.Promise<VR1, VJ1, any> | JQuery.Thenable<VR1> | VR1): JQuery.Promise3<TR1, TJ1, never, 2907 UR1, UJ1, never, 2908 VR1, VJ1, never>; 2909 /** 2910 * Provides a way to execute callback functions based on zero or more Thenable objects, usually 2911 * Deferred objects that represent asynchronous events. 2912 * 2913 * @see {@link https://api.jquery.com/jQuery.when/} 2914 * @since 1.5 2915 */ 2916 when<TR1, UR1, 2917 TJ1 = any, UJ1 = any> 2918 (deferredT: JQuery.Promise<TR1, TJ1, any> | JQuery.Thenable<TR1> | TR1, 2919 deferredU: JQuery.Promise<UR1, UJ1, any> | JQuery.Thenable<UR1> | UR1): JQuery.Promise2<TR1, TJ1, never, 2920 UR1, UJ1, never>; 2921 /** 2922 * Provides a way to execute callback functions based on zero or more Thenable objects, usually 2923 * Deferred objects that represent asynchronous events. 2924 * 2925 * @see {@link https://api.jquery.com/jQuery.when/} 2926 * @since 1.5 2927 */ 2928 when<TR1, TJ1, 2929 TR2, TJ2, 2930 TR3 = never, TJ3 = never> 2931 (deferredT: JQuery.Promise3<TR1, TJ1, any, TR2, TJ2, any, TR3, TJ3, any> | 2932 JQuery.Promise2<TR1, TJ1, any, TR2, TJ2, any>): JQuery.Promise3<TR1, TJ1, never, TR2, TJ2, never, TR3, TJ3, never>; 2933 /** 2934 * Provides a way to execute callback functions based on zero or more Thenable objects, usually 2935 * Deferred objects that represent asynchronous events. 2936 * 2937 * @see {@link https://api.jquery.com/jQuery.when/} 2938 * @since 1.5 2939 */ 2940 when<TR1, TJ1 = any>(deferred: JQuery.Promise<TR1, TJ1, any> | JQuery.Thenable<TR1> | TR1): JQuery.Promise<TR1, TJ1, never>; 2941 /** 2942 * Provides a way to execute callback functions based on zero or more Thenable objects, usually 2943 * Deferred objects that represent asynchronous events. 2944 * 2945 * @param deferreds Zero or more Thenable objects. 2946 * @see {@link https://api.jquery.com/jQuery.when/} 2947 * @since 1.5 2948 */ 2949 when<TR1 = never, TJ1 = never>(...deferreds: Array<JQuery.Promise<TR1, TJ1, any> | JQuery.Thenable<TR1> | TR1>): JQuery.Promise<TR1, TJ1, never>; 2950 /** 2951 * Provides a way to execute callback functions based on zero or more Thenable objects, usually 2952 * Deferred objects that represent asynchronous events. 2953 * 2954 * @param deferreds Zero or more Thenable objects. 2955 * @see {@link https://api.jquery.com/jQuery.when/} 2956 * @since 1.5 2957 */ 2958 when(...deferreds: any[]): JQuery.Promise<any, any, never>; 2959 } 2960 2961 interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement> { 2962 /** 2963 * A string containing the jQuery version number. 2964 * 2965 * @see {@link https://api.jquery.com/jquery/} 2966 * @since 1.0 2967 */ 2968 jquery: string; 2969 /** 2970 * The number of elements in the jQuery object. 2971 * 2972 * @see {@link https://api.jquery.com/length/} 2973 * @since 1.0 2974 */ 2975 length: number; 2976 /** 2977 * Create a new jQuery object with elements added to the set of matched elements. 2978 * 2979 * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. 2980 * @param context The point in the document at which the selector should begin matching; similar to the context 2981 * argument of the $(selector, context) method. 2982 * @see {@link https://api.jquery.com/add/} 2983 * @since 1.4 2984 */ 2985 add(selector: JQuery.Selector, context: Element): this; 2986 /** 2987 * Create a new jQuery object with elements added to the set of matched elements. 2988 * 2989 * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. 2990 * One or more elements to add to the set of matched elements. 2991 * An HTML fragment to add to the set of matched elements. 2992 * An existing jQuery object to add to the set of matched elements. 2993 * @see {@link https://api.jquery.com/add/} 2994 * @since 1.0 2995 * @since 1.3.2 2996 */ 2997 add(selector: JQuery.Selector | JQuery.TypeOrArray<Element> | JQuery.htmlString | JQuery): this; 2998 /** 2999 * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. 3000 * 3001 * @param selector A string containing a selector expression to match the current set of elements against. 3002 * @see {@link https://api.jquery.com/addBack/} 3003 * @since 1.8 3004 */ 3005 addBack(selector?: JQuery.Selector): this; 3006 /** 3007 * Adds the specified class(es) to each element in the set of matched elements. 3008 * 3009 * @param className One or more space-separated classes to be added to the class attribute of each matched element. 3010 * A function returning one or more space-separated class names to be added to the existing class 3011 * name(s). Receives the index position of the element in the set and the existing class name(s) as 3012 * arguments. Within the function, this refers to the current element in the set. 3013 * @see {@link https://api.jquery.com/addClass/} 3014 * @since 1.0 3015 * @since 1.4 3016 */ 3017 addClass(className: string | ((this: TElement, index: number, currentClassName: string) => string)): this; 3018 /** 3019 * Insert content, specified by the parameter, after each element in the set of matched elements. 3020 * 3021 * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or 3022 * jQuery objects to insert after each element in the set of matched elements. 3023 * @see {@link https://api.jquery.com/after/} 3024 * @since 1.0 3025 */ 3026 after(...contents: Array<JQuery.htmlString | JQuery.TypeOrArray<JQuery.Node | JQuery<JQuery.Node>>>): this; 3027 /** 3028 * Insert content, specified by the parameter, after each element in the set of matched elements. 3029 * 3030 * @param fn A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert 3031 * after each element in the set of matched elements. Receives the index position of the element in the 3032 * set and the old HTML value of the element as arguments. Within the function, this refers to the 3033 * current element in the set. 3034 * @see {@link https://api.jquery.com/after/} 3035 * @since 1.4 3036 * @since 1.10 3037 */ 3038 after(fn: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray<JQuery.Node | JQuery<JQuery.Node>>): this; 3039 /** 3040 * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. 3041 * 3042 * @param handler The function to be invoked. 3043 * @see {@link https://api.jquery.com/ajaxComplete/} 3044 * @since 1.0 3045 */ 3046 ajaxComplete(handler: (this: Document, event: JQuery.Event<Document>, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings) => void | false): this; 3047 /** 3048 * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. 3049 * 3050 * @param handler The function to be invoked. 3051 * @see {@link https://api.jquery.com/ajaxError/} 3052 * @since 1.0 3053 */ 3054 ajaxError(handler: (this: Document, event: JQuery.Event<Document>, jqXHR: JQuery.jqXHR, ajaxSettings: JQuery.AjaxSettings, thrownError: string) => void | false): this; 3055 /** 3056 * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. 3057 * 3058 * @param handler The function to be invoked. 3059 * @see {@link https://api.jquery.com/ajaxSend/} 3060 * @since 1.0 3061 */ 3062 ajaxSend(handler: (this: Document, event: JQuery.Event<Document>, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings) => void | false): this; 3063 /** 3064 * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. 3065 * 3066 * @param handler The function to be invoked. 3067 * @see {@link https://api.jquery.com/ajaxStart/} 3068 * @since 1.0 3069 */ 3070 ajaxStart(handler: (this: Document) => void | false): this; 3071 /** 3072 * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. 3073 * 3074 * @param handler The function to be invoked. 3075 * @see {@link https://api.jquery.com/ajaxStop/} 3076 * @since 1.0 3077 */ 3078 ajaxStop(handler: (this: Document) => void | false): this; 3079 /** 3080 * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. 3081 * 3082 * @param handler The function to be invoked. 3083 * @see {@link https://api.jquery.com/ajaxSuccess/} 3084 * @since 1.0 3085 */ 3086 ajaxSuccess(handler: (this: Document, event: JQuery.Event<Document>, jqXHR: JQuery.jqXHR, ajaxOptions: JQuery.AjaxSettings, data: JQuery.PlainObject) => void | false): this; 3087 /** 3088 * Perform a custom animation of a set of CSS properties. 3089 * 3090 * @param properties An object of CSS properties and values that the animation will move toward. 3091 * @param duration A string or number determining how long the animation will run. 3092 * @param easing A string indicating which easing function to use for the transition. 3093 * @param complete A function to call once the animation is complete, called once per matched element. 3094 * @see {@link https://api.jquery.com/animate/} 3095 * @since 1.0 3096 */ 3097 animate(properties: JQuery.PlainObject, 3098 duration: JQuery.Duration, 3099 easing: string, 3100 complete?: (this: TElement) => void): this; 3101 /** 3102 * Perform a custom animation of a set of CSS properties. 3103 * 3104 * @param properties An object of CSS properties and values that the animation will move toward. 3105 * @param duration_easing A string or number determining how long the animation will run. 3106 * A string indicating which easing function to use for the transition. 3107 * @param complete A function to call once the animation is complete, called once per matched element. 3108 * @see {@link https://api.jquery.com/animate/} 3109 * @since 1.0 3110 */ 3111 animate(properties: JQuery.PlainObject, 3112 duration_easing: JQuery.Duration | string, 3113 complete?: (this: TElement) => void): this; 3114 /** 3115 * Perform a custom animation of a set of CSS properties. 3116 * 3117 * @param properties An object of CSS properties and values that the animation will move toward. 3118 * @param options A map of additional options to pass to the method. 3119 * @see {@link https://api.jquery.com/animate/} 3120 * @since 1.0 3121 */ 3122 animate(properties: JQuery.PlainObject, 3123 options: JQuery.EffectsOptions<TElement>): this; 3124 /** 3125 * Perform a custom animation of a set of CSS properties. 3126 * 3127 * @param properties An object of CSS properties and values that the animation will move toward. 3128 * @param complete A function to call once the animation is complete, called once per matched element. 3129 * @see {@link https://api.jquery.com/animate/} 3130 * @since 1.0 3131 */ 3132 animate(properties: JQuery.PlainObject, 3133 complete?: (this: TElement) => void): this; 3134 /** 3135 * Insert content, specified by the parameter, to the end of each element in the set of matched elements. 3136 * 3137 * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or 3138 * jQuery objects to insert at the end of each element in the set of matched elements. 3139 * @see {@link https://api.jquery.com/append/} 3140 * @since 1.0 3141 */ 3142 append(...contents: Array<JQuery.htmlString | JQuery.TypeOrArray<JQuery.Node | JQuery<JQuery.Node>>>): this; 3143 /** 3144 * Insert content, specified by the parameter, to the end of each element in the set of matched elements. 3145 * 3146 * @param fn A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert at 3147 * the end of each element in the set of matched elements. Receives the index position of the element 3148 * in the set and the old HTML value of the element as arguments. Within the function, this refers to 3149 * the current element in the set. 3150 * @see {@link https://api.jquery.com/append/} 3151 * @since 1.4 3152 */ 3153 append(fn: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray<JQuery.Node | JQuery<JQuery.Node>>): this; 3154 /** 3155 * Insert every element in the set of matched elements to the end of the target. 3156 * 3157 * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements 3158 * will be inserted at the end of the element(s) specified by this parameter. 3159 * @see {@link https://api.jquery.com/appendTo/} 3160 * @since 1.0 3161 */ 3162 appendTo(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray<Element> | JQuery): this; 3163 /** 3164 * Set one or more attributes for the set of matched elements. 3165 * 3166 * @param attributeName The name of the attribute to set. 3167 * @param value A value to set for the attribute. If null, the specified attribute will be removed (as in .removeAttr()). 3168 * A function returning the value to set. this is the current element. Receives the index position of 3169 * the element in the set and the old attribute value as arguments. 3170 * @see {@link https://api.jquery.com/attr/} 3171 * @since 1.0 3172 * @since 1.1 3173 */ 3174 attr(attributeName: string, 3175 value: string | number | null | ((this: TElement, index: number, attr: string) => string | number | void | undefined)): this; 3176 /** 3177 * Set one or more attributes for the set of matched elements. 3178 * 3179 * @param attributes An object of attribute-value pairs to set. 3180 * @see {@link https://api.jquery.com/attr/} 3181 * @since 1.0 3182 */ 3183 attr(attributes: JQuery.PlainObject): this; 3184 /** 3185 * Get the value of an attribute for the first element in the set of matched elements. 3186 * 3187 * @param attributeName The name of the attribute to get. 3188 * @see {@link https://api.jquery.com/attr/} 3189 * @since 1.0 3190 */ 3191 attr(attributeName: string): string | undefined; 3192 /** 3193 * Insert content, specified by the parameter, before each element in the set of matched elements. 3194 * 3195 * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or 3196 * jQuery objects to insert before each element in the set of matched elements. 3197 * @see {@link https://api.jquery.com/before/} 3198 * @since 1.0 3199 */ 3200 before(...contents: Array<JQuery.htmlString | JQuery.TypeOrArray<JQuery.Node | JQuery<JQuery.Node>>>): this; 3201 /** 3202 * Insert content, specified by the parameter, before each element in the set of matched elements. 3203 * 3204 * @param fn A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert 3205 * before each element in the set of matched elements. Receives the index position of the element in 3206 * the set and the old HTML value of the element as arguments. Within the function, this refers to the 3207 * current element in the set. 3208 * @see {@link https://api.jquery.com/before/} 3209 * @since 1.4 3210 * @since 1.10 3211 */ 3212 before(fn: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray<JQuery.Node | JQuery<JQuery.Node>>): this; 3213 // [bind() overloads] https://github.com/jquery/api.jquery.com/issues/1048 3214 /** 3215 * Attach a handler to an event for the elements. 3216 * 3217 * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. 3218 * @param eventData An object containing data that will be passed to the event handler. 3219 * @param handler A function to execute each time the event is triggered. 3220 * @see {@link https://api.jquery.com/bind/} 3221 * @since 1.0 3222 * @since 1.4.3 3223 * @deprecated 3.0 3224 */ 3225 bind<TData>(eventType: string, 3226 eventData: TData, 3227 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 3228 /** 3229 * Attach a handler to an event for the elements. 3230 * 3231 * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. 3232 * @param handler A function to execute each time the event is triggered. 3233 * Setting the second argument to false will attach a function that prevents the default action from 3234 * occurring and stops the event from bubbling. 3235 * @see {@link https://api.jquery.com/bind/} 3236 * @since 1.0 3237 * @since 1.4.3 3238 * @deprecated 3.0 3239 */ 3240 bind(eventType: string, 3241 handler: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false | null | undefined): this; 3242 /** 3243 * Attach a handler to an event for the elements. 3244 * 3245 * @param events An object containing one or more DOM event types and functions to execute for them. 3246 * @see {@link https://api.jquery.com/bind/} 3247 * @since 1.4 3248 * @deprecated 3.0 3249 */ 3250 bind(events: JQuery.PlainObject<JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false>): this; 3251 /** 3252 * Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. 3253 * 3254 * @param eventData An object containing data that will be passed to the event handler. 3255 * @param handler A function to execute each time the event is triggered. 3256 * @see {@link https://api.jquery.com/blur/} 3257 * @since 1.4.3 3258 */ 3259 blur<TData>(eventData: TData, 3260 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 3261 /** 3262 * Bind an event handler to the "blur" JavaScript event, or trigger that event on an element. 3263 * 3264 * @param handler A function to execute each time the event is triggered. 3265 * @see {@link https://api.jquery.com/blur/} 3266 * @since 1.0 3267 */ 3268 blur(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 3269 /** 3270 * Bind an event handler to the "change" JavaScript event, or trigger that event on an element. 3271 * 3272 * @param eventData An object containing data that will be passed to the event handler. 3273 * @param handler A function to execute each time the event is triggered. 3274 * @see {@link https://api.jquery.com/change/} 3275 * @since 1.4.3 3276 */ 3277 change<TData>(eventData: TData, 3278 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 3279 /** 3280 * Bind an event handler to the "change" JavaScript event, or trigger that event on an element. 3281 * 3282 * @param handler A function to execute each time the event is triggered. 3283 * @see {@link https://api.jquery.com/change/} 3284 * @since 1.0 3285 */ 3286 change(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 3287 /** 3288 * Get the children of each element in the set of matched elements, optionally filtered by a selector. 3289 * 3290 * @param selector A string containing a selector expression to match elements against. 3291 * @see {@link https://api.jquery.com/children/} 3292 * @since 1.0 3293 */ 3294 children(selector?: JQuery.Selector): this; 3295 /** 3296 * Remove from the queue all items that have not yet been run. 3297 * 3298 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. 3299 * @see {@link https://api.jquery.com/clearQueue/} 3300 * @since 1.4 3301 */ 3302 clearQueue(queueName?: string): this; 3303 /** 3304 * Bind an event handler to the "click" JavaScript event, or trigger that event on an element. 3305 * 3306 * @param eventData An object containing data that will be passed to the event handler. 3307 * @param handler A function to execute each time the event is triggered. 3308 * @see {@link https://api.jquery.com/click/} 3309 * @since 1.4.3 3310 */ 3311 click<TData>(eventData: TData, 3312 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 3313 /** 3314 * Bind an event handler to the "click" JavaScript event, or trigger that event on an element. 3315 * 3316 * @param handler A function to execute each time the event is triggered. 3317 * @see {@link https://api.jquery.com/click/} 3318 * @since 1.0 3319 */ 3320 click(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 3321 /** 3322 * Create a deep copy of the set of matched elements. 3323 * 3324 * @param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The 3325 * default value is false. *In jQuery 1.5.0 the default value was incorrectly true; it was changed back 3326 * to false in 1.5.1 and up. 3327 * @param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should 3328 * be copied. By default its value matches the first argument's value (which defaults to false). 3329 * @see {@link https://api.jquery.com/clone/} 3330 * @since 1.0 3331 * @since 1.5 3332 */ 3333 clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): this; 3334 /** 3335 * For each element in the set, get the first element that matches the selector by testing the element 3336 * itself and traversing up through its ancestors in the DOM tree. 3337 * 3338 * @param selector A string containing a selector expression to match elements against. 3339 * @param context A DOM element within which a matching element may be found. 3340 * @see {@link https://api.jquery.com/closest/} 3341 * @since 1.4 3342 */ 3343 closest(selector: JQuery.Selector, context: Element): this; 3344 /** 3345 * For each element in the set, get the first element that matches the selector by testing the element 3346 * itself and traversing up through its ancestors in the DOM tree. 3347 * 3348 * @param selector A string containing a selector expression to match elements against. 3349 * A jQuery object to match elements against. 3350 * An element to match elements against. 3351 * @see {@link https://api.jquery.com/closest/} 3352 * @since 1.3 3353 * @since 1.6 3354 */ 3355 closest(selector: JQuery.Selector | Element | JQuery): this; 3356 /** 3357 * Get the children of each element in the set of matched elements, including text and comment nodes. 3358 * 3359 * @see {@link https://api.jquery.com/contents/} 3360 * @since 1.2 3361 */ 3362 contents(): JQuery<TElement | Text | Comment>; 3363 /** 3364 * Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element. 3365 * 3366 * @param eventData An object containing data that will be passed to the event handler. 3367 * @param handler A function to execute each time the event is triggered. 3368 * @see {@link https://api.jquery.com/contextmenu/} 3369 * @since 1.4.3 3370 */ 3371 contextmenu<TData>(eventData: TData, 3372 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 3373 /** 3374 * Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element. 3375 * 3376 * @param handler A function to execute each time the event is triggered. 3377 * @see {@link https://api.jquery.com/contextmenu/} 3378 * @since 1.0 3379 */ 3380 contextmenu(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 3381 /** 3382 * Set one or more CSS properties for the set of matched elements. 3383 * 3384 * @param propertyName A CSS property name. 3385 * @param value A value to set for the property. 3386 * A function returning the value to set. this is the current element. Receives the index position of 3387 * the element in the set and the old value as arguments. 3388 * @see {@link https://api.jquery.com/css/} 3389 * @since 1.0 3390 * @since 1.4 3391 */ 3392 css(propertyName: string, 3393 value: string | number | ((this: TElement, index: number, value: string) => string | number | void | undefined)): this; 3394 /** 3395 * Set one or more CSS properties for the set of matched elements. 3396 * 3397 * @param properties An object of property-value pairs to set. 3398 * @see {@link https://api.jquery.com/css/} 3399 * @since 1.0 3400 */ 3401 css(properties: JQuery.PlainObject<string | number | ((this: TElement, index: number, value: string) => string | number | void | undefined)>): this; 3402 /** 3403 * Get the computed style properties for the first element in the set of matched elements. 3404 * 3405 * @param propertyName A CSS property. 3406 * An array of one or more CSS properties. 3407 * @see {@link https://api.jquery.com/css/} 3408 * @since 1.0 3409 */ 3410 css(propertyName: string): string; 3411 /** 3412 * Get the computed style properties for the first element in the set of matched elements. 3413 * 3414 * @param propertyNames An array of one or more CSS properties. 3415 * @see {@link https://api.jquery.com/css/} 3416 * @since 1.9 3417 */ 3418 css(propertyNames: string[]): JQuery.PlainObject<string>; 3419 /** 3420 * Return the value at the named data store for the first element in the jQuery collection, as set by 3421 * data(name, value) or by an HTML5 data-* attribute. 3422 * 3423 * @param key Name of the data stored. 3424 * @see {@link https://api.jquery.com/data/} 3425 * @since 1.2.3 3426 */ 3427 data(key: string, undefined: undefined): any; // tslint:disable-line:unified-signatures 3428 /** 3429 * Store arbitrary data associated with the matched elements. 3430 * 3431 * @param key A string naming the piece of data to set. 3432 * @param value The new data value; this can be any Javascript type except undefined. 3433 * @see {@link https://api.jquery.com/data/} 3434 * @since 1.2.3 3435 */ 3436 data(key: string, value: any): this; 3437 /** 3438 * Store arbitrary data associated with the matched elements. 3439 * 3440 * @param obj An object of key-value pairs of data to update. 3441 * @see {@link https://api.jquery.com/data/} 3442 * @since 1.4.3 3443 */ 3444 data(obj: JQuery.PlainObject): this; 3445 /** 3446 * Return the value at the named data store for the first element in the jQuery collection, as set by 3447 * data(name, value) or by an HTML5 data-* attribute. 3448 * 3449 * @param key Name of the data stored. 3450 * @see {@link https://api.jquery.com/data/} 3451 * @since 1.2.3 3452 */ 3453 data(key: string): any; 3454 /** 3455 * Return the value at the named data store for the first element in the jQuery collection, as set by 3456 * data(name, value) or by an HTML5 data-* attribute. 3457 * 3458 * @see {@link https://api.jquery.com/data/} 3459 * @since 1.4 3460 */ 3461 data(): JQuery.PlainObject; 3462 /** 3463 * Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element. 3464 * 3465 * @param eventData An object containing data that will be passed to the event handler. 3466 * @param handler A function to execute each time the event is triggered. 3467 * @see {@link https://api.jquery.com/dblclick/} 3468 * @since 1.4.3 3469 */ 3470 dblclick<TData>(eventData: TData, 3471 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 3472 /** 3473 * Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element. 3474 * 3475 * @param handler A function to execute each time the event is triggered. 3476 * @see {@link https://api.jquery.com/dblclick/} 3477 * @since 1.0 3478 */ 3479 dblclick(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 3480 /** 3481 * Set a timer to delay execution of subsequent items in the queue. 3482 * 3483 * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. 3484 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. 3485 * @see {@link https://api.jquery.com/delay/} 3486 * @since 1.4 3487 */ 3488 delay(duration: JQuery.Duration, queueName?: string): this; 3489 /** 3490 * Attach a handler to one or more events for all elements that match the selector, now or in the 3491 * future, based on a specific set of root elements. 3492 * 3493 * @param selector A selector to filter the elements that trigger the event. 3494 * @param eventType A string containing one or more space-separated JavaScript event types, such as "click" or 3495 * "keydown," or custom event names. 3496 * @param eventData An object containing data that will be passed to the event handler. 3497 * @param handler A function to execute each time the event is triggered. 3498 * @see {@link https://api.jquery.com/delegate/} 3499 * @since 1.4.2 3500 * @deprecated 3.0 3501 */ 3502 delegate<TData>(selector: JQuery.Selector, 3503 eventType: string, 3504 eventData: TData, 3505 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 3506 /** 3507 * Attach a handler to one or more events for all elements that match the selector, now or in the 3508 * future, based on a specific set of root elements. 3509 * 3510 * @param selector A selector to filter the elements that trigger the event. 3511 * @param eventType A string containing one or more space-separated JavaScript event types, such as "click" or 3512 * "keydown," or custom event names. 3513 * @param handler A function to execute each time the event is triggered. 3514 * @see {@link https://api.jquery.com/delegate/} 3515 * @since 1.4.2 3516 * @deprecated 3.0 3517 */ 3518 delegate(selector: JQuery.Selector, 3519 eventType: string, 3520 handler: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 3521 /** 3522 * Attach a handler to one or more events for all elements that match the selector, now or in the 3523 * future, based on a specific set of root elements. 3524 * 3525 * @param selector A selector to filter the elements that trigger the event. 3526 * @param events A plain object of one or more event types and functions to execute for them. 3527 * @see {@link https://api.jquery.com/delegate/} 3528 * @since 1.4.3 3529 * @deprecated 3.0 3530 */ 3531 delegate(selector: JQuery.Selector, 3532 events: JQuery.PlainObject<JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false>): this; 3533 /** 3534 * Execute the next function on the queue for the matched elements. 3535 * 3536 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. 3537 * @see {@link https://api.jquery.com/dequeue/} 3538 * @since 1.2 3539 */ 3540 dequeue(queueName?: string): this; 3541 /** 3542 * Remove the set of matched elements from the DOM. 3543 * 3544 * @param selector A selector expression that filters the set of matched elements to be removed. 3545 * @see {@link https://api.jquery.com/detach/} 3546 * @since 1.4 3547 */ 3548 detach(selector?: JQuery.Selector): this; 3549 /** 3550 * Iterate over a jQuery object, executing a function for each matched element. 3551 * 3552 * @param fn A function to execute for each matched element. 3553 * @see {@link https://api.jquery.com/each/} 3554 * @since 1.0 3555 */ 3556 each(fn: (this: TElement, index: number, element: TElement) => void | false): this; 3557 /** 3558 * Remove all child nodes of the set of matched elements from the DOM. 3559 * 3560 * @see {@link https://api.jquery.com/empty/} 3561 * @since 1.0 3562 */ 3563 empty(): this; 3564 /** 3565 * End the most recent filtering operation in the current chain and return the set of matched elements 3566 * to its previous state. 3567 * 3568 * @see {@link https://api.jquery.com/end/} 3569 * @since 1.0 3570 */ 3571 end(): this; 3572 /** 3573 * Reduce the set of matched elements to the one at the specified index. 3574 * 3575 * @param index An integer indicating the 0-based position of the element. 3576 * An integer indicating the position of the element, counting backwards from the last element in the set. 3577 * @see {@link https://api.jquery.com/eq/} 3578 * @since 1.1.2 3579 * @since 1.4 3580 */ 3581 eq(index: number): this; 3582 /** 3583 * Merge the contents of an object onto the jQuery prototype to provide new jQuery instance methods. 3584 * 3585 * @param obj An object to merge onto the jQuery prototype. 3586 * @see {@link https://api.jquery.com/jQuery.fn.extend/} 3587 * @since 1.0 3588 */ 3589 extend(obj: object): this; 3590 /** 3591 * Display the matched elements by fading them to opaque. 3592 * 3593 * @param duration A string or number determining how long the animation will run. 3594 * @param easing A string indicating which easing function to use for the transition. 3595 * @param complete A function to call once the animation is complete, called once per matched element. 3596 * @see {@link https://api.jquery.com/fadeIn/} 3597 * @since 1.4.3 3598 */ 3599 fadeIn(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; 3600 /** 3601 * Display the matched elements by fading them to opaque. 3602 * 3603 * @param duration_easing A string or number determining how long the animation will run. 3604 * A string indicating which easing function to use for the transition. 3605 * @param complete A function to call once the animation is complete, called once per matched element. 3606 * @see {@link https://api.jquery.com/fadeIn/} 3607 * @since 1.0 3608 * @since 1.4.3 3609 */ 3610 fadeIn(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; 3611 /** 3612 * Display the matched elements by fading them to opaque. 3613 * 3614 * @param duration_easing_complete_options A string or number determining how long the animation will run. 3615 * A string indicating which easing function to use for the transition. 3616 * A function to call once the animation is complete, called once per matched element. 3617 * A map of additional options to pass to the method. 3618 * @see {@link https://api.jquery.com/fadeIn/} 3619 * @since 1.0 3620 * @since 1.4.3 3621 */ 3622 fadeIn(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions<TElement>): this; 3623 /** 3624 * Hide the matched elements by fading them to transparent. 3625 * 3626 * @param duration A string or number determining how long the animation will run. 3627 * @param easing A string indicating which easing function to use for the transition. 3628 * @param complete A function to call once the animation is complete, called once per matched element. 3629 * @see {@link https://api.jquery.com/fadeOut/} 3630 * @since 1.4.3 3631 */ 3632 fadeOut(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; 3633 /** 3634 * Hide the matched elements by fading them to transparent. 3635 * 3636 * @param duration_easing A string or number determining how long the animation will run. 3637 * A string indicating which easing function to use for the transition. 3638 * @param complete A function to call once the animation is complete, called once per matched element. 3639 * @see {@link https://api.jquery.com/fadeOut/} 3640 * @since 1.0 3641 * @since 1.4.3 3642 */ 3643 fadeOut(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; 3644 /** 3645 * Hide the matched elements by fading them to transparent. 3646 * 3647 * @param duration_easing_complete_options A string or number determining how long the animation will run. 3648 * A string indicating which easing function to use for the transition. 3649 * A function to call once the animation is complete, called once per matched element. 3650 * A map of additional options to pass to the method. 3651 * @see {@link https://api.jquery.com/fadeOut/} 3652 * @since 1.0 3653 * @since 1.4.3 3654 */ 3655 fadeOut(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions<TElement>): this; 3656 /** 3657 * Adjust the opacity of the matched elements. 3658 * 3659 * @param duration A string or number determining how long the animation will run. 3660 * @param opacity A number between 0 and 1 denoting the target opacity. 3661 * @param easing A string indicating which easing function to use for the transition. 3662 * @param complete A function to call once the animation is complete, called once per matched element. 3663 * @see {@link https://api.jquery.com/fadeTo/} 3664 * @since 1.4.3 3665 */ 3666 fadeTo(duration: JQuery.Duration, opacity: number, easing: string, complete?: (this: TElement) => void): this; 3667 /** 3668 * Adjust the opacity of the matched elements. 3669 * 3670 * @param duration A string or number determining how long the animation will run. 3671 * @param opacity A number between 0 and 1 denoting the target opacity. 3672 * @param complete A function to call once the animation is complete, called once per matched element. 3673 * @see {@link https://api.jquery.com/fadeTo/} 3674 * @since 1.0 3675 */ 3676 fadeTo(duration: JQuery.Duration, opacity: number, complete?: (this: TElement) => void): this; 3677 /** 3678 * Display or hide the matched elements by animating their opacity. 3679 * 3680 * @param duration A string or number determining how long the animation will run. 3681 * @param easing A string indicating which easing function to use for the transition. 3682 * @param complete A function to call once the animation is complete, called once per matched element. 3683 * @see {@link https://api.jquery.com/fadeToggle/} 3684 * @since 1.4.4 3685 */ 3686 fadeToggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; 3687 /** 3688 * Display or hide the matched elements by animating their opacity. 3689 * 3690 * @param duration_easing A string or number determining how long the animation will run. 3691 * A string indicating which easing function to use for the transition. 3692 * @param complete A function to call once the animation is complete, called once per matched element. 3693 * @see {@link https://api.jquery.com/fadeToggle/} 3694 * @since 1.0 3695 * @since 1.4.3 3696 */ 3697 fadeToggle(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; 3698 /** 3699 * Display or hide the matched elements by animating their opacity. 3700 * 3701 * @param duration_easing_complete_options A string or number determining how long the animation will run. 3702 * A string indicating which easing function to use for the transition. 3703 * A function to call once the animation is complete, called once per matched element. 3704 * A map of additional options to pass to the method. 3705 * @see {@link https://api.jquery.com/fadeToggle/} 3706 * @since 1.0 3707 * @since 1.4.3 3708 */ 3709 fadeToggle(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions<TElement>): this; 3710 /** 3711 * Reduce the set of matched elements to those that match the selector or pass the function's test. 3712 * 3713 * @param selector A string containing a selector expression to match the current set of elements against. 3714 * One or more DOM elements to match the current set of elements against. 3715 * An existing jQuery object to match the current set of elements against. 3716 * A function used as a test for each element in the set. this is the current DOM element. 3717 * @see {@link https://api.jquery.com/filter/} 3718 * @since 1.0 3719 * @since 1.4 3720 */ 3721 filter(selector: JQuery.Selector | JQuery.TypeOrArray<Element> | JQuery | ((this: TElement, index: number, element: TElement) => boolean)): this; 3722 /** 3723 * Get the descendants of each element in the current set of matched elements, filtered by a selector, 3724 * jQuery object, or element. 3725 * 3726 * @param selector A string containing a selector expression to match elements against. 3727 * An element or a jQuery object to match elements against. 3728 * @see {@link https://api.jquery.com/find/} 3729 * @since 1.0 3730 * @since 1.6 3731 */ 3732 find(selector: JQuery.Selector | Element | JQuery): this; 3733 /** 3734 * Stop the currently-running animation, remove all queued animations, and complete all animations for 3735 * the matched elements. 3736 * 3737 * @param queue The name of the queue in which to stop animations. 3738 * @see {@link https://api.jquery.com/finish/} 3739 * @since 1.9 3740 */ 3741 finish(queue?: string): this; 3742 /** 3743 * Reduce the set of matched elements to the first in the set. 3744 * 3745 * @see {@link https://api.jquery.com/first/} 3746 * @since 1.4 3747 */ 3748 first(): this; 3749 /** 3750 * Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. 3751 * 3752 * @param eventData An object containing data that will be passed to the event handler. 3753 * @param handler A function to execute each time the event is triggered. 3754 * @see {@link https://api.jquery.com/focus/} 3755 * @since 1.4.3 3756 */ 3757 focus<TData>(eventData: TData, 3758 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 3759 /** 3760 * Bind an event handler to the "focus" JavaScript event, or trigger that event on an element. 3761 * 3762 * @param handler A function to execute each time the event is triggered. 3763 * @see {@link https://api.jquery.com/focus/} 3764 * @since 1.0 3765 */ 3766 focus(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 3767 /** 3768 * Bind an event handler to the "focusin" event. 3769 * 3770 * @param eventData An object containing data that will be passed to the event handler. 3771 * @param handler A function to execute each time the event is triggered. 3772 * @see {@link https://api.jquery.com/focusin/} 3773 * @since 1.4.3 3774 */ 3775 focusin<TData>(eventData: TData, 3776 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 3777 /** 3778 * Bind an event handler to the "focusin" event. 3779 * 3780 * @param handler A function to execute each time the event is triggered. 3781 * @see {@link https://api.jquery.com/focusin/} 3782 * @since 1.4 3783 */ 3784 focusin(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 3785 /** 3786 * Bind an event handler to the "focusout" JavaScript event. 3787 * 3788 * @param eventData An object containing data that will be passed to the event handler. 3789 * @param handler A function to execute each time the event is triggered. 3790 * @see {@link https://api.jquery.com/focusout/} 3791 * @since 1.4.3 3792 */ 3793 focusout<TData>(eventData: TData, 3794 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 3795 /** 3796 * Bind an event handler to the "focusout" JavaScript event. 3797 * 3798 * @param handler A function to execute each time the event is triggered. 3799 * @see {@link https://api.jquery.com/focusout/} 3800 * @since 1.4 3801 */ 3802 focusout(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 3803 /** 3804 * Retrieve one of the elements matched by the jQuery object. 3805 * 3806 * @param index A zero-based integer indicating which element to retrieve. 3807 * @see {@link https://api.jquery.com/get/} 3808 * @since 1.0 3809 */ 3810 get(index: number): TElement; 3811 /** 3812 * Retrieve the elements matched by the jQuery object. 3813 * 3814 * @see {@link https://api.jquery.com/get/} 3815 * @since 1.0 3816 */ 3817 get(): TElement[]; 3818 /** 3819 * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. 3820 * 3821 * @param selector A string containing a selector expression to match elements against. 3822 * A DOM element to match elements against. 3823 * @see {@link https://api.jquery.com/has/} 3824 * @since 1.4 3825 */ 3826 has(selector: string | Element): this; 3827 /** 3828 * Determine whether any of the matched elements are assigned the given class. 3829 * 3830 * @param className The class name to search for. 3831 * @see {@link https://api.jquery.com/hasClass/} 3832 * @since 1.2 3833 */ 3834 hasClass(className: string): boolean; 3835 /** 3836 * Set the CSS height of every matched element. 3837 * 3838 * @param value An integer representing the number of pixels, or an integer with an optional unit of measure 3839 * appended (as a string). 3840 * A function returning the height to set. Receives the index position of the element in the set and 3841 * the old height as arguments. Within the function, this refers to the current element in the set. 3842 * @see {@link https://api.jquery.com/height/} 3843 * @since 1.0 3844 * @since 1.4.1 3845 */ 3846 height(value: string | number | ((this: TElement, index: number, height: number) => string | number)): this; 3847 /** 3848 * Get the current computed height for the first element in the set of matched elements. 3849 * 3850 * @see {@link https://api.jquery.com/height/} 3851 * @since 1.0 3852 */ 3853 height(): number | undefined; 3854 /** 3855 * Hide the matched elements. 3856 * 3857 * @param duration A string or number determining how long the animation will run. 3858 * @param easing A string indicating which easing function to use for the transition. 3859 * @param complete A function to call once the animation is complete, called once per matched element. 3860 * @see {@link https://api.jquery.com/hide/} 3861 * @since 1.4.3 3862 */ 3863 hide(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): this; 3864 /** 3865 * Hide the matched elements. 3866 * 3867 * @param duration A string or number determining how long the animation will run. 3868 * @param easing_complete A string indicating which easing function to use for the transition. 3869 * A function to call once the animation is complete, called once per matched element. 3870 * @see {@link https://api.jquery.com/hide/} 3871 * @since 1.0 3872 * @since 1.4.3 3873 */ 3874 hide(duration: JQuery.Duration, easing_complete: string | ((this: TElement) => void)): this; 3875 /** 3876 * Hide the matched elements. 3877 * 3878 * @param duration_complete_options A string or number determining how long the animation will run. 3879 * A function to call once the animation is complete, called once per matched element. 3880 * A map of additional options to pass to the method. 3881 * @see {@link https://api.jquery.com/hide/} 3882 * @since 1.0 3883 */ 3884 hide(duration_complete_options?: JQuery.Duration | ((this: TElement) => void) | JQuery.EffectsOptions<TElement>): this; 3885 /** 3886 * Bind one or two handlers to the matched elements, to be executed when the mouse pointer enters and 3887 * leaves the elements. 3888 * 3889 * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element. 3890 * @param handlerOut A function to execute when the mouse pointer leaves the element. 3891 * @see {@link https://api.jquery.com/hover/} 3892 * @since 1.0 3893 * @since 1.4 3894 */ 3895 // HACK: The type parameter T is not used but ensures the 'event' callback parameter is typed correctly. 3896 hover<T>(handlerInOut: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false, 3897 handlerOut?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 3898 /** 3899 * Set the HTML contents of each element in the set of matched elements. 3900 * 3901 * @param htmlString A string of HTML to set as the content of each matched element. 3902 * A function returning the HTML content to set. Receives the index position of the element in the set 3903 * and the old HTML value as arguments. jQuery empties the element before calling the function; use the 3904 * oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. 3905 * @see {@link https://api.jquery.com/html/} 3906 * @since 1.0 3907 * @since 1.4 3908 */ 3909 html(htmlString: JQuery.htmlString | ((this: TElement, index: number, oldhtml: JQuery.htmlString) => JQuery.htmlString)): this; 3910 /** 3911 * Get the HTML contents of the first element in the set of matched elements. 3912 * 3913 * @see {@link https://api.jquery.com/html/} 3914 * @since 1.0 3915 */ 3916 html(): string; 3917 /** 3918 * Search for a given element from among the matched elements. 3919 * 3920 * @param element The DOM element or first element within the jQuery object to look for. 3921 * A selector representing a jQuery collection in which to look for an element. 3922 * @see {@link https://api.jquery.com/index/} 3923 * @since 1.0 3924 * @since 1.4 3925 */ 3926 index(element?: JQuery.Selector | Element | JQuery): number; 3927 /** 3928 * Set the CSS inner height of each element in the set of matched elements. 3929 * 3930 * @param value A number representing the number of pixels, or a number along with an optional unit of measure 3931 * appended (as a string). 3932 * A function returning the inner height (including padding but not border) to set. Receives the index 3933 * position of the element in the set and the old inner height as arguments. Within the function, this 3934 * refers to the current element in the set. 3935 * @see {@link https://api.jquery.com/innerHeight/} 3936 * @since 1.8.0 3937 */ 3938 innerHeight(value: string | number | ((this: TElement, index: number, height: number) => string | number)): this; 3939 /** 3940 * Get the current computed height for the first element in the set of matched elements, including 3941 * padding but not border. 3942 * 3943 * @see {@link https://api.jquery.com/innerHeight/} 3944 * @since 1.2.6 3945 */ 3946 innerHeight(): number | undefined; 3947 /** 3948 * Set the CSS inner width of each element in the set of matched elements. 3949 * 3950 * @param value A number representing the number of pixels, or a number along with an optional unit of measure 3951 * appended (as a string). 3952 * A function returning the inner width (including padding but not border) to set. Receives the index 3953 * position of the element in the set and the old inner width as arguments. Within the function, this 3954 * refers to the current element in the set. 3955 * @see {@link https://api.jquery.com/innerWidth/} 3956 * @since 1.8.0 3957 */ 3958 innerWidth(value: string | number | ((this: TElement, index: number, width: number) => string | number)): this; 3959 /** 3960 * Get the current computed inner width for the first element in the set of matched elements, including 3961 * padding but not border. 3962 * 3963 * @see {@link https://api.jquery.com/innerWidth/} 3964 * @since 1.2.6 3965 */ 3966 innerWidth(): number | undefined; 3967 /** 3968 * Insert every element in the set of matched elements after the target. 3969 * 3970 * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements 3971 * will be inserted after the element(s) specified by this parameter. 3972 * @see {@link https://api.jquery.com/insertAfter/} 3973 * @since 1.0 3974 */ 3975 insertAfter(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray<Element> | JQuery): this; 3976 /** 3977 * Insert every element in the set of matched elements before the target. 3978 * 3979 * @param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements 3980 * will be inserted before the element(s) specified by this parameter. 3981 * @see {@link https://api.jquery.com/insertBefore/} 3982 * @since 1.0 3983 */ 3984 insertBefore(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray<Element> | JQuery): this; 3985 /** 3986 * Check the current matched set of elements against a selector, element, or jQuery object and return 3987 * true if at least one of these elements matches the given arguments. 3988 * 3989 * @param selector A string containing a selector expression to match elements against. 3990 * A function used as a test for every element in the set. It accepts two arguments, index, which is 3991 * the element's index in the jQuery collection, and element, which is the DOM element. Within the 3992 * function, this refers to the current DOM element. 3993 * An existing jQuery object to match the current set of elements against. 3994 * One or more elements to match the current set of elements against. 3995 * @see {@link https://api.jquery.com/is/} 3996 * @since 1.0 3997 * @since 1.6 3998 */ 3999 is(selector: JQuery.Selector | JQuery.TypeOrArray<Element> | JQuery | ((this: TElement, index: number, element: TElement) => boolean)): boolean; 4000 /** 4001 * Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element. 4002 * 4003 * @param eventData An object containing data that will be passed to the event handler. 4004 * @param handler A function to execute each time the event is triggered. 4005 * @see {@link https://api.jquery.com/keydown/} 4006 * @since 1.4.3 4007 */ 4008 keydown<TData>(eventData: TData, 4009 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 4010 /** 4011 * Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element. 4012 * 4013 * @param handler A function to execute each time the event is triggered. 4014 * @see {@link https://api.jquery.com/keydown/} 4015 * @since 1.0 4016 */ 4017 keydown(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 4018 /** 4019 * Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element. 4020 * 4021 * @param eventData An object containing data that will be passed to the event handler. 4022 * @param handler A function to execute each time the event is triggered. 4023 * @see {@link https://api.jquery.com/keypress/} 4024 * @since 1.4.3 4025 */ 4026 keypress<TData>(eventData: TData, 4027 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 4028 /** 4029 * Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element. 4030 * 4031 * @param handler A function to execute each time the event is triggered. 4032 * @see {@link https://api.jquery.com/keypress/} 4033 * @since 1.0 4034 */ 4035 keypress(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 4036 /** 4037 * Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element. 4038 * 4039 * @param eventData An object containing data that will be passed to the event handler. 4040 * @param handler A function to execute each time the event is triggered. 4041 * @see {@link https://api.jquery.com/keyup/} 4042 * @since 1.4.3 4043 */ 4044 keyup<TData>(eventData: TData, 4045 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 4046 /** 4047 * Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element. 4048 * 4049 * @param handler A function to execute each time the event is triggered. 4050 * @see {@link https://api.jquery.com/keyup/} 4051 * @since 1.0 4052 */ 4053 keyup(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 4054 /** 4055 * Reduce the set of matched elements to the final one in the set. 4056 * 4057 * @see {@link https://api.jquery.com/last/} 4058 * @since 1.4 4059 */ 4060 last(): this; 4061 /** 4062 * Load data from the server and place the returned HTML into the matched element. 4063 * 4064 * @param url A string containing the URL to which the request is sent. 4065 * @param data A plain object or string that is sent to the server with the request. 4066 * @param complete A callback function that is executed when the request completes. 4067 * @see {@link https://api.jquery.com/load/} 4068 * @since 1.0 4069 */ 4070 load(url: string, 4071 data: string | JQuery.PlainObject, 4072 complete: (this: TElement, responseText: string, textStatus: JQuery.Ajax.TextStatus, jqXHR: JQuery.jqXHR) => void): this; 4073 /** 4074 * Load data from the server and place the returned HTML into the matched element. 4075 * 4076 * @param url A string containing the URL to which the request is sent. 4077 * @param complete_data A callback function that is executed when the request completes. 4078 * A plain object or string that is sent to the server with the request. 4079 * @see {@link https://api.jquery.com/load/} 4080 * @since 1.0 4081 */ 4082 load(url: string, 4083 complete_data?: ((this: TElement, responseText: string, textStatus: JQuery.Ajax.TextStatus, jqXHR: JQuery.jqXHR) => void) | string | JQuery.PlainObject): this; 4084 /** 4085 * Pass each element in the current matched set through a function, producing a new jQuery object 4086 * containing the return values. 4087 * 4088 * @param callback A function object that will be invoked for each element in the current set. 4089 * @see {@link https://api.jquery.com/map/} 4090 * @since 1.2 4091 */ 4092 map(callback: (this: TElement, index: number, domElement: TElement) => any | any[] | null | undefined): this; 4093 /** 4094 * Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element. 4095 * 4096 * @param eventData An object containing data that will be passed to the event handler. 4097 * @param handler A function to execute each time the event is triggered. 4098 * @see {@link https://api.jquery.com/mousedown/} 4099 * @since 1.4.3 4100 */ 4101 mousedown<TData>(eventData: TData, 4102 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 4103 /** 4104 * Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element. 4105 * 4106 * @param handler A function to execute each time the event is triggered. 4107 * @see {@link https://api.jquery.com/mousedown/} 4108 * @since 1.0 4109 */ 4110 mousedown(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 4111 /** 4112 * Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element. 4113 * 4114 * @param eventData An object containing data that will be passed to the event handler. 4115 * @param handler A function to execute each time the event is triggered. 4116 * @see {@link https://api.jquery.com/mouseenter/} 4117 * @since 1.4.3 4118 */ 4119 mouseenter<TData>(eventData: TData, 4120 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 4121 /** 4122 * Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element. 4123 * 4124 * @param handler A function to execute each time the event is triggered. 4125 * @see {@link https://api.jquery.com/mouseenter/} 4126 * @since 1.0 4127 */ 4128 mouseenter(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 4129 /** 4130 * Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. 4131 * 4132 * @param eventData An object containing data that will be passed to the event handler. 4133 * @param handler A function to execute each time the event is triggered. 4134 * @see {@link https://api.jquery.com/mouseleave/} 4135 * @since 1.4.3 4136 */ 4137 mouseleave<TData>(eventData: TData, 4138 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 4139 /** 4140 * Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. 4141 * 4142 * @param handler A function to execute each time the event is triggered. 4143 * @see {@link https://api.jquery.com/mouseleave/} 4144 * @since 1.0 4145 */ 4146 mouseleave(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 4147 /** 4148 * Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element. 4149 * 4150 * @param eventData An object containing data that will be passed to the event handler. 4151 * @param handler A function to execute each time the event is triggered. 4152 * @see {@link https://api.jquery.com/mousemove/} 4153 * @since 1.4.3 4154 */ 4155 mousemove<TData>(eventData: TData, 4156 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 4157 /** 4158 * Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element. 4159 * 4160 * @param handler A function to execute each time the event is triggered. 4161 * @see {@link https://api.jquery.com/mousemove/} 4162 * @since 1.0 4163 */ 4164 mousemove(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 4165 /** 4166 * Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element. 4167 * 4168 * @param eventData An object containing data that will be passed to the event handler. 4169 * @param handler A function to execute each time the event is triggered. 4170 * @see {@link https://api.jquery.com/mouseout/} 4171 * @since 1.4.3 4172 */ 4173 mouseout<TData>(eventData: TData, 4174 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 4175 /** 4176 * Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element. 4177 * 4178 * @param handler A function to execute each time the event is triggered. 4179 * @see {@link https://api.jquery.com/mouseout/} 4180 * @since 1.0 4181 */ 4182 mouseout(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 4183 /** 4184 * Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element. 4185 * 4186 * @param eventData An object containing data that will be passed to the event handler. 4187 * @param handler A function to execute each time the event is triggered. 4188 * @see {@link https://api.jquery.com/mouseover/} 4189 * @since 1.4.3 4190 */ 4191 mouseover<TData>(eventData: TData, 4192 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 4193 /** 4194 * Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element. 4195 * 4196 * @param handler A function to execute each time the event is triggered. 4197 * @see {@link https://api.jquery.com/mouseover/} 4198 * @since 1.0 4199 */ 4200 mouseover(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 4201 /** 4202 * Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element. 4203 * 4204 * @param eventData An object containing data that will be passed to the event handler. 4205 * @param handler A function to execute each time the event is triggered. 4206 * @see {@link https://api.jquery.com/mouseup/} 4207 * @since 1.4.3 4208 */ 4209 mouseup<TData>(eventData: TData, 4210 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 4211 /** 4212 * Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element. 4213 * 4214 * @param handler A function to execute each time the event is triggered. 4215 * @see {@link https://api.jquery.com/mouseup/} 4216 * @since 1.0 4217 */ 4218 mouseup(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 4219 /** 4220 * Get the immediately following sibling of each element in the set of matched elements. If a selector 4221 * is provided, it retrieves the next sibling only if it matches that selector. 4222 * 4223 * @param selector A string containing a selector expression to match elements against. 4224 * @see {@link https://api.jquery.com/next/} 4225 * @since 1.0 4226 */ 4227 next(selector?: JQuery.Selector): this; 4228 /** 4229 * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. 4230 * 4231 * @param selector A string containing a selector expression to match elements against. 4232 * @see {@link https://api.jquery.com/nextAll/} 4233 * @since 1.2 4234 */ 4235 nextAll(selector?: string): this; 4236 /** 4237 * Get all following siblings of each element up to but not including the element matched by the 4238 * selector, DOM node, or jQuery object passed. 4239 * 4240 * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements. 4241 * A DOM node or jQuery object indicating where to stop matching following sibling elements. 4242 * @param filter A string containing a selector expression to match elements against. 4243 * @see {@link https://api.jquery.com/nextUntil/} 4244 * @since 1.4 4245 * @since 1.6 4246 */ 4247 nextUntil(selector?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; 4248 /** 4249 * Remove elements from the set of matched elements. 4250 * 4251 * @param selector A string containing a selector expression, a DOM element, or an array of elements to match against the set. 4252 * A function used as a test for each element in the set. It accepts two arguments, index, which is the 4253 * element's index in the jQuery collection, and element, which is the DOM element. Within the 4254 * function, this refers to the current DOM element. 4255 * An existing jQuery object to match the current set of elements against. 4256 * @see {@link https://api.jquery.com/not/} 4257 * @since 1.0 4258 * @since 1.4 4259 */ 4260 not(selector: JQuery.Selector | JQuery.TypeOrArray<Element> | JQuery | ((this: TElement, index: number, element: TElement) => boolean)): this; 4261 /** 4262 * Remove an event handler. 4263 * 4264 * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as 4265 * "click", "keydown.myPlugin", or ".myPlugin". 4266 * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. 4267 * @param handler A function to execute each time the event is triggered. 4268 * @see {@link https://api.jquery.com/off/} 4269 * @since 1.7 4270 */ 4271 off(events: string, selector: JQuery.Selector, handler: JQuery.EventHandlerBase<any, JQuery.Event<TElement, any>> | false): this; 4272 /** 4273 * Remove an event handler. 4274 * 4275 * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as 4276 * "click", "keydown.myPlugin", or ".myPlugin". 4277 * @param selector_handler A selector which should match the one originally passed to .on() when attaching event handlers. 4278 * A function to execute each time the event is triggered. 4279 * @see {@link https://api.jquery.com/off/} 4280 * @since 1.7 4281 */ 4282 off(events: string, selector_handler?: JQuery.Selector | JQuery.EventHandlerBase<any, JQuery.Event<TElement, any>> | false): this; 4283 /** 4284 * Remove an event handler. 4285 * 4286 * @param events An object where the string keys represent one or more space-separated event types and optional 4287 * namespaces, and the values represent handler functions previously attached for the event(s). 4288 * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. 4289 * @see {@link https://api.jquery.com/off/} 4290 * @since 1.7 4291 */ 4292 off(events: JQuery.PlainObject<JQuery.EventHandlerBase<any, JQuery.Event<TElement, any>> | false>, selector?: JQuery.Selector): this; 4293 /** 4294 * Remove an event handler. 4295 * 4296 * @param event A jQuery.Event object. 4297 * @see {@link https://api.jquery.com/off/} 4298 * @since 1.7 4299 */ 4300 off(event?: JQuery.Event<TElement>): this; 4301 /** 4302 * Set the current coordinates of every element in the set of matched elements, relative to the document. 4303 * 4304 * @param coordinates An object containing the properties top and left, which are numbers indicating the new top and left 4305 * coordinates for the elements. 4306 * A function to return the coordinates to set. Receives the index of the element in the collection as 4307 * the first argument and the current coordinates as the second argument. The function should return an 4308 * object with the new top and left properties. 4309 * @see {@link https://api.jquery.com/offset/} 4310 * @since 1.4 4311 */ 4312 offset(coordinates: JQuery.Coordinates | ((this: TElement, index: number, coords: JQuery.Coordinates) => JQuery.Coordinates)): this; 4313 /** 4314 * Get the current coordinates of the first element in the set of matched elements, relative to the document. 4315 * 4316 * @see {@link https://api.jquery.com/offset/} 4317 * @since 1.2 4318 */ 4319 offset(): JQuery.Coordinates | undefined; 4320 /** 4321 * Get the closest ancestor element that is positioned. 4322 * 4323 * @see {@link https://api.jquery.com/offsetParent/} 4324 * @since 1.2.6 4325 */ 4326 offsetParent(): this; 4327 /** 4328 * Attach an event handler function for one or more events to the selected elements. 4329 * 4330 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". 4331 * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the 4332 * selector is null or omitted, the event is always triggered when it reaches the selected element. 4333 * @param data Data to be passed to the handler in event.data when an event is triggered. 4334 * @param handler A function to execute when the event is triggered. 4335 * @see {@link https://api.jquery.com/on/} 4336 * @since 1.7 4337 */ 4338 on<TData>(events: string, 4339 selector: JQuery.Selector | null, 4340 data: TData, 4341 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 4342 /** 4343 * Attach an event handler function for one or more events to the selected elements. 4344 * 4345 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". 4346 * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the 4347 * selector is null or omitted, the event is always triggered when it reaches the selected element. 4348 * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand 4349 * for a function that simply does return false. 4350 * @see {@link https://api.jquery.com/on/} 4351 * @since 1.7 4352 */ 4353 on(events: string, 4354 selector: JQuery.Selector, 4355 handler: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 4356 /** 4357 * Attach an event handler function for one or more events to the selected elements. 4358 * 4359 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". 4360 * @param data Data to be passed to the handler in event.data when an event is triggered. 4361 * @param handler A function to execute when the event is triggered. 4362 * @see {@link https://api.jquery.com/on/} 4363 * @since 1.7 4364 */ 4365 on<TData>(events: string, 4366 data: TData, 4367 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 4368 /** 4369 * Attach an event handler function for one or more events to the selected elements. 4370 * 4371 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". 4372 * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand 4373 * for a function that simply does return false. 4374 * @see {@link https://api.jquery.com/on/} 4375 * @since 1.7 4376 */ 4377 on(events: string, 4378 handler: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 4379 /** 4380 * Attach an event handler function for one or more events to the selected elements. 4381 * 4382 * @param events An object in which the string keys represent one or more space-separated event types and optional 4383 * namespaces, and the values represent a handler function to be called for the event(s). 4384 * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If 4385 * the selector is null or omitted, the handler is always called when it reaches the selected element. 4386 * @param data Data to be passed to the handler in event.data when an event occurs. 4387 * @see {@link https://api.jquery.com/on/} 4388 * @since 1.7 4389 */ 4390 on<TData>(events: JQuery.PlainObject<JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>> | false>, 4391 selector: JQuery.Selector | null, 4392 data: TData): this; 4393 /** 4394 * Attach an event handler function for one or more events to the selected elements. 4395 * 4396 * @param events An object in which the string keys represent one or more space-separated event types and optional 4397 * namespaces, and the values represent a handler function to be called for the event(s). 4398 * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If 4399 * the selector is null or omitted, the handler is always called when it reaches the selected element. 4400 * @see {@link https://api.jquery.com/on/} 4401 * @since 1.7 4402 */ 4403 on(events: JQuery.PlainObject<JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false>, 4404 selector: JQuery.Selector): this; // tslint:disable-line:unified-signatures 4405 /** 4406 * Attach an event handler function for one or more events to the selected elements. 4407 * 4408 * @param events An object in which the string keys represent one or more space-separated event types and optional 4409 * namespaces, and the values represent a handler function to be called for the event(s). 4410 * @param data Data to be passed to the handler in event.data when an event occurs. 4411 * @see {@link https://api.jquery.com/on/} 4412 * @since 1.7 4413 */ 4414 on<TData>(events: JQuery.PlainObject<JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>> | false>, 4415 data: TData): this; 4416 /** 4417 * Attach an event handler function for one or more events to the selected elements. 4418 * 4419 * @param events An object in which the string keys represent one or more space-separated event types and optional 4420 * namespaces, and the values represent a handler function to be called for the event(s). 4421 * @see {@link https://api.jquery.com/on/} 4422 * @since 1.7 4423 */ 4424 on(events: JQuery.PlainObject<JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false>): this; 4425 /** 4426 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. 4427 * 4428 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". 4429 * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the 4430 * selector is null or omitted, the event is always triggered when it reaches the selected element. 4431 * @param data Data to be passed to the handler in event.data when an event is triggered. 4432 * @param handler A function to execute when the event is triggered. 4433 * @see {@link https://api.jquery.com/one/} 4434 * @since 1.7 4435 */ 4436 one<TData>(events: string, 4437 selector: JQuery.Selector | null, 4438 data: TData, 4439 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 4440 /** 4441 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. 4442 * 4443 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". 4444 * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the 4445 * selector is null or omitted, the event is always triggered when it reaches the selected element. 4446 * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand 4447 * for a function that simply does return false. 4448 * @see {@link https://api.jquery.com/one/} 4449 * @since 1.7 4450 */ 4451 one(events: string, 4452 selector: JQuery.Selector, 4453 handler: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 4454 /** 4455 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. 4456 * 4457 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". 4458 * @param data Data to be passed to the handler in event.data when an event is triggered. 4459 * @param handler A function to execute when the event is triggered. 4460 * @see {@link https://api.jquery.com/one/} 4461 * @since 1.7 4462 */ 4463 one<TData>(events: string, 4464 data: TData, 4465 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 4466 /** 4467 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. 4468 * 4469 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". 4470 * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand 4471 * for a function that simply does return false. 4472 * @see {@link https://api.jquery.com/one/} 4473 * @since 1.7 4474 */ 4475 one(events: string, 4476 handler: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 4477 /** 4478 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. 4479 * 4480 * @param events An object in which the string keys represent one or more space-separated event types and optional 4481 * namespaces, and the values represent a handler function to be called for the event(s). 4482 * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If 4483 * the selector is null or omitted, the handler is always called when it reaches the selected element. 4484 * @param data Data to be passed to the handler in event.data when an event occurs. 4485 * @see {@link https://api.jquery.com/one/} 4486 * @since 1.7 4487 */ 4488 one<TData>(events: JQuery.PlainObject<JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>> | false>, 4489 selector: JQuery.Selector | null, 4490 data: TData): this; 4491 /** 4492 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. 4493 * 4494 * @param events An object in which the string keys represent one or more space-separated event types and optional 4495 * namespaces, and the values represent a handler function to be called for the event(s). 4496 * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If 4497 * the selector is null or omitted, the handler is always called when it reaches the selected element. 4498 * @see {@link https://api.jquery.com/one/} 4499 * @since 1.7 4500 */ 4501 one(events: JQuery.PlainObject<JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false>, 4502 selector: JQuery.Selector): this; // tslint:disable-line:unified-signatures 4503 /** 4504 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. 4505 * 4506 * @param events An object in which the string keys represent one or more space-separated event types and optional 4507 * namespaces, and the values represent a handler function to be called for the event(s). 4508 * @param data Data to be passed to the handler in event.data when an event occurs. 4509 * @see {@link https://api.jquery.com/one/} 4510 * @since 1.7 4511 */ 4512 one<TData>(events: JQuery.PlainObject<JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>> | false>, 4513 data: TData): this; 4514 /** 4515 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. 4516 * 4517 * @param events An object in which the string keys represent one or more space-separated event types and optional 4518 * namespaces, and the values represent a handler function to be called for the event(s). 4519 * @see {@link https://api.jquery.com/one/} 4520 * @since 1.7 4521 */ 4522 one(events: JQuery.PlainObject<JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false>): this; 4523 /** 4524 * Set the CSS outer height of each element in the set of matched elements. 4525 * 4526 * @param value A number representing the number of pixels, or a number along with an optional unit of measure 4527 * appended (as a string). 4528 * @see {@link https://api.jquery.com/outerHeight/} 4529 * @since 1.8.0 4530 */ 4531 outerHeight(value: string | number | ((this: TElement, index: number, height: number) => string | number)): this; 4532 /** 4533 * Get the current computed outer height (including padding, border, and optionally margin) for the 4534 * first element in the set of matched elements. 4535 * 4536 * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. 4537 * @see {@link https://api.jquery.com/outerHeight/} 4538 * @since 1.2.6 4539 */ 4540 outerHeight(includeMargin?: boolean): number | undefined; 4541 /** 4542 * Set the CSS outer width of each element in the set of matched elements. 4543 * 4544 * @param value A number representing the number of pixels, or a number along with an optional unit of measure 4545 * appended (as a string). 4546 * A function returning the outer width to set. Receives the index position of the element in the set 4547 * and the old outer width as arguments. Within the function, this refers to the current element in the set. 4548 * @see {@link https://api.jquery.com/outerWidth/} 4549 * @since 1.8.0 4550 */ 4551 outerWidth(value: string | number | ((this: TElement, index: number, width: number) => string | number)): this; 4552 /** 4553 * Get the current computed outer width (including padding, border, and optionally margin) for the 4554 * first element in the set of matched elements. 4555 * 4556 * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. 4557 * @see {@link https://api.jquery.com/outerWidth/} 4558 * @since 1.2.6 4559 */ 4560 outerWidth(includeMargin?: boolean): number | undefined; 4561 /** 4562 * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. 4563 * 4564 * @param selector A string containing a selector expression to match elements against. 4565 * @see {@link https://api.jquery.com/parent/} 4566 * @since 1.0 4567 */ 4568 parent(selector?: JQuery.Selector): this; 4569 /** 4570 * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. 4571 * 4572 * @param selector A string containing a selector expression to match elements against. 4573 * @see {@link https://api.jquery.com/parents/} 4574 * @since 1.0 4575 */ 4576 parents(selector?: JQuery.Selector): this; 4577 /** 4578 * Get the ancestors of each element in the current set of matched elements, up to but not including 4579 * the element matched by the selector, DOM node, or jQuery object. 4580 * 4581 * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements. 4582 * A DOM node or jQuery object indicating where to stop matching ancestor elements. 4583 * @param filter A string containing a selector expression to match elements against. 4584 * @see {@link https://api.jquery.com/parentsUntil/} 4585 * @since 1.4 4586 * @since 1.6 4587 */ 4588 parentsUntil(selector?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; 4589 /** 4590 * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. 4591 * 4592 * @see {@link https://api.jquery.com/position/} 4593 * @since 1.2 4594 */ 4595 position(): JQuery.Coordinates; 4596 /** 4597 * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. 4598 * 4599 * @param contents One or more additional DOM elements, text nodes, arrays of elements and text nodes, HTML strings, or 4600 * jQuery objects to insert at the beginning of each element in the set of matched elements. 4601 * @see {@link https://api.jquery.com/prepend/} 4602 * @since 1.0 4603 */ 4604 prepend(...contents: Array<JQuery.htmlString | JQuery.TypeOrArray<JQuery.Node | JQuery<JQuery.Node>>>): this; 4605 /** 4606 * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. 4607 * 4608 * @param fn A function that returns an HTML string, DOM element(s), text node(s), or jQuery object to insert at 4609 * the beginning of each element in the set of matched elements. Receives the index position of the 4610 * element in the set and the old HTML value of the element as arguments. Within the function, this 4611 * refers to the current element in the set. 4612 * @see {@link https://api.jquery.com/prepend/} 4613 * @since 1.4 4614 */ 4615 prepend(fn: (this: TElement, index: number, html: string) => JQuery.htmlString | JQuery.TypeOrArray<JQuery.Node | JQuery<JQuery.Node>>): this; 4616 /** 4617 * Insert every element in the set of matched elements to the beginning of the target. 4618 * 4619 * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements 4620 * will be inserted at the beginning of the element(s) specified by this parameter. 4621 * @see {@link https://api.jquery.com/prependTo/} 4622 * @since 1.0 4623 */ 4624 prependTo(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray<Element> | JQuery): this; 4625 /** 4626 * Get the immediately preceding sibling of each element in the set of matched elements. If a selector 4627 * is provided, it retrieves the previous sibling only if it matches that selector. 4628 * 4629 * @param selector A string containing a selector expression to match elements against. 4630 * @see {@link https://api.jquery.com/prev/} 4631 * @since 1.0 4632 */ 4633 prev(selector?: JQuery.Selector): this; 4634 /** 4635 * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. 4636 * 4637 * @param selector A string containing a selector expression to match elements against. 4638 * @see {@link https://api.jquery.com/prevAll/} 4639 * @since 1.2 4640 */ 4641 prevAll(selector?: JQuery.Selector): this; 4642 /** 4643 * Get all preceding siblings of each element up to but not including the element matched by the 4644 * selector, DOM node, or jQuery object. 4645 * 4646 * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements. 4647 * A DOM node or jQuery object indicating where to stop matching preceding sibling elements. 4648 * @param filter A string containing a selector expression to match elements against. 4649 * @see {@link https://api.jquery.com/prevUntil/} 4650 * @since 1.4 4651 * @since 1.6 4652 */ 4653 prevUntil(selector?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this; 4654 /** 4655 * Return a Promise object to observe when all actions of a certain type bound to the collection, 4656 * queued or not, have finished. 4657 * 4658 * @param type The type of queue that needs to be observed. 4659 * @param target Object onto which the promise methods have to be attached 4660 * @see {@link https://api.jquery.com/promise/} 4661 * @since 1.6 4662 */ 4663 promise<T extends object>(type: string, target: T): T & JQuery.Promise<this>; 4664 /** 4665 * Return a Promise object to observe when all actions of a certain type bound to the collection, 4666 * queued or not, have finished. 4667 * 4668 * @param target Object onto which the promise methods have to be attached 4669 * @see {@link https://api.jquery.com/promise/} 4670 * @since 1.6 4671 */ 4672 promise<T extends object>(target: T): T & JQuery.Promise<this>; 4673 /** 4674 * Return a Promise object to observe when all actions of a certain type bound to the collection, 4675 * queued or not, have finished. 4676 * 4677 * @param type The type of queue that needs to be observed. 4678 * @see {@link https://api.jquery.com/promise/} 4679 * @since 1.6 4680 */ 4681 promise(type?: string): JQuery.Promise<this>; 4682 /** 4683 * Set one or more properties for the set of matched elements. 4684 * 4685 * @param propertyName The name of the property to set. 4686 * @param value A function returning the value to set. Receives the index position of the element in the set and the 4687 * old property value as arguments. Within the function, the keyword this refers to the current element. 4688 * @see {@link https://api.jquery.com/prop/} 4689 * @since 1.6 4690 */ 4691 prop(propertyName: string, value: (this: TElement, index: number, oldPropertyValue: any) => any): this; 4692 /** 4693 * Set one or more properties for the set of matched elements. 4694 * 4695 * @param propertyName The name of the property to set. 4696 * @param value A value to set for the property. 4697 * @see {@link https://api.jquery.com/prop/} 4698 * @since 1.6 4699 */ 4700 prop(propertyName: string, value: any): this; // tslint:disable-line:unified-signatures 4701 /** 4702 * Set one or more properties for the set of matched elements. 4703 * 4704 * @param properties An object of property-value pairs to set. 4705 * @see {@link https://api.jquery.com/prop/} 4706 * @since 1.6 4707 */ 4708 prop(properties: JQuery.PlainObject): this; 4709 /** 4710 * Get the value of a property for the first element in the set of matched elements. 4711 * 4712 * @param propertyName The name of the property to get. 4713 * @see {@link https://api.jquery.com/prop/} 4714 * @since 1.6 4715 */ 4716 prop(propertyName: string): any | undefined; 4717 /** 4718 * Add a collection of DOM elements onto the jQuery stack. 4719 * 4720 * @param elements An array of elements to push onto the stack and make into a new jQuery object. 4721 * @param name The name of a jQuery method that generated the array of elements. 4722 * @param args The arguments that were passed in to the jQuery method (for serialization). 4723 * @see {@link https://api.jquery.com/pushStack/} 4724 * @since 1.3 4725 */ 4726 pushStack(elements: ArrayLike<Element>, name: string, args: any[]): this; 4727 /** 4728 * Add a collection of DOM elements onto the jQuery stack. 4729 * 4730 * @param elements An array of elements to push onto the stack and make into a new jQuery object. 4731 * @see {@link https://api.jquery.com/pushStack/} 4732 * @since 1.0 4733 */ 4734 pushStack(elements: ArrayLike<Element>): this; 4735 /** 4736 * Manipulate the queue of functions to be executed, once for each matched element. 4737 * 4738 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. 4739 * @param newQueue The new function to add to the queue, with a function to call that will dequeue the next item. 4740 * An array of functions to replace the current queue contents. 4741 * @see {@link https://api.jquery.com/queue/} 4742 * @since 1.2 4743 */ 4744 queue(queueName: string, newQueue: JQuery.TypeOrArray<JQuery.QueueFunction<TElement>>): this; 4745 /** 4746 * Manipulate the queue of functions to be executed, once for each matched element. 4747 * 4748 * @param newQueue The new function to add to the queue, with a function to call that will dequeue the next item. 4749 * An array of functions to replace the current queue contents. 4750 * @see {@link https://api.jquery.com/queue/} 4751 * @since 1.2 4752 */ 4753 queue(newQueue: JQuery.TypeOrArray<JQuery.QueueFunction<TElement>>): this; 4754 /** 4755 * Show the queue of functions to be executed on the matched elements. 4756 * 4757 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. 4758 * @see {@link https://api.jquery.com/queue/} 4759 * @since 1.2 4760 */ 4761 queue(queueName?: string): JQuery.Queue<Node>; 4762 /** 4763 * Specify a function to execute when the DOM is fully loaded. 4764 * 4765 * @param handler A function to execute after the DOM is ready. 4766 * @see {@link https://api.jquery.com/ready/} 4767 * @since 1.0 4768 * @deprecated 3.0 4769 */ 4770 ready(handler: ($: JQueryStatic<TElement>) => void): this; 4771 /** 4772 * Remove the set of matched elements from the DOM. 4773 * 4774 * @param selector A selector expression that filters the set of matched elements to be removed. 4775 * @see {@link https://api.jquery.com/remove/} 4776 * @since 1.0 4777 */ 4778 remove(selector?: string): this; 4779 /** 4780 * Remove an attribute from each element in the set of matched elements. 4781 * 4782 * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. 4783 * @see {@link https://api.jquery.com/removeAttr/} 4784 * @since 1.0 4785 */ 4786 removeAttr(attributeName: string): this; 4787 /** 4788 * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. 4789 * 4790 * @param className One or more space-separated classes to be removed from the class attribute of each matched element. 4791 * A function returning one or more space-separated class names to be removed. Receives the index 4792 * position of the element in the set and the old class value as arguments. 4793 * @see {@link https://api.jquery.com/removeClass/} 4794 * @since 1.0 4795 * @since 1.4 4796 */ 4797 removeClass(className?: string | ((this: TElement, index: number, className: string) => string)): this; 4798 /** 4799 * Remove a previously-stored piece of data. 4800 * 4801 * @param name A string naming the piece of data to delete. 4802 * An array or space-separated string naming the pieces of data to delete. 4803 * @see {@link https://api.jquery.com/removeData/} 4804 * @since 1.2.3 4805 * @since 1.7 4806 */ 4807 removeData(name?: JQuery.TypeOrArray<string>): this; 4808 /** 4809 * Remove a property for the set of matched elements. 4810 * 4811 * @param propertyName The name of the property to remove. 4812 * @see {@link https://api.jquery.com/removeProp/} 4813 * @since 1.6 4814 */ 4815 removeProp(propertyName: string): this; 4816 /** 4817 * Replace each target element with the set of matched elements. 4818 * 4819 * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. 4820 * @see {@link https://api.jquery.com/replaceAll/} 4821 * @since 1.2 4822 */ 4823 replaceAll(target: JQuery.Selector | JQuery | JQuery.TypeOrArray<Element>): this; 4824 /** 4825 * Replace each element in the set of matched elements with the provided new content and return the set 4826 * of elements that was removed. 4827 * 4828 * @param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. 4829 * A function that returns content with which to replace the set of matched elements. 4830 * @see {@link https://api.jquery.com/replaceWith/} 4831 * @since 1.2 4832 * @since 1.4 4833 */ 4834 replaceWith(newContent: JQuery.htmlString | JQuery | JQuery.TypeOrArray<Element> | ((this: TElement) => any)): this; 4835 /** 4836 * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. 4837 * 4838 * @param eventData An object containing data that will be passed to the event handler. 4839 * @param handler A function to execute each time the event is triggered. 4840 * @see {@link https://api.jquery.com/resize/} 4841 * @since 1.4.3 4842 */ 4843 resize<TData>(eventData: TData, 4844 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 4845 /** 4846 * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. 4847 * 4848 * @param handler A function to execute each time the event is triggered. 4849 * @see {@link https://api.jquery.com/resize/} 4850 * @since 1.0 4851 */ 4852 resize(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 4853 /** 4854 * Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. 4855 * 4856 * @param eventData An object containing data that will be passed to the event handler. 4857 * @param handler A function to execute each time the event is triggered. 4858 * @see {@link https://api.jquery.com/scroll/} 4859 * @since 1.4.3 4860 */ 4861 scroll<TData>(eventData: TData, 4862 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 4863 /** 4864 * Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. 4865 * 4866 * @param handler A function to execute each time the event is triggered. 4867 * @see {@link https://api.jquery.com/scroll/} 4868 * @since 1.0 4869 */ 4870 scroll(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 4871 /** 4872 * Set the current horizontal position of the scroll bar for each of the set of matched elements. 4873 * 4874 * @param value An integer indicating the new position to set the scroll bar to. 4875 * @see {@link https://api.jquery.com/scrollLeft/} 4876 * @since 1.2.6 4877 */ 4878 scrollLeft(value: number): this; 4879 /** 4880 * Get the current horizontal position of the scroll bar for the first element in the set of matched elements. 4881 * 4882 * @see {@link https://api.jquery.com/scrollLeft/} 4883 * @since 1.2.6 4884 */ 4885 scrollLeft(): number | undefined; 4886 /** 4887 * Set the current vertical position of the scroll bar for each of the set of matched elements. 4888 * 4889 * @param value A number indicating the new position to set the scroll bar to. 4890 * @see {@link https://api.jquery.com/scrollTop/} 4891 * @since 1.2.6 4892 */ 4893 scrollTop(value: number): this; 4894 /** 4895 * Get the current vertical position of the scroll bar for the first element in the set of matched 4896 * elements or set the vertical position of the scroll bar for every matched element. 4897 * 4898 * @see {@link https://api.jquery.com/scrollTop/} 4899 * @since 1.2.6 4900 */ 4901 scrollTop(): number | undefined; 4902 /** 4903 * Bind an event handler to the "select" JavaScript event, or trigger that event on an element. 4904 * 4905 * @param eventData An object containing data that will be passed to the event handler. 4906 * @param handler A function to execute each time the event is triggered. 4907 * @see {@link https://api.jquery.com/select/} 4908 * @since 1.4.3 4909 */ 4910 select<TData>(eventData: TData, 4911 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 4912 /** 4913 * Bind an event handler to the "select" JavaScript event, or trigger that event on an element. 4914 * 4915 * @param handler A function to execute each time the event is triggered. 4916 * @see {@link https://api.jquery.com/select/} 4917 * @since 1.0 4918 */ 4919 select(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 4920 /** 4921 * Encode a set of form elements as a string for submission. 4922 * 4923 * @see {@link https://api.jquery.com/serialize/} 4924 * @since 1.0 4925 */ 4926 serialize(): string; 4927 /** 4928 * Encode a set of form elements as an array of names and values. 4929 * 4930 * @see {@link https://api.jquery.com/serializeArray/} 4931 * @since 1.2 4932 */ 4933 serializeArray(): JQuery.NameValuePair[]; 4934 /** 4935 * Display the matched elements. 4936 * 4937 * @param duration A string or number determining how long the animation will run. 4938 * @param easing A string indicating which easing function to use for the transition. 4939 * @param complete A function to call once the animation is complete, called once per matched element. 4940 * @see {@link https://api.jquery.com/show/} 4941 * @since 1.4.3 4942 */ 4943 show(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): this; 4944 /** 4945 * Display the matched elements. 4946 * 4947 * @param duration A string or number determining how long the animation will run. 4948 * @param easing_complete A string indicating which easing function to use for the transition. 4949 * A function to call once the animation is complete, called once per matched element. 4950 * @see {@link https://api.jquery.com/show/} 4951 * @since 1.0 4952 * @since 1.4.3 4953 */ 4954 show(duration: JQuery.Duration, easing_complete: string | ((this: TElement) => void)): this; 4955 /** 4956 * Display the matched elements. 4957 * 4958 * @param duration_complete_options A string or number determining how long the animation will run. 4959 * A function to call once the animation is complete, called once per matched element. 4960 * A map of additional options to pass to the method. 4961 * @see {@link https://api.jquery.com/show/} 4962 * @since 1.0 4963 */ 4964 show(duration_complete_options?: JQuery.Duration | ((this: TElement) => void) | JQuery.EffectsOptions<TElement>): this; 4965 /** 4966 * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. 4967 * 4968 * @param selector A string containing a selector expression to match elements against. 4969 * @see {@link https://api.jquery.com/siblings/} 4970 * @since 1.0 4971 */ 4972 siblings(selector?: JQuery.Selector): this; 4973 /** 4974 * Reduce the set of matched elements to a subset specified by a range of indices. 4975 * 4976 * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, 4977 * it indicates an offset from the end of the set. 4978 * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, 4979 * it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. 4980 * @see {@link https://api.jquery.com/slice/} 4981 * @since 1.1.4 4982 */ 4983 slice(start: number, end?: number): this; 4984 /** 4985 * Display the matched elements with a sliding motion. 4986 * 4987 * @param duration A string or number determining how long the animation will run. 4988 * @param easing A string indicating which easing function to use for the transition. 4989 * @param complete A function to call once the animation is complete, called once per matched element. 4990 * @see {@link https://api.jquery.com/slideDown/} 4991 * @since 1.4.3 4992 */ 4993 slideDown(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; 4994 /** 4995 * Display the matched elements with a sliding motion. 4996 * 4997 * @param duration_easing A string or number determining how long the animation will run. 4998 * A string indicating which easing function to use for the transition. 4999 * @param complete A function to call once the animation is complete, called once per matched element. 5000 * @see {@link https://api.jquery.com/slideDown/} 5001 * @since 1.0 5002 * @since 1.4.3 5003 */ 5004 slideDown(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; 5005 /** 5006 * Display the matched elements with a sliding motion. 5007 * 5008 * @param duration_easing_complete_options A string or number determining how long the animation will run. 5009 * A string indicating which easing function to use for the transition. 5010 * A function to call once the animation is complete, called once per matched element. 5011 * A map of additional options to pass to the method. 5012 * @see {@link https://api.jquery.com/slideDown/} 5013 * @since 1.0 5014 * @since 1.4.3 5015 */ 5016 slideDown(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions<TElement>): this; 5017 /** 5018 * Display or hide the matched elements with a sliding motion. 5019 * 5020 * @param duration A string or number determining how long the animation will run. 5021 * @param easing A string indicating which easing function to use for the transition. 5022 * @param complete A function to call once the animation is complete, called once per matched element. 5023 * @see {@link https://api.jquery.com/slideToggle/} 5024 * @since 1.4.3 5025 */ 5026 slideToggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; 5027 /** 5028 * Display or hide the matched elements with a sliding motion. 5029 * 5030 * @param duration_easing A string or number determining how long the animation will run. 5031 * A string indicating which easing function to use for the transition. 5032 * @param complete A function to call once the animation is complete, called once per matched element. 5033 * @see {@link https://api.jquery.com/slideToggle/} 5034 * @since 1.0 5035 * @since 1.4.3 5036 */ 5037 slideToggle(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; 5038 /** 5039 * Display or hide the matched elements with a sliding motion. 5040 * 5041 * @param duration_easing_complete_options A string or number determining how long the animation will run. 5042 * A string indicating which easing function to use for the transition. 5043 * A function to call once the animation is complete, called once per matched element. 5044 * A map of additional options to pass to the method. 5045 * @see {@link https://api.jquery.com/slideToggle/} 5046 * @since 1.0 5047 * @since 1.4.3 5048 */ 5049 slideToggle(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions<TElement>): this; 5050 /** 5051 * Hide the matched elements with a sliding motion. 5052 * 5053 * @param duration A string or number determining how long the animation will run. 5054 * @param easing A string indicating which easing function to use for the transition. 5055 * @param complete A function to call once the animation is complete, called once per matched element. 5056 * @see {@link https://api.jquery.com/slideUp/} 5057 * @since 1.4.3 5058 */ 5059 slideUp(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; 5060 /** 5061 * Hide the matched elements with a sliding motion. 5062 * 5063 * @param duration_easing A string or number determining how long the animation will run. 5064 * A string indicating which easing function to use for the transition. 5065 * @param complete A function to call once the animation is complete, called once per matched element. 5066 * @see {@link https://api.jquery.com/slideUp/} 5067 * @since 1.0 5068 * @since 1.4.3 5069 */ 5070 slideUp(duration_easing: JQuery.Duration | string, complete: (this: TElement) => void): this; 5071 /** 5072 * Hide the matched elements with a sliding motion. 5073 * 5074 * @param duration_easing_complete_options A string or number determining how long the animation will run. 5075 * A string indicating which easing function to use for the transition. 5076 * A function to call once the animation is complete, called once per matched element. 5077 * A map of additional options to pass to the method. 5078 * @see {@link https://api.jquery.com/slideUp/} 5079 * @since 1.0 5080 * @since 1.4.3 5081 */ 5082 slideUp(duration_easing_complete_options?: JQuery.Duration | string | ((this: TElement) => void) | JQuery.EffectsOptions<TElement>): this; 5083 /** 5084 * Stop the currently-running animation on the matched elements. 5085 * 5086 * @param queue The name of the queue in which to stop animations. 5087 * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. 5088 * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. 5089 * @see {@link https://api.jquery.com/stop/} 5090 * @since 1.7 5091 */ 5092 stop(queue: string, clearQueue?: boolean, jumpToEnd?: boolean): this; 5093 /** 5094 * Stop the currently-running animation on the matched elements. 5095 * 5096 * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. 5097 * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. 5098 * @see {@link https://api.jquery.com/stop/} 5099 * @since 1.2 5100 */ 5101 stop(clearQueue?: boolean, jumpToEnd?: boolean): this; 5102 /** 5103 * Bind an event handler to the "submit" JavaScript event, or trigger that event on an element. 5104 * 5105 * @param eventData An object containing data that will be passed to the event handler. 5106 * @param handler A function to execute each time the event is triggered. 5107 * @see {@link https://api.jquery.com/submit/} 5108 * @since 1.4.3 5109 */ 5110 submit<TData>(eventData: TData, 5111 handler: JQuery.EventHandler<TElement, TData> | JQuery.EventHandlerBase<any, JQuery.Event<TElement, TData>>): this; 5112 /** 5113 * Bind an event handler to the "submit" JavaScript event, or trigger that event on an element. 5114 * 5115 * @param handler A function to execute each time the event is triggered. 5116 * @see {@link https://api.jquery.com/submit/} 5117 * @since 1.0 5118 */ 5119 submit(handler?: JQuery.EventHandler<TElement> | JQuery.EventHandlerBase<any, JQuery.Event<TElement>> | false): this; 5120 /** 5121 * Set the content of each element in the set of matched elements to the specified text. 5122 * 5123 * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will 5124 * be converted to a String representation. 5125 * A function returning the text content to set. Receives the index position of the element in the set 5126 * and the old text value as arguments. 5127 * @see {@link https://api.jquery.com/text/} 5128 * @since 1.0 5129 * @since 1.4 5130 */ 5131 text(text: string | number | boolean | ((this: TElement, index: number, text: string) => string | number | boolean)): this; 5132 /** 5133 * Get the combined text contents of each element in the set of matched elements, including their descendants. 5134 * 5135 * @see {@link https://api.jquery.com/text/} 5136 * @since 1.0 5137 */ 5138 text(): string; 5139 /** 5140 * Retrieve all the elements contained in the jQuery set, as an array. 5141 * 5142 * @see {@link https://api.jquery.com/toArray/} 5143 * @since 1.4 5144 */ 5145 toArray(): TElement[]; 5146 /** 5147 * Display or hide the matched elements. 5148 * 5149 * @param duration A string or number determining how long the animation will run. 5150 * @param easing A string indicating which easing function to use for the transition. 5151 * @param complete A function to call once the animation is complete, called once per matched element. 5152 * @see {@link https://api.jquery.com/toggle/} 5153 * @since 1.4.3 5154 */ 5155 toggle(duration: JQuery.Duration, easing: string, complete?: (this: TElement) => void): this; 5156 /** 5157 * Display or hide the matched elements. 5158 * 5159 * @param duration A string or number determining how long the animation will run. 5160 * @param complete A function to call once the animation is complete, called once per matched element. 5161 * @see {@link https://api.jquery.com/toggle/} 5162 * @since 1.0 5163 */ 5164 toggle(duration: JQuery.Duration, complete: (this: TElement) => void): this; 5165 /** 5166 * Display or hide the matched elements. 5167 * 5168 * @param duration_complete_options_display A string or number determining how long the animation will run. 5169 * A function to call once the animation is complete, called once per matched element. 5170 * A map of additional options to pass to the method. 5171 * Use true to show the element or false to hide it. 5172 * @see {@link https://api.jquery.com/toggle/} 5173 * @since 1.0 5174 * @since 1.3 5175 */ 5176 toggle(duration_complete_options_display?: JQuery.Duration | ((this: TElement) => void) | JQuery.EffectsOptions<TElement> | boolean): this; 5177 /** 5178 * Add or remove one or more classes from each element in the set of matched elements, depending on 5179 * either the class's presence or the value of the state argument. 5180 * 5181 * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. 5182 * A function that returns class names to be toggled in the class attribute of each element in the 5183 * matched set. Receives the index position of the element in the set, the old class value, and the state as arguments. 5184 * @param state A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. 5185 * @see {@link https://api.jquery.com/toggleClass/} 5186 * @since 1.0 5187 * @since 1.3 5188 * @since 1.4 5189 */ 5190 toggleClass<TState extends boolean>(className: string | ((this: TElement, index: number, className: string, state: TState) => string), 5191 state?: TState): this; 5192 /** 5193 * Add or remove one or more classes from each element in the set of matched elements, depending on 5194 * either the class's presence or the value of the state argument. 5195 * 5196 * @param state A boolean value to determine whether the class should be added or removed. 5197 * @see {@link https://api.jquery.com/toggleClass/} 5198 * @since 1.4 5199 * @deprecated 3.0 5200 */ 5201 toggleClass(state?: boolean): this; 5202 /** 5203 * Execute all handlers and behaviors attached to the matched elements for the given event type. 5204 * 5205 * @param eventType A string containing a JavaScript event type, such as click or submit. 5206 * A jQuery.Event object. 5207 * @param extraParameters Additional parameters to pass along to the event handler. 5208 * @see {@link https://api.jquery.com/trigger/} 5209 * @since 1.0 5210 * @since 1.3 5211 */ 5212 trigger(eventType: string | JQuery.Event<TElement>, extraParameters?: any[] | JQuery.PlainObject | string | number): this; 5213 /** 5214 * Execute all handlers attached to an element for an event. 5215 * 5216 * @param eventType A string containing a JavaScript event type, such as click or submit. 5217 * A jQuery.Event object. 5218 * @param extraParameters Additional parameters to pass along to the event handler. 5219 * @see {@link https://api.jquery.com/triggerHandler/} 5220 * @since 1.2 5221 * @since 1.3 5222 */ 5223 triggerHandler(eventType: string | JQuery.Event<TElement>, extraParameters?: any[] | JQuery.PlainObject | string | number): undefined | any; 5224 /** 5225 * Remove a previously-attached event handler from the elements. 5226 * 5227 * @param event A string containing one or more DOM event types, such as "click" or "submit," or custom event names. 5228 * @param handler A function to execute each time the event is triggered. 5229 * @see {@link https://api.jquery.com/unbind/} 5230 * @since 1.0 5231 * @since 1.4.3 5232 * @deprecated 3.0 5233 */ 5234 unbind(event: string, handler: JQuery.EventHandlerBase<any, JQuery.Event<TElement, any>> | false): this; 5235 /** 5236 * Remove a previously-attached event handler from the elements. 5237 * 5238 * @param event A string containing one or more DOM event types, such as "click" or "submit," or custom event names. 5239 * A jQuery.Event object. 5240 * @see {@link https://api.jquery.com/unbind/} 5241 * @since 1.0 5242 * @deprecated 3.0 5243 */ 5244 unbind(event?: string | JQuery.Event<TElement>): this; 5245 /** 5246 * Remove a handler from the event for all elements which match the current selector, based upon a 5247 * specific set of root elements. 5248 * 5249 * @param selector A selector which will be used to filter the event results. 5250 * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" 5251 * @param handler A function to execute each time the event is triggered. 5252 * @see {@link https://api.jquery.com/undelegate/} 5253 * @since 1.4.2 5254 * @deprecated 3.0 5255 */ 5256 undelegate(selector: JQuery.Selector, eventType: string, handler: JQuery.EventHandlerBase<any, JQuery.Event<TElement, any>> | false): this; 5257 /** 5258 * Remove a handler from the event for all elements which match the current selector, based upon a 5259 * specific set of root elements. 5260 * 5261 * @param selector A selector which will be used to filter the event results. 5262 * @param eventTypes A string containing a JavaScript event type, such as "click" or "keydown" 5263 * An object of one or more event types and previously bound functions to unbind from them. 5264 * @see {@link https://api.jquery.com/undelegate/} 5265 * @since 1.4.2 5266 * @since 1.4.3 5267 * @deprecated 3.0 5268 */ 5269 undelegate(selector: JQuery.Selector, eventTypes: string | JQuery.PlainObject<JQuery.EventHandlerBase<any, JQuery.Event<TElement, any>> | false>): this; 5270 /** 5271 * Remove a handler from the event for all elements which match the current selector, based upon a 5272 * specific set of root elements. 5273 * 5274 * @param namespace A selector which will be used to filter the event results. 5275 * @see {@link https://api.jquery.com/undelegate/} 5276 * @since 1.4.2 5277 * @since 1.6 5278 * @deprecated 3.0 5279 */ 5280 undelegate(namespace?: string): this; 5281 /** 5282 * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. 5283 * 5284 * @param selector A selector to check the parent element against. If an element's parent does not match the selector, 5285 * the element won't be unwrapped. 5286 * @see {@link https://api.jquery.com/unwrap/} 5287 * @since 1.4 5288 * @since 3.0 5289 */ 5290 unwrap(selector?: string): this; 5291 /** 5292 * Set the value of each element in the set of matched elements. 5293 * 5294 * @param value A string of text, a number, or an array of strings corresponding to the value of each matched 5295 * element to set as selected/checked. 5296 * A function returning the value to set. this is the current element. Receives the index position of 5297 * the element in the set and the old value as arguments. 5298 * @see {@link https://api.jquery.com/val/} 5299 * @since 1.0 5300 * @since 1.4 5301 */ 5302 val(value: string | number | string[] | ((this: TElement, index: number, value: string) => string)): this; 5303 /** 5304 * Get the current value of the first element in the set of matched elements. 5305 * 5306 * @see {@link https://api.jquery.com/val/} 5307 * @since 1.0 5308 */ 5309 val(): string | number | string[] | undefined; 5310 /** 5311 * Set the CSS width of each element in the set of matched elements. 5312 * 5313 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure 5314 * appended (as a string). 5315 * A function returning the width to set. Receives the index position of the element in the set and the 5316 * old width as arguments. Within the function, this refers to the current element in the set. 5317 * @see {@link https://api.jquery.com/width/} 5318 * @since 1.0 5319 * @since 1.4.1 5320 */ 5321 width(value: string | number | ((this: TElement, index: number, value: number) => string | number)): this; 5322 /** 5323 * Get the current computed width for the first element in the set of matched elements. 5324 * 5325 * @see {@link https://api.jquery.com/width/} 5326 * @since 1.0 5327 */ 5328 width(): number | undefined; 5329 /** 5330 * Wrap an HTML structure around each element in the set of matched elements. 5331 * 5332 * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the 5333 * matched elements. When you pass a jQuery collection containing more than one element, or a selector 5334 * matching more than one element, the first element will be used. 5335 * A callback function returning the HTML content or jQuery object to wrap around the matched elements. 5336 * Receives the index position of the element in the set as an argument. Within the function, this 5337 * refers to the current element in the set. 5338 * @see {@link https://api.jquery.com/wrap/} 5339 * @since 1.0 5340 * @since 1.4 5341 */ 5342 wrap(wrappingElement: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement, index: number) => string | JQuery)): this; 5343 /** 5344 * Wrap an HTML structure around all elements in the set of matched elements. 5345 * 5346 * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. 5347 * A callback function returning the HTML content or jQuery object to wrap around all the matched 5348 * elements. Within the function, this refers to the first element in the set. Prior to jQuery 3.0, the 5349 * callback was incorrectly called for every element in the set and received the index position of the 5350 * element in the set as an argument. 5351 * @see {@link https://api.jquery.com/wrapAll/} 5352 * @since 1.2 5353 * @since 1.4 5354 */ 5355 wrapAll(wrappingElement: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement) => string | JQuery)): this; 5356 /** 5357 * Wrap an HTML structure around the content of each element in the set of matched elements. 5358 * 5359 * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap 5360 * around the content of the matched elements. 5361 * A callback function which generates a structure to wrap around the content of the matched elements. 5362 * Receives the index position of the element in the set as an argument. Within the function, this 5363 * refers to the current element in the set. 5364 * @see {@link https://api.jquery.com/wrapInner/} 5365 * @since 1.2 5366 * @since 1.4 5367 */ 5368 wrapInner(wrappingElement: JQuery.Selector | JQuery.htmlString | Element | JQuery | ((this: TElement, index: number) => string | JQuery | Element)): this; 5369 5370 [n: number]: TElement; 5371 } 5372 5373 declare namespace JQuery { 5374 type TypeOrArray<T> = T | T[]; 5375 type Node = Element | Text | Comment; 5376 5377 /** 5378 * A string is designated htmlString in jQuery documentation when it is used to represent one or more 5379 * DOM elements, typically to be created and inserted in the document. When passed as an argument of 5380 * the jQuery() function, the string is identified as HTML if it starts with <tag ... >) and is parsed 5381 * as such until the final > character. Prior to jQuery 1.9, a string was considered to be HTML if it 5382 * contained <tag ... > anywhere within the string. 5383 */ 5384 type htmlString = string; 5385 /** 5386 * A selector is used in jQuery to select DOM elements from a DOM document. That document is, in most 5387 * cases, the DOM document present in all browsers, but can also be an XML document received via Ajax. 5388 */ 5389 type Selector = string; 5390 5391 /** 5392 * The PlainObject type is a JavaScript object containing zero or more key-value pairs. The plain 5393 * object is, in other words, an Object object. It is designated "plain" in jQuery documentation to 5394 * distinguish it from other kinds of JavaScript objects: for example, null, user-defined arrays, and 5395 * host objects such as document, all of which have a typeof value of "object." 5396 */ 5397 interface PlainObject<T = any> { 5398 [key: string]: T; 5399 } 5400 5401 // region Ajax 5402 5403 interface AjaxSettings<TContext = any> extends Ajax.AjaxSettingsBase<TContext> { 5404 /** 5405 * A string containing the URL to which the request is sent. 5406 */ 5407 url?: string; 5408 /** 5409 * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, 5410 * XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and 5411 * settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend 5412 * function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless 5413 * of the type of request. 5414 */ 5415 beforeSend?(this: TContext, jqXHR: jqXHR, settings: AjaxSettings<TContext>): false | void; 5416 } 5417 5418 interface UrlAjaxSettings<TContext = any> extends Ajax.AjaxSettingsBase<TContext> { 5419 /** 5420 * A string containing the URL to which the request is sent. 5421 */ 5422 url: string; 5423 /** 5424 * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, 5425 * XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and 5426 * settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend 5427 * function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless 5428 * of the type of request. 5429 */ 5430 beforeSend?(this: TContext, jqXHR: jqXHR, settings: UrlAjaxSettings<TContext>): false | void; 5431 } 5432 5433 namespace Ajax { 5434 type SuccessTextStatus = 'success' | 'notmodified' | 'nocontent'; 5435 type ErrorTextStatus = 'timeout' | 'error' | 'abort' | 'parsererror'; 5436 type TextStatus = SuccessTextStatus | ErrorTextStatus; 5437 5438 interface SuccessCallback<TContext> { 5439 (this: TContext, data: any, textStatus: SuccessTextStatus, jqXHR: JQuery.jqXHR): void; 5440 } 5441 5442 interface ErrorCallback<TContext> { 5443 (this: TContext, jqXHR: jqXHR, textStatus: ErrorTextStatus, errorThrown: string): void; 5444 } 5445 5446 interface CompleteCallback<TContext> { 5447 (this: TContext, jqXHR: jqXHR, textStatus: TextStatus): void; 5448 } 5449 5450 /** 5451 * @see {@link http://api.jquery.com/jquery.ajax/#jQuery-ajax-settings} 5452 */ 5453 interface AjaxSettingsBase<TContext> { 5454 /** 5455 * A set of key/value pairs that map a given dataType to its MIME type, which gets sent in the Accept 5456 * request header. This header tells the server what kind of response it will accept in return. 5457 */ 5458 accepts?: PlainObject<string>; 5459 /** 5460 * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need 5461 * synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests 5462 * do not support synchronous operation. Note that synchronous requests may temporarily lock the 5463 * browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: 5464 * false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback 5465 * options instead of the corresponding methods of the jqXHR object such as jqXHR.done(). 5466 */ 5467 async?: boolean; 5468 /** 5469 * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, 5470 * XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and 5471 * settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend 5472 * function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless 5473 * of the type of request. 5474 */ 5475 beforeSend?(this: TContext, jqXHR: jqXHR, settings: AjaxSettingsBase<TContext>): false | void; 5476 /** 5477 * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache 5478 * to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" 5479 * to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a 5480 * POST is made to a URL that has already been requested by a GET. 5481 */ 5482 cache?: boolean; 5483 /** 5484 * A function to be called when the request finishes (after success and error callbacks are executed). 5485 * The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a 5486 * string categorizing the status of the request ("success", "notmodified", "nocontent", "error", 5487 * "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of 5488 * functions. Each function will be called in turn. This is an Ajax Event. 5489 */ 5490 complete?: TypeOrArray<Ajax.CompleteCallback<TContext>>; 5491 /** 5492 * An object of string/regular-expression pairs that determine how jQuery will parse the response, 5493 * given its content type. 5494 */ 5495 contents?: PlainObject<RegExp>; 5496 /** 5497 * When sending data to the server, use this content type. Default is 5498 * "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly 5499 * pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). 5500 * As of jQuery 1.6 you can pass false to tell jQuery to not set any content type header. Note: The W3C 5501 * XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset 5502 * will not force the browser to change the encoding. Note: For cross-domain requests, setting the 5503 * content type to anything other than application/x-www-form-urlencoded, multipart/form-data, or 5504 * text/plain will trigger the browser to send a preflight OPTIONS request to the server. 5505 */ 5506 contentType?: string | false; 5507 /** 5508 * This object will be the context of all Ajax-related callbacks. By default, the context is an object 5509 * that represents the Ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). 5510 */ 5511 context?: TContext; 5512 /** 5513 * An object containing dataType-to-dataType converters. Each converter's value is a function that 5514 * returns the transformed value of the response. 5515 */ 5516 converters?: PlainObject<((value: any) => any) | true>; 5517 /** 5518 * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of 5519 * crossDomain to true. This allows, for example, server-side redirection to another domain. 5520 */ 5521 crossDomain?: boolean; 5522 /** 5523 * Data to be sent to the server. It is converted to a query string, if not already a string. It's 5524 * appended to the url for GET-requests. See processData option to prevent this automatic processing. 5525 * Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same 5526 * key based on the value of the traditional setting (described below). 5527 */ 5528 data?: PlainObject | string; 5529 /** 5530 * A function to be used to handle the raw response data of XMLHttpRequest. This is a pre-filtering 5531 * function to sanitize the response. You should return the sanitized data. The function accepts two 5532 * arguments: The raw data returned from the server and the 'dataType' parameter. 5533 */ 5534 dataFilter?(data: string, type: string): any; 5535 /** 5536 * The type of data that you're expecting back from the server. If none is specified, jQuery will try 5537 * to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON 5538 * will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be 5539 * returned as a string). The available types (and the result passed as the first argument to your 5540 * success callback) are: 5541 * 5542 * "xml": Returns a XML document that can be processed via jQuery. 5543 * 5544 * "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM. 5545 * 5546 * "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by 5547 * appending a query string parameter, _=[TIMESTAMP], to the URL unless the cache option is set to 5548 * true. Note: This will turn POSTs into GETs for remote-domain requests. 5549 * 5550 * "json": Evaluates the response as JSON and returns a JavaScript object. Cross-domain "json" requests 5551 * are converted to "jsonp" unless the request includes jsonp: false in its request options. The JSON 5552 * data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of 5553 * jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} 5554 * instead. (See json.org for more information on proper JSON formatting.) 5555 * 5556 * "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to 5557 * specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to 5558 * the URL unless the cache option is set to true. 5559 * 5560 * "text": A plain text string. 5561 * 5562 * multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it 5563 * received in the Content-Type header to what you require. For example, if you want a text response to 5564 * be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it 5565 * received as text, and interpreted by jQuery as XML: "jsonp text xml". Similarly, a shorthand string 5566 * such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from 5567 * jsonp to text, and then from text to xml. 5568 */ 5569 dataType?: 'xml' | 'html' | 'script' | 'json' | 'jsonp' | 'text' | string; 5570 /** 5571 * A function to be called if the request fails. The function receives three arguments: The jqXHR (in 5572 * jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an 5573 * optional exception object, if one occurred. Possible values for the second argument (besides null) 5574 * are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives 5575 * the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 5576 * 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: 5577 * This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. 5578 */ 5579 error?: TypeOrArray<Ajax.ErrorCallback<TContext>>; 5580 /** 5581 * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to 5582 * prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to 5583 * control various Ajax Events. 5584 */ 5585 global?: boolean; 5586 /** 5587 * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest 5588 * transport. The header X-Requested-With: XMLHttpRequest is always added, but its default 5589 * XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from 5590 * within the beforeSend function. 5591 */ 5592 headers?: PlainObject<string | null | undefined>; 5593 /** 5594 * Allow the request to be successful only if the response has changed since the last request. This is 5595 * done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 5596 * 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. 5597 */ 5598 ifModified?: boolean; 5599 /** 5600 * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery 5601 * does not recognize it as such by default. The following protocols are currently recognized as local: 5602 * file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so 5603 * once in the $.ajaxSetup() method. 5604 */ 5605 isLocal?: boolean; 5606 /** 5607 * Override the callback function name in a JSONP request. This value will be used instead of 5608 * 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would 5609 * result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false 5610 * prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for 5611 * transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, 5612 * { jsonp: false, jsonpCallback: "callbackName" }. If you don't trust the target of your Ajax 5613 * requests, consider setting the jsonp property to false for security reasons. 5614 */ 5615 jsonp?: string | false; 5616 /** 5617 * Specify the callback function name for a JSONP request. This value will be used instead of the 5618 * random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name 5619 * as it'll make it easier to manage the requests and provide callbacks and error handling. You may 5620 * want to specify the callback when you want to enable better browser caching of GET requests. As of 5621 * jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback 5622 * is set to the return value of that function. 5623 */ 5624 jsonpCallback?: string | ((this: TContext) => string); 5625 /** 5626 * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). 5627 */ 5628 method?: string; 5629 /** 5630 * A mime type to override the XHR mime type. 5631 */ 5632 mimeType?: string; 5633 /** 5634 * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. 5635 */ 5636 password?: string; 5637 /** 5638 * By default, data passed in to the data option as an object (technically, anything other than a 5639 * string) will be processed and transformed into a query string, fitting to the default content-type 5640 * "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, 5641 * set this option to false. 5642 */ 5643 processData?: boolean; 5644 /** 5645 * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or 5646 * "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. 5647 * Used when the character set on the local page is not the same as the one on the remote script. 5648 */ 5649 scriptCharset?: string; 5650 /** 5651 * An object of numeric HTTP codes and functions to be called when the response has the corresponding 5652 * code. 5653 * 5654 * If the request is successful, the status code functions take the same parameters as the success 5655 * callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. 5656 */ 5657 statusCode?: StatusCodeCallbacks<TContext>; 5658 /** 5659 * A function to be called if the request succeeds. The function gets passed three arguments: The data 5660 * returned from the server, formatted according to the dataType parameter or the dataFilter callback 5661 * function, if specified; a string describing the status; and the jqXHR (in jQuery 1.4.x, 5662 * XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each 5663 * function will be called in turn. This is an Ajax Event. 5664 */ 5665 success?: TypeOrArray<Ajax.SuccessCallback<TContext>>; 5666 /** 5667 * Set a timeout (in milliseconds) for the request. A value of 0 means there will be no timeout. This 5668 * will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the 5669 * $.ajax call is made; if several other requests are in progress and the browser has no connections 5670 * available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and 5671 * below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any 5672 * object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be 5673 * cancelled by a timeout; the script will run even if it arrives after the timeout period. 5674 */ 5675 timeout?: number; 5676 /** 5677 * Set this to true if you wish to use the traditional style of param serialization. 5678 */ 5679 traditional?: boolean; 5680 /** 5681 * An alias for method. You should use type if you're using versions of jQuery prior to 1.9.0. 5682 */ 5683 type?: string; 5684 /** 5685 * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. 5686 */ 5687 username?: string; 5688 // ActiveXObject requires "lib": ["scripthost"] which consumers would also require 5689 /** 5690 * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), 5691 * the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or 5692 * enhancements to the factory. 5693 */ 5694 xhr?(): XMLHttpRequest; 5695 /** 5696 * An object of fieldName-fieldValue pairs to set on the native XHR object. 5697 * 5698 * In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS 5699 * requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ 5700 * should you require the use of it. 5701 */ 5702 xhrFields?: XHRFields; 5703 } 5704 5705 type StatusCodeCallbacks<TContext> = { 5706 // region Success Status Codes 5707 5708 // jQuery treats 2xx and 304 status codes as a success 5709 5710 200?: SuccessCallback<TContext>; 5711 201?: SuccessCallback<TContext>; 5712 202?: SuccessCallback<TContext>; 5713 203?: SuccessCallback<TContext>; 5714 204?: SuccessCallback<TContext>; 5715 205?: SuccessCallback<TContext>; 5716 206?: SuccessCallback<TContext>; 5717 207?: SuccessCallback<TContext>; 5718 208?: SuccessCallback<TContext>; 5719 209?: SuccessCallback<TContext>; 5720 210?: SuccessCallback<TContext>; 5721 211?: SuccessCallback<TContext>; 5722 212?: SuccessCallback<TContext>; 5723 213?: SuccessCallback<TContext>; 5724 214?: SuccessCallback<TContext>; 5725 215?: SuccessCallback<TContext>; 5726 216?: SuccessCallback<TContext>; 5727 217?: SuccessCallback<TContext>; 5728 218?: SuccessCallback<TContext>; 5729 219?: SuccessCallback<TContext>; 5730 220?: SuccessCallback<TContext>; 5731 221?: SuccessCallback<TContext>; 5732 222?: SuccessCallback<TContext>; 5733 223?: SuccessCallback<TContext>; 5734 224?: SuccessCallback<TContext>; 5735 225?: SuccessCallback<TContext>; 5736 226?: SuccessCallback<TContext>; 5737 227?: SuccessCallback<TContext>; 5738 228?: SuccessCallback<TContext>; 5739 229?: SuccessCallback<TContext>; 5740 230?: SuccessCallback<TContext>; 5741 231?: SuccessCallback<TContext>; 5742 232?: SuccessCallback<TContext>; 5743 233?: SuccessCallback<TContext>; 5744 234?: SuccessCallback<TContext>; 5745 235?: SuccessCallback<TContext>; 5746 236?: SuccessCallback<TContext>; 5747 237?: SuccessCallback<TContext>; 5748 238?: SuccessCallback<TContext>; 5749 239?: SuccessCallback<TContext>; 5750 240?: SuccessCallback<TContext>; 5751 241?: SuccessCallback<TContext>; 5752 242?: SuccessCallback<TContext>; 5753 243?: SuccessCallback<TContext>; 5754 244?: SuccessCallback<TContext>; 5755 245?: SuccessCallback<TContext>; 5756 246?: SuccessCallback<TContext>; 5757 247?: SuccessCallback<TContext>; 5758 248?: SuccessCallback<TContext>; 5759 249?: SuccessCallback<TContext>; 5760 250?: SuccessCallback<TContext>; 5761 251?: SuccessCallback<TContext>; 5762 252?: SuccessCallback<TContext>; 5763 253?: SuccessCallback<TContext>; 5764 254?: SuccessCallback<TContext>; 5765 255?: SuccessCallback<TContext>; 5766 256?: SuccessCallback<TContext>; 5767 257?: SuccessCallback<TContext>; 5768 258?: SuccessCallback<TContext>; 5769 259?: SuccessCallback<TContext>; 5770 260?: SuccessCallback<TContext>; 5771 261?: SuccessCallback<TContext>; 5772 262?: SuccessCallback<TContext>; 5773 263?: SuccessCallback<TContext>; 5774 264?: SuccessCallback<TContext>; 5775 265?: SuccessCallback<TContext>; 5776 266?: SuccessCallback<TContext>; 5777 267?: SuccessCallback<TContext>; 5778 268?: SuccessCallback<TContext>; 5779 269?: SuccessCallback<TContext>; 5780 270?: SuccessCallback<TContext>; 5781 271?: SuccessCallback<TContext>; 5782 272?: SuccessCallback<TContext>; 5783 273?: SuccessCallback<TContext>; 5784 274?: SuccessCallback<TContext>; 5785 275?: SuccessCallback<TContext>; 5786 276?: SuccessCallback<TContext>; 5787 277?: SuccessCallback<TContext>; 5788 278?: SuccessCallback<TContext>; 5789 279?: SuccessCallback<TContext>; 5790 280?: SuccessCallback<TContext>; 5791 281?: SuccessCallback<TContext>; 5792 282?: SuccessCallback<TContext>; 5793 283?: SuccessCallback<TContext>; 5794 284?: SuccessCallback<TContext>; 5795 285?: SuccessCallback<TContext>; 5796 286?: SuccessCallback<TContext>; 5797 287?: SuccessCallback<TContext>; 5798 288?: SuccessCallback<TContext>; 5799 289?: SuccessCallback<TContext>; 5800 290?: SuccessCallback<TContext>; 5801 291?: SuccessCallback<TContext>; 5802 292?: SuccessCallback<TContext>; 5803 293?: SuccessCallback<TContext>; 5804 294?: SuccessCallback<TContext>; 5805 295?: SuccessCallback<TContext>; 5806 296?: SuccessCallback<TContext>; 5807 297?: SuccessCallback<TContext>; 5808 298?: SuccessCallback<TContext>; 5809 299?: SuccessCallback<TContext>; 5810 304?: SuccessCallback<TContext>; 5811 5812 // endregion 5813 5814 // region Error Status Codes 5815 5816 300?: ErrorCallback<TContext>; 5817 301?: ErrorCallback<TContext>; 5818 302?: ErrorCallback<TContext>; 5819 303?: ErrorCallback<TContext>; 5820 305?: ErrorCallback<TContext>; 5821 306?: ErrorCallback<TContext>; 5822 307?: ErrorCallback<TContext>; 5823 308?: ErrorCallback<TContext>; 5824 309?: ErrorCallback<TContext>; 5825 310?: ErrorCallback<TContext>; 5826 311?: ErrorCallback<TContext>; 5827 312?: ErrorCallback<TContext>; 5828 313?: ErrorCallback<TContext>; 5829 314?: ErrorCallback<TContext>; 5830 315?: ErrorCallback<TContext>; 5831 316?: ErrorCallback<TContext>; 5832 317?: ErrorCallback<TContext>; 5833 318?: ErrorCallback<TContext>; 5834 319?: ErrorCallback<TContext>; 5835 320?: ErrorCallback<TContext>; 5836 321?: ErrorCallback<TContext>; 5837 322?: ErrorCallback<TContext>; 5838 323?: ErrorCallback<TContext>; 5839 324?: ErrorCallback<TContext>; 5840 325?: ErrorCallback<TContext>; 5841 326?: ErrorCallback<TContext>; 5842 327?: ErrorCallback<TContext>; 5843 328?: ErrorCallback<TContext>; 5844 329?: ErrorCallback<TContext>; 5845 330?: ErrorCallback<TContext>; 5846 331?: ErrorCallback<TContext>; 5847 332?: ErrorCallback<TContext>; 5848 333?: ErrorCallback<TContext>; 5849 334?: ErrorCallback<TContext>; 5850 335?: ErrorCallback<TContext>; 5851 336?: ErrorCallback<TContext>; 5852 337?: ErrorCallback<TContext>; 5853 338?: ErrorCallback<TContext>; 5854 339?: ErrorCallback<TContext>; 5855 340?: ErrorCallback<TContext>; 5856 341?: ErrorCallback<TContext>; 5857 342?: ErrorCallback<TContext>; 5858 343?: ErrorCallback<TContext>; 5859 344?: ErrorCallback<TContext>; 5860 345?: ErrorCallback<TContext>; 5861 346?: ErrorCallback<TContext>; 5862 347?: ErrorCallback<TContext>; 5863 348?: ErrorCallback<TContext>; 5864 349?: ErrorCallback<TContext>; 5865 350?: ErrorCallback<TContext>; 5866 351?: ErrorCallback<TContext>; 5867 352?: ErrorCallback<TContext>; 5868 353?: ErrorCallback<TContext>; 5869 354?: ErrorCallback<TContext>; 5870 355?: ErrorCallback<TContext>; 5871 356?: ErrorCallback<TContext>; 5872 357?: ErrorCallback<TContext>; 5873 358?: ErrorCallback<TContext>; 5874 359?: ErrorCallback<TContext>; 5875 360?: ErrorCallback<TContext>; 5876 361?: ErrorCallback<TContext>; 5877 362?: ErrorCallback<TContext>; 5878 363?: ErrorCallback<TContext>; 5879 364?: ErrorCallback<TContext>; 5880 365?: ErrorCallback<TContext>; 5881 366?: ErrorCallback<TContext>; 5882 367?: ErrorCallback<TContext>; 5883 368?: ErrorCallback<TContext>; 5884 369?: ErrorCallback<TContext>; 5885 370?: ErrorCallback<TContext>; 5886 371?: ErrorCallback<TContext>; 5887 372?: ErrorCallback<TContext>; 5888 373?: ErrorCallback<TContext>; 5889 374?: ErrorCallback<TContext>; 5890 375?: ErrorCallback<TContext>; 5891 376?: ErrorCallback<TContext>; 5892 377?: ErrorCallback<TContext>; 5893 378?: ErrorCallback<TContext>; 5894 379?: ErrorCallback<TContext>; 5895 380?: ErrorCallback<TContext>; 5896 381?: ErrorCallback<TContext>; 5897 382?: ErrorCallback<TContext>; 5898 383?: ErrorCallback<TContext>; 5899 384?: ErrorCallback<TContext>; 5900 385?: ErrorCallback<TContext>; 5901 386?: ErrorCallback<TContext>; 5902 387?: ErrorCallback<TContext>; 5903 388?: ErrorCallback<TContext>; 5904 389?: ErrorCallback<TContext>; 5905 390?: ErrorCallback<TContext>; 5906 391?: ErrorCallback<TContext>; 5907 392?: ErrorCallback<TContext>; 5908 393?: ErrorCallback<TContext>; 5909 394?: ErrorCallback<TContext>; 5910 395?: ErrorCallback<TContext>; 5911 396?: ErrorCallback<TContext>; 5912 397?: ErrorCallback<TContext>; 5913 398?: ErrorCallback<TContext>; 5914 399?: ErrorCallback<TContext>; 5915 400?: ErrorCallback<TContext>; 5916 401?: ErrorCallback<TContext>; 5917 402?: ErrorCallback<TContext>; 5918 403?: ErrorCallback<TContext>; 5919 404?: ErrorCallback<TContext>; 5920 405?: ErrorCallback<TContext>; 5921 406?: ErrorCallback<TContext>; 5922 407?: ErrorCallback<TContext>; 5923 408?: ErrorCallback<TContext>; 5924 409?: ErrorCallback<TContext>; 5925 410?: ErrorCallback<TContext>; 5926 411?: ErrorCallback<TContext>; 5927 412?: ErrorCallback<TContext>; 5928 413?: ErrorCallback<TContext>; 5929 414?: ErrorCallback<TContext>; 5930 415?: ErrorCallback<TContext>; 5931 416?: ErrorCallback<TContext>; 5932 417?: ErrorCallback<TContext>; 5933 418?: ErrorCallback<TContext>; 5934 419?: ErrorCallback<TContext>; 5935 420?: ErrorCallback<TContext>; 5936 421?: ErrorCallback<TContext>; 5937 422?: ErrorCallback<TContext>; 5938 423?: ErrorCallback<TContext>; 5939 424?: ErrorCallback<TContext>; 5940 425?: ErrorCallback<TContext>; 5941 426?: ErrorCallback<TContext>; 5942 427?: ErrorCallback<TContext>; 5943 428?: ErrorCallback<TContext>; 5944 429?: ErrorCallback<TContext>; 5945 430?: ErrorCallback<TContext>; 5946 431?: ErrorCallback<TContext>; 5947 432?: ErrorCallback<TContext>; 5948 433?: ErrorCallback<TContext>; 5949 434?: ErrorCallback<TContext>; 5950 435?: ErrorCallback<TContext>; 5951 436?: ErrorCallback<TContext>; 5952 437?: ErrorCallback<TContext>; 5953 438?: ErrorCallback<TContext>; 5954 439?: ErrorCallback<TContext>; 5955 440?: ErrorCallback<TContext>; 5956 441?: ErrorCallback<TContext>; 5957 442?: ErrorCallback<TContext>; 5958 443?: ErrorCallback<TContext>; 5959 444?: ErrorCallback<TContext>; 5960 445?: ErrorCallback<TContext>; 5961 446?: ErrorCallback<TContext>; 5962 447?: ErrorCallback<TContext>; 5963 448?: ErrorCallback<TContext>; 5964 449?: ErrorCallback<TContext>; 5965 450?: ErrorCallback<TContext>; 5966 451?: ErrorCallback<TContext>; 5967 452?: ErrorCallback<TContext>; 5968 453?: ErrorCallback<TContext>; 5969 454?: ErrorCallback<TContext>; 5970 455?: ErrorCallback<TContext>; 5971 456?: ErrorCallback<TContext>; 5972 457?: ErrorCallback<TContext>; 5973 458?: ErrorCallback<TContext>; 5974 459?: ErrorCallback<TContext>; 5975 460?: ErrorCallback<TContext>; 5976 461?: ErrorCallback<TContext>; 5977 462?: ErrorCallback<TContext>; 5978 463?: ErrorCallback<TContext>; 5979 464?: ErrorCallback<TContext>; 5980 465?: ErrorCallback<TContext>; 5981 466?: ErrorCallback<TContext>; 5982 467?: ErrorCallback<TContext>; 5983 468?: ErrorCallback<TContext>; 5984 469?: ErrorCallback<TContext>; 5985 470?: ErrorCallback<TContext>; 5986 471?: ErrorCallback<TContext>; 5987 472?: ErrorCallback<TContext>; 5988 473?: ErrorCallback<TContext>; 5989 474?: ErrorCallback<TContext>; 5990 475?: ErrorCallback<TContext>; 5991 476?: ErrorCallback<TContext>; 5992 477?: ErrorCallback<TContext>; 5993 478?: ErrorCallback<TContext>; 5994 479?: ErrorCallback<TContext>; 5995 480?: ErrorCallback<TContext>; 5996 481?: ErrorCallback<TContext>; 5997 482?: ErrorCallback<TContext>; 5998 483?: ErrorCallback<TContext>; 5999 484?: ErrorCallback<TContext>; 6000 485?: ErrorCallback<TContext>; 6001 486?: ErrorCallback<TContext>; 6002 487?: ErrorCallback<TContext>; 6003 488?: ErrorCallback<TContext>; 6004 489?: ErrorCallback<TContext>; 6005 490?: ErrorCallback<TContext>; 6006 491?: ErrorCallback<TContext>; 6007 492?: ErrorCallback<TContext>; 6008 493?: ErrorCallback<TContext>; 6009 494?: ErrorCallback<TContext>; 6010 495?: ErrorCallback<TContext>; 6011 496?: ErrorCallback<TContext>; 6012 497?: ErrorCallback<TContext>; 6013 498?: ErrorCallback<TContext>; 6014 499?: ErrorCallback<TContext>; 6015 500?: ErrorCallback<TContext>; 6016 501?: ErrorCallback<TContext>; 6017 502?: ErrorCallback<TContext>; 6018 503?: ErrorCallback<TContext>; 6019 504?: ErrorCallback<TContext>; 6020 505?: ErrorCallback<TContext>; 6021 506?: ErrorCallback<TContext>; 6022 507?: ErrorCallback<TContext>; 6023 508?: ErrorCallback<TContext>; 6024 509?: ErrorCallback<TContext>; 6025 510?: ErrorCallback<TContext>; 6026 511?: ErrorCallback<TContext>; 6027 512?: ErrorCallback<TContext>; 6028 513?: ErrorCallback<TContext>; 6029 514?: ErrorCallback<TContext>; 6030 515?: ErrorCallback<TContext>; 6031 516?: ErrorCallback<TContext>; 6032 517?: ErrorCallback<TContext>; 6033 518?: ErrorCallback<TContext>; 6034 519?: ErrorCallback<TContext>; 6035 520?: ErrorCallback<TContext>; 6036 521?: ErrorCallback<TContext>; 6037 522?: ErrorCallback<TContext>; 6038 523?: ErrorCallback<TContext>; 6039 524?: ErrorCallback<TContext>; 6040 525?: ErrorCallback<TContext>; 6041 526?: ErrorCallback<TContext>; 6042 527?: ErrorCallback<TContext>; 6043 528?: ErrorCallback<TContext>; 6044 529?: ErrorCallback<TContext>; 6045 530?: ErrorCallback<TContext>; 6046 531?: ErrorCallback<TContext>; 6047 532?: ErrorCallback<TContext>; 6048 533?: ErrorCallback<TContext>; 6049 534?: ErrorCallback<TContext>; 6050 535?: ErrorCallback<TContext>; 6051 536?: ErrorCallback<TContext>; 6052 537?: ErrorCallback<TContext>; 6053 538?: ErrorCallback<TContext>; 6054 539?: ErrorCallback<TContext>; 6055 540?: ErrorCallback<TContext>; 6056 541?: ErrorCallback<TContext>; 6057 542?: ErrorCallback<TContext>; 6058 543?: ErrorCallback<TContext>; 6059 544?: ErrorCallback<TContext>; 6060 545?: ErrorCallback<TContext>; 6061 546?: ErrorCallback<TContext>; 6062 547?: ErrorCallback<TContext>; 6063 548?: ErrorCallback<TContext>; 6064 549?: ErrorCallback<TContext>; 6065 550?: ErrorCallback<TContext>; 6066 551?: ErrorCallback<TContext>; 6067 552?: ErrorCallback<TContext>; 6068 553?: ErrorCallback<TContext>; 6069 554?: ErrorCallback<TContext>; 6070 555?: ErrorCallback<TContext>; 6071 556?: ErrorCallback<TContext>; 6072 557?: ErrorCallback<TContext>; 6073 558?: ErrorCallback<TContext>; 6074 559?: ErrorCallback<TContext>; 6075 560?: ErrorCallback<TContext>; 6076 561?: ErrorCallback<TContext>; 6077 562?: ErrorCallback<TContext>; 6078 563?: ErrorCallback<TContext>; 6079 564?: ErrorCallback<TContext>; 6080 565?: ErrorCallback<TContext>; 6081 566?: ErrorCallback<TContext>; 6082 567?: ErrorCallback<TContext>; 6083 568?: ErrorCallback<TContext>; 6084 569?: ErrorCallback<TContext>; 6085 570?: ErrorCallback<TContext>; 6086 571?: ErrorCallback<TContext>; 6087 572?: ErrorCallback<TContext>; 6088 573?: ErrorCallback<TContext>; 6089 574?: ErrorCallback<TContext>; 6090 575?: ErrorCallback<TContext>; 6091 576?: ErrorCallback<TContext>; 6092 577?: ErrorCallback<TContext>; 6093 578?: ErrorCallback<TContext>; 6094 579?: ErrorCallback<TContext>; 6095 580?: ErrorCallback<TContext>; 6096 581?: ErrorCallback<TContext>; 6097 582?: ErrorCallback<TContext>; 6098 583?: ErrorCallback<TContext>; 6099 584?: ErrorCallback<TContext>; 6100 585?: ErrorCallback<TContext>; 6101 586?: ErrorCallback<TContext>; 6102 587?: ErrorCallback<TContext>; 6103 588?: ErrorCallback<TContext>; 6104 589?: ErrorCallback<TContext>; 6105 590?: ErrorCallback<TContext>; 6106 591?: ErrorCallback<TContext>; 6107 592?: ErrorCallback<TContext>; 6108 593?: ErrorCallback<TContext>; 6109 594?: ErrorCallback<TContext>; 6110 595?: ErrorCallback<TContext>; 6111 596?: ErrorCallback<TContext>; 6112 597?: ErrorCallback<TContext>; 6113 598?: ErrorCallback<TContext>; 6114 599?: ErrorCallback<TContext>; 6115 6116 // endregion 6117 } & { 6118 // Status codes not listed require type annotations when defining the callback 6119 [index: number]: SuccessCallback<TContext> | ErrorCallback<TContext>; 6120 }; 6121 6122 // Writable properties on XMLHttpRequest 6123 interface XHRFields extends Partial<Pick<XMLHttpRequest, 'onreadystatechange' | 'responseType' | 'timeout' | 'withCredentials' | 'msCaching'>> { } 6124 } 6125 6126 interface Transport { 6127 send(headers: PlainObject, completeCallback: Transport.SuccessCallback): void; 6128 abort(): void; 6129 } 6130 6131 namespace Transport { 6132 interface SuccessCallback { 6133 (status: number, statusText: Ajax.TextStatus, responses?: PlainObject, headers?: string): void; 6134 } 6135 } 6136 6137 /** 6138 * @see {@link http://api.jquery.com/jquery.ajax/#jqXHR} 6139 */ 6140 interface jqXHR<TResolve = any> extends Promise3<TResolve, jqXHR<TResolve>, never, 6141 Ajax.SuccessTextStatus, Ajax.ErrorTextStatus, never, 6142 jqXHR<TResolve>, string, never>, 6143 Pick<XMLHttpRequest, 'abort' | 'getAllResponseHeaders' | 'getResponseHeader' | 'overrideMimeType' | 'readyState' | 'responseText' | 6144 'setRequestHeader' | 'status' | 'statusText'>, 6145 Partial<Pick<XMLHttpRequest, 'responseXML'>> { 6146 responseJSON?: any; 6147 6148 /** 6149 * Determine the current state of a Deferred object. 6150 * 6151 * @see {@link https://api.jquery.com/deferred.state/} 6152 * @since 1.7 6153 */ 6154 state(): 'pending' | 'resolved' | 'rejected'; 6155 statusCode(map: Ajax.StatusCodeCallbacks<any>): void; 6156 } 6157 6158 namespace jqXHR { 6159 /** 6160 * @deprecated 6161 */ 6162 interface DoneCallback<TResolve = any, TjqXHR = jqXHR<TResolve>> extends Deferred.Callback3<TResolve, Ajax.SuccessTextStatus, TjqXHR> { } 6163 6164 /** 6165 * @deprecated 6166 */ 6167 interface FailCallback<TjqXHR> extends Deferred.Callback3<TjqXHR, Ajax.ErrorTextStatus, string> { } 6168 6169 /** 6170 * @deprecated 6171 */ 6172 interface AlwaysCallback<TResolve = any, TjqXHR = jqXHR<TResolve>> extends Deferred.Callback3<TResolve | TjqXHR, Ajax.TextStatus, TjqXHR | string> { } 6173 } 6174 6175 // endregion 6176 6177 // region Callbacks 6178 6179 interface Callbacks<T extends Function = Function> { 6180 /** 6181 * Add a callback or a collection of callbacks to a callback list. 6182 * 6183 * @param callback A function, or array of functions, that are to be added to the callback list. 6184 * @param callbacks A function, or array of functions, that are to be added to the callback list. 6185 * @see {@link https://api.jquery.com/callbacks.add/} 6186 * @since 1.7 6187 */ 6188 add(callback: TypeOrArray<T>, ...callbacks: Array<TypeOrArray<T>>): this; 6189 /** 6190 * Disable a callback list from doing anything more. 6191 * 6192 * @see {@link https://api.jquery.com/callbacks.disable/} 6193 * @since 1.7 6194 */ 6195 disable(): this; 6196 /** 6197 * Determine if the callbacks list has been disabled. 6198 * 6199 * @see {@link https://api.jquery.com/callbacks.disabled/} 6200 * @since 1.7 6201 */ 6202 disabled(): boolean; 6203 /** 6204 * Remove all of the callbacks from a list. 6205 * 6206 * @see {@link https://api.jquery.com/callbacks.empty/} 6207 * @since 1.7 6208 */ 6209 empty(): this; 6210 /** 6211 * Call all of the callbacks with the given arguments. 6212 * 6213 * @param args The argument or list of arguments to pass back to the callback list. 6214 * @see {@link https://api.jquery.com/callbacks.fire/} 6215 * @since 1.7 6216 */ 6217 fire(...args: any[]): this; 6218 /** 6219 * Call all callbacks in a list with the given context and arguments. 6220 * 6221 * @param context A reference to the context in which the callbacks in the list should be fired. 6222 * @param args An argument, or array of arguments, to pass to the callbacks in the list. 6223 * @see {@link https://api.jquery.com/callbacks.fireWith/} 6224 * @since 1.7 6225 */ 6226 fireWith(context: object, args?: ArrayLike<any>): this; 6227 /** 6228 * Determine if the callbacks have already been called at least once. 6229 * 6230 * @see {@link https://api.jquery.com/callbacks.fired/} 6231 * @since 1.7 6232 */ 6233 fired(): boolean; 6234 /** 6235 * Determine whether or not the list has any callbacks attached. If a callback is provided as an 6236 * argument, determine whether it is in a list. 6237 * 6238 * @param callback The callback to search for. 6239 * @see {@link https://api.jquery.com/callbacks.has/} 6240 * @since 1.7 6241 */ 6242 has(callback?: T): boolean; 6243 /** 6244 * Lock a callback list in its current state. 6245 * 6246 * @see {@link https://api.jquery.com/callbacks.lock/} 6247 * @since 1.7 6248 */ 6249 lock(): this; 6250 /** 6251 * Determine if the callbacks list has been locked. 6252 * 6253 * @see {@link https://api.jquery.com/callbacks.locked/} 6254 * @since 1.7 6255 */ 6256 locked(): boolean; 6257 /** 6258 * Remove a callback or a collection of callbacks from a callback list. 6259 * 6260 * @param callbacks A function, or array of functions, that are to be removed from the callback list. 6261 * @see {@link https://api.jquery.com/callbacks.remove/} 6262 * @since 1.7 6263 */ 6264 remove(...callbacks: T[]): this; 6265 } 6266 6267 // endregion 6268 6269 // region CSS 6270 6271 interface CSSHook<TElement> { 6272 get(this: this, elem: TElement, computed: any, extra: any): any; 6273 set(this: this, elem: TElement, value: any): void; 6274 } 6275 6276 // endregion 6277 6278 // region Deferred 6279 6280 /** 6281 * Any object that has a then method. 6282 */ 6283 interface Thenable<T> extends PromiseLike<T> { } 6284 6285 // Type parameter guide 6286 // -------------------- 6287 // Each type parameter represents a parameter in one of the three possible callbacks. 6288 // 6289 // The first letter indicates which position the parameter is in. 6290 // 6291 // T = A = 1st position 6292 // U = B = 2nd position 6293 // V = C = 3rd position 6294 // S = R = rest position 6295 // 6296 // The second letter indicates which whether it is a [R]esolve, Re[J]ect, or [N]otify value. 6297 // 6298 // The third letter indicates whether the value is returned in the [D]one filter, [F]ail filter, or [P]rogress filter. 6299 6300 /** 6301 * This object provides a subset of the methods of the Deferred object (then, done, fail, always, 6302 * pipe, progress, state and promise) to prevent users from changing the state of the Deferred. 6303 * 6304 * @see {@link http://api.jquery.com/Types/#Promise} 6305 * @deprecated Experimental. Avoid referncing this type directly in your code. 6306 */ 6307 interface PromiseBase<TR, TJ, TN, 6308 UR, UJ, UN, 6309 VR, VJ, VN, 6310 SR, SJ, SN> extends _Promise<TR>, PromiseLike<TR> { 6311 /** 6312 * Add handlers to be called when the Deferred object is either resolved or rejected. 6313 * 6314 * @param alwaysCallback A function, or array of functions, that is called when the Deferred is resolved or rejected. 6315 * @param alwaysCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. 6316 * @see {@link https://api.jquery.com/deferred.always/} 6317 * @since 1.6 6318 */ 6319 always(alwaysCallback: TypeOrArray<Deferred.CallbackBase<TR | TJ, UR | UJ, VR | VJ, SR | SJ>>, 6320 ...alwaysCallbacks: Array<TypeOrArray<Deferred.CallbackBase<TR | TJ, UR | UJ, VR | VJ, SR | SJ>>>): this; 6321 /** 6322 * Add handlers to be called when the Deferred object is resolved. 6323 * 6324 * @param doneCallback A function, or array of functions, that are called when the Deferred is resolved. 6325 * @param doneCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. 6326 * @see {@link https://api.jquery.com/deferred.done/} 6327 * @since 1.5 6328 */ 6329 done(doneCallback: TypeOrArray<Deferred.CallbackBase<TR, UR, VR, SR>>, 6330 ...doneCallbacks: Array<TypeOrArray<Deferred.CallbackBase<TR, UR, VR, SR>>>): this; 6331 /** 6332 * Add handlers to be called when the Deferred object is rejected. 6333 * 6334 * @param failCallback A function, or array of functions, that are called when the Deferred is rejected. 6335 * @param failCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. 6336 * @see {@link https://api.jquery.com/deferred.fail/} 6337 * @since 1.5 6338 */ 6339 fail(failCallback: TypeOrArray<Deferred.CallbackBase<TJ, UJ, VJ, SJ>>, 6340 ...failCallbacks: Array<TypeOrArray<Deferred.CallbackBase<TJ, UJ, VJ, SJ>>>): this; 6341 /** 6342 * Add handlers to be called when the Deferred object generates progress notifications. 6343 * 6344 * @param progressCallback A function, or array of functions, to be called when the Deferred generates progress notifications. 6345 * @param progressCallbacks Optional additional functions, or arrays of functions, to be called when the Deferred generates 6346 * progress notifications. 6347 * @see {@link https://api.jquery.com/deferred.progress/} 6348 * @since 1.7 6349 */ 6350 progress(progressCallback: TypeOrArray<Deferred.CallbackBase<TN, UN, VN, SN>>, 6351 ...progressCallbacks: Array<TypeOrArray<Deferred.CallbackBase<TN, UN, VN, SN>>>): this; 6352 /** 6353 * Return a Deferred's Promise object. 6354 * 6355 * @param target Object onto which the promise methods have to be attached 6356 * @see {@link https://api.jquery.com/deferred.promise/} 6357 * @since 1.5 6358 */ 6359 promise<TTarget extends object>(target: TTarget): this & TTarget; 6360 /** 6361 * Return a Deferred's Promise object. 6362 * 6363 * @see {@link https://api.jquery.com/deferred.promise/} 6364 * @since 1.5 6365 */ 6366 promise(): this; 6367 /** 6368 * Determine the current state of a Deferred object. 6369 * 6370 * @see {@link https://api.jquery.com/deferred.state/} 6371 * @since 1.7 6372 */ 6373 state(): 'pending' | 'resolved' | 'rejected'; 6374 6375 // region pipe 6376 6377 /** 6378 * Utility method to filter and/or chain Deferreds. 6379 * 6380 * @param doneFilter An optional function that is called when the Deferred is resolved. 6381 * @param failFilter An optional function that is called when the Deferred is rejected. 6382 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 6383 * @see {@link https://api.jquery.com/deferred.pipe/} 6384 * @since 1.6 6385 * @since 1.7 6386 * @deprecated 1.8 6387 */ 6388 pipe<ARD = never, AJD = never, AND = never, 6389 BRD = never, BJD = never, BND = never, 6390 CRD = never, CJD = never, CND = never, 6391 RRD = never, RJD = never, RND = never, 6392 ARF = never, AJF = never, ANF = never, 6393 BRF = never, BJF = never, BNF = never, 6394 CRF = never, CJF = never, CNF = never, 6395 RRF = never, RJF = never, RNF = never, 6396 ARP = never, AJP = never, ANP = never, 6397 BRP = never, BJP = never, BNP = never, 6398 CRP = never, CJP = never, CNP = never, 6399 RRP = never, RJP = never, RNP = never> 6400 (doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase<ARD, AJD, AND, 6401 BRD, BJD, BND, 6402 CRD, CJD, CND, 6403 RRD, RJD, RND> | Thenable<ARD> | ARD, 6404 failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase<ARF, AJF, ANF, 6405 BRF, BJF, BNF, 6406 CRF, CJF, CNF, 6407 RRF, RJF, RNF> | Thenable<AJF> | AJF, 6408 progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase<ARP, AJP, ANP, 6409 BRP, BJP, BNP, 6410 CRP, CJP, CNP, 6411 RRP, RJP, RNP> | Thenable<ANP> | ANP): PromiseBase<ARD | ARF | ARP, AJD | AJF | AJP, AND | ANF | ANP, 6412 BRD | BRF | BRP, BJD | BJF | BJP, BND | BNF | BNP, 6413 CRD | CRF | CRP, CJD | CJF | CJP, CND | CNF | CNP, 6414 RRD | RRF | RRP, RJD | RJF | RJP, RND | RNF | RNP>; 6415 /** 6416 * Utility method to filter and/or chain Deferreds. 6417 * 6418 * @param doneFilter An optional function that is called when the Deferred is resolved. 6419 * @param failFilter An optional function that is called when the Deferred is rejected. 6420 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 6421 * @see {@link https://api.jquery.com/deferred.pipe/} 6422 * @since 1.6 6423 * @since 1.7 6424 * @deprecated 1.8 6425 */ 6426 pipe<ARF = never, AJF = never, ANF = never, 6427 BRF = never, BJF = never, BNF = never, 6428 CRF = never, CJF = never, CNF = never, 6429 RRF = never, RJF = never, RNF = never, 6430 ARP = never, AJP = never, ANP = never, 6431 BRP = never, BJP = never, BNP = never, 6432 CRP = never, CJP = never, CNP = never, 6433 RRP = never, RJP = never, RNP = never> 6434 (doneFilter: null, 6435 failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase<ARF, AJF, ANF, 6436 BRF, BJF, BNF, 6437 CRF, CJF, CNF, 6438 RRF, RJF, RNF> | Thenable<AJF> | AJF, 6439 progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase<ARP, AJP, ANP, 6440 BRP, BJP, BNP, 6441 CRP, CJP, CNP, 6442 RRP, RJP, RNP> | Thenable<ANP> | ANP): PromiseBase<ARF | ARP, AJF | AJP, ANF | ANP, 6443 BRF | BRP, BJF | BJP, BNF | BNP, 6444 CRF | CRP, CJF | CJP, CNF | CNP, 6445 RRF | RRP, RJF | RJP, RNF | RNP>; 6446 /** 6447 * Utility method to filter and/or chain Deferreds. 6448 * 6449 * @param doneFilter An optional function that is called when the Deferred is resolved. 6450 * @param failFilter An optional function that is called when the Deferred is rejected. 6451 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 6452 * @see {@link https://api.jquery.com/deferred.pipe/} 6453 * @since 1.6 6454 * @since 1.7 6455 * @deprecated 1.8 6456 */ 6457 pipe<ARD = never, AJD = never, AND = never, 6458 BRD = never, BJD = never, BND = never, 6459 CRD = never, CJD = never, CND = never, 6460 RRD = never, RJD = never, RND = never, 6461 ARP = never, AJP = never, ANP = never, 6462 BRP = never, BJP = never, BNP = never, 6463 CRP = never, CJP = never, CNP = never, 6464 RRP = never, RJP = never, RNP = never> 6465 (doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase<ARD, AJD, AND, 6466 BRD, BJD, BND, 6467 CRD, CJD, CND, 6468 RRD, RJD, RND> | Thenable<ARD> | ARD, 6469 failFilter: null, 6470 progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase<ARP, AJP, ANP, 6471 BRP, BJP, BNP, 6472 CRP, CJP, CNP, 6473 RRP, RJP, RNP> | Thenable<ANP> | ANP): PromiseBase<ARD | ARP, AJD | AJP, AND | ANP, 6474 BRD | BRP, BJD | BJP, BND | BNP, 6475 CRD | CRP, CJD | CJP, CND | CNP, 6476 RRD | RRP, RJD | RJP, RND | RNP>; 6477 /** 6478 * Utility method to filter and/or chain Deferreds. 6479 * 6480 * @param doneFilter An optional function that is called when the Deferred is resolved. 6481 * @param failFilter An optional function that is called when the Deferred is rejected. 6482 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 6483 * @see {@link https://api.jquery.com/deferred.pipe/} 6484 * @since 1.6 6485 * @since 1.7 6486 * @deprecated 1.8 6487 */ 6488 pipe<ARP = never, AJP = never, ANP = never, 6489 BRP = never, BJP = never, BNP = never, 6490 CRP = never, CJP = never, CNP = never, 6491 RRP = never, RJP = never, RNP = never> 6492 (doneFilter: null, 6493 failFilter: null, 6494 progressFilter?: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase<ARP, AJP, ANP, 6495 BRP, BJP, BNP, 6496 CRP, CJP, CNP, 6497 RRP, RJP, RNP> | Thenable<ANP> | ANP): PromiseBase<ARP, AJP, ANP, 6498 BRP, BJP, BNP, 6499 CRP, CJP, CNP, 6500 RRP, RJP, RNP>; 6501 /** 6502 * Utility method to filter and/or chain Deferreds. 6503 * 6504 * @param doneFilter An optional function that is called when the Deferred is resolved. 6505 * @param failFilter An optional function that is called when the Deferred is rejected. 6506 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 6507 * @see {@link https://api.jquery.com/deferred.pipe/} 6508 * @since 1.6 6509 * @since 1.7 6510 * @deprecated 1.8 6511 */ 6512 pipe<ARD = never, AJD = never, AND = never, 6513 BRD = never, BJD = never, BND = never, 6514 CRD = never, CJD = never, CND = never, 6515 RRD = never, RJD = never, RND = never, 6516 ARF = never, AJF = never, ANF = never, 6517 BRF = never, BJF = never, BNF = never, 6518 CRF = never, CJF = never, CNF = never, 6519 RRF = never, RJF = never, RNF = never> 6520 (doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase<ARD, AJD, AND, 6521 BRD, BJD, BND, 6522 CRD, CJD, CND, 6523 RRD, RJD, RND> | Thenable<ARD> | ARD, 6524 failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase<ARF, AJF, ANF, 6525 BRF, BJF, BNF, 6526 CRF, CJF, CNF, 6527 RRF, RJF, RNF> | Thenable<AJF> | AJF, 6528 progressFilter?: null): PromiseBase<ARD | ARF, AJD | AJF, AND | ANF, 6529 BRD | BRF, BJD | BJF, BND | BNF, 6530 CRD | CRF, CJD | CJF, CND | CNF, 6531 RRD | RRF, RJD | RJF, RND | RNF>; 6532 /** 6533 * Utility method to filter and/or chain Deferreds. 6534 * 6535 * @param doneFilter An optional function that is called when the Deferred is resolved. 6536 * @param failFilter An optional function that is called when the Deferred is rejected. 6537 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 6538 * @see {@link https://api.jquery.com/deferred.pipe/} 6539 * @since 1.6 6540 * @since 1.7 6541 * @deprecated 1.8 6542 */ 6543 pipe<ARF = never, AJF = never, ANF = never, 6544 BRF = never, BJF = never, BNF = never, 6545 CRF = never, CJF = never, CNF = never, 6546 RRF = never, RJF = never, RNF = never> 6547 (doneFilter: null, 6548 failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase<ARF, AJF, ANF, 6549 BRF, BJF, BNF, 6550 CRF, CJF, CNF, 6551 RRF, RJF, RNF> | Thenable<AJF> | AJF, 6552 progressFilter?: null): PromiseBase<ARF, AJF, ANF, 6553 BRF, BJF, BNF, 6554 CRF, CJF, CNF, 6555 RRF, RJF, RNF>; 6556 /** 6557 * Utility method to filter and/or chain Deferreds. 6558 * 6559 * @param doneFilter An optional function that is called when the Deferred is resolved. 6560 * @param failFilter An optional function that is called when the Deferred is rejected. 6561 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 6562 * @see {@link https://api.jquery.com/deferred.pipe/} 6563 * @since 1.6 6564 * @since 1.7 6565 * @deprecated 1.8 6566 */ 6567 pipe<ARD = never, AJD = never, AND = never, 6568 BRD = never, BJD = never, BND = never, 6569 CRD = never, CJD = never, CND = never, 6570 RRD = never, RJD = never, RND = never> 6571 (doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase<ARD, AJD, AND, 6572 BRD, BJD, BND, 6573 CRD, CJD, CND, 6574 RRD, RJD, RND> | Thenable<ARD> | ARD, 6575 failFilter?: null, 6576 progressFilter?: null): PromiseBase<ARD, AJD, AND, 6577 BRD, BJD, BND, 6578 CRD, CJD, CND, 6579 RRD, RJD, RND>; 6580 6581 // endregion 6582 6583 // region then 6584 6585 /** 6586 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. 6587 * 6588 * @param doneFilter An optional function that is called when the Deferred is resolved. 6589 * @param failFilter An optional function that is called when the Deferred is rejected. 6590 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 6591 * @see {@link https://api.jquery.com/deferred.then/} 6592 * @since 1.8 6593 */ 6594 then<ARD = never, AJD = never, AND = never, 6595 BRD = never, BJD = never, BND = never, 6596 CRD = never, CJD = never, CND = never, 6597 RRD = never, RJD = never, RND = never, 6598 ARF = never, AJF = never, ANF = never, 6599 BRF = never, BJF = never, BNF = never, 6600 CRF = never, CJF = never, CNF = never, 6601 RRF = never, RJF = never, RNF = never, 6602 ARP = never, AJP = never, ANP = never, 6603 BRP = never, BJP = never, BNP = never, 6604 CRP = never, CJP = never, CNP = never, 6605 RRP = never, RJP = never, RNP = never> 6606 (doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase<ARD, AJD, AND, 6607 BRD, BJD, BND, 6608 CRD, CJD, CND, 6609 RRD, RJD, RND> | Thenable<ARD> | ARD, 6610 failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase<ARF, AJF, ANF, 6611 BRF, BJF, BNF, 6612 CRF, CJF, CNF, 6613 RRF, RJF, RNF> | Thenable<ARF> | ARF, 6614 progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase<ARP, AJP, ANP, 6615 BRP, BJP, BNP, 6616 CRP, CJP, CNP, 6617 RRP, RJP, RNP> | Thenable<ANP> | ANP): PromiseBase<ARD | ARF | ARP, AJD | AJF | AJP, AND | ANF | ANP, 6618 BRD | BRF | BRP, BJD | BJF | BJP, BND | BNF | BNP, 6619 CRD | CRF | CRP, CJD | CJF | CJP, CND | CNF | CNP, 6620 RRD | RRF | RRP, RJD | RJF | RJP, RND | RNF | RNP>; 6621 /** 6622 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. 6623 * 6624 * @param doneFilter An optional function that is called when the Deferred is resolved. 6625 * @param failFilter An optional function that is called when the Deferred is rejected. 6626 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 6627 * @see {@link https://api.jquery.com/deferred.then/} 6628 * @since 1.8 6629 */ 6630 then<ARF = never, AJF = never, ANF = never, 6631 BRF = never, BJF = never, BNF = never, 6632 CRF = never, CJF = never, CNF = never, 6633 RRF = never, RJF = never, RNF = never, 6634 ARP = never, AJP = never, ANP = never, 6635 BRP = never, BJP = never, BNP = never, 6636 CRP = never, CJP = never, CNP = never, 6637 RRP = never, RJP = never, RNP = never> 6638 (doneFilter: null, 6639 failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase<ARF, AJF, ANF, 6640 BRF, BJF, BNF, 6641 CRF, CJF, CNF, 6642 RRF, RJF, RNF> | Thenable<ARF> | ARF, 6643 progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase<ARP, AJP, ANP, 6644 BRP, BJP, BNP, 6645 CRP, CJP, CNP, 6646 RRP, RJP, RNP> | Thenable<ANP> | ANP): PromiseBase<ARF | ARP, AJF | AJP, ANF | ANP, 6647 BRF | BRP, BJF | BJP, BNF | BNP, 6648 CRF | CRP, CJF | CJP, CNF | CNP, 6649 RRF | RRP, RJF | RJP, RNF | RNP>; 6650 /** 6651 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. 6652 * 6653 * @param doneFilter An optional function that is called when the Deferred is resolved. 6654 * @param failFilter An optional function that is called when the Deferred is rejected. 6655 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 6656 * @see {@link https://api.jquery.com/deferred.then/} 6657 * @since 1.8 6658 */ 6659 then<ARD = never, AJD = never, AND = never, 6660 BRD = never, BJD = never, BND = never, 6661 CRD = never, CJD = never, CND = never, 6662 RRD = never, RJD = never, RND = never, 6663 ARP = never, AJP = never, ANP = never, 6664 BRP = never, BJP = never, BNP = never, 6665 CRP = never, CJP = never, CNP = never, 6666 RRP = never, RJP = never, RNP = never> 6667 (doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase<ARD, AJD, AND, 6668 BRD, BJD, BND, 6669 CRD, CJD, CND, 6670 RRD, RJD, RND> | Thenable<ARD> | ARD, 6671 failFilter: null, 6672 progressFilter: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase<ARP, AJP, ANP, 6673 BRP, BJP, BNP, 6674 CRP, CJP, CNP, 6675 RRP, RJP, RNP> | Thenable<ANP> | ANP): PromiseBase<ARD | ARP, AJD | AJP, AND | ANP, 6676 BRD | BRP, BJD | BJP, BND | BNP, 6677 CRD | CRP, CJD | CJP, CND | CNP, 6678 RRD | RRP, RJD | RJP, RND | RNP>; 6679 /** 6680 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. 6681 * 6682 * @param doneFilter An optional function that is called when the Deferred is resolved. 6683 * @param failFilter An optional function that is called when the Deferred is rejected. 6684 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 6685 * @see {@link https://api.jquery.com/deferred.then/} 6686 * @since 1.8 6687 */ 6688 then<ARP = never, AJP = never, ANP = never, 6689 BRP = never, BJP = never, BNP = never, 6690 CRP = never, CJP = never, CNP = never, 6691 RRP = never, RJP = never, RNP = never> 6692 (doneFilter: null, 6693 failFilter: null, 6694 progressFilter?: (t: TN, u: UN, v: VN, ...s: SN[]) => PromiseBase<ARP, AJP, ANP, 6695 BRP, BJP, BNP, 6696 CRP, CJP, CNP, 6697 RRP, RJP, RNP> | Thenable<ANP> | ANP): PromiseBase<ARP, AJP, ANP, 6698 BRP, BJP, BNP, 6699 CRP, CJP, CNP, 6700 RRP, RJP, RNP>; 6701 /** 6702 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. 6703 * 6704 * @param doneFilter An optional function that is called when the Deferred is resolved. 6705 * @param failFilter An optional function that is called when the Deferred is rejected. 6706 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 6707 * @see {@link https://api.jquery.com/deferred.then/} 6708 * @since 1.8 6709 */ 6710 then<ARD = never, AJD = never, AND = never, 6711 BRD = never, BJD = never, BND = never, 6712 CRD = never, CJD = never, CND = never, 6713 RRD = never, RJD = never, RND = never, 6714 ARF = never, AJF = never, ANF = never, 6715 BRF = never, BJF = never, BNF = never, 6716 CRF = never, CJF = never, CNF = never, 6717 RRF = never, RJF = never, RNF = never> 6718 (doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase<ARD, AJD, AND, 6719 BRD, BJD, BND, 6720 CRD, CJD, CND, 6721 RRD, RJD, RND> | Thenable<ARD> | ARD, 6722 failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase<ARF, AJF, ANF, 6723 BRF, BJF, BNF, 6724 CRF, CJF, CNF, 6725 RRF, RJF, RNF> | Thenable<ARF> | ARF, 6726 progressFilter?: null): PromiseBase<ARD | ARF, AJD | AJF, AND | ANF, 6727 BRD | BRF, BJD | BJF, BND | BNF, 6728 CRD | CRF, CJD | CJF, CND | CNF, 6729 RRD | RRF, RJD | RJF, RND | RNF>; 6730 /** 6731 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. 6732 * 6733 * @param doneFilter An optional function that is called when the Deferred is resolved. 6734 * @param failFilter An optional function that is called when the Deferred is rejected. 6735 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 6736 * @see {@link https://api.jquery.com/deferred.then/} 6737 * @since 1.8 6738 */ 6739 then<ARF = never, AJF = never, ANF = never, 6740 BRF = never, BJF = never, BNF = never, 6741 CRF = never, CJF = never, CNF = never, 6742 RRF = never, RJF = never, RNF = never> 6743 (doneFilter: null, 6744 failFilter: (t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase<ARF, AJF, ANF, 6745 BRF, BJF, BNF, 6746 CRF, CJF, CNF, 6747 RRF, RJF, RNF> | Thenable<ARF> | ARF, 6748 progressFilter?: null): PromiseBase<ARF, AJF, ANF, 6749 BRF, BJF, BNF, 6750 CRF, CJF, CNF, 6751 RRF, RJF, RNF>; 6752 /** 6753 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. 6754 * 6755 * @param doneFilter An optional function that is called when the Deferred is resolved. 6756 * @param failFilter An optional function that is called when the Deferred is rejected. 6757 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 6758 * @see {@link https://api.jquery.com/deferred.then/} 6759 * @since 1.8 6760 */ 6761 then<ARD = never, AJD = never, AND = never, 6762 BRD = never, BJD = never, BND = never, 6763 CRD = never, CJD = never, CND = never, 6764 RRD = never, RJD = never, RND = never> 6765 (doneFilter: (t: TR, u: UR, v: VR, ...s: SR[]) => PromiseBase<ARD, AJD, AND, 6766 BRD, BJD, BND, 6767 CRD, CJD, CND, 6768 RRD, RJD, RND> | Thenable<ARD> | ARD, 6769 failFilter?: null, 6770 progressFilter?: null): PromiseBase<ARD, AJD, AND, 6771 BRD, BJD, BND, 6772 CRD, CJD, CND, 6773 RRD, RJD, RND>; 6774 6775 // endregion 6776 6777 /** 6778 * Add handlers to be called when the Deferred object is rejected. 6779 * 6780 * @param failFilter A function that is called when the Deferred is rejected. 6781 * @see {@link https://api.jquery.com/deferred.catch/} 6782 * @since 3.0 6783 */ 6784 catch<ARF = never, AJF = never, ANF = never, 6785 BRF = never, BJF = never, BNF = never, 6786 CRF = never, CJF = never, CNF = never, 6787 RRF = never, RJF = never, RNF = never> 6788 (failFilter?: ((t: TJ, u: UJ, v: VJ, ...s: SJ[]) => PromiseBase<ARF, AJF, ANF, 6789 BRF, BJF, BNF, 6790 CRF, CJF, CNF, 6791 RRF, RJF, RNF> | Thenable<ARF> | ARF) | null): PromiseBase<ARF, AJF, ANF, 6792 BRF, BJF, BNF, 6793 CRF, CJF, CNF, 6794 RRF, RJF, RNF>; 6795 } 6796 6797 /** 6798 * This object provides a subset of the methods of the Deferred object (then, done, fail, always, 6799 * pipe, progress, state and promise) to prevent users from changing the state of the Deferred. 6800 * 6801 * @see {@link http://api.jquery.com/Types/#Promise} 6802 */ 6803 interface Promise3<TR, TJ, TN, 6804 UR, UJ, UN, 6805 VR, VJ, VN> extends PromiseBase<TR, TJ, TN, 6806 UR, UJ, UN, 6807 VR, VJ, VN, 6808 never, never, never> { } 6809 6810 /** 6811 * This object provides a subset of the methods of the Deferred object (then, done, fail, always, 6812 * pipe, progress, state and promise) to prevent users from changing the state of the Deferred. 6813 * 6814 * @see {@link http://api.jquery.com/Types/#Promise} 6815 */ 6816 interface Promise2<TR, TJ, TN, 6817 UR, UJ, UN> extends PromiseBase<TR, TJ, TN, 6818 UR, UJ, UN, 6819 never, never, never, 6820 never, never, never> { } 6821 6822 /** 6823 * This object provides a subset of the methods of the Deferred object (then, done, fail, always, 6824 * pipe, progress, state and promise) to prevent users from changing the state of the Deferred. 6825 * 6826 * @see {@link http://api.jquery.com/Types/#Promise} 6827 */ 6828 interface Promise<TR, TJ = any, TN = any> extends PromiseBase<TR, TJ, TN, 6829 TR, TJ, TN, 6830 TR, TJ, TN, 6831 TR, TJ, TN> { } 6832 6833 interface DeferredStatic { 6834 // https://jquery.com/upgrade-guide/3.0/#callback-exit 6835 exceptionHook: any; 6836 <TR = any, TJ = any, TN = any>(beforeStart?: (this: JQuery.Deferred<TR, TJ, TN>, deferred: JQuery.Deferred<TR, TJ, TN>) => void): JQuery.Deferred<TR, TJ, TN>; 6837 } 6838 6839 interface Deferred<TR, TJ = any, TN = any> { 6840 /** 6841 * Call the progressCallbacks on a Deferred object with the given args. 6842 * 6843 * @param args Optional arguments that are passed to the progressCallbacks. 6844 * @see {@link https://api.jquery.com/deferred.notify/} 6845 * @since 1.7 6846 */ 6847 notify(...args: TN[]): this; 6848 /** 6849 * Call the progressCallbacks on a Deferred object with the given context and args. 6850 * 6851 * @param context Context passed to the progressCallbacks as the this object. 6852 * @param args An optional array of arguments that are passed to the progressCallbacks. 6853 * @see {@link https://api.jquery.com/deferred.notifyWith/} 6854 * @since 1.7 6855 */ 6856 notifyWith(context: object, args?: ArrayLike<TN>): this; 6857 /** 6858 * Reject a Deferred object and call any failCallbacks with the given args. 6859 * 6860 * @param args Optional arguments that are passed to the failCallbacks. 6861 * @see {@link https://api.jquery.com/deferred.reject/} 6862 * @since 1.5 6863 */ 6864 reject(...args: TJ[]): this; 6865 /** 6866 * Reject a Deferred object and call any failCallbacks with the given context and args. 6867 * 6868 * @param context Context passed to the failCallbacks as the this object. 6869 * @param args An optional array of arguments that are passed to the failCallbacks. 6870 * @see {@link https://api.jquery.com/deferred.rejectWith/} 6871 * @since 1.5 6872 */ 6873 rejectWith(context: object, args?: ArrayLike<TJ>): this; 6874 /** 6875 * Resolve a Deferred object and call any doneCallbacks with the given args. 6876 * 6877 * @param args Optional arguments that are passed to the doneCallbacks. 6878 * @see {@link https://api.jquery.com/deferred.resolve/} 6879 * @since 1.5 6880 */ 6881 resolve(...args: TR[]): this; 6882 /** 6883 * Resolve a Deferred object and call any doneCallbacks with the given context and args. 6884 * 6885 * @param context Context passed to the doneCallbacks as the this object. 6886 * @param args An optional array of arguments that are passed to the doneCallbacks. 6887 * @see {@link https://api.jquery.com/deferred.resolveWith/} 6888 * @since 1.5 6889 */ 6890 resolveWith(context: object, args?: ArrayLike<TR>): this; 6891 6892 /** 6893 * Add handlers to be called when the Deferred object is either resolved or rejected. 6894 * 6895 * @param alwaysCallback A function, or array of functions, that is called when the Deferred is resolved or rejected. 6896 * @param alwaysCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. 6897 * @see {@link https://api.jquery.com/deferred.always/} 6898 * @since 1.6 6899 */ 6900 always(alwaysCallback: TypeOrArray<Deferred.Callback<TR | TJ>>, 6901 ...alwaysCallbacks: Array<TypeOrArray<Deferred.Callback<TR | TJ>>>): this; 6902 /** 6903 * Add handlers to be called when the Deferred object is resolved. 6904 * 6905 * @param doneCallback A function, or array of functions, that are called when the Deferred is resolved. 6906 * @param doneCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. 6907 * @see {@link https://api.jquery.com/deferred.done/} 6908 * @since 1.5 6909 */ 6910 done(doneCallback: TypeOrArray<Deferred.Callback<TR>>, 6911 ...doneCallbacks: Array<TypeOrArray<Deferred.Callback<TR>>>): this; 6912 /** 6913 * Add handlers to be called when the Deferred object is rejected. 6914 * 6915 * @param failCallback A function, or array of functions, that are called when the Deferred is rejected. 6916 * @param failCallbacks Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. 6917 * @see {@link https://api.jquery.com/deferred.fail/} 6918 * @since 1.5 6919 */ 6920 fail(failCallback: TypeOrArray<Deferred.Callback<TJ>>, 6921 ...failCallbacks: Array<TypeOrArray<Deferred.Callback<TJ>>>): this; 6922 /** 6923 * Add handlers to be called when the Deferred object generates progress notifications. 6924 * 6925 * @param progressCallback A function, or array of functions, to be called when the Deferred generates progress notifications. 6926 * @param progressCallbacks Optional additional functions, or arrays of functions, to be called when the Deferred generates 6927 * progress notifications. 6928 * @see {@link https://api.jquery.com/deferred.progress/} 6929 * @since 1.7 6930 */ 6931 progress(progressCallback: TypeOrArray<Deferred.Callback<TN>>, 6932 ...progressCallbacks: Array<TypeOrArray<Deferred.Callback<TN>>>): this; 6933 /** 6934 * Return a Deferred's Promise object. 6935 * 6936 * @param target Object onto which the promise methods have to be attached 6937 * @see {@link https://api.jquery.com/deferred.promise/} 6938 * @since 1.5 6939 */ 6940 promise<TTarget extends object>(target: TTarget): JQuery.Promise<TR, TJ, TN> & TTarget; 6941 /** 6942 * Return a Deferred's Promise object. 6943 * 6944 * @see {@link https://api.jquery.com/deferred.promise/} 6945 * @since 1.5 6946 */ 6947 promise(): JQuery.Promise<TR, TJ, TN>; 6948 /** 6949 * Determine the current state of a Deferred object. 6950 * 6951 * @see {@link https://api.jquery.com/deferred.state/} 6952 * @since 1.7 6953 */ 6954 state(): 'pending' | 'resolved' | 'rejected'; 6955 6956 // region pipe 6957 6958 /** 6959 * Utility method to filter and/or chain Deferreds. 6960 * 6961 * @param doneFilter An optional function that is called when the Deferred is resolved. 6962 * @param failFilter An optional function that is called when the Deferred is rejected. 6963 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 6964 * @see {@link https://api.jquery.com/deferred.pipe/} 6965 * @since 1.6 6966 * @since 1.7 6967 * @deprecated 1.8 6968 */ 6969 pipe<ARD = never, AJD = never, AND = never, 6970 BRD = never, BJD = never, BND = never, 6971 CRD = never, CJD = never, CND = never, 6972 RRD = never, RJD = never, RND = never, 6973 ARF = never, AJF = never, ANF = never, 6974 BRF = never, BJF = never, BNF = never, 6975 CRF = never, CJF = never, CNF = never, 6976 RRF = never, RJF = never, RNF = never, 6977 ARP = never, AJP = never, ANP = never, 6978 BRP = never, BJP = never, BNP = never, 6979 CRP = never, CJP = never, CNP = never, 6980 RRP = never, RJP = never, RNP = never> 6981 (doneFilter: (...t: TR[]) => PromiseBase<ARD, AJD, AND, 6982 BRD, BJD, BND, 6983 CRD, CJD, CND, 6984 RRD, RJD, RND> | Thenable<ARD> | ARD, 6985 failFilter: (...t: TJ[]) => PromiseBase<ARF, AJF, ANF, 6986 BRF, BJF, BNF, 6987 CRF, CJF, CNF, 6988 RRF, RJF, RNF> | Thenable<AJF> | AJF, 6989 progressFilter: (...t: TN[]) => PromiseBase<ARP, AJP, ANP, 6990 BRP, BJP, BNP, 6991 CRP, CJP, CNP, 6992 RRP, RJP, RNP> | Thenable<ANP> | ANP): PromiseBase<ARD | ARF | ARP, AJD | AJF | AJP, AND | ANF | ANP, 6993 BRD | BRF | BRP, BJD | BJF | BJP, BND | BNF | BNP, 6994 CRD | CRF | CRP, CJD | CJF | CJP, CND | CNF | CNP, 6995 RRD | RRF | RRP, RJD | RJF | RJP, RND | RNF | RNP>; 6996 /** 6997 * Utility method to filter and/or chain Deferreds. 6998 * 6999 * @param doneFilter An optional function that is called when the Deferred is resolved. 7000 * @param failFilter An optional function that is called when the Deferred is rejected. 7001 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 7002 * @see {@link https://api.jquery.com/deferred.pipe/} 7003 * @since 1.6 7004 * @since 1.7 7005 * @deprecated 1.8 7006 */ 7007 pipe<ARF = never, AJF = never, ANF = never, 7008 BRF = never, BJF = never, BNF = never, 7009 CRF = never, CJF = never, CNF = never, 7010 RRF = never, RJF = never, RNF = never, 7011 ARP = never, AJP = never, ANP = never, 7012 BRP = never, BJP = never, BNP = never, 7013 CRP = never, CJP = never, CNP = never, 7014 RRP = never, RJP = never, RNP = never> 7015 (doneFilter: null, 7016 failFilter: (...t: TJ[]) => PromiseBase<ARF, AJF, ANF, 7017 BRF, BJF, BNF, 7018 CRF, CJF, CNF, 7019 RRF, RJF, RNF> | Thenable<AJF> | AJF, 7020 progressFilter: (...t: TN[]) => PromiseBase<ARP, AJP, ANP, 7021 BRP, BJP, BNP, 7022 CRP, CJP, CNP, 7023 RRP, RJP, RNP> | Thenable<ANP> | ANP): PromiseBase<ARF | ARP, AJF | AJP, ANF | ANP, 7024 BRF | BRP, BJF | BJP, BNF | BNP, 7025 CRF | CRP, CJF | CJP, CNF | CNP, 7026 RRF | RRP, RJF | RJP, RNF | RNP>; 7027 /** 7028 * Utility method to filter and/or chain Deferreds. 7029 * 7030 * @param doneFilter An optional function that is called when the Deferred is resolved. 7031 * @param failFilter An optional function that is called when the Deferred is rejected. 7032 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 7033 * @see {@link https://api.jquery.com/deferred.pipe/} 7034 * @since 1.6 7035 * @since 1.7 7036 * @deprecated 1.8 7037 */ 7038 pipe<ARD = never, AJD = never, AND = never, 7039 BRD = never, BJD = never, BND = never, 7040 CRD = never, CJD = never, CND = never, 7041 RRD = never, RJD = never, RND = never, 7042 ARP = never, AJP = never, ANP = never, 7043 BRP = never, BJP = never, BNP = never, 7044 CRP = never, CJP = never, CNP = never, 7045 RRP = never, RJP = never, RNP = never> 7046 (doneFilter: (...t: TR[]) => PromiseBase<ARD, AJD, AND, 7047 BRD, BJD, BND, 7048 CRD, CJD, CND, 7049 RRD, RJD, RND> | Thenable<ARD> | ARD, 7050 failFilter: null, 7051 progressFilter: (...t: TN[]) => PromiseBase<ARP, AJP, ANP, 7052 BRP, BJP, BNP, 7053 CRP, CJP, CNP, 7054 RRP, RJP, RNP> | Thenable<ANP> | ANP): PromiseBase<ARD | ARP, AJD | AJP, AND | ANP, 7055 BRD | BRP, BJD | BJP, BND | BNP, 7056 CRD | CRP, CJD | CJP, CND | CNP, 7057 RRD | RRP, RJD | RJP, RND | RNP>; 7058 /** 7059 * Utility method to filter and/or chain Deferreds. 7060 * 7061 * @param doneFilter An optional function that is called when the Deferred is resolved. 7062 * @param failFilter An optional function that is called when the Deferred is rejected. 7063 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 7064 * @see {@link https://api.jquery.com/deferred.pipe/} 7065 * @since 1.6 7066 * @since 1.7 7067 * @deprecated 1.8 7068 */ 7069 pipe<ARP = never, AJP = never, ANP = never, 7070 BRP = never, BJP = never, BNP = never, 7071 CRP = never, CJP = never, CNP = never, 7072 RRP = never, RJP = never, RNP = never> 7073 (doneFilter: null, 7074 failFilter: null, 7075 progressFilter?: (...t: TN[]) => PromiseBase<ARP, AJP, ANP, 7076 BRP, BJP, BNP, 7077 CRP, CJP, CNP, 7078 RRP, RJP, RNP> | Thenable<ANP> | ANP): PromiseBase<ARP, AJP, ANP, 7079 BRP, BJP, BNP, 7080 CRP, CJP, CNP, 7081 RRP, RJP, RNP>; 7082 /** 7083 * Utility method to filter and/or chain Deferreds. 7084 * 7085 * @param doneFilter An optional function that is called when the Deferred is resolved. 7086 * @param failFilter An optional function that is called when the Deferred is rejected. 7087 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 7088 * @see {@link https://api.jquery.com/deferred.pipe/} 7089 * @since 1.6 7090 * @since 1.7 7091 * @deprecated 1.8 7092 */ 7093 pipe<ARD = never, AJD = never, AND = never, 7094 BRD = never, BJD = never, BND = never, 7095 CRD = never, CJD = never, CND = never, 7096 RRD = never, RJD = never, RND = never, 7097 ARF = never, AJF = never, ANF = never, 7098 BRF = never, BJF = never, BNF = never, 7099 CRF = never, CJF = never, CNF = never, 7100 RRF = never, RJF = never, RNF = never> 7101 (doneFilter: (...t: TR[]) => PromiseBase<ARD, AJD, AND, 7102 BRD, BJD, BND, 7103 CRD, CJD, CND, 7104 RRD, RJD, RND> | Thenable<ARD> | ARD, 7105 failFilter: (...t: TJ[]) => PromiseBase<ARF, AJF, ANF, 7106 BRF, BJF, BNF, 7107 CRF, CJF, CNF, 7108 RRF, RJF, RNF> | Thenable<AJF> | AJF, 7109 progressFilter?: null): PromiseBase<ARD | ARF, AJD | AJF, AND | ANF, 7110 BRD | BRF, BJD | BJF, BND | BNF, 7111 CRD | CRF, CJD | CJF, CND | CNF, 7112 RRD | RRF, RJD | RJF, RND | RNF>; 7113 /** 7114 * Utility method to filter and/or chain Deferreds. 7115 * 7116 * @param doneFilter An optional function that is called when the Deferred is resolved. 7117 * @param failFilter An optional function that is called when the Deferred is rejected. 7118 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 7119 * @see {@link https://api.jquery.com/deferred.pipe/} 7120 * @since 1.6 7121 * @since 1.7 7122 * @deprecated 1.8 7123 */ 7124 pipe<ARF = never, AJF = never, ANF = never, 7125 BRF = never, BJF = never, BNF = never, 7126 CRF = never, CJF = never, CNF = never, 7127 RRF = never, RJF = never, RNF = never> 7128 (doneFilter: null, 7129 failFilter: (...t: TJ[]) => PromiseBase<ARF, AJF, ANF, 7130 BRF, BJF, BNF, 7131 CRF, CJF, CNF, 7132 RRF, RJF, RNF> | Thenable<AJF> | AJF, 7133 progressFilter?: null): PromiseBase<ARF, AJF, ANF, 7134 BRF, BJF, BNF, 7135 CRF, CJF, CNF, 7136 RRF, RJF, RNF>; 7137 /** 7138 * Utility method to filter and/or chain Deferreds. 7139 * 7140 * @param doneFilter An optional function that is called when the Deferred is resolved. 7141 * @param failFilter An optional function that is called when the Deferred is rejected. 7142 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 7143 * @see {@link https://api.jquery.com/deferred.pipe/} 7144 * @since 1.6 7145 * @since 1.7 7146 * @deprecated 1.8 7147 */ 7148 pipe<ARD = never, AJD = never, AND = never, 7149 BRD = never, BJD = never, BND = never, 7150 CRD = never, CJD = never, CND = never, 7151 RRD = never, RJD = never, RND = never> 7152 (doneFilter: (...t: TR[]) => PromiseBase<ARD, AJD, AND, 7153 BRD, BJD, BND, 7154 CRD, CJD, CND, 7155 RRD, RJD, RND> | Thenable<ARD> | ARD, 7156 failFilter?: null, 7157 progressFilter?: null): PromiseBase<ARD, AJD, AND, 7158 BRD, BJD, BND, 7159 CRD, CJD, CND, 7160 RRD, RJD, RND>; 7161 7162 // endregion 7163 7164 // region then 7165 7166 /** 7167 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. 7168 * 7169 * @param doneFilter A function that is called when the Deferred is resolved. 7170 * @param failFilter An optional function that is called when the Deferred is rejected. 7171 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 7172 * @see {@link https://api.jquery.com/deferred.then/} 7173 * @since 1.8 7174 */ 7175 then<ARD = never, AJD = never, AND = never, 7176 BRD = never, BJD = never, BND = never, 7177 CRD = never, CJD = never, CND = never, 7178 RRD = never, RJD = never, RND = never, 7179 ARF = never, AJF = never, ANF = never, 7180 BRF = never, BJF = never, BNF = never, 7181 CRF = never, CJF = never, CNF = never, 7182 RRF = never, RJF = never, RNF = never, 7183 ARP = never, AJP = never, ANP = never, 7184 BRP = never, BJP = never, BNP = never, 7185 CRP = never, CJP = never, CNP = never, 7186 RRP = never, RJP = never, RNP = never> 7187 (doneFilter: (...t: TR[]) => PromiseBase<ARD, AJD, AND, 7188 BRD, BJD, BND, 7189 CRD, CJD, CND, 7190 RRD, RJD, RND> | Thenable<ARD> | ARD, 7191 failFilter: (...t: TJ[]) => PromiseBase<ARF, AJF, ANF, 7192 BRF, BJF, BNF, 7193 CRF, CJF, CNF, 7194 RRF, RJF, RNF> | Thenable<ARF> | ARF, 7195 progressFilter: (...t: TN[]) => PromiseBase<ARP, AJP, ANP, 7196 BRP, BJP, BNP, 7197 CRP, CJP, CNP, 7198 RRP, RJP, RNP> | Thenable<ANP> | ANP): PromiseBase<ARD | ARF | ARP, AJD | AJF | AJP, AND | ANF | ANP, 7199 BRD | BRF | BRP, BJD | BJF | BJP, BND | BNF | BNP, 7200 CRD | CRF | CRP, CJD | CJF | CJP, CND | CNF | CNP, 7201 RRD | RRF | RRP, RJD | RJF | RJP, RND | RNF | RNP>; 7202 /** 7203 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. 7204 * 7205 * @param doneFilter A function that is called when the Deferred is resolved. 7206 * @param failFilter An optional function that is called when the Deferred is rejected. 7207 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 7208 * @see {@link https://api.jquery.com/deferred.then/} 7209 * @since 1.8 7210 */ 7211 then<ARF = never, AJF = never, ANF = never, 7212 BRF = never, BJF = never, BNF = never, 7213 CRF = never, CJF = never, CNF = never, 7214 RRF = never, RJF = never, RNF = never, 7215 ARP = never, AJP = never, ANP = never, 7216 BRP = never, BJP = never, BNP = never, 7217 CRP = never, CJP = never, CNP = never, 7218 RRP = never, RJP = never, RNP = never> 7219 (doneFilter: null, 7220 failFilter: (...t: TJ[]) => PromiseBase<ARF, AJF, ANF, 7221 BRF, BJF, BNF, 7222 CRF, CJF, CNF, 7223 RRF, RJF, RNF> | Thenable<ARF> | ARF, 7224 progressFilter: (...t: TN[]) => PromiseBase<ARP, AJP, ANP, 7225 BRP, BJP, BNP, 7226 CRP, CJP, CNP, 7227 RRP, RJP, RNP> | Thenable<ANP> | ANP): PromiseBase<ARF | ARP, AJF | AJP, ANF | ANP, 7228 BRF | BRP, BJF | BJP, BNF | BNP, 7229 CRF | CRP, CJF | CJP, CNF | CNP, 7230 RRF | RRP, RJF | RJP, RNF | RNP>; 7231 /** 7232 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. 7233 * 7234 * @param doneFilter A function that is called when the Deferred is resolved. 7235 * @param failFilter An optional function that is called when the Deferred is rejected. 7236 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 7237 * @see {@link https://api.jquery.com/deferred.then/} 7238 * @since 1.8 7239 */ 7240 then<ARD = never, AJD = never, AND = never, 7241 BRD = never, BJD = never, BND = never, 7242 CRD = never, CJD = never, CND = never, 7243 RRD = never, RJD = never, RND = never, 7244 ARP = never, AJP = never, ANP = never, 7245 BRP = never, BJP = never, BNP = never, 7246 CRP = never, CJP = never, CNP = never, 7247 RRP = never, RJP = never, RNP = never> 7248 (doneFilter: (...t: TR[]) => PromiseBase<ARD, AJD, AND, 7249 BRD, BJD, BND, 7250 CRD, CJD, CND, 7251 RRD, RJD, RND> | Thenable<ARD> | ARD, 7252 failFilter: null, 7253 progressFilter: (...t: TN[]) => PromiseBase<ARP, AJP, ANP, 7254 BRP, BJP, BNP, 7255 CRP, CJP, CNP, 7256 RRP, RJP, RNP> | Thenable<ANP> | ANP): PromiseBase<ARD | ARP, AJD | AJP, AND | ANP, 7257 BRD | BRP, BJD | BJP, BND | BNP, 7258 CRD | CRP, CJD | CJP, CND | CNP, 7259 RRD | RRP, RJD | RJP, RND | RNP>; 7260 /** 7261 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. 7262 * 7263 * @param doneFilter A function that is called when the Deferred is resolved. 7264 * @param failFilter An optional function that is called when the Deferred is rejected. 7265 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 7266 * @see {@link https://api.jquery.com/deferred.then/} 7267 * @since 1.8 7268 */ 7269 then<ARP = never, AJP = never, ANP = never, 7270 BRP = never, BJP = never, BNP = never, 7271 CRP = never, CJP = never, CNP = never, 7272 RRP = never, RJP = never, RNP = never> 7273 (doneFilter: null, 7274 failFilter: null, 7275 progressFilter?: (...t: TN[]) => PromiseBase<ARP, AJP, ANP, 7276 BRP, BJP, BNP, 7277 CRP, CJP, CNP, 7278 RRP, RJP, RNP> | Thenable<ANP> | ANP): PromiseBase<ARP, AJP, ANP, 7279 BRP, BJP, BNP, 7280 CRP, CJP, CNP, 7281 RRP, RJP, RNP>; 7282 /** 7283 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. 7284 * 7285 * @param doneFilter An optional function that is called when the Deferred is resolved. 7286 * @param failFilter An optional function that is called when the Deferred is rejected. 7287 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 7288 * @see {@link https://api.jquery.com/deferred.then/} 7289 * @since 1.8 7290 */ 7291 then<ARD = never, AJD = never, AND = never, 7292 BRD = never, BJD = never, BND = never, 7293 CRD = never, CJD = never, CND = never, 7294 RRD = never, RJD = never, RND = never, 7295 ARF = never, AJF = never, ANF = never, 7296 BRF = never, BJF = never, BNF = never, 7297 CRF = never, CJF = never, CNF = never, 7298 RRF = never, RJF = never, RNF = never> 7299 (doneFilter: (...t: TR[]) => PromiseBase<ARD, AJD, AND, 7300 BRD, BJD, BND, 7301 CRD, CJD, CND, 7302 RRD, RJD, RND> | Thenable<ARD> | ARD, 7303 failFilter: (...t: TJ[]) => PromiseBase<ARF, AJF, ANF, 7304 BRF, BJF, BNF, 7305 CRF, CJF, CNF, 7306 RRF, RJF, RNF> | Thenable<ARF> | ARF, 7307 progressFilter?: null): PromiseBase<ARD | ARF, AJD | AJF, AND | ANF, 7308 BRD | BRF, BJD | BJF, BND | BNF, 7309 CRD | CRF, CJD | CJF, CND | CNF, 7310 RRD | RRF, RJD | RJF, RND | RNF>; 7311 /** 7312 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. 7313 * 7314 * @param doneFilter An optional function that is called when the Deferred is resolved. 7315 * @param failFilter An optional function that is called when the Deferred is rejected. 7316 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 7317 * @see {@link https://api.jquery.com/deferred.then/} 7318 * @since 1.8 7319 */ 7320 then<ARF = never, AJF = never, ANF = never, 7321 BRF = never, BJF = never, BNF = never, 7322 CRF = never, CJF = never, CNF = never, 7323 RRF = never, RJF = never, RNF = never> 7324 (doneFilter: null, 7325 failFilter: (...t: TJ[]) => PromiseBase<ARF, AJF, ANF, 7326 BRF, BJF, BNF, 7327 CRF, CJF, CNF, 7328 RRF, RJF, RNF> | Thenable<ARF> | ARF, 7329 progressFilter?: null): PromiseBase<ARF, AJF, ANF, 7330 BRF, BJF, BNF, 7331 CRF, CJF, CNF, 7332 RRF, RJF, RNF>; 7333 /** 7334 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. 7335 * 7336 * @param doneFilter An optional function that is called when the Deferred is resolved. 7337 * @param failFilter An optional function that is called when the Deferred is rejected. 7338 * @param progressFilter An optional function that is called when progress notifications are sent to the Deferred. 7339 * @see {@link https://api.jquery.com/deferred.then/} 7340 * @since 1.8 7341 */ 7342 then<ARD = never, AJD = never, AND = never, 7343 BRD = never, BJD = never, BND = never, 7344 CRD = never, CJD = never, CND = never, 7345 RRD = never, RJD = never, RND = never> 7346 (doneFilter: (...t: TR[]) => PromiseBase<ARD, AJD, AND, 7347 BRD, BJD, BND, 7348 CRD, CJD, CND, 7349 RRD, RJD, RND> | Thenable<ARD> | ARD, 7350 failFilter?: null, 7351 progressFilter?: null): PromiseBase<ARD, AJD, AND, 7352 BRD, BJD, BND, 7353 CRD, CJD, CND, 7354 RRD, RJD, RND>; 7355 7356 // endregion 7357 7358 /** 7359 * Add handlers to be called when the Deferred object is rejected. 7360 * 7361 * @param failFilter A function that is called when the Deferred is rejected. 7362 * @see {@link https://api.jquery.com/deferred.catch/} 7363 * @since 3.0 7364 */ 7365 catch<ARF = never, AJF = never, ANF = never, 7366 BRF = never, BJF = never, BNF = never, 7367 CRF = never, CJF = never, CNF = never, 7368 RRF = never, RJF = never, RNF = never> 7369 (failFilter?: ((...t: TJ[]) => PromiseBase<ARF, AJF, ANF, 7370 BRF, BJF, BNF, 7371 CRF, CJF, CNF, 7372 RRF, RJF, RNF> | Thenable<ARF> | ARF) | null): PromiseBase<ARF, AJF, ANF, 7373 BRF, BJF, BNF, 7374 CRF, CJF, CNF, 7375 RRF, RJF, RNF>; 7376 } 7377 7378 namespace Deferred { 7379 interface CallbackBase<T, U, V, R> { 7380 (t: T, u: U, v: V, ...r: R[]): void; 7381 } 7382 7383 interface Callback3<T, U, V> extends CallbackBase<T, U, V, never> { } 7384 7385 interface Callback<T> { 7386 (...args: T[]): void; 7387 } 7388 7389 /** 7390 * @deprecated 7391 */ 7392 interface DoneCallback<TResolve> extends Callback<TResolve> { } 7393 7394 /** 7395 * @deprecated 7396 */ 7397 interface FailCallback<TReject> extends Callback<TReject> { } 7398 7399 /** 7400 * @deprecated 7401 */ 7402 interface AlwaysCallback<TResolve, TReject> extends Callback<TResolve | TReject> { } 7403 7404 /** 7405 * @deprecated 7406 */ 7407 interface ProgressCallback<TNotify> extends Callback<TNotify> { } 7408 } 7409 7410 // endregion 7411 7412 // region Effects 7413 7414 type Duration = number | 'fast' | 'slow'; 7415 // TODO: Is the first element always a string or is that specific to the 'fx' queue? 7416 type Queue<TElement> = { 0: string; } & Array<QueueFunction<TElement>>; 7417 7418 interface QueueFunction<TElement> { 7419 (this: TElement, next: () => void): void; 7420 } 7421 7422 /** 7423 * @see {@link https://api.jquery.com/animate/#animate-properties-options} 7424 */ 7425 interface EffectsOptions<TElement> { 7426 /** 7427 * A function to be called when the animation on an element completes or stops without completing (its 7428 * Promise object is either resolved or rejected). 7429 */ 7430 always?(this: TElement, animation: JQuery.Promise<any>, jumpedToEnd: boolean): void; 7431 /** 7432 * A function that is called once the animation on an element is complete. 7433 */ 7434 complete?(this: TElement): void; 7435 /** 7436 * A function to be called when the animation on an element completes (its Promise object is resolved). 7437 */ 7438 done?(this: TElement, animation: JQuery.Promise<any>, jumpedToEnd: boolean): void; 7439 /** 7440 * A string or number determining how long the animation will run. 7441 */ 7442 duration?: Duration; 7443 /** 7444 * A string indicating which easing function to use for the transition. 7445 */ 7446 easing?: string; 7447 /** 7448 * A function to be called when the animation on an element fails to complete (its Promise object is rejected). 7449 */ 7450 fail?(this: TElement, animation: JQuery.Promise<any>, jumpedToEnd: boolean): void; 7451 /** 7452 * A function to be called after each step of the animation, only once per animated element regardless 7453 * of the number of animated properties. 7454 */ 7455 progress?(this: TElement, animation: JQuery.Promise<any>, progress: number, remainingMs: number): void; 7456 /** 7457 * A Boolean indicating whether to place the animation in the effects queue. If false, the animation 7458 * will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case 7459 * the animation is added to the queue represented by that string. When a custom queue name is used the 7460 * animation does not automatically start; you must call .dequeue("queuename") to start it. 7461 */ 7462 queue?: boolean | string; 7463 /** 7464 * An object containing one or more of the CSS properties defined by the properties argument and their 7465 * corresponding easing functions. 7466 */ 7467 specialEasing?: PlainObject<string>; 7468 /** 7469 * A function to call when the animation on an element begins. 7470 */ 7471 start?(this: TElement, animation: JQuery.Promise<any>): void; 7472 /** 7473 * A function to be called for each animated property of each animated element. This function provides 7474 * an opportunity to modify the Tween object to change the value of the property before it is set. 7475 */ 7476 step?(this: TElement, now: number, tween: Tween<TElement>): void; 7477 } 7478 7479 interface SpeedSettings<TElement> { 7480 /** 7481 * A string or number determining how long the animation will run. 7482 */ 7483 duration?: Duration; 7484 /** 7485 * A string indicating which easing function to use for the transition. 7486 */ 7487 easing?: string; 7488 /** 7489 * A function to call once the animation is complete. 7490 */ 7491 complete?(this: TElement): void; 7492 } 7493 7494 // This should be a class but doesn't work correctly under the JQuery namespace. Tween should be an inner class of jQuery. 7495 // Undocumented 7496 // https://github.com/jquery/api.jquery.com/issues/391 7497 // https://github.com/jquery/api.jquery.com/issues/61 7498 interface Tween<TElement> { 7499 easing: string; 7500 elem: TElement; 7501 end: number; 7502 now: number; 7503 options: EffectsOptions<TElement>; 7504 pos: number; 7505 prop: string; 7506 start: number; 7507 unit: string; 7508 } 7509 7510 interface AnimationHook<TElement> { 7511 (fx: JQuery.Tween<TElement>): void; 7512 } 7513 7514 // endregion 7515 7516 // region Events 7517 7518 // region Event 7519 7520 // This should be a class but doesn't work correctly under the JQuery namespace. Event should be an inner class of jQuery. 7521 7522 // Static members 7523 interface EventStatic<TTarget = EventTarget> { 7524 <T extends object>(event: string, properties?: T): JQuery.Event<TTarget> & T; 7525 <T extends EventLike>(properties: T): JQuery.Event<TTarget> & T; 7526 new <T extends object>(event: string, properties?: T): JQuery.Event<TTarget> & T; 7527 new <T extends EventLike>(properties: T): JQuery.Event<TTarget> & T; 7528 } 7529 7530 // Instance members 7531 interface Event { 7532 /** 7533 * Indicates whether the META key was pressed when the event fired. 7534 * 7535 * @see {@link https://api.jquery.com/event.metaKey/} 7536 * @since 1.0.4 7537 */ 7538 metaKey: boolean; 7539 /** 7540 * The namespace specified when the event was triggered. 7541 * 7542 * @see {@link https://api.jquery.com/event.namespace/} 7543 * @since 1.4.3 7544 */ 7545 namespace: string; 7546 /** 7547 * The mouse position relative to the left edge of the document. 7548 * 7549 * @see {@link https://api.jquery.com/event.pageX/} 7550 * @since 1.0.4 7551 */ 7552 pageX: number; 7553 /** 7554 * The mouse position relative to the top edge of the document. 7555 * 7556 * @see {@link https://api.jquery.com/event.pageY/} 7557 * @since 1.0.4 7558 */ 7559 pageY: number; 7560 /** 7561 * The last value returned by an event handler that was triggered by this event, unless the value was undefined. 7562 * 7563 * @see {@link https://api.jquery.com/event.result/} 7564 * @since 1.3 7565 */ 7566 result: any; 7567 /** 7568 * The difference in milliseconds between the time the browser created the event and January 1, 1970. 7569 * 7570 * @see {@link https://api.jquery.com/event.timeStamp/} 7571 * @since 1.2.6 7572 */ 7573 timeStamp: number; 7574 /** 7575 * Describes the nature of the event. 7576 * 7577 * @see {@link https://api.jquery.com/event.type/} 7578 * @since 1.0 7579 */ 7580 type: string; 7581 /** 7582 * For key or mouse events, this property indicates the specific key or button that was pressed. 7583 * 7584 * @see {@link https://api.jquery.com/event.which/} 7585 * @since 1.1.3 7586 */ 7587 which: number; 7588 /** 7589 * Returns whether event.preventDefault() was ever called on this event object. 7590 * 7591 * @see {@link https://api.jquery.com/event.isDefaultPrevented/} 7592 * @since 1.3 7593 */ 7594 isDefaultPrevented(): boolean; 7595 /** 7596 * Returns whether event.stopImmediatePropagation() was ever called on this event object. 7597 * 7598 * @see {@link https://api.jquery.com/event.isImmediatePropagationStopped/} 7599 * @since 1.3 7600 */ 7601 isImmediatePropagationStopped(): boolean; 7602 /** 7603 * Returns whether event.stopPropagation() was ever called on this event object. 7604 * 7605 * @see {@link https://api.jquery.com/event.isPropagationStopped/} 7606 * @since 1.3 7607 */ 7608 isPropagationStopped(): boolean; 7609 /** 7610 * If this method is called, the default action of the event will not be triggered. 7611 * 7612 * @see {@link https://api.jquery.com/event.preventDefault/} 7613 * @since 1.0 7614 */ 7615 preventDefault(): void; 7616 /** 7617 * Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree. 7618 * 7619 * @see {@link https://api.jquery.com/event.stopImmediatePropagation/} 7620 * @since 1.3 7621 */ 7622 stopImmediatePropagation(): void; 7623 /** 7624 * Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. 7625 * 7626 * @see {@link https://api.jquery.com/event.stopPropagation/} 7627 * @since 1.0 7628 */ 7629 stopPropagation(): void; 7630 } 7631 7632 // Generic members 7633 interface Event<TTarget = EventTarget, 7634 TData = null> extends Partial<Pick<PointerEvent & KeyboardEvent & TouchEvent, 'altKey' | 'bubbles' | 'cancelable' | 7635 'changedTouches' | 'ctrlKey' | 'detail' | 'eventPhase' | 'metaKey' | 'pageX' | 'pageY' | 'shiftKey' | 'view' | 7636 'char' | 'charCode' | 'key' | 'keyCode' | 'button' | 'buttons' | 'clientX' | 'clientY' | 'offsetX' | 'offsetY' | 7637 'pointerId' | 'pointerType' | 'screenX' | 'screenY' | 'targetTouches' | 'toElement' | 'touches'>> { 7638 /** 7639 * The current DOM element within the event bubbling phase. 7640 * 7641 * @see {@link https://api.jquery.com/event.currentTarget/} 7642 * @since 1.3 7643 */ 7644 currentTarget: TTarget; 7645 /** 7646 * An optional object of data passed to an event method when the current executing handler is bound. 7647 * 7648 * @see {@link https://api.jquery.com/event.data/} 7649 * @since 1.1 7650 */ 7651 data: TData; 7652 /** 7653 * The element where the currently-called jQuery event handler was attached. 7654 * 7655 * @see {@link https://api.jquery.com/event.delegateTarget/} 7656 * @since 1.7 7657 */ 7658 delegateTarget: TTarget; 7659 originalEvent: _Event; 7660 /** 7661 * The other DOM element involved in the event, if any. 7662 * 7663 * @see {@link https://api.jquery.com/event.relatedTarget/} 7664 * @since 1.1.4 7665 */ 7666 relatedTarget: TTarget | null; 7667 /** 7668 * The DOM element that initiated the event. 7669 * 7670 * @see {@link https://api.jquery.com/event.target/} 7671 * @since 1.0 7672 */ 7673 target: TTarget; 7674 } 7675 7676 interface EventLike { 7677 type: string; 7678 } 7679 7680 // endregion 7681 7682 interface EventHandler<TCurrentTarget extends EventTarget, TData = null> extends EventHandlerBase<TCurrentTarget, JQuery.Event<TCurrentTarget, TData>> { } 7683 7684 interface EventHandlerBase<TContext extends object, T> { 7685 // Extra parameters can be passed from trigger() 7686 (this: TContext, t: T, ...args: any[]): void | false | any; 7687 } 7688 7689 // Provided for convenience for use with jQuery.Event.which 7690 const enum Mouse { 7691 None = 0, 7692 Left = 1, 7693 Middle = 2, 7694 Right = 3 7695 } 7696 7697 // Provided for convenience for use with jQuery.Event.which 7698 const enum Key { 7699 Backspace = 8, 7700 Tab = 9, 7701 Enter = 13, 7702 Shift = 16, 7703 Control = 17, 7704 Alt = 18, 7705 CapsLock = 20, 7706 Escape = 27, 7707 Space = 32, 7708 PageUp = 33, 7709 PageDown = 34, 7710 End = 35, 7711 Home = 36, 7712 ArrowLeft = 37, 7713 ArrowUp = 38, 7714 ArrowRight = 39, 7715 ArrowDown = 40, 7716 7717 Semicolon = 186, 7718 Colon = 186, 7719 EqualsSign = 187, 7720 Plus = 187, 7721 Comma = 188, 7722 LessThanSign = 188, 7723 Minus = 189, 7724 Underscore = 189, 7725 Period = 190, 7726 GreaterThanSign = 190, 7727 ForwardSlash = 191, 7728 QuestionMark = 191, 7729 Backtick = 192, 7730 Tilde = 192, 7731 OpeningSquareBracket = 219, 7732 OpeningCurlyBrace = 219, 7733 Backslash = 220, 7734 Pipe = 220, 7735 ClosingSquareBracket = 221, 7736 ClosingCurlyBrace = 221, 7737 SingleQuote = 222, 7738 DoubleQuote = 222, 7739 7740 Pause = 19, 7741 PrintScreen = 44, 7742 Insert = 45, 7743 Delete = 46, 7744 Num0 = 48, 7745 Num1 = 49, 7746 Num2 = 50, 7747 Num3 = 51, 7748 Num4 = 52, 7749 Num5 = 53, 7750 Num6 = 54, 7751 Num7 = 55, 7752 Num8 = 56, 7753 Num9 = 57, 7754 A = 65, 7755 B = 66, 7756 C = 67, 7757 D = 68, 7758 E = 69, 7759 F = 70, 7760 G = 71, 7761 H = 72, 7762 I = 73, 7763 J = 74, 7764 K = 75, 7765 L = 76, 7766 M = 77, 7767 N = 78, 7768 O = 79, 7769 P = 80, 7770 Q = 81, 7771 R = 82, 7772 S = 83, 7773 T = 84, 7774 U = 85, 7775 V = 86, 7776 W = 87, 7777 X = 88, 7778 Y = 89, 7779 Z = 90, 7780 MetaLeft = 91, 7781 MetaRight = 92, 7782 ContextMenu = 93, 7783 Numpad0 = 96, 7784 Numpad1 = 97, 7785 Numpad2 = 98, 7786 Numpad3 = 99, 7787 Numpad4 = 100, 7788 Numpad5 = 101, 7789 Numpad6 = 102, 7790 Numpad7 = 103, 7791 Numpad8 = 104, 7792 Numpad9 = 105, 7793 NumpadMultiply = 106, 7794 NumpadAdd = 107, 7795 NumpadSubtract = 109, 7796 NumpadDecimal = 110, 7797 NumpadDivide = 111, 7798 F1 = 112, 7799 F2 = 113, 7800 F3 = 114, 7801 F4 = 115, 7802 F5 = 116, 7803 F6 = 117, 7804 F7 = 118, 7805 F8 = 119, 7806 F9 = 120, 7807 F10 = 121, 7808 F11 = 122, 7809 F12 = 123, 7810 NumLock = 144, 7811 ScrollLock = 145 7812 } 7813 7814 // endregion 7815 7816 interface NameValuePair { 7817 name: string; 7818 value: string; 7819 } 7820 7821 interface Coordinates { 7822 left: number; 7823 top: number; 7824 } 7825 7826 interface ValHook<TElement> { 7827 get?(elem: TElement): any; 7828 set?(elem: TElement, value: any): any; 7829 } 7830 } 7831 7832 // region Legacy types 7833 7834 interface JQueryCallback extends JQuery.Callbacks<Function> { } 7835 interface JQueryDeferred<T> extends JQuery.Deferred<T> { } 7836 interface JQueryEventConstructor extends JQuery.Event<EventTarget> { } 7837 interface JQueryDeferred<T> extends JQuery.Deferred<T> { } 7838 interface JQueryAjaxSettings extends JQuery.AjaxSettings { } 7839 interface JQueryAnimationOptions extends JQuery.EffectsOptions<Element> { } 7840 interface JQueryCoordinates extends JQuery.Coordinates { } 7841 interface JQueryGenericPromise<T> extends JQuery.Thenable<T> { } 7842 interface JQueryXHR extends JQuery.jqXHR { } 7843 interface JQueryPromise<T> extends JQuery.Promise<T> { } 7844 interface JQuerySerializeArrayElement extends JQuery.NameValuePair { } 7845 7846 /** 7847 * @deprecated 1.9 7848 */ 7849 interface JQuerySupport extends JQuery.PlainObject { } 7850 7851 // Legacy types that are not represented in the current type definitions are marked deprecated. 7852 7853 /** 7854 * @deprecated 7855 */ 7856 interface JQueryPromiseCallback<T> { 7857 (value?: T, ...args: any[]): void; 7858 } 7859 /** 7860 * @deprecated 7861 */ 7862 interface JQueryParam { 7863 /** 7864 * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. 7865 * 7866 * @param obj An array or object to serialize. 7867 * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. 7868 */ 7869 (obj: any, traditional?: boolean): string; 7870 } 7871 /** 7872 * @deprecated 7873 */ 7874 interface BaseJQueryEventObject extends Event { 7875 /** 7876 * The current DOM element within the event bubbling phase. 7877 * @see {@link https://api.jquery.com/event.currentTarget/} 7878 */ 7879 currentTarget: Element; 7880 /** 7881 * An optional object of data passed to an event method when the current executing handler is bound. 7882 * @see {@link https://api.jquery.com/event.data/} 7883 */ 7884 data: any; 7885 /** 7886 * The element where the currently-called jQuery event handler was attached. 7887 * @see {@link https://api.jquery.com/event.delegateTarget/} 7888 */ 7889 delegateTarget: Element; 7890 /** 7891 * Returns whether event.preventDefault() was ever called on this event object. 7892 * @see {@link https://api.jquery.com/event.isDefaultPrevented/} 7893 */ 7894 isDefaultPrevented(): boolean; 7895 /** 7896 * Returns whether event.stopImmediatePropagation() was ever called on this event object. 7897 * @see {@link https://api.jquery.com/event.isImmediatePropagationStopped/} 7898 */ 7899 isImmediatePropagationStopped(): boolean; 7900 /** 7901 * Returns whether event.stopPropagation() was ever called on this event object. 7902 * @see {@link https://api.jquery.com/event.isPropagationStopped/} 7903 */ 7904 isPropagationStopped(): boolean; 7905 /** 7906 * The namespace specified when the event was triggered. 7907 * @see {@link https://api.jquery.com/event.namespace/} 7908 */ 7909 namespace: string; 7910 /** 7911 * The browser's original Event object. 7912 * @see {@link https://api.jquery.com/category/events/event-object/} 7913 */ 7914 originalEvent: Event; 7915 /** 7916 * If this method is called, the default action of the event will not be triggered. 7917 * @see {@link https://api.jquery.com/event.preventDefault/} 7918 */ 7919 preventDefault(): any; 7920 /** 7921 * The other DOM element involved in the event, if any. 7922 * @see {@link https://api.jquery.com/event.relatedTarget/} 7923 */ 7924 relatedTarget: Element; 7925 /** 7926 * The last value returned by an event handler that was triggered by this event, unless the value was undefined. 7927 * @see {@link https://api.jquery.com/event.result/} 7928 */ 7929 result: any; 7930 /** 7931 * Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree. 7932 * @see {@link https://api.jquery.com/event.stopImmediatePropagation/} 7933 */ 7934 stopImmediatePropagation(): void; 7935 /** 7936 * Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. 7937 * @see {@link https://api.jquery.com/event.stopPropagation/} 7938 */ 7939 stopPropagation(): void; 7940 /** 7941 * The DOM element that initiated the event. 7942 * @see {@link https://api.jquery.com/event.target/} 7943 */ 7944 target: Element; 7945 /** 7946 * The mouse position relative to the left edge of the document. 7947 * @see {@link https://api.jquery.com/event.pageX/} 7948 */ 7949 pageX: number; 7950 /** 7951 * The mouse position relative to the top edge of the document. 7952 * @see {@link https://api.jquery.com/event.pageY/} 7953 */ 7954 pageY: number; 7955 /** 7956 * For key or mouse events, this property indicates the specific key or button that was pressed. 7957 * @see {@link https://api.jquery.com/event.which/} 7958 */ 7959 which: number; 7960 /** 7961 * Indicates whether the META key was pressed when the event fired. 7962 * @see {@link https://api.jquery.com/event.metaKey/} 7963 */ 7964 metaKey: boolean; 7965 } 7966 /** 7967 * @deprecated 7968 */ 7969 interface JQueryInputEventObject extends BaseJQueryEventObject { 7970 altKey: boolean; 7971 ctrlKey: boolean; 7972 metaKey: boolean; 7973 shiftKey: boolean; 7974 } 7975 /** 7976 * @deprecated 7977 */ 7978 interface JQueryMouseEventObject extends JQueryInputEventObject { 7979 button: number; 7980 clientX: number; 7981 clientY: number; 7982 offsetX: number; 7983 offsetY: number; 7984 pageX: number; 7985 pageY: number; 7986 screenX: number; 7987 screenY: number; 7988 } 7989 /** 7990 * @deprecated 7991 */ 7992 interface JQueryKeyEventObject extends JQueryInputEventObject { 7993 char: any; 7994 charCode: number; 7995 key: any; 7996 keyCode: number; 7997 } 7998 /** 7999 * @deprecated 8000 */ 8001 interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject { } 8002 /** 8003 * @deprecated 8004 */ 8005 interface JQueryPromiseOperator<T, U> { 8006 (callback1: JQuery.TypeOrArray<JQueryPromiseCallback<T>>, 8007 ...callbacksN: Array<JQuery.TypeOrArray<JQueryPromiseCallback<any>>>): JQueryPromise<U>; 8008 } 8009 /** 8010 * @deprecated 8011 */ 8012 interface JQueryEasingFunction { 8013 (percent: number): number; 8014 } 8015 /** 8016 * @deprecated 8017 */ 8018 interface JQueryEasingFunctions { 8019 [name: string]: JQueryEasingFunction; 8020 linear: JQueryEasingFunction; 8021 swing: JQueryEasingFunction; 8022 } 8023 8024 // endregion