bosun.org@v0.0.0-20210513094433-e25bc3e69a1f/cmd/bosun/web/static/js/jquery.d.ts (about) 1 // Type definitions for jQuery 1.10.x / 2.0.x 2 // Project: http://jquery.com/ 3 // Definitions by: Boris Yankov <https://github.com/borisyankov/>, Christian Hoffmeister <https://github.com/choffmeister>, Steve Fenton, Diullei Gomes <https://github.com/Diullei>, Tass Iliopoulos <https://github.com/tasoili>, Jason Swearingen, Sean Hill <https://github.com/seanski>, Guus Goossens <https://github.com/Guuz>, Kelly Summerlin <https://github.com/ksummerlin>, Basarat Ali Syed <https://github.com/basarat>, Nicholas Wolverson <https://github.com/nwolverson>, Derek Cicerone <https://github.com/derekcicerone>, Andrew Gaspar <https://github.com/AndrewGaspar>, James Harrison Fisher <https://github.com/jameshfisher>, Seikichi Kondo <https://github.com/seikichi>, Benjamin Jackman <https://github.com/benjaminjackman>, Poul Sorensen <https://github.com/s093294>, Josh Strobl <https://github.com/JoshStrobl>, John Reilly <https://github.com/johnnyreilly/> 4 // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 6 /* ***************************************************************************** 7 Copyright (c) Microsoft Corporation. All rights reserved. 8 Licensed under the Apache License, Version 2.0 (the "License"); you may not use 9 this file except in compliance with the License. You may obtain a copy of the 10 License at http://www.apache.org/licenses/LICENSE-2.0 11 12 THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 14 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 15 MERCHANTABLITY OR NON-INFRINGEMENT. 16 17 See the Apache Version 2.0 License for specific language governing permissions 18 and limitations under the License. 19 ***************************************************************************** */ 20 21 /** 22 * Interface for the AJAX setting that will configure the AJAX request 23 */ 24 interface JQueryAjaxSettings { 25 /** 26 * The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. 27 */ 28 accepts?: any; 29 /** 30 * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success(). 31 */ 32 async?: boolean; 33 /** 34 * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. 35 */ 36 beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any; 37 /** 38 * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET. 39 */ 40 cache?: boolean; 41 /** 42 * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. 43 */ 44 complete? (jqXHR: JQueryXHR, textStatus: string): any; 45 /** 46 * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5) 47 */ 48 contents?: { [key: string]: any; }; 49 //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false" 50 // https://github.com/borisyankov/DefinitelyTyped/issues/742 51 /** 52 * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. 53 */ 54 contentType?: any; 55 /** 56 * This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). 57 */ 58 context?: any; 59 /** 60 * An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. (version added: 1.5) 61 */ 62 converters?: { [key: string]: any; }; 63 /** 64 * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. (version added: 1.5) 65 */ 66 crossDomain?: boolean; 67 /** 68 * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). 69 */ 70 data?: any; 71 /** 72 * A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. 73 */ 74 dataFilter? (data: any, ty: any): any; 75 /** 76 * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). 77 */ 78 dataType?: string; 79 /** 80 * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. 81 */ 82 error? (jqXHR: JQueryXHR, textStatus: string, errorThrow: string): any; 83 /** 84 * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. 85 */ 86 global?: boolean; 87 /** 88 * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5) 89 */ 90 headers?: { [key: string]: any; }; 91 /** 92 * Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. 93 */ 94 ifModified?: boolean; 95 /** 96 * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. (version added: 1.5.1) 97 */ 98 isLocal?: boolean; 99 /** 100 * Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" } 101 */ 102 jsonp?: any; 103 /** 104 * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function. 105 */ 106 jsonpCallback?: any; 107 /** 108 * A mime type to override the XHR mime type. (version added: 1.5.1) 109 */ 110 mimeType?: string; 111 /** 112 * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. 113 */ 114 password?: string; 115 /** 116 * By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false. 117 */ 118 processData?: boolean; 119 /** 120 * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. 121 */ 122 scriptCharset?: string; 123 /** 124 * An object of numeric HTTP codes and functions to be called when the response has the corresponding code. f the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. (version added: 1.5) 125 */ 126 statusCode?: { [key: string]: any; }; 127 /** 128 * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. 129 */ 130 success? (data: any, textStatus: string, jqXHR: JQueryXHR): any; 131 /** 132 * Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. 133 */ 134 timeout?: number; 135 /** 136 * Set this to true if you wish to use the traditional style of param serialization. 137 */ 138 traditional?: boolean; 139 /** 140 * The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers. 141 */ 142 type?: string; 143 /** 144 * A string containing the URL to which the request is sent. 145 */ 146 url?: string; 147 /** 148 * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. 149 */ 150 username?: string; 151 /** 152 * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory. 153 */ 154 xhr?: any; 155 /** 156 * An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. (version added: 1.5.1) 157 */ 158 xhrFields?: { [key: string]: any; }; 159 } 160 161 /** 162 * Interface for the jqXHR object 163 */ 164 interface JQueryXHR extends XMLHttpRequest, JQueryPromise<any> { 165 /** 166 * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). 167 */ 168 overrideMimeType(mimeType: string): any; 169 abort(statusText?: string): void; 170 } 171 172 /** 173 * Interface for the JQuery callback 174 */ 175 interface JQueryCallback { 176 /** 177 * Add a callback or a collection of callbacks to a callback list. 178 * 179 * @param callbacks A function, or array of functions, that are to be added to the callback list. 180 */ 181 add(callbacks: Function): JQueryCallback; 182 /** 183 * Add a callback or a collection of callbacks to a callback list. 184 * 185 * @param callbacks A function, or array of functions, that are to be added to the callback list. 186 */ 187 add(callbacks: Function[]): JQueryCallback; 188 189 /** 190 * Disable a callback list from doing anything more. 191 */ 192 disable(): JQueryCallback; 193 194 /** 195 * Determine if the callbacks list has been disabled. 196 */ 197 disabled(): boolean; 198 199 /** 200 * Remove all of the callbacks from a list. 201 */ 202 empty(): JQueryCallback; 203 204 /** 205 * Call all of the callbacks with the given arguments 206 * 207 * @param arguments The argument or list of arguments to pass back to the callback list. 208 */ 209 fire(...arguments: any[]): JQueryCallback; 210 211 /** 212 * Determine if the callbacks have already been called at least once. 213 */ 214 fired(): boolean; 215 216 /** 217 * Call all callbacks in a list with the given context and arguments. 218 * 219 * @param context A reference to the context in which the callbacks in the list should be fired. 220 * @param arguments An argument, or array of arguments, to pass to the callbacks in the list. 221 */ 222 fireWith(context?: any, ...args: any[]): JQueryCallback; 223 224 /** 225 * Determine whether a supplied callback is in a list 226 * 227 * @param callback The callback to search for. 228 */ 229 has(callback: Function): boolean; 230 231 /** 232 * Lock a callback list in its current state. 233 */ 234 lock(): JQueryCallback; 235 236 /** 237 * Determine if the callbacks list has been locked. 238 */ 239 locked(): boolean; 240 241 /** 242 * Remove a callback or a collection of callbacks from a callback list. 243 * 244 * @param callbacks A function, or array of functions, that are to be removed from the callback list. 245 */ 246 remove(callbacks: Function): JQueryCallback; 247 /** 248 * Remove a callback or a collection of callbacks from a callback list. 249 * 250 * @param callbacks A function, or array of functions, that are to be removed from the callback list. 251 */ 252 remove(callbacks: Function[]): JQueryCallback; 253 } 254 255 /* 256 Allows jQuery Promises to interop with non-jQuery promises 257 */ 258 interface JQueryGenericPromise<T> { 259 then<U>(onFulfill: (value: T) => U, onReject?: (reason: any) => U): JQueryGenericPromise<U>; 260 then<U>(onFulfill: (value: T) => JQueryGenericPromise<U>, onReject?: (reason: any) => U): JQueryGenericPromise<U>; 261 then<U>(onFulfill: (value: T) => U, onReject?: (reason: any) => JQueryGenericPromise<U>): JQueryGenericPromise<U>; 262 then<U>(onFulfill: (value: T) => JQueryGenericPromise<U>, onReject?: (reason: any) => JQueryGenericPromise<U>): JQueryGenericPromise<U>; 263 } 264 265 /* 266 Interface for the JQuery promise, part of callbacks 267 */ 268 interface JQueryPromise<T> { 269 // Generic versions of callbacks 270 always(...alwaysCallbacks: T[]): JQueryPromise<T>; 271 done(...doneCallbacks: T[]): JQueryPromise<T>; 272 fail(...failCallbacks: T[]): JQueryPromise<T>; 273 progress(...progressCallbacks: T[]): JQueryPromise<T>; 274 275 always(...alwaysCallbacks: any[]): JQueryPromise<T>; 276 done(...doneCallbacks: any[]): JQueryPromise<T>; 277 fail(...failCallbacks: any[]): JQueryPromise<T>; 278 progress(...progressCallbacks: any[]): JQueryPromise<T>; 279 280 // Deprecated - given no typings 281 pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>; 282 283 then<U>(onFulfill: (value: T) => U, onReject?: (...reasons: any[]) => U, onProgress?: (...progression: any[]) => any): JQueryPromise<U>; 284 then<U>(onFulfill: (value: T) => JQueryGenericPromise<U>, onReject?: (...reasons: any[]) => U, onProgress?: (...progression: any[]) => any): JQueryPromise<U>; 285 then<U>(onFulfill: (value: T) => U, onReject?: (...reasons: any[]) => JQueryGenericPromise<U>, onProgress?: (...progression: any[]) => any): JQueryPromise<U>; 286 then<U>(onFulfill: (value: T) => JQueryGenericPromise<U>, onReject?: (...reasons: any[]) => JQueryGenericPromise<U>, onProgress?: (...progression: any[]) => any): JQueryPromise<U>; 287 288 // Because JQuery Promises Suck 289 then<U>(onFulfill: (...values: any[]) => U, onReject?: (...reasons: any[]) => U, onProgress?: (...progression: any[]) => any): JQueryPromise<U>; 290 then<U>(onFulfill: (...values: any[]) => JQueryGenericPromise<U>, onReject?: (...reasons: any[]) => U, onProgress?: (...progression: any[]) => any): JQueryPromise<U>; 291 then<U>(onFulfill: (...values: any[]) => U, onReject?: (...reasons: any[]) => JQueryGenericPromise<U>, onProgress?: (...progression: any[]) => any): JQueryPromise<U>; 292 then<U>(onFulfill: (...values: any[]) => JQueryGenericPromise<U>, onReject?: (...reasons: any[]) => JQueryGenericPromise<U>, onProgress?: (...progression: any[]) => any): JQueryPromise<U>; 293 } 294 295 /* 296 Interface for the JQuery deferred, part of callbacks 297 */ 298 interface JQueryDeferred<T> extends JQueryPromise<T> { 299 // Generic versions of callbacks 300 always(...alwaysCallbacks: T[]): JQueryDeferred<T>; 301 done(...doneCallbacks: T[]): JQueryDeferred<T>; 302 fail(...failCallbacks: T[]): JQueryDeferred<T>; 303 progress(...progressCallbacks: T[]): JQueryDeferred<T>; 304 305 always(...alwaysCallbacks: any[]): JQueryDeferred<T>; 306 done(...doneCallbacks: any[]): JQueryDeferred<T>; 307 fail(...failCallbacks: any[]): JQueryDeferred<T>; 308 progress(...progressCallbacks: any[]): JQueryDeferred<T>; 309 310 notify(...args: any[]): JQueryDeferred<T>; 311 notifyWith(context: any, ...args: any[]): JQueryDeferred<T>; 312 313 reject(...args: any[]): JQueryDeferred<T>; 314 rejectWith(context: any, ...args: any[]): JQueryDeferred<T>; 315 316 resolve(val: T): JQueryDeferred<T>; 317 resolve(...args: any[]): JQueryDeferred<T>; 318 resolveWith(context: any, ...args: any[]): JQueryDeferred<T>; 319 state(): string; 320 321 promise(target?: any): JQueryPromise<T>; 322 } 323 324 /* 325 Interface of the JQuery extension of the W3C event object 326 */ 327 328 interface BaseJQueryEventObject extends Event { 329 data: any; 330 delegateTarget: Element; 331 isDefaultPrevented(): boolean; 332 isImmediatePropogationStopped(): boolean; 333 isPropagationStopped(): boolean; 334 namespace: string; 335 preventDefault(): any; 336 relatedTarget: Element; 337 result: any; 338 stopImmediatePropagation(): void; 339 stopPropagation(): void; 340 pageX: number; 341 pageY: number; 342 which: number; 343 metaKey: boolean; 344 } 345 346 interface JQueryInputEventObject extends BaseJQueryEventObject { 347 altKey: boolean; 348 ctrlKey: boolean; 349 metaKey: boolean; 350 shiftKey: boolean; 351 } 352 353 interface JQueryMouseEventObject extends JQueryInputEventObject { 354 button: number; 355 clientX: number; 356 clientY: number; 357 offsetX: number; 358 offsetY: number; 359 pageX: number; 360 pageY: number; 361 screenX: number; 362 screenY: number; 363 } 364 365 interface JQueryKeyEventObject extends JQueryInputEventObject { 366 char: any; 367 charCode: number; 368 key: any; 369 keyCode: number; 370 } 371 372 interface JQueryPopStateEventObject extends BaseJQueryEventObject { 373 originalEvent: PopStateEvent; 374 } 375 376 interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject, JQueryPopStateEventObject { 377 } 378 379 /* 380 Collection of properties of the current browser 381 */ 382 383 interface JQuerySupport { 384 ajax?: boolean; 385 boxModel?: boolean; 386 changeBubbles?: boolean; 387 checkClone?: boolean; 388 checkOn?: boolean; 389 cors?: boolean; 390 cssFloat?: boolean; 391 hrefNormalized?: boolean; 392 htmlSerialize?: boolean; 393 leadingWhitespace?: boolean; 394 noCloneChecked?: boolean; 395 noCloneEvent?: boolean; 396 opacity?: boolean; 397 optDisabled?: boolean; 398 optSelected?: boolean; 399 scriptEval? (): boolean; 400 style?: boolean; 401 submitBubbles?: boolean; 402 tbody?: boolean; 403 } 404 405 interface JQueryParam { 406 /** 407 * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. 408 * 409 * @param obj An array or object to serialize. 410 */ 411 (obj: any): string; 412 413 /** 414 * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. 415 * 416 * @param obj An array or object to serialize. 417 * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. 418 */ 419 (obj: any, traditional: boolean): string; 420 } 421 422 /** 423 * The interface used to construct jQuery events (with $.Event). It is 424 * defined separately instead of inline in JQueryStatic to allow 425 * overriding the construction function with specific strings 426 * returning specific event objects. 427 */ 428 interface JQueryEventConstructor { 429 (name: string, eventProperties?: any): JQueryEventObject; 430 new (name: string, eventProperties?: any): JQueryEventObject; 431 } 432 433 /** 434 * The interface used to specify coordinates. 435 */ 436 interface JQueryCoordinates { 437 left: number; 438 top: number; 439 } 440 441 interface JQueryAnimationOptions { 442 /** 443 * A string or number determining how long the animation will run. 444 */ 445 duration?: any; 446 /** 447 * A string indicating which easing function to use for the transition. 448 */ 449 easing?: string; 450 /** 451 * A function to call once the animation is complete. 452 */ 453 complete?: Function; 454 /** 455 * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set. 456 */ 457 step?: (now: number, tween: any) => any; 458 /** 459 * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8) 460 */ 461 progress?: (animation: JQueryPromise<any>, progress: number, remainingMs: number) => any; 462 /** 463 * A function to call when the animation begins. (version added: 1.8) 464 */ 465 start?: (animation: JQueryPromise<any>) => any; 466 /** 467 * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8) 468 */ 469 done?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any; 470 /** 471 * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8) 472 */ 473 fail?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any; 474 /** 475 * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8) 476 */ 477 always?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any; 478 /** 479 * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it. 480 */ 481 queue?: any; 482 /** 483 * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4) 484 */ 485 specialEasing?: Object; 486 } 487 488 /** 489 * The interface used to specify easing functions. 490 */ 491 interface JQueryEasing { 492 linear(p: number): number; 493 swing(p: number): number; 494 } 495 496 /** 497 * Static members of jQuery (those on $ and jQuery themselves) 498 */ 499 interface JQueryStatic { 500 501 /** 502 * Perform an asynchronous HTTP (Ajax) request. 503 * 504 * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). 505 */ 506 ajax(settings: JQueryAjaxSettings): JQueryXHR; 507 /** 508 * Perform an asynchronous HTTP (Ajax) request. 509 * 510 * @param url A string containing the URL to which the request is sent. 511 * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). 512 */ 513 ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR; 514 515 /** 516 * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). 517 * 518 * @param dataTypes An optional string containing one or more space-separated dataTypes 519 * @param handler A handler to set default values for future Ajax requests. 520 */ 521 ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; 522 /** 523 * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). 524 * 525 * @param handler A handler to set default values for future Ajax requests. 526 */ 527 ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; 528 529 ajaxSettings: JQueryAjaxSettings; 530 531 /** 532 * Set default values for future Ajax requests. Its use is not recommended. 533 * 534 * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. 535 */ 536 ajaxSetup(options: JQueryAjaxSettings): void; 537 538 /** 539 * Load data from the server using a HTTP GET request. 540 * 541 * @param url A string containing the URL to which the request is sent. 542 * @param success A callback function that is executed if the request succeeds. 543 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). 544 */ 545 get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; 546 /** 547 * Load data from the server using a HTTP GET request. 548 * 549 * @param url A string containing the URL to which the request is sent. 550 * @param data A plain object or string that is sent to the server with the request. 551 * @param success A callback function that is executed if the request succeeds. 552 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). 553 */ 554 get(url: string, data?: Object, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; 555 /** 556 * Load data from the server using a HTTP GET request. 557 * 558 * @param url A string containing the URL to which the request is sent. 559 * @param data A plain object or string that is sent to the server with the request. 560 * @param success A callback function that is executed if the request succeeds. 561 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). 562 */ 563 get(url: string, data?: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; 564 /** 565 * Load JSON-encoded data from the server using a GET HTTP request. 566 * 567 * @param url A string containing the URL to which the request is sent. 568 * @param success A callback function that is executed if the request succeeds. 569 */ 570 getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; 571 /** 572 * Load JSON-encoded data from the server using a GET HTTP request. 573 * 574 * @param url A string containing the URL to which the request is sent. 575 * @param data A plain object or string that is sent to the server with the request. 576 * @param success A callback function that is executed if the request succeeds. 577 */ 578 getJSON(url: string, data?: Object, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; 579 /** 580 * Load JSON-encoded data from the server using a GET HTTP request. 581 * 582 * @param url A string containing the URL to which the request is sent. 583 * @param data A plain object or string that is sent to the server with the request. 584 * @param success A callback function that is executed if the request succeeds. 585 */ 586 getJSON(url: string, data?: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; 587 /** 588 * Load a JavaScript file from the server using a GET HTTP request, then execute it. 589 * 590 * @param url A string containing the URL to which the request is sent. 591 * @param success A callback function that is executed if the request succeeds. 592 */ 593 getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; 594 595 /** 596 * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. 597 */ 598 param: JQueryParam; 599 600 /** 601 * Load data from the server using a HTTP POST request. 602 * 603 * @param url A string containing the URL to which the request is sent. 604 * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. 605 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). 606 */ 607 post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; 608 /** 609 * Load data from the server using a HTTP POST request. 610 * 611 * @param url A string containing the URL to which the request is sent. 612 * @param data A plain object or string that is sent to the server with the request. 613 * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. 614 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). 615 */ 616 post(url: string, data?: Object, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; 617 /** 618 * Load data from the server using a HTTP POST request. 619 * 620 * @param url A string containing the URL to which the request is sent. 621 * @param data A plain object or string that is sent to the server with the request. 622 * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. 623 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). 624 */ 625 post(url: string, data?: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; 626 627 /** 628 * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. 629 * 630 * @param flags An optional list of space-separated flags that change how the callback list behaves. 631 */ 632 Callbacks(flags?: string): JQueryCallback; 633 634 /** 635 * Holds or releases the execution of jQuery's ready event. 636 * 637 * @param hold Indicates whether the ready hold is being requested or released 638 */ 639 holdReady(hold: boolean): void; 640 641 /** 642 * Accepts a string containing a CSS selector which is then used to match a set of elements. 643 * 644 * @param selector A string containing a selector expression 645 * @param context A DOM Element, Document, or jQuery to use as context 646 */ 647 (selector: string, context?: Element): JQuery; 648 /** 649 * Accepts a string containing a CSS selector which is then used to match a set of elements. 650 * 651 * @param selector A string containing a selector expression 652 * @param context A DOM Element, Document, or jQuery to use as context 653 */ 654 (selector: string, context?: JQuery): JQuery; 655 /** 656 * Accepts a string containing a CSS selector which is then used to match a set of elements. 657 * 658 * @param element A DOM element to wrap in a jQuery object. 659 */ 660 (element: Element): JQuery; 661 /** 662 * Accepts a string containing a CSS selector which is then used to match a set of elements. 663 * 664 * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object. 665 */ 666 (elementArray: Element[]): JQuery; 667 /** 668 * Accepts a string containing a CSS selector which is then used to match a set of elements. 669 * 670 * @param object A plain object to wrap in a jQuery object. 671 */ 672 (object: {}): JQuery; 673 /** 674 * Accepts a string containing a CSS selector which is then used to match a set of elements. 675 * 676 * @param object An existing jQuery object to clone. 677 */ 678 (object: JQuery): JQuery; 679 /** 680 * Specify a function to execute when the DOM is fully loaded. 681 */ 682 (): JQuery; 683 684 /** 685 * Creates DOM elements on the fly from the provided string of raw HTML. 686 * 687 * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML. 688 * @param ownerDocument A document in which the new elements will be created. 689 */ 690 (html: string, ownerDocument?: Document): JQuery; 691 /** 692 * Creates DOM elements on the fly from the provided string of raw HTML. 693 * 694 * @param html A string defining a single, standalone, HTML element (e.g. <div/> or <div></div>). 695 * @param attributes An object of attributes, events, and methods to call on the newly-created element. 696 */ 697 (html: string, attributes: Object): JQuery; 698 699 /** 700 * Binds a function to be executed when the DOM has finished loading. 701 * 702 * @param callback A function to execute after the DOM is ready. 703 */ 704 (callback: Function): JQuery; 705 706 /** 707 * Relinquish jQuery's control of the $ variable. 708 * 709 * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). 710 */ 711 noConflict(removeAll?: boolean): Object; 712 713 /** 714 * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. 715 * 716 * @param deferreds One or more Deferred objects, or plain JavaScript objects. 717 */ 718 when<T>(...deferreds: JQueryGenericPromise<T>[]): JQueryPromise<T>; 719 /** 720 * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. 721 * 722 * @param deferreds One or more Deferred objects, or plain JavaScript objects. 723 */ 724 when<T>(...deferreds: T[]): JQueryPromise<T>; 725 /** 726 * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. 727 * 728 * @param deferreds One or more Deferred objects, or plain JavaScript objects. 729 */ 730 when<T>(...deferreds: any[]): JQueryPromise<T>; 731 732 /** 733 * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties. 734 */ 735 cssHooks: { [key: string]: any; }; 736 cssNumber: any; 737 738 /** 739 * Store arbitrary data associated with the specified element. Returns the value that was set. 740 * 741 * @param element The DOM element to associate with the data. 742 * @param key A string naming the piece of data to set. 743 * @param value The new data value. 744 */ 745 data<T>(element: Element, key: string, value: T): T; 746 /** 747 * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. 748 * 749 * @param element The DOM element to associate with the data. 750 * @param key A string naming the piece of data to set. 751 */ 752 data(element: Element, key: string): any; 753 /** 754 * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. 755 * 756 * @param element The DOM element to associate with the data. 757 */ 758 data(element: Element): any; 759 760 /** 761 * Execute the next function on the queue for the matched element. 762 * 763 * @param element A DOM element from which to remove and execute a queued function. 764 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. 765 */ 766 dequeue(element: Element, queueName?: string): void; 767 768 /** 769 * Determine whether an element has any jQuery data associated with it. 770 * 771 * @param element A DOM element to be checked for data. 772 */ 773 hasData(element: Element): boolean; 774 775 /** 776 * Show the queue of functions to be executed on the matched element. 777 * 778 * @param element A DOM element to inspect for an attached queue. 779 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. 780 */ 781 queue(element: Element, queueName?: string): any[]; 782 /** 783 * Manipulate the queue of functions to be executed on the matched element. 784 * 785 * @param element A DOM element where the array of queued functions is attached. 786 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. 787 * @param newQueue An array of functions to replace the current queue contents. 788 */ 789 queue(element: Element, queueName: string, newQueue: Function[]): JQuery; 790 /** 791 * Manipulate the queue of functions to be executed on the matched element. 792 * 793 * @param element A DOM element on which to add a queued function. 794 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. 795 * @param callback The new function to add to the queue. 796 */ 797 queue(element: Element, queueName: string, callback: Function): JQuery; 798 799 /** 800 * Remove a previously-stored piece of data. 801 * 802 * @param element A DOM element from which to remove data. 803 * @param name A string naming the piece of data to remove. 804 */ 805 removeData(element: Element, name?: string): JQuery; 806 807 /** 808 * A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function. 809 * 810 * @param beforeStart A function that is called just before the constructor returns. 811 */ 812 Deferred<T>(beforeStart?: (deferred: JQueryDeferred<T>) => any): JQueryDeferred<T>; 813 814 /** 815 * Effects 816 */ 817 fx: { 818 tick: () => void; 819 /** 820 * The rate (in milliseconds) at which animations fire. 821 */ 822 interval: number; 823 stop: () => void; 824 speeds: { slow: number; fast: number; }; 825 /** 826 * Globally disable all animations. 827 */ 828 off: boolean; 829 step: any; 830 }; 831 832 /** 833 * Takes a function and returns a new one that will always have a particular context. 834 * 835 * @param fnction The function whose context will be changed. 836 * @param context The object to which the context (this) of the function should be set. 837 * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. 838 */ 839 proxy(fnction: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any; 840 /** 841 * Takes a function and returns a new one that will always have a particular context. 842 * 843 * @param context The object to which the context (this) of the function should be set. 844 * @param name The name of the function whose context will be changed (should be a property of the context object). 845 * @param additionalArguments Any number of arguments to be passed to the function named in the name argument. 846 */ 847 proxy(context: Object, name: string, ...additionalArguments: any[]): any; 848 849 Event: JQueryEventConstructor; 850 851 /** 852 * Takes a string and throws an exception containing it. 853 * 854 * @param message The message to send out. 855 */ 856 error(message: any): JQuery; 857 858 expr: any; 859 fn: any; //TODO: Decide how we want to type this 860 861 isReady: boolean; 862 863 // Properties 864 support: JQuerySupport; 865 866 /** 867 * Check to see if a DOM element is a descendant of another DOM element. 868 * 869 * @param container The DOM element that may contain the other element. 870 * @param contained The DOM element that may be contained by (a descendant of) the other element. 871 */ 872 contains(container: Element, contained: Element): boolean; 873 874 /** 875 * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. 876 * 877 * @param collection The object or array to iterate over. 878 * @param callback The function that will be executed on every object. 879 */ 880 each<T>( 881 collection: T[], 882 callback: (indexInArray: number, valueOfElement: T) => any 883 ): any; 884 885 /** 886 * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. 887 * 888 * @param collection The object or array to iterate over. 889 * @param callback The function that will be executed on every object. 890 */ 891 each( 892 collection: any, 893 callback: (indexInArray: any, valueOfElement: any) => any 894 ): any; 895 896 /** 897 * Merge the contents of two or more objects together into the first object. 898 * 899 * @param target An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument. 900 * @param object1 An object containing additional properties to merge in. 901 * @param objectN Additional objects containing properties to merge in. 902 */ 903 extend(target: any, object1?: any, ...objectN: any[]): any; 904 /** 905 * Merge the contents of two or more objects together into the first object. 906 * 907 * @param deep If true, the merge becomes recursive (aka. deep copy). 908 * @param target The object to extend. It will receive the new properties. 909 * @param object1 An object containing additional properties to merge in. 910 * @param objectN Additional objects containing properties to merge in. 911 */ 912 extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any; 913 914 /** 915 * Execute some JavaScript code globally. 916 * 917 * @param code The JavaScript code to execute. 918 */ 919 globalEval(code: string): any; 920 921 /** 922 * Finds the elements of an array which satisfy a filter function. The original array is not affected. 923 * 924 * @param array The array to search through. 925 * @param func The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object. 926 * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false. 927 */ 928 grep<T>(array: T[], func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[]; 929 930 /** 931 * Search for a specified value within an array and return its index (or -1 if not found). 932 * 933 * @param value The value to search for. 934 * @param array An array through which to search. 935 * @param fromIndex he index of the array at which to begin the search. The default is 0, which will search the whole array. 936 */ 937 inArray<T>(value: T, array: T[], fromIndex?: number): number; 938 939 /** 940 * Determine whether the argument is an array. 941 * 942 * @param obj Object to test whether or not it is an array. 943 */ 944 isArray(obj: any): boolean; 945 /** 946 * Check to see if an object is empty (contains no enumerable properties). 947 * 948 * @param obj The object that will be checked to see if it's empty. 949 */ 950 isEmptyObject(obj: any): boolean; 951 /** 952 * Determine if the argument passed is a Javascript function object. 953 * 954 * @param obj Object to test whether or not it is a function. 955 */ 956 isFunction(obj: any): boolean; 957 /** 958 * Determines whether its argument is a number. 959 * 960 * @param obj The value to be tested. 961 */ 962 isNumeric(value: any): boolean; 963 /** 964 * Check to see if an object is a plain object (created using "{}" or "new Object"). 965 * 966 * @param obj The object that will be checked to see if it's a plain object. 967 */ 968 isPlainObject(obj: any): boolean; 969 /** 970 * Determine whether the argument is a window. 971 * 972 * @param obj Object to test whether or not it is a window. 973 */ 974 isWindow(obj: any): boolean; 975 /** 976 * Check to see if a DOM node is within an XML document (or is an XML document). 977 * 978 * @param node he DOM node that will be checked to see if it's in an XML document. 979 */ 980 isXMLDoc(node: Node): boolean; 981 982 /** 983 * Convert an array-like object into a true JavaScript array. 984 * 985 * @param obj Any object to turn into a native Array. 986 */ 987 makeArray(obj: any): any[]; 988 989 /** 990 * Translate all items in an array or object to new array of items. 991 * 992 * @param array The Array to translate. 993 * @param callback The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object. 994 */ 995 map<T, U>(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[]; 996 /** 997 * Translate all items in an array or object to new array of items. 998 * 999 * @param arrayOrObject The Array or Object to translate. 1000 * @param callback The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. 1001 */ 1002 map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any; 1003 1004 /** 1005 * Merge the contents of two arrays together into the first array. 1006 * 1007 * @param first The first array to merge, the elements of second added. 1008 * @param second The second array to merge into the first, unaltered. 1009 */ 1010 merge<T>(first: T[], second: T[]): T[]; 1011 1012 /** 1013 * An empty function. 1014 */ 1015 noop(): any; 1016 1017 /** 1018 * Return a number representing the current time. 1019 */ 1020 now(): number; 1021 1022 /** 1023 * Takes a well-formed JSON string and returns the resulting JavaScript object. 1024 * 1025 * @param json The JSON string to parse. 1026 */ 1027 parseJSON(json: string): Object; 1028 1029 /** 1030 * Parses a string into an XML document. 1031 * 1032 * @param data a well-formed XML string to be parsed 1033 */ 1034 parseXML(data: string): XMLDocument; 1035 1036 /** 1037 * Remove the whitespace from the beginning and end of a string. 1038 * 1039 * @param str Remove the whitespace from the beginning and end of a string. 1040 */ 1041 trim(str: string): string; 1042 1043 /** 1044 * Determine the internal JavaScript [[Class]] of an object. 1045 * 1046 * @param obj Object to get the internal JavaScript [[Class]] of. 1047 */ 1048 type(obj: any): string; 1049 1050 /** 1051 * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. 1052 * 1053 * @param array The Array of DOM elements. 1054 */ 1055 unique(array: Element[]): Element[]; 1056 1057 /** 1058 * Parses a string into an array of DOM nodes. 1059 * 1060 * @param data HTML string to be parsed 1061 * @param context DOM element to serve as the context in which the HTML fragment will be created 1062 * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string 1063 */ 1064 parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[]; 1065 } 1066 1067 /** 1068 * The jQuery instance members 1069 */ 1070 interface JQuery { 1071 /** 1072 * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. 1073 * 1074 * @param handler The function to be invoked. 1075 */ 1076 ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery; 1077 /** 1078 * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. 1079 * 1080 * @param handler The function to be invoked. 1081 */ 1082 ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery; 1083 /** 1084 * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. 1085 * 1086 * @param handler The function to be invoked. 1087 */ 1088 ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery; 1089 /** 1090 * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. 1091 * 1092 * @param handler The function to be invoked. 1093 */ 1094 ajaxStart(handler: () => any): JQuery; 1095 /** 1096 * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. 1097 * 1098 * @param handler The function to be invoked. 1099 */ 1100 ajaxStop(handler: () => any): JQuery; 1101 /** 1102 * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. 1103 * 1104 * @param handler The function to be invoked. 1105 */ 1106 ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery; 1107 1108 /** 1109 * Load data from the server and place the returned HTML into the matched element. 1110 * 1111 * @param url A string containing the URL to which the request is sent. 1112 * @param data A plain object or string that is sent to the server with the request. 1113 * @param complete A callback function that is executed when the request completes. 1114 */ 1115 load(url: string, data?: string, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery; 1116 /** 1117 * Load data from the server and place the returned HTML into the matched element. 1118 * 1119 * @param url A string containing the URL to which the request is sent. 1120 * @param data A plain object or string that is sent to the server with the request. 1121 * @param complete A callback function that is executed when the request completes. 1122 */ 1123 load(url: string, data?: Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery; 1124 1125 /** 1126 * Encode a set of form elements as a string for submission. 1127 */ 1128 serialize(): string; 1129 /** 1130 * Encode a set of form elements as an array of names and values. 1131 */ 1132 serializeArray(): Object[]; 1133 1134 /** 1135 * Adds the specified class(es) to each of the set of matched elements. 1136 * 1137 * @param className One or more space-separated classes to be added to the class attribute of each matched element. 1138 */ 1139 addClass(className: string): JQuery; 1140 /** 1141 * Adds the specified class(es) to each of the set of matched elements. 1142 * 1143 * @param function A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. 1144 */ 1145 addClass(func: (index: number, className: string) => string): JQuery; 1146 1147 /** 1148 * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. 1149 */ 1150 addBack(selector?: string): JQuery; 1151 1152 /** 1153 * Get the value of an attribute for the first element in the set of matched elements. 1154 * 1155 * @param attributeName The name of the attribute to get. 1156 */ 1157 attr(attributeName: string): string; 1158 /** 1159 * Set one or more attributes for the set of matched elements. 1160 * 1161 * @param attributeName The name of the attribute to set. 1162 * @param value A value to set for the attribute. 1163 */ 1164 attr(attributeName: string, value: string): JQuery; 1165 /** 1166 * Set one or more attributes for the set of matched elements. 1167 * 1168 * @param attributeName The name of the attribute to set. 1169 * @param value A value to set for the attribute. 1170 */ 1171 attr(attributeName: string, value: number): JQuery; 1172 /** 1173 * Set one or more attributes for the set of matched elements. 1174 * 1175 * @param attributeName The name of the attribute to set. 1176 * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments. 1177 */ 1178 attr(attributeName: string, func: (index: number, attr: any) => any): JQuery; 1179 /** 1180 * Set one or more attributes for the set of matched elements. 1181 * 1182 * @param attributes An object of attribute-value pairs to set. 1183 */ 1184 attr(attributes: Object): JQuery; 1185 1186 /** 1187 * Determine whether any of the matched elements are assigned the given class. 1188 * 1189 * @param className The class name to search for. 1190 */ 1191 hasClass(className: string): boolean; 1192 1193 /** 1194 * Get the HTML contents of the first element in the set of matched elements. 1195 */ 1196 html(): string; 1197 /** 1198 * Set the HTML contents of each element in the set of matched elements. 1199 * 1200 * @param htmlString A string of HTML to set as the content of each matched element. 1201 */ 1202 html(htmlString: string): JQuery; 1203 /** 1204 * Set the HTML contents of each element in the set of matched elements. 1205 * 1206 * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. 1207 */ 1208 html(func: (index: number, oldhtml: string) => string): JQuery; 1209 /** 1210 * Set the HTML contents of each element in the set of matched elements. 1211 * 1212 * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. 1213 */ 1214 1215 /** 1216 * Get the value of a property for the first element in the set of matched elements. 1217 * 1218 * @param propertyName The name of the property to get. 1219 */ 1220 prop(propertyName: string): any; 1221 /** 1222 * Set one or more properties for the set of matched elements. 1223 * 1224 * @param propertyName The name of the property to set. 1225 * @param value A value to set for the property. 1226 */ 1227 prop(propertyName: string, value: string): JQuery; 1228 /** 1229 * Set one or more properties for the set of matched elements. 1230 * 1231 * @param propertyName The name of the property to set. 1232 * @param value A value to set for the property. 1233 */ 1234 prop(propertyName: string, value: number): JQuery; 1235 /** 1236 * Set one or more properties for the set of matched elements. 1237 * 1238 * @param propertyName The name of the property to set. 1239 * @param value A value to set for the property. 1240 */ 1241 prop(propertyName: string, value: boolean): JQuery; 1242 /** 1243 * Set one or more properties for the set of matched elements. 1244 * 1245 * @param properties An object of property-value pairs to set. 1246 */ 1247 prop(properties: Object): JQuery; 1248 /** 1249 * Set one or more properties for the set of matched elements. 1250 * 1251 * @param propertyName The name of the property to set. 1252 * @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element. 1253 */ 1254 prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery; 1255 1256 /** 1257 * Remove an attribute from each element in the set of matched elements. 1258 * 1259 * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. 1260 */ 1261 removeAttr(attributeName: string): JQuery; 1262 1263 /** 1264 * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. 1265 * 1266 * @param className One or more space-separated classes to be removed from the class attribute of each matched element. 1267 */ 1268 removeClass(className?: string): JQuery; 1269 /** 1270 * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. 1271 * 1272 * @param function A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. 1273 */ 1274 removeClass(func: (index: number, className: string) => string): JQuery; 1275 1276 /** 1277 * Remove a property for the set of matched elements. 1278 * 1279 * @param propertyName The name of the property to remove. 1280 */ 1281 removeProp(propertyName: string): JQuery; 1282 1283 /** 1284 * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. 1285 * 1286 * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. 1287 * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. 1288 */ 1289 toggleClass(className: string, swtch?: boolean): JQuery; 1290 /** 1291 * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. 1292 * 1293 * @param swtch A boolean value to determine whether the class should be added or removed. 1294 */ 1295 toggleClass(swtch?: boolean): JQuery; 1296 /** 1297 * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. 1298 * 1299 * @param func A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments. 1300 * @param swtch A boolean value to determine whether the class should be added or removed. 1301 */ 1302 toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery; 1303 1304 /** 1305 * Get the current value of the first element in the set of matched elements. 1306 */ 1307 val(): any; 1308 /** 1309 * Set the value of each element in the set of matched elements. 1310 * 1311 * @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked. 1312 */ 1313 val(value: string): JQuery; 1314 /** 1315 * Set the value of each element in the set of matched elements. 1316 * 1317 * @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked. 1318 */ 1319 val(value: string[]): JQuery; 1320 /** 1321 * Set the value of each element in the set of matched elements. 1322 * 1323 * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. 1324 */ 1325 val(func: (index: number, value: any) => any): JQuery; 1326 1327 /** 1328 * Get the value of style properties for the first element in the set of matched elements. 1329 * 1330 * @param propertyName A CSS property. 1331 */ 1332 css(propertyName: string): string; 1333 /** 1334 * Set one or more CSS properties for the set of matched elements. 1335 * 1336 * @param propertyName A CSS property name. 1337 * @param value A value to set for the property. 1338 */ 1339 css(propertyName: string, value: string): JQuery; 1340 /** 1341 * Set one or more CSS properties for the set of matched elements. 1342 * 1343 * @param propertyName A CSS property name. 1344 * @param value A value to set for the property. 1345 */ 1346 css(propertyName: string, value: number): JQuery; 1347 /** 1348 * Set one or more CSS properties for the set of matched elements. 1349 * 1350 * @param propertyName A CSS property name. 1351 * @param value A value to set for the property. 1352 */ 1353 css(propertyName: string, value: string[]): JQuery; 1354 /** 1355 * Set one or more CSS properties for the set of matched elements. 1356 * 1357 * @param propertyName A CSS property name. 1358 * @param value A value to set for the property. 1359 */ 1360 css(propertyName: string, value: number[]): JQuery; 1361 /** 1362 * Set one or more CSS properties for the set of matched elements. 1363 * 1364 * @param propertyName A CSS property name. 1365 * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. 1366 */ 1367 css(propertyName: string, value: (index: number, value: string) => string): JQuery; 1368 /** 1369 * Set one or more CSS properties for the set of matched elements. 1370 * 1371 * @param propertyName A CSS property name. 1372 * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. 1373 */ 1374 css(propertyName: string, value: (index: number, value: number) => number): JQuery; 1375 /** 1376 * Set one or more CSS properties for the set of matched elements. 1377 * 1378 * @param properties An object of property-value pairs to set. 1379 */ 1380 css(properties: Object): JQuery; 1381 1382 /** 1383 * Get the current computed height for the first element in the set of matched elements. 1384 */ 1385 height(): number; 1386 /** 1387 * Set the CSS height of every matched element. 1388 * 1389 * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string). 1390 */ 1391 height(value: number): JQuery; 1392 /** 1393 * Set the CSS height of every matched element. 1394 * 1395 * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string). 1396 */ 1397 height(value: string): JQuery; 1398 /** 1399 * Set the CSS height of every matched element. 1400 * 1401 * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. 1402 */ 1403 height(func: (index: number, height: number) => number): JQuery; 1404 /** 1405 * Set the CSS height of every matched element. 1406 * 1407 * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. 1408 */ 1409 height(func: (index: number, height: string) => string): JQuery; 1410 /** 1411 * Set the CSS height of every matched element. 1412 * 1413 * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. 1414 */ 1415 height(func: (index: number, height: string) => number): JQuery; 1416 /** 1417 * Set the CSS height of every matched element. 1418 * 1419 * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. 1420 */ 1421 height(func: (index: number, height: number) => string): JQuery; 1422 1423 /** 1424 * Get the current computed height for the first element in the set of matched elements, including padding but not border. 1425 */ 1426 innerHeight(): number; 1427 1428 /** 1429 * Get the current computed width for the first element in the set of matched elements, including padding but not border. 1430 */ 1431 innerWidth(): number; 1432 1433 /** 1434 * Get the current coordinates of the first element in the set of matched elements, relative to the document. 1435 */ 1436 offset(): JQueryCoordinates; 1437 /** 1438 * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. 1439 * 1440 * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. 1441 */ 1442 offset(coordinates: JQueryCoordinates): JQuery; 1443 /** 1444 * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. 1445 * 1446 * @param func A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties. 1447 */ 1448 offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery; 1449 1450 /** 1451 * Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements. 1452 * 1453 * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. 1454 */ 1455 outerHeight(includeMargin?: boolean): number; 1456 1457 /** 1458 * Get the current computed width for the first element in the set of matched elements, including padding and border. 1459 * 1460 * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. 1461 */ 1462 outerWidth(includeMargin?: boolean): number; 1463 1464 /** 1465 * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. 1466 */ 1467 position(): JQueryCoordinates; 1468 1469 /** 1470 * Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element. 1471 */ 1472 scrollLeft(): number; 1473 /** 1474 * Set the current horizontal position of the scroll bar for each of the set of matched elements. 1475 * 1476 * @param value An integer indicating the new position to set the scroll bar to. 1477 */ 1478 scrollLeft(value: number): JQuery; 1479 1480 /** 1481 * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element. 1482 */ 1483 scrollTop(): number; 1484 /** 1485 * Set the current vertical position of the scroll bar for each of the set of matched elements. 1486 * 1487 * @param value An integer indicating the new position to set the scroll bar to. 1488 */ 1489 scrollTop(value: number): JQuery; 1490 1491 /** 1492 * Get the current computed width for the first element in the set of matched elements. 1493 */ 1494 width(): number; 1495 /** 1496 * Set the CSS width of each element in the set of matched elements. 1497 * 1498 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). 1499 */ 1500 width(value: number): JQuery; 1501 /** 1502 * Set the CSS width of each element in the set of matched elements. 1503 * 1504 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). 1505 */ 1506 width(value: string): JQuery; 1507 /** 1508 * Set the CSS width of each element in the set of matched elements. 1509 * 1510 * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. 1511 */ 1512 width(func: (index: number, width: number) => number): JQuery; 1513 /** 1514 * Set the CSS width of each element in the set of matched elements. 1515 * 1516 * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. 1517 */ 1518 width(func: (index: number, width: string) => string): JQuery; 1519 /** 1520 * Set the CSS width of each element in the set of matched elements. 1521 * 1522 * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. 1523 */ 1524 width(func: (index: number, width: string) => number): JQuery; 1525 /** 1526 * Set the CSS width of each element in the set of matched elements. 1527 * 1528 * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. 1529 */ 1530 width(func: (index: number, width: number) => string): JQuery; 1531 1532 /** 1533 * Remove from the queue all items that have not yet been run. 1534 * 1535 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. 1536 */ 1537 clearQueue(queueName?: string): JQuery; 1538 1539 /** 1540 * Store arbitrary data associated with the matched elements. 1541 * 1542 * @param key A string naming the piece of data to set. 1543 * @param value The new data value; it can be any Javascript type including Array or Object. 1544 */ 1545 data(key: string, value: any): JQuery; 1546 /** 1547 * Store arbitrary data associated with the matched elements. 1548 * 1549 * @param obj An object of key-value pairs of data to update. 1550 */ 1551 data(obj: { [key: string]: any; }): JQuery; 1552 /** 1553 * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. 1554 * 1555 * @param key Name of the data stored. 1556 */ 1557 data(key: string): any; 1558 /** 1559 * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. 1560 */ 1561 data(): any; 1562 1563 /** 1564 * Execute the next function on the queue for the matched elements. 1565 * 1566 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. 1567 */ 1568 dequeue(queueName?: string): JQuery; 1569 1570 /** 1571 * Remove a previously-stored piece of data. 1572 * 1573 * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete. 1574 */ 1575 removeData(name: string): JQuery; 1576 /** 1577 * Remove a previously-stored piece of data. 1578 * 1579 * @param list An array of strings naming the pieces of data to delete. 1580 */ 1581 removeData(list: string[]): JQuery; 1582 1583 /** 1584 * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. 1585 * 1586 * @param type The type of queue that needs to be observed. (default: fx) 1587 * @param target Object onto which the promise methods have to be attached 1588 */ 1589 promise(type?: string, target?: Object): JQueryPromise<any>; 1590 1591 /** 1592 * Perform a custom animation of a set of CSS properties. 1593 * 1594 * @param properties An object of CSS properties and values that the animation will move toward. 1595 * @param duration A string or number determining how long the animation will run. 1596 * @param complete A function to call once the animation is complete. 1597 */ 1598 animate(properties: Object, duration?: string, complete?: Function): JQuery; 1599 /** 1600 * Perform a custom animation of a set of CSS properties. 1601 * 1602 * @param properties An object of CSS properties and values that the animation will move toward. 1603 * @param duration A string or number determining how long the animation will run. 1604 * @param complete A function to call once the animation is complete. 1605 */ 1606 animate(properties: Object, duration?: number, complete?: Function): JQuery; 1607 /** 1608 * Perform a custom animation of a set of CSS properties. 1609 * 1610 * @param properties An object of CSS properties and values that the animation will move toward. 1611 * @param duration A string or number determining how long the animation will run. 1612 * @param easing A string indicating which easing function to use for the transition. (default: swing) 1613 * @param complete A function to call once the animation is complete. 1614 */ 1615 animate(properties: Object, duration?: string, easing?: string, complete?: Function): JQuery; 1616 /** 1617 * Perform a custom animation of a set of CSS properties. 1618 * 1619 * @param properties An object of CSS properties and values that the animation will move toward. 1620 * @param duration A string or number determining how long the animation will run. 1621 * @param easing A string indicating which easing function to use for the transition. (default: swing) 1622 * @param complete A function to call once the animation is complete. 1623 */ 1624 animate(properties: Object, duration?: number, easing?: string, complete?: Function): JQuery; 1625 /** 1626 * Perform a custom animation of a set of CSS properties. 1627 * 1628 * @param properties An object of CSS properties and values that the animation will move toward. 1629 * @param options A map of additional options to pass to the method. 1630 */ 1631 animate(properties: Object, options: JQueryAnimationOptions): JQuery; 1632 1633 /** 1634 * Set a timer to delay execution of subsequent items in the queue. 1635 * 1636 * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. 1637 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. 1638 */ 1639 delay(duration: number, queueName?: string): JQuery; 1640 1641 /** 1642 * Display the matched elements by fading them to opaque. 1643 * 1644 * @param duration A string or number determining how long the animation will run. 1645 * @param complete A function to call once the animation is complete. 1646 */ 1647 fadeIn(duration?: number, complete?: Function): JQuery; 1648 /** 1649 * Display the matched elements by fading them to opaque. 1650 * 1651 * @param duration A string or number determining how long the animation will run. 1652 * @param complete A function to call once the animation is complete. 1653 */ 1654 fadeIn(duration?: string, complete?: Function): JQuery; 1655 /** 1656 * Display the matched elements by fading them to opaque. 1657 * 1658 * @param duration A string or number determining how long the animation will run. 1659 * @param easing A string indicating which easing function to use for the transition. 1660 * @param complete A function to call once the animation is complete. 1661 */ 1662 fadeIn(duration?: number, easing?: string, complete?: Function): JQuery; 1663 /** 1664 * Display the matched elements by fading them to opaque. 1665 * 1666 * @param duration A string or number determining how long the animation will run. 1667 * @param easing A string indicating which easing function to use for the transition. 1668 * @param complete A function to call once the animation is complete. 1669 */ 1670 fadeIn(duration?: string, easing?: string, complete?: Function): JQuery; 1671 /** 1672 * Display the matched elements by fading them to opaque. 1673 * 1674 * @param options A map of additional options to pass to the method. 1675 */ 1676 fadeIn(options: JQueryAnimationOptions): JQuery; 1677 1678 /** 1679 * Hide the matched elements by fading them to transparent. 1680 * 1681 * @param duration A string or number determining how long the animation will run. 1682 * @param complete A function to call once the animation is complete. 1683 */ 1684 fadeOut(duration?: number, complete?: Function): JQuery; 1685 /** 1686 * Hide the matched elements by fading them to transparent. 1687 * 1688 * @param duration A string or number determining how long the animation will run. 1689 * @param complete A function to call once the animation is complete. 1690 */ 1691 fadeOut(duration?: string, complete?: Function): JQuery; 1692 /** 1693 * Hide the matched elements by fading them to transparent. 1694 * 1695 * @param duration A string or number determining how long the animation will run. 1696 * @param easing A string indicating which easing function to use for the transition. 1697 * @param complete A function to call once the animation is complete. 1698 */ 1699 fadeOut(duration?: number, easing?: string, complete?: Function): JQuery; 1700 /** 1701 * Hide the matched elements by fading them to transparent. 1702 * 1703 * @param duration A string or number determining how long the animation will run. 1704 * @param easing A string indicating which easing function to use for the transition. 1705 * @param complete A function to call once the animation is complete. 1706 */ 1707 fadeOut(duration?: string, easing?: string, complete?: Function): JQuery; 1708 /** 1709 * Hide the matched elements by fading them to transparent. 1710 * 1711 * @param options A map of additional options to pass to the method. 1712 */ 1713 fadeOut(options: JQueryAnimationOptions): JQuery; 1714 1715 /** 1716 * Adjust the opacity of the matched elements. 1717 * 1718 * @param duration A string or number determining how long the animation will run. 1719 * @param opacity A number between 0 and 1 denoting the target opacity. 1720 * @param complete A function to call once the animation is complete. 1721 */ 1722 fadeTo(duration: string, opacity: number, complete?: Function): JQuery; 1723 /** 1724 * Adjust the opacity of the matched elements. 1725 * 1726 * @param duration A string or number determining how long the animation will run. 1727 * @param opacity A number between 0 and 1 denoting the target opacity. 1728 * @param complete A function to call once the animation is complete. 1729 */ 1730 fadeTo(duration: number, opacity: number, complete?: Function): JQuery; 1731 /** 1732 * Adjust the opacity of the matched elements. 1733 * 1734 * @param duration A string or number determining how long the animation will run. 1735 * @param opacity A number between 0 and 1 denoting the target opacity. 1736 * @param easing A string indicating which easing function to use for the transition. 1737 * @param complete A function to call once the animation is complete. 1738 */ 1739 fadeTo(duration: string, opacity: number, easing?: string, complete?: Function): JQuery; 1740 /** 1741 * Adjust the opacity of the matched elements. 1742 * 1743 * @param duration A string or number determining how long the animation will run. 1744 * @param opacity A number between 0 and 1 denoting the target opacity. 1745 * @param easing A string indicating which easing function to use for the transition. 1746 * @param complete A function to call once the animation is complete. 1747 */ 1748 fadeTo(duration: number, opacity: number, easing?: string, complete?: Function): JQuery; 1749 1750 /** 1751 * Display or hide the matched elements by animating their opacity. 1752 * 1753 * @param duration A string or number determining how long the animation will run. 1754 * @param complete A function to call once the animation is complete. 1755 */ 1756 fadeToggle(duration?: number, complete?: Function): JQuery; 1757 /** 1758 * Display or hide the matched elements by animating their opacity. 1759 * 1760 * @param duration A string or number determining how long the animation will run. 1761 * @param complete A function to call once the animation is complete. 1762 */ 1763 fadeToggle(duration?: string, complete?: Function): JQuery; 1764 /** 1765 * Display or hide the matched elements by animating their opacity. 1766 * 1767 * @param duration A string or number determining how long the animation will run. 1768 * @param easing A string indicating which easing function to use for the transition. 1769 * @param complete A function to call once the animation is complete. 1770 */ 1771 fadeToggle(duration?: number, easing?: string, complete?: Function): JQuery; 1772 /** 1773 * Display or hide the matched elements by animating their opacity. 1774 * 1775 * @param duration A string or number determining how long the animation will run. 1776 * @param easing A string indicating which easing function to use for the transition. 1777 * @param complete A function to call once the animation is complete. 1778 */ 1779 fadeToggle(duration?: string, easing?: string, complete?: Function): JQuery; 1780 /** 1781 * Display or hide the matched elements by animating their opacity. 1782 * 1783 * @param options A map of additional options to pass to the method. 1784 */ 1785 fadeToggle(options: JQueryAnimationOptions): JQuery; 1786 1787 /** 1788 * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements. 1789 * 1790 * @param queue The name of the queue in which to stop animations. 1791 */ 1792 finish(queue?: string): JQuery; 1793 1794 /** 1795 * Hide the matched elements. 1796 * 1797 * @param duration A string or number determining how long the animation will run. 1798 * @param complete A function to call once the animation is complete. 1799 */ 1800 hide(duration?: number, complete?: Function): JQuery; 1801 /** 1802 * Hide the matched elements. 1803 * 1804 * @param duration A string or number determining how long the animation will run. 1805 * @param complete A function to call once the animation is complete. 1806 */ 1807 hide(duration?: string, complete?: Function): JQuery; 1808 /** 1809 * Hide the matched elements. 1810 * 1811 * @param duration A string or number determining how long the animation will run. 1812 * @param easing A string indicating which easing function to use for the transition. 1813 * @param complete A function to call once the animation is complete. 1814 */ 1815 hide(duration?: number, easing?: string, complete?: Function): JQuery; 1816 /** 1817 * Hide the matched elements. 1818 * 1819 * @param duration A string or number determining how long the animation will run. 1820 * @param easing A string indicating which easing function to use for the transition. 1821 * @param complete A function to call once the animation is complete. 1822 */ 1823 hide(duration?: string, easing?: string, complete?: Function): JQuery; 1824 /** 1825 * Hide the matched elements. 1826 * 1827 * @param options A map of additional options to pass to the method. 1828 */ 1829 hide(options: JQueryAnimationOptions): JQuery; 1830 1831 /** 1832 * Display the matched elements. 1833 * 1834 * @param duration A string or number determining how long the animation will run. 1835 * @param complete A function to call once the animation is complete. 1836 */ 1837 show(duration?: number, complete?: Function): JQuery; 1838 /** 1839 * Display the matched elements. 1840 * 1841 * @param duration A string or number determining how long the animation will run. 1842 * @param complete A function to call once the animation is complete. 1843 */ 1844 show(duration?: string, complete?: Function): JQuery; 1845 /** 1846 * Display the matched elements. 1847 * 1848 * @param duration A string or number determining how long the animation will run. 1849 * @param easing A string indicating which easing function to use for the transition. 1850 * @param complete A function to call once the animation is complete. 1851 */ 1852 show(duration?: number, easing?: string, complete?: Function): JQuery; 1853 /** 1854 * Display the matched elements. 1855 * 1856 * @param duration A string or number determining how long the animation will run. 1857 * @param easing A string indicating which easing function to use for the transition. 1858 * @param complete A function to call once the animation is complete. 1859 */ 1860 show(duration?: string, easing?: string, complete?: Function): JQuery; 1861 /** 1862 * Display the matched elements. 1863 * 1864 * @param options A map of additional options to pass to the method. 1865 */ 1866 show(options: JQueryAnimationOptions): JQuery; 1867 1868 /** 1869 * Display the matched elements with a sliding motion. 1870 * 1871 * @param duration A string or number determining how long the animation will run. 1872 * @param complete A function to call once the animation is complete. 1873 */ 1874 slideDown(duration?: number, complete?: Function): JQuery; 1875 /** 1876 * Display the matched elements with a sliding motion. 1877 * 1878 * @param duration A string or number determining how long the animation will run. 1879 * @param complete A function to call once the animation is complete. 1880 */ 1881 slideDown(duration?: string, complete?: Function): JQuery; 1882 /** 1883 * Display the matched elements with a sliding motion. 1884 * 1885 * @param duration A string or number determining how long the animation will run. 1886 * @param easing A string indicating which easing function to use for the transition. 1887 * @param complete A function to call once the animation is complete. 1888 */ 1889 slideDown(duration?: number, easing?: string, complete?: Function): JQuery; 1890 /** 1891 * Display the matched elements with a sliding motion. 1892 * 1893 * @param duration A string or number determining how long the animation will run. 1894 * @param easing A string indicating which easing function to use for the transition. 1895 * @param complete A function to call once the animation is complete. 1896 */ 1897 slideDown(duration?: string, easing?: string, complete?: Function): JQuery; 1898 /** 1899 * Display the matched elements with a sliding motion. 1900 * 1901 * @param options A map of additional options to pass to the method. 1902 */ 1903 slideDown(options: JQueryAnimationOptions): JQuery; 1904 1905 /** 1906 * Display or hide the matched elements with a sliding motion. 1907 * 1908 * @param duration A string or number determining how long the animation will run. 1909 * @param complete A function to call once the animation is complete. 1910 */ 1911 slideToggle(duration?: number, complete?: Function): JQuery; 1912 /** 1913 * Display or hide the matched elements with a sliding motion. 1914 * 1915 * @param duration A string or number determining how long the animation will run. 1916 * @param complete A function to call once the animation is complete. 1917 */ 1918 slideToggle(duration?: string, complete?: Function): JQuery; 1919 /** 1920 * Display or hide the matched elements with a sliding motion. 1921 * 1922 * @param duration A string or number determining how long the animation will run. 1923 * @param easing A string indicating which easing function to use for the transition. 1924 * @param complete A function to call once the animation is complete. 1925 */ 1926 slideToggle(duration?: number, easing?: string, complete?: Function): JQuery; 1927 /** 1928 * Display or hide the matched elements with a sliding motion. 1929 * 1930 * @param duration A string or number determining how long the animation will run. 1931 * @param easing A string indicating which easing function to use for the transition. 1932 * @param complete A function to call once the animation is complete. 1933 */ 1934 slideToggle(duration?: string, easing?: string, complete?: Function): JQuery; 1935 /** 1936 * Display or hide the matched elements with a sliding motion. 1937 * 1938 * @param options A map of additional options to pass to the method. 1939 */ 1940 slideToggle(options: JQueryAnimationOptions): JQuery; 1941 1942 /** 1943 * Hide the matched elements with a sliding motion. 1944 * 1945 * @param duration A string or number determining how long the animation will run. 1946 * @param complete A function to call once the animation is complete. 1947 */ 1948 slideUp(duration?: number, complete?: Function): JQuery; 1949 /** 1950 * Hide the matched elements with a sliding motion. 1951 * 1952 * @param duration A string or number determining how long the animation will run. 1953 * @param complete A function to call once the animation is complete. 1954 */ 1955 slideUp(duration?: string, complete?: Function): JQuery; 1956 /** 1957 * Hide the matched elements with a sliding motion. 1958 * 1959 * @param duration A string or number determining how long the animation will run. 1960 * @param easing A string indicating which easing function to use for the transition. 1961 * @param complete A function to call once the animation is complete. 1962 */ 1963 slideUp(duration?: number, easing?: string, complete?: Function): JQuery; 1964 /** 1965 * Hide the matched elements with a sliding motion. 1966 * 1967 * @param duration A string or number determining how long the animation will run. 1968 * @param easing A string indicating which easing function to use for the transition. 1969 * @param complete A function to call once the animation is complete. 1970 */ 1971 slideUp(duration?: string, easing?: string, complete?: Function): JQuery; 1972 /** 1973 * Hide the matched elements with a sliding motion. 1974 * 1975 * @param options A map of additional options to pass to the method. 1976 */ 1977 slideUp(options: JQueryAnimationOptions): JQuery; 1978 1979 /** 1980 * Stop the currently-running animation on the matched elements. 1981 * 1982 * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. 1983 * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. 1984 */ 1985 stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery; 1986 /** 1987 * Stop the currently-running animation on the matched elements. 1988 * 1989 * @param queue The name of the queue in which to stop animations. 1990 * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. 1991 * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. 1992 */ 1993 stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery; 1994 1995 /** 1996 * Display or hide the matched elements. 1997 * 1998 * @param duration A string or number determining how long the animation will run. 1999 * @param complete A function to call once the animation is complete. 2000 */ 2001 toggle(duration?: number, complete?: Function): JQuery; 2002 /** 2003 * Display or hide the matched elements. 2004 * 2005 * @param duration A string or number determining how long the animation will run. 2006 * @param complete A function to call once the animation is complete. 2007 */ 2008 toggle(duration?: string, complete?: Function): JQuery; 2009 /** 2010 * Display or hide the matched elements. 2011 * 2012 * @param duration A string or number determining how long the animation will run. 2013 * @param easing A string indicating which easing function to use for the transition. 2014 * @param complete A function to call once the animation is complete. 2015 */ 2016 toggle(duration?: number, easing?: string, complete?: Function): JQuery; 2017 /** 2018 * Display or hide the matched elements. 2019 * 2020 * @param duration A string or number determining how long the animation will run. 2021 * @param easing A string indicating which easing function to use for the transition. 2022 * @param complete A function to call once the animation is complete. 2023 */ 2024 toggle(duration?: string, easing?: string, complete?: Function): JQuery; 2025 /** 2026 * Display or hide the matched elements. 2027 * 2028 * @param options A map of additional options to pass to the method. 2029 */ 2030 toggle(options: JQueryAnimationOptions): JQuery; 2031 /** 2032 * Display or hide the matched elements. 2033 * 2034 * @param showOrHide A Boolean indicating whether to show or hide the elements. 2035 */ 2036 toggle(showOrHide: boolean): JQuery; 2037 2038 // Events 2039 bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; 2040 bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; 2041 bind(eventType: string, eventData: any, preventBubble: boolean): JQuery; 2042 bind(eventType: string, preventBubble: boolean): JQuery; 2043 bind(...events: any[]): JQuery; 2044 2045 blur(handler: (eventObject: JQueryEventObject) => any): JQuery; 2046 blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; 2047 2048 /** 2049 * Trigger the "change" event on an element. 2050 */ 2051 change(): JQuery; 2052 /** 2053 * Bind an event handler to the "change" JavaScript event 2054 * 2055 * @param handler A function to execute each time the event is triggered. 2056 */ 2057 change(handler: (eventObject: JQueryEventObject) => any): JQuery; 2058 /** 2059 * Bind an event handler to the "change" JavaScript event 2060 * 2061 * @param eventData An object containing data that will be passed to the event handler. 2062 * @param handler A function to execute each time the event is triggered. 2063 */ 2064 change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; 2065 2066 /** 2067 * Trigger the "click" event on an element. 2068 */ 2069 click(): JQuery; 2070 /** 2071 * Bind an event handler to the "click" JavaScript event 2072 * 2073 * @param eventData An object containing data that will be passed to the event handler. 2074 */ 2075 click(handler: (eventObject: JQueryEventObject) => any): JQuery; 2076 /** 2077 * Bind an event handler to the "click" JavaScript event 2078 * 2079 * @param eventData An object containing data that will be passed to the event handler. 2080 * @param handler A function to execute each time the event is triggered. 2081 */ 2082 click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; 2083 2084 /** 2085 * Trigger the "dblclick" event on an element. 2086 */ 2087 dblclick(): JQuery; 2088 /** 2089 * Bind an event handler to the "dblclick" JavaScript event 2090 * 2091 * @param handler A function to execute each time the event is triggered. 2092 */ 2093 dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery; 2094 /** 2095 * Bind an event handler to the "dblclick" JavaScript event 2096 * 2097 * @param eventData An object containing data that will be passed to the event handler. 2098 * @param handler A function to execute each time the event is triggered. 2099 */ 2100 dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; 2101 2102 delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; 2103 2104 /** 2105 * Trigger the "focus" event on an element. 2106 */ 2107 focus(): JQuery; 2108 /** 2109 * Bind an event handler to the "focus" JavaScript event 2110 * 2111 * @param handler A function to execute each time the event is triggered. 2112 */ 2113 focus(handler: (eventObject: JQueryEventObject) => any): JQuery; 2114 /** 2115 * Bind an event handler to the "focus" JavaScript event 2116 * 2117 * @param eventData An object containing data that will be passed to the event handler. 2118 * @param handler A function to execute each time the event is triggered. 2119 */ 2120 focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; 2121 2122 /** 2123 * Bind an event handler to the "focusin" JavaScript event 2124 * 2125 * @param handler A function to execute each time the event is triggered. 2126 */ 2127 focusin(handler: (eventObject: JQueryEventObject) => any): JQuery; 2128 /** 2129 * Bind an event handler to the "focusin" JavaScript event 2130 * 2131 * @param eventData An object containing data that will be passed to the event handler. 2132 * @param handler A function to execute each time the event is triggered. 2133 */ 2134 focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; 2135 2136 /** 2137 * Bind an event handler to the "focusout" JavaScript event 2138 * 2139 * @param handler A function to execute each time the event is triggered. 2140 */ 2141 focusout(handler: (eventObject: JQueryEventObject) => any): JQuery; 2142 /** 2143 * Bind an event handler to the "focusout" JavaScript event 2144 * 2145 * @param eventData An object containing data that will be passed to the event handler. 2146 * @param handler A function to execute each time the event is triggered. 2147 */ 2148 focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; 2149 2150 /** 2151 * Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. 2152 * 2153 * @param handlerIn A function to execute when the mouse pointer enters the element. 2154 * @param handlerOut A function to execute when the mouse pointer leaves the element. 2155 */ 2156 hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery; 2157 /** 2158 * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements. 2159 * 2160 * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element. 2161 */ 2162 hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery; 2163 2164 /** 2165 * Trigger the "keydown" event on an element. 2166 */ 2167 keydown(): JQuery; 2168 /** 2169 * Bind an event handler to the "keydown" JavaScript event 2170 * 2171 * @param handler A function to execute each time the event is triggered. 2172 */ 2173 keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; 2174 /** 2175 * Bind an event handler to the keydown"" JavaScript event 2176 * 2177 * @param eventData An object containing data that will be passed to the event handler. 2178 * @param handler A function to execute each time the event is triggered. 2179 */ 2180 keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; 2181 2182 /** 2183 * Trigger the "keypress" event on an element. 2184 */ 2185 keypress(): JQuery; 2186 /** 2187 * Bind an event handler to the "keypress" JavaScript event 2188 * 2189 * @param handler A function to execute each time the event is triggered. 2190 */ 2191 keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; 2192 /** 2193 * Bind an event handler to the "keypress" JavaScript event 2194 * 2195 * @param eventData An object containing data that will be passed to the event handler. 2196 * @param handler A function to execute each time the event is triggered. 2197 */ 2198 keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; 2199 2200 /** 2201 * Trigger the "keyup" event on an element. 2202 */ 2203 keyup(): JQuery; 2204 /** 2205 * Bind an event handler to the "keyup" JavaScript event 2206 * 2207 * @param handler A function to execute each time the event is triggered. 2208 */ 2209 keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; 2210 /** 2211 * Bind an event handler to the "keyup" JavaScript event 2212 * 2213 * @param eventData An object containing data that will be passed to the event handler. 2214 * @param handler A function to execute each time the event is triggered. 2215 */ 2216 keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; 2217 2218 /** 2219 * Bind an event handler to the "load" JavaScript event. 2220 * 2221 * @param handler A function to execute when the event is triggered. 2222 */ 2223 load(handler: (eventObject: JQueryEventObject) => any): JQuery; 2224 /** 2225 * Bind an event handler to the "load" JavaScript event. 2226 * 2227 * @param eventData An object containing data that will be passed to the event handler. 2228 * @param handler A function to execute when the event is triggered. 2229 */ 2230 load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; 2231 2232 /** 2233 * Trigger the "mousedown" event on an element. 2234 */ 2235 mousedown(): JQuery; 2236 /** 2237 * Bind an event handler to the "mousedown" JavaScript event. 2238 * 2239 * @param handler A function to execute when the event is triggered. 2240 */ 2241 mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; 2242 /** 2243 * Bind an event handler to the "mousedown" JavaScript event. 2244 * 2245 * @param eventData An object containing data that will be passed to the event handler. 2246 * @param handler A function to execute when the event is triggered. 2247 */ 2248 mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; 2249 2250 /** 2251 * Trigger the "mouseenter" event on an element. 2252 */ 2253 mouseenter(): JQuery; 2254 /** 2255 * Bind an event handler to be fired when the mouse enters an element. 2256 * 2257 * @param handler A function to execute when the event is triggered. 2258 */ 2259 mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; 2260 /** 2261 * Bind an event handler to be fired when the mouse enters an element. 2262 * 2263 * @param eventData An object containing data that will be passed to the event handler. 2264 * @param handler A function to execute when the event is triggered. 2265 */ 2266 mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; 2267 2268 /** 2269 * Trigger the "mouseleave" event on an element. 2270 */ 2271 mouseleave(): JQuery; 2272 /** 2273 * Bind an event handler to be fired when the mouse leaves an element. 2274 * 2275 * @param handler A function to execute when the event is triggered. 2276 */ 2277 mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; 2278 /** 2279 * Bind an event handler to be fired when the mouse leaves an element. 2280 * 2281 * @param eventData An object containing data that will be passed to the event handler. 2282 * @param handler A function to execute when the event is triggered. 2283 */ 2284 mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; 2285 2286 /** 2287 * Trigger the "mousemove" event on an element. 2288 */ 2289 mousemove(): JQuery; 2290 /** 2291 * Bind an event handler to the "mousemove" JavaScript event. 2292 * 2293 * @param handler A function to execute when the event is triggered. 2294 */ 2295 mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; 2296 /** 2297 * Bind an event handler to the "mousemove" JavaScript event. 2298 * 2299 * @param eventData An object containing data that will be passed to the event handler. 2300 * @param handler A function to execute when the event is triggered. 2301 */ 2302 mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; 2303 2304 /** 2305 * Trigger the "mouseout" event on an element. 2306 */ 2307 mouseout(): JQuery; 2308 /** 2309 * Bind an event handler to the "mouseout" JavaScript event. 2310 * 2311 * @param handler A function to execute when the event is triggered. 2312 */ 2313 mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; 2314 /** 2315 * Bind an event handler to the "mouseout" JavaScript event. 2316 * 2317 * @param eventData An object containing data that will be passed to the event handler. 2318 * @param handler A function to execute when the event is triggered. 2319 */ 2320 mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; 2321 2322 /** 2323 * Trigger the "mouseover" event on an element. 2324 */ 2325 mouseover(): JQuery; 2326 /** 2327 * Bind an event handler to the "mouseover" JavaScript event. 2328 * 2329 * @param handler A function to execute when the event is triggered. 2330 */ 2331 mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; 2332 /** 2333 * Bind an event handler to the "mouseover" JavaScript event. 2334 * 2335 * @param eventData An object containing data that will be passed to the event handler. 2336 * @param handler A function to execute when the event is triggered. 2337 */ 2338 mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; 2339 2340 /** 2341 * Trigger the "mouseup" event on an element. 2342 */ 2343 mouseup(): JQuery; 2344 /** 2345 * Bind an event handler to the "mouseup" JavaScript event. 2346 * 2347 * @param handler A function to execute when the event is triggered. 2348 */ 2349 mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; 2350 /** 2351 * Bind an event handler to the "mouseup" JavaScript event. 2352 * 2353 * @param eventData An object containing data that will be passed to the event handler. 2354 * @param handler A function to execute when the event is triggered. 2355 */ 2356 mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; 2357 2358 /** 2359 * Remove an event handler. 2360 */ 2361 off(): JQuery; 2362 /** 2363 * Remove an event handler. 2364 * 2365 * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". 2366 * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. 2367 * @param handler A handler function previously attached for the event(s), or the special value false. 2368 */ 2369 off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; 2370 /** 2371 * Remove an event handler. 2372 * 2373 * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". 2374 * @param handler A handler function previously attached for the event(s), or the special value false. 2375 */ 2376 off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; 2377 /** 2378 * Remove an event handler. 2379 * 2380 * @param events An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s). 2381 * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. 2382 */ 2383 off(events: { [key: string]: any; }, selector?: string): JQuery; 2384 2385 /** 2386 * Attach an event handler function for one or more events to the selected elements. 2387 * 2388 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". 2389 * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax). 2390 */ 2391 on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; 2392 /** 2393 * Attach an event handler function for one or more events to the selected elements. 2394 * 2395 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". 2396 * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. 2397 * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. 2398 */ 2399 on(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery; 2400 /** 2401 * Attach an event handler function for one or more events to the selected elements. 2402 * 2403 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". 2404 * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. 2405 * @param data Data to be passed to the handler in event.data when an event is triggered. 2406 * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. 2407 */ 2408 on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery; 2409 /** 2410 * Attach an event handler function for one or more events to the selected elements. 2411 * 2412 * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). 2413 * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. 2414 * @param data Data to be passed to the handler in event.data when an event occurs. 2415 */ 2416 on(events: { [key: string]: any; }, selector?: any, data?: any): JQuery; 2417 2418 /** 2419 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. 2420 * 2421 * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. 2422 * @param handler A function to execute at the time the event is triggered. 2423 */ 2424 one(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; 2425 /** 2426 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. 2427 * 2428 * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. 2429 * @param data An object containing data that will be passed to the event handler. 2430 * @param handler A function to execute at the time the event is triggered. 2431 */ 2432 one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; 2433 2434 /** 2435 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. 2436 * 2437 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". 2438 * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. 2439 * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. 2440 */ 2441 one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery; 2442 /** 2443 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. 2444 * 2445 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". 2446 * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. 2447 * @param data Data to be passed to the handler in event.data when an event is triggered. 2448 * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. 2449 */ 2450 one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery; 2451 2452 /** 2453 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. 2454 * 2455 * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). 2456 * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. 2457 * @param data Data to be passed to the handler in event.data when an event occurs. 2458 */ 2459 one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; 2460 2461 2462 /** 2463 * Specify a function to execute when the DOM is fully loaded. 2464 * 2465 * @param handler A function to execute after the DOM is ready. 2466 */ 2467 ready(handler: Function): JQuery; 2468 2469 /** 2470 * Trigger the "resize" event on an element. 2471 */ 2472 resize(): JQuery; 2473 /** 2474 * Bind an event handler to the "resize" JavaScript event. 2475 * 2476 * @param handler A function to execute each time the event is triggered. 2477 */ 2478 resize(handler: (eventObject: JQueryEventObject) => any): JQuery; 2479 /** 2480 * Bind an event handler to the "resize" JavaScript event. 2481 * 2482 * @param eventData An object containing data that will be passed to the event handler. 2483 * @param handler A function to execute each time the event is triggered. 2484 */ 2485 resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; 2486 2487 /** 2488 * Trigger the "scroll" event on an element. 2489 */ 2490 scroll(): JQuery; 2491 /** 2492 * Bind an event handler to the "scroll" JavaScript event. 2493 * 2494 * @param handler A function to execute each time the event is triggered. 2495 */ 2496 scroll(handler: (eventObject: JQueryEventObject) => any): JQuery; 2497 /** 2498 * Bind an event handler to the "scroll" JavaScript event. 2499 * 2500 * @param eventData An object containing data that will be passed to the event handler. 2501 * @param handler A function to execute each time the event is triggered. 2502 */ 2503 scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; 2504 2505 /** 2506 * Trigger the "select" event on an element. 2507 */ 2508 select(): JQuery; 2509 /** 2510 * Bind an event handler to the "select" JavaScript event. 2511 * 2512 * @param handler A function to execute each time the event is triggered. 2513 */ 2514 select(handler: (eventObject: JQueryEventObject) => any): JQuery; 2515 /** 2516 * Bind an event handler to the "select" JavaScript event. 2517 * 2518 * @param eventData An object containing data that will be passed to the event handler. 2519 * @param handler A function to execute each time the event is triggered. 2520 */ 2521 select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; 2522 2523 /** 2524 * Trigger the "submit" event on an element. 2525 */ 2526 submit(): JQuery; 2527 /** 2528 * Bind an event handler to the "submit" JavaScript event 2529 * 2530 * @param handler A function to execute each time the event is triggered. 2531 */ 2532 submit(handler: (eventObject: JQueryEventObject) => any): JQuery; 2533 /** 2534 * Bind an event handler to the "submit" JavaScript event 2535 * 2536 * @param eventData An object containing data that will be passed to the event handler. 2537 * @param handler A function to execute each time the event is triggered. 2538 */ 2539 submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; 2540 2541 trigger(eventType: string, ...extraParameters: any[]): JQuery; 2542 trigger(event: JQueryEventObject): JQuery; 2543 2544 triggerHandler(eventType: string, ...extraParameters: any[]): Object; 2545 2546 unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; 2547 unbind(eventType: string, fls: boolean): JQuery; 2548 unbind(evt: any): JQuery; 2549 2550 undelegate(): JQuery; 2551 undelegate(selector: any, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; 2552 undelegate(selector: any, events: any): JQuery; 2553 undelegate(namespace: string): JQuery; 2554 2555 unload(handler: (eventObject: JQueryEventObject) => any): JQuery; 2556 unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; 2557 2558 // Internals 2559 context: Element; 2560 jquery: string; 2561 2562 error(handler: (eventObject: JQueryEventObject) => any): JQuery; 2563 error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; 2564 2565 pushStack(elements: any[]): JQuery; 2566 pushStack(elements: any[], name: any, arguments: any): JQuery; 2567 2568 // Manipulation 2569 after(...content: any[]): JQuery; 2570 after(func: (index: any) => any): JQuery; 2571 2572 append(...content: any[]): JQuery; 2573 append(func: (index: any, html: any) => any): JQuery; 2574 2575 appendTo(target: any): JQuery; 2576 2577 before(...content: any[]): JQuery; 2578 before(func: (index: any) => any): JQuery; 2579 2580 clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery; 2581 2582 detach(selector?: any): JQuery; 2583 2584 empty(): JQuery; 2585 2586 insertAfter(target: any): JQuery; 2587 insertBefore(target: any): JQuery; 2588 2589 prepend(...content: any[]): JQuery; 2590 prepend(func: (index: any, html: any) => any): JQuery; 2591 2592 prependTo(target: any): JQuery; 2593 2594 remove(selector?: any): JQuery; 2595 2596 replaceAll(target: any): JQuery; 2597 2598 replaceWith(func: any): JQuery; 2599 2600 text(): string; 2601 text(textString: any): JQuery; 2602 text(textString: (index: number, text: string) => string): JQuery; 2603 2604 toArray(): any[]; 2605 2606 unwrap(): JQuery; 2607 2608 wrap(wrappingElement: any): JQuery; 2609 wrap(func: (index: any) => any): JQuery; 2610 2611 wrapAll(wrappingElement: any): JQuery; 2612 2613 wrapInner(wrappingElement: any): JQuery; 2614 wrapInner(func: (index: any) => any): JQuery; 2615 2616 /** 2617 * Iterate over a jQuery object, executing a function for each matched element. 2618 * 2619 * @param func A function to execute for each matched element. 2620 */ 2621 each(func: (index: number, elem: Element) => any): JQuery; 2622 2623 get(index?: number): any; 2624 2625 index(): number; 2626 index(selector: string): number; 2627 index(element: any): number; 2628 2629 // Properties 2630 length: number; 2631 selector: string; 2632 [x: string]: any; 2633 [x: number]: HTMLElement; 2634 2635 // Traversing 2636 add(selector: string, context?: any): JQuery; 2637 add(...elements: any[]): JQuery; 2638 add(html: string): JQuery; 2639 add(obj: JQuery): JQuery; 2640 2641 children(selector?: any): JQuery; 2642 2643 closest(selector: string): JQuery; 2644 closest(selector: string, context?: Element): JQuery; 2645 closest(obj: JQuery): JQuery; 2646 closest(element: any): JQuery; 2647 closest(selectors: any, context?: Element): any[]; 2648 2649 contents(): JQuery; 2650 2651 end(): JQuery; 2652 2653 eq(index: number): JQuery; 2654 2655 filter(selector: string): JQuery; 2656 filter(func: (index: any) => any): JQuery; 2657 filter(element: any): JQuery; 2658 filter(obj: JQuery): JQuery; 2659 2660 find(selector: string): JQuery; 2661 find(element: any): JQuery; 2662 find(obj: JQuery): JQuery; 2663 2664 first(): JQuery; 2665 2666 has(selector: string): JQuery; 2667 has(contained: Element): JQuery; 2668 2669 is(selector: string): boolean; 2670 is(func: (index: any) => any): boolean; 2671 is(element: any): boolean; 2672 is(obj: JQuery): boolean; 2673 2674 last(): JQuery; 2675 2676 map(callback: (index: any, domElement: Element) => any): JQuery; 2677 2678 next(selector?: string): JQuery; 2679 2680 nextAll(selector?: string): JQuery; 2681 2682 nextUntil(selector?: string, filter?: string): JQuery; 2683 nextUntil(element?: Element, filter?: string): JQuery; 2684 nextUntil(obj?: JQuery, filter?: string): JQuery; 2685 2686 not(selector: string): JQuery; 2687 not(func: (index: any) => any): JQuery; 2688 not(element: any): JQuery; 2689 not(obj: JQuery): JQuery; 2690 2691 offsetParent(): JQuery; 2692 2693 parent(selector?: string): JQuery; 2694 2695 parents(selector?: string): JQuery; 2696 2697 parentsUntil(selector?: string, filter?: string): JQuery; 2698 parentsUntil(element?: Element, filter?: string): JQuery; 2699 parentsUntil(obj?: JQuery, filter?: string): JQuery; 2700 2701 prev(selector?: string): JQuery; 2702 2703 prevAll(selector?: string): JQuery; 2704 2705 prevUntil(selector?: string, filter?: string): JQuery; 2706 prevUntil(element?: Element, filter?: string): JQuery; 2707 prevUntil(obj?: JQuery, filter?: string): JQuery; 2708 2709 siblings(selector?: string): JQuery; 2710 2711 slice(start: number, end?: number): JQuery; 2712 2713 // Utilities 2714 2715 queue(queueName?: string): any[]; 2716 queue(queueName: string, newQueueOrCallback: any): JQuery; 2717 queue(newQueueOrCallback: any): JQuery; 2718 } 2719 declare module "jquery" { 2720 export = $; 2721 } 2722 declare var jQuery: JQueryStatic; 2723 declare var $: JQueryStatic;