Debian Codegraph @

typings/jquery/jquery.d.ts

raw symbols SCIP
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 <https://github.com/Steve-Fenton>, Diullei Gomes <https://github.com/Diullei>, Tass Iliopoulos <https://github.com/tasoili>, Jason Swearingen <https://github.com/jasons-novaleaf>, 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/>, Dick van den Brink <https://github.com/DickvdBrink>
4 // Definitions: https://github.com/DefinitelyTyped/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 /**
23 * Interface for the AJAX setting that will configure the AJAX request
24 */
25 interface JQueryAjaxSettings {
26 /**
27 * 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.
28 */
29 accepts?: any;
30 /**
31 * 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().
32 */
33 async?: boolean;
34 /**
35 * 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.
36 */
37 beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any;
38 /**
39 * 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.
40 */
41 cache?: boolean;
42 /**
43 * 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.
44 */
45 complete? (jqXHR: JQueryXHR, textStatus: string): any;
46 /**
47 * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5)
48 */
49 contents?: { [key: string]: any; };
50 //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false"
51 // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/742
52 /**
53 * 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.
54 */
55 contentType?: any;
56 /**
57 * 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).
58 */
59 context?: any;
60 /**
61 * 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)
62 */
63 converters?: { [key: string]: any; };
64 /**
65 * 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)
66 */
67 crossDomain?: boolean;
68 /**
69 * 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).
70 */
71 data?: any;
72 /**
73 * 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.
74 */
75 dataFilter? (data: any, ty: any): any;
76 /**
77 * 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).
78 */
79 dataType?: string;
80 /**
81 * 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.
82 */
83 error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any;
84 /**
85 * 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.
86 */
87 global?: boolean;
88 /**
89 * 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)
90 */
91 headers?: { [key: string]: any; };
92 /**
93 * 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.
94 */
95 ifModified?: boolean;
96 /**
97 * 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)
98 */
99 isLocal?: boolean;
100 /**
101 * 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" }
102 */
103 jsonp?: any;
104 /**
105 * 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.
106 */
107 jsonpCallback?: any;
108 /**
109 * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0)
110 */
111 method?: string;
112 /**
113 * A mime type to override the XHR mime type. (version added: 1.5.1)
114 */
115 mimeType?: string;
116 /**
117 * A password to be used with XMLHttpRequest in response to an HTTP access authentication request.
118 */
119 password?: string;
120 /**
121 * 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.
122 */
123 processData?: boolean;
124 /**
125 * 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.
126 */
127 scriptCharset?: string;
128 /**
129 * 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)
130 */
131 statusCode?: { [key: string]: any; };
132 /**
133 * 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.
134 */
135 success? (data: any, textStatus: string, jqXHR: JQueryXHR): any;
136 /**
137 * 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.
138 */
139 timeout?: number;
140 /**
141 * Set this to true if you wish to use the traditional style of param serialization.
142 */
143 traditional?: boolean;
144 /**
145 * 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.
146 */
147 type?: string;
148 /**
149 * A string containing the URL to which the request is sent.
150 */
151 url?: string;
152 /**
153 * A username to be used with XMLHttpRequest in response to an HTTP access authentication request.
154 */
155 username?: string;
156 /**
157 * 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.
158 */
159 xhr?: any;
160 /**
161 * 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)
162 */
163 xhrFields?: { [key: string]: any; };
164 }
165
166 /**
167 * Interface for the jqXHR object
168 */
169 interface JQueryXHR extends XMLHttpRequest, JQueryPromise<any> {
170 /**
171 * 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).
172 */
173 overrideMimeType(mimeType: string): any;
174 /**
175 * Cancel the request.
176 *
177 * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled"
178 */
179 abort(statusText?: string): void;
180 /**
181 * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details.
182 */
183 then<R>(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => R, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise<R>;
184 /**
185 * Property containing the parsed response if the response Content-Type is json
186 */
187 responseJSON?: any;
188 /**
189 * A function to be called if the request fails.
190 */
191 error(xhr: JQueryXHR, textStatus: string, errorThrown: string): void;
192 }
193
194 /**
195 * Interface for the JQuery callback
196 */
197 interface JQueryCallback {
198 /**
199 * Add a callback or a collection of callbacks to a callback list.
200 *
201 * @param callbacks A function, or array of functions, that are to be added to the callback list.
202 */
203 add(callbacks: Function): JQueryCallback;
204 /**
205 * Add a callback or a collection of callbacks to a callback list.
206 *
207 * @param callbacks A function, or array of functions, that are to be added to the callback list.
208 */
209 add(callbacks: Function[]): JQueryCallback;
210
211 /**
212 * Disable a callback list from doing anything more.
213 */
214 disable(): JQueryCallback;
215
216 /**
217 * Determine if the callbacks list has been disabled.
218 */
219 disabled(): boolean;
220
221 /**
222 * Remove all of the callbacks from a list.
223 */
224 empty(): JQueryCallback;
225
226 /**
227 * Call all of the callbacks with the given arguments
228 *
229 * @param arguments The argument or list of arguments to pass back to the callback list.
230 */
231 fire(...arguments: any[]): JQueryCallback;
232
233 /**
234 * Determine if the callbacks have already been called at least once.
235 */
236 fired(): boolean;
237
238 /**
239 * Call all callbacks in a list with the given context and arguments.
240 *
241 * @param context A reference to the context in which the callbacks in the list should be fired.
242 * @param arguments An argument, or array of arguments, to pass to the callbacks in the list.
243 */
244 fireWith(context?: any, args?: any[]): JQueryCallback;
245
246 /**
247 * Determine whether a supplied callback is in a list
248 *
249 * @param callback The callback to search for.
250 */
251 has(callback: Function): boolean;
252
253 /**
254 * Lock a callback list in its current state.
255 */
256 lock(): JQueryCallback;
257
258 /**
259 * Determine if the callbacks list has been locked.
260 */
261 locked(): boolean;
262
263 /**
264 * Remove a callback or a collection of callbacks from a callback list.
265 *
266 * @param callbacks A function, or array of functions, that are to be removed from the callback list.
267 */
268 remove(callbacks: Function): JQueryCallback;
269 /**
270 * Remove a callback or a collection of callbacks from a callback list.
271 *
272 * @param callbacks A function, or array of functions, that are to be removed from the callback list.
273 */
274 remove(callbacks: Function[]): JQueryCallback;
275 }
276
277 /**
278 * Allows jQuery Promises to interop with non-jQuery promises
279 */
280 interface JQueryGenericPromise<T> {
281 /**
282 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
283 *
284 * @param doneFilter A function that is called when the Deferred is resolved.
285 * @param failFilter An optional function that is called when the Deferred is rejected.
286 */
287 then<U>(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise<U>, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>;
288
289 /**
290 * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
291 *
292 * @param doneFilter A function that is called when the Deferred is resolved.
293 * @param failFilter An optional function that is called when the Deferred is rejected.
294 */
295 then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise<void>;
296 }
297
298 /**
299 * Interface for the JQuery promise/deferred callbacks
300 */
301 interface JQueryPromiseCallback<T> {
302 (value?: T, ...args: any[]): void;
303 }
304
305 interface JQueryPromiseOperator<T, U> {
306 (callback1: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...callbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<U>;
307 }
308
309 /**
310 * Interface for the JQuery promise, part of callbacks
311 */
312 interface JQueryPromise<T> extends JQueryGenericPromise<T> {
313 /**
314 * Determine the current state of a Deferred object.
315 */
316 state(): string;
317 /**
318 * Add handlers to be called when the Deferred object is either resolved or rejected.
319 *
320 * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
321 * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
322 */
323 always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
324 /**
325 * Add handlers to be called when the Deferred object is resolved.
326 *
327 * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
328 * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
329 */
330 done(doneCallback1?: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...doneCallbackN: Array<JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[]>): JQueryPromise<T>;
331 /**
332 * Add handlers to be called when the Deferred object is rejected.
333 *
334 * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
335 * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
336 */
337 fail(failCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...failCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
338 /**
339 * Add handlers to be called when the Deferred object generates progress notifications.
340 *
341 * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
342 */
343 progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
344
345 // Deprecated - given no typings
346 pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>;
347 }
348
349 /**
350 * Interface for the JQuery deferred, part of callbacks
351 */
352 interface JQueryDeferred<T> extends JQueryGenericPromise<T> {
353 /**
354 * Determine the current state of a Deferred object.
355 */
356 state(): string;
357 /**
358 * Add handlers to be called when the Deferred object is either resolved or rejected.
359 *
360 * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
361 * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
362 */
363 always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
364 /**
365 * Add handlers to be called when the Deferred object is resolved.
366 *
367 * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
368 * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
369 */
370 done(doneCallback1?: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...doneCallbackN: Array<JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[]>): JQueryDeferred<T>;
371 /**
372 * Add handlers to be called when the Deferred object is rejected.
373 *
374 * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
375 * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
376 */
377 fail(failCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...failCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
378 /**
379 * Add handlers to be called when the Deferred object generates progress notifications.
380 *
381 * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
382 */
383 progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
384
385 /**
386 * Call the progressCallbacks on a Deferred object with the given args.
387 *
388 * @param args Optional arguments that are passed to the progressCallbacks.
389 */
390 notify(value?: any, ...args: any[]): JQueryDeferred<T>;
391
392 /**
393 * Call the progressCallbacks on a Deferred object with the given context and args.
394 *
395 * @param context Context passed to the progressCallbacks as the this object.
396 * @param args Optional arguments that are passed to the progressCallbacks.
397 */
398 notifyWith(context: any, value?: any[]): JQueryDeferred<T>;
399
400 /**
401 * Reject a Deferred object and call any failCallbacks with the given args.
402 *
403 * @param args Optional arguments that are passed to the failCallbacks.
404 */
405 reject(value?: any, ...args: any[]): JQueryDeferred<T>;
406 /**
407 * Reject a Deferred object and call any failCallbacks with the given context and args.
408 *
409 * @param context Context passed to the failCallbacks as the this object.
410 * @param args An optional array of arguments that are passed to the failCallbacks.
411 */
412 rejectWith(context: any, value?: any[]): JQueryDeferred<T>;
413
414 /**
415 * Resolve a Deferred object and call any doneCallbacks with the given args.
416 *
417 * @param value First argument passed to doneCallbacks.
418 * @param args Optional subsequent arguments that are passed to the doneCallbacks.
419 */
420 resolve(value?: T, ...args: any[]): JQueryDeferred<T>;
421
422 /**
423 * Resolve a Deferred object and call any doneCallbacks with the given context and args.
424 *
425 * @param context Context passed to the doneCallbacks as the this object.
426 * @param args An optional array of arguments that are passed to the doneCallbacks.
427 */
428 resolveWith(context: any, value?: T[]): JQueryDeferred<T>;
429
430 /**
431 * Return a Deferred's Promise object.
432 *
433 * @param target Object onto which the promise methods have to be attached
434 */
435 promise(target?: any): JQueryPromise<T>;
436
437 // Deprecated - given no typings
438 pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>;
439 }
440
441 /**
442 * Interface of the JQuery extension of the W3C event object
443 */
444 interface BaseJQueryEventObject extends Event {
445 data: any;
446 delegateTarget: Element;
447 isDefaultPrevented(): boolean;
448 isImmediatePropagationStopped(): boolean;
449 isPropagationStopped(): boolean;
450 namespace: string;
451 originalEvent: Event;
452 preventDefault(): any;
453 relatedTarget: Element;
454 result: any;
455 stopImmediatePropagation(): void;
456 stopPropagation(): void;
457 target: Element;
458 pageX: number;
459 pageY: number;
460 which: number;
461 metaKey: boolean;
462 }
463
464 interface JQueryInputEventObject extends BaseJQueryEventObject {
465 altKey: boolean;
466 ctrlKey: boolean;
467 metaKey: boolean;
468 shiftKey: boolean;
469 }
470
471 interface JQueryMouseEventObject extends JQueryInputEventObject {
472 button: number;
473 clientX: number;
474 clientY: number;
475 offsetX: number;
476 offsetY: number;
477 pageX: number;
478 pageY: number;
479 screenX: number;
480 screenY: number;
481 }
482
483 interface JQueryKeyEventObject extends JQueryInputEventObject {
484 char: any;
485 charCode: number;
486 key: any;
487 keyCode: number;
488 }
489
490 interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{
491 }
492
493 /*
494 Collection of properties of the current browser
495 */
496
497 interface JQuerySupport {
498 ajax?: boolean;
499 boxModel?: boolean;
500 changeBubbles?: boolean;
501 checkClone?: boolean;
502 checkOn?: boolean;
503 cors?: boolean;
504 cssFloat?: boolean;
505 hrefNormalized?: boolean;
506 htmlSerialize?: boolean;
507 leadingWhitespace?: boolean;
508 noCloneChecked?: boolean;
509 noCloneEvent?: boolean;
510 opacity?: boolean;
511 optDisabled?: boolean;
512 optSelected?: boolean;
513 scriptEval? (): boolean;
514 style?: boolean;
515 submitBubbles?: boolean;
516 tbody?: boolean;
517 }
518
519 interface JQueryParam {
520 /**
521 * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
522 *
523 * @param obj An array or object to serialize.
524 */
525 (obj: any): string;
526
527 /**
528 * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
529 *
530 * @param obj An array or object to serialize.
531 * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization.
532 */
533 (obj: any, traditional: boolean): string;
534 }
535
536 /**
537 * The interface used to construct jQuery events (with $.Event). It is
538 * defined separately instead of inline in JQueryStatic to allow
539 * overriding the construction function with specific strings
540 * returning specific event objects.
541 */
542 interface JQueryEventConstructor {
543 (name: string, eventProperties?: any): JQueryEventObject;
544 new (name: string, eventProperties?: any): JQueryEventObject;
545 }
546
547 /**
548 * The interface used to specify coordinates.
549 */
550 interface JQueryCoordinates {
551 left: number;
552 top: number;
553 }
554
555 /**
556 * Elements in the array returned by serializeArray()
557 */
558 interface JQuerySerializeArrayElement {
559 name: string;
560 value: string;
561 }
562
563 interface JQueryAnimationOptions {
564 /**
565 * A string or number determining how long the animation will run.
566 */
567 duration?: any;
568 /**
569 * A string indicating which easing function to use for the transition.
570 */
571 easing?: string;
572 /**
573 * A function to call once the animation is complete.
574 */
575 complete?: Function;
576 /**
577 * 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.
578 */
579 step?: (now: number, tween: any) => any;
580 /**
581 * 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)
582 */
583 progress?: (animation: JQueryPromise<any>, progress: number, remainingMs: number) => any;
584 /**
585 * A function to call when the animation begins. (version added: 1.8)
586 */
587 start?: (animation: JQueryPromise<any>) => any;
588 /**
589 * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8)
590 */
591 done?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
592 /**
593 * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8)
594 */
595 fail?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
596 /**
597 * 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)
598 */
599 always?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
600 /**
601 * 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.
602 */
603 queue?: any;
604 /**
605 * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4)
606 */
607 specialEasing?: Object;
608 }
609
610 interface JQueryEasingFunction {
611 ( percent: number ): number;
612 }
613
614 interface JQueryEasingFunctions {
615 [ name: string ]: JQueryEasingFunction;
616 linear: JQueryEasingFunction;
617 swing: JQueryEasingFunction;
618 }
619
620 /**
621 * Static members of jQuery (those on $ and jQuery themselves)
622 */
623 interface JQueryStatic {
624
625 /**
626 * Perform an asynchronous HTTP (Ajax) request.
627 *
628 * @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().
629 */
630 ajax(settings: JQueryAjaxSettings): JQueryXHR;
631 /**
632 * Perform an asynchronous HTTP (Ajax) request.
633 *
634 * @param url A string containing the URL to which the request is sent.
635 * @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().
636 */
637 ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR;
638
639 /**
640 * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
641 *
642 * @param dataTypes An optional string containing one or more space-separated dataTypes
643 * @param handler A handler to set default values for future Ajax requests.
644 */
645 ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
646 /**
647 * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
648 *
649 * @param handler A handler to set default values for future Ajax requests.
650 */
651 ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
652
653 ajaxSettings: JQueryAjaxSettings;
654
655 /**
656 * Set default values for future Ajax requests. Its use is not recommended.
657 *
658 * @param options A set of key/value pairs that configure the default Ajax request. All options are optional.
659 */
660 ajaxSetup(options: JQueryAjaxSettings): void;
661
662 /**
663 * Load data from the server using a HTTP GET request.
664 *
665 * @param url A string containing the URL to which the request is sent.
666 * @param success A callback function that is executed if the request succeeds.
667 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
668 */
669 get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
670 /**
671 * Load data from the server using a HTTP GET request.
672 *
673 * @param url A string containing the URL to which the request is sent.
674 * @param data A plain object or string that is sent to the server with the request.
675 * @param success A callback function that is executed if the request succeeds.
676 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
677 */
678 get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
679 /**
680 * Load data from the server using a HTTP GET request.
681 *
682 * @param settings The JQueryAjaxSettings to be used for the request
683 */
684 get(settings : JQueryAjaxSettings): JQueryXHR;
685 /**
686 * Load JSON-encoded data from the server using a GET HTTP request.
687 *
688 * @param url A string containing the URL to which the request is sent.
689 * @param success A callback function that is executed if the request succeeds.
690 */
691 getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
692 /**
693 * Load JSON-encoded data from the server using a GET HTTP request.
694 *
695 * @param url A string containing the URL to which the request is sent.
696 * @param data A plain object or string that is sent to the server with the request.
697 * @param success A callback function that is executed if the request succeeds.
698 */
699 getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
700 /**
701 * Load a JavaScript file from the server using a GET HTTP request, then execute it.
702 *
703 * @param url A string containing the URL to which the request is sent.
704 * @param success A callback function that is executed if the request succeeds.
705 */
706 getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
707
708 /**
709 * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
710 */
711 param: JQueryParam;
712
713 /**
714 * Load data from the server using a HTTP POST request.
715 *
716 * @param url A string containing the URL to which the request is sent.
717 * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
718 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
719 */
720 post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
721 /**
722 * Load data from the server using a HTTP POST request.
723 *
724 * @param url A string containing the URL to which the request is sent.
725 * @param data A plain object or string that is sent to the server with the request.
726 * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
727 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
728 */
729 post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
730 /**
731 * Load data from the server using a HTTP POST request.
732 *
733 * @param settings The JQueryAjaxSettings to be used for the request
734 */
735 post(settings : JQueryAjaxSettings): JQueryXHR;
736 /**
737 * A multi-purpose callbacks list object that provides a powerful way to manage callback lists.
738 *
739 * @param flags An optional list of space-separated flags that change how the callback list behaves.
740 */
741 Callbacks(flags?: string): JQueryCallback;
742
743 /**
744 * Holds or releases the execution of jQuery's ready event.
745 *
746 * @param hold Indicates whether the ready hold is being requested or released
747 */
748 holdReady(hold: boolean): void;
749
750 /**
751 * Accepts a string containing a CSS selector which is then used to match a set of elements.
752 *
753 * @param selector A string containing a selector expression
754 * @param context A DOM Element, Document, or jQuery to use as context
755 */
756 (selector: string, context?: Element|JQuery): JQuery;
757
758 /**
759 * Accepts a string containing a CSS selector which is then used to match a set of elements.
760 *
761 * @param element A DOM element to wrap in a jQuery object.
762 */
763 (element: Element): JQuery;
764
765 /**
766 * Accepts a string containing a CSS selector which is then used to match a set of elements.
767 *
768 * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object.
769 */
770 (elementArray: Element[]): JQuery;
771
772 /**
773 * Binds a function to be executed when the DOM has finished loading.
774 *
775 * @param callback A function to execute after the DOM is ready.
776 */
777 (callback: (jQueryAlias?: JQueryStatic) => any): JQuery;
778
779 /**
780 * Accepts a string containing a CSS selector which is then used to match a set of elements.
781 *
782 * @param object A plain object to wrap in a jQuery object.
783 */
784 (object: {}): JQuery;
785
786 /**
787 * Accepts a string containing a CSS selector which is then used to match a set of elements.
788 *
789 * @param object An existing jQuery object to clone.
790 */
791 (object: JQuery): JQuery;
792
793 /**
794 * Specify a function to execute when the DOM is fully loaded.
795 */
796 (): JQuery;
797
798 /**
799 * Creates DOM elements on the fly from the provided string of raw HTML.
800 *
801 * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML.
802 * @param ownerDocument A document in which the new elements will be created.
803 */
804 (html: string, ownerDocument?: Document): JQuery;
805
806 /**
807 * Creates DOM elements on the fly from the provided string of raw HTML.
808 *
809 * @param html A string defining a single, standalone, HTML element (e.g. <div/> or <div></div>).
810 * @param attributes An object of attributes, events, and methods to call on the newly-created element.
811 */
812 (html: string, attributes: Object): JQuery;
813
814 /**
815 * Relinquish jQuery's control of the $ variable.
816 *
817 * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).
818 */
819 noConflict(removeAll?: boolean): JQueryStatic;
820
821 /**
822 * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
823 *
824 * @param deferreds One or more Deferred objects, or plain JavaScript objects.
825 */
826 when<T>(...deferreds: Array<T|JQueryPromise<T>/* as JQueryDeferred<T> */>): JQueryPromise<T>;
827
828 /**
829 * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties.
830 */
831 cssHooks: { [key: string]: any; };
832 cssNumber: any;
833
834 /**
835 * Store arbitrary data associated with the specified element. Returns the value that was set.
836 *
837 * @param element The DOM element to associate with the data.
838 * @param key A string naming the piece of data to set.
839 * @param value The new data value.
840 */
841 data<T>(element: Element, key: string, value: T): T;
842 /**
843 * 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.
844 *
845 * @param element The DOM element to associate with the data.
846 * @param key A string naming the piece of data to set.
847 */
848 data(element: Element, key: string): any;
849 /**
850 * 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.
851 *
852 * @param element The DOM element to associate with the data.
853 */
854 data(element: Element): any;
855
856 /**
857 * Execute the next function on the queue for the matched element.
858 *
859 * @param element A DOM element from which to remove and execute a queued function.
860 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
861 */
862 dequeue(element: Element, queueName?: string): void;
863
864 /**
865 * Determine whether an element has any jQuery data associated with it.
866 *
867 * @param element A DOM element to be checked for data.
868 */
869 hasData(element: Element): boolean;
870
871 /**
872 * Show the queue of functions to be executed on the matched element.
873 *
874 * @param element A DOM element to inspect for an attached queue.
875 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
876 */
877 queue(element: Element, queueName?: string): any[];
878 /**
879 * Manipulate the queue of functions to be executed on the matched element.
880 *
881 * @param element A DOM element where the array of queued functions is attached.
882 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
883 * @param newQueue An array of functions to replace the current queue contents.
884 */
885 queue(element: Element, queueName: string, newQueue: Function[]): JQuery;
886 /**
887 * Manipulate the queue of functions to be executed on the matched element.
888 *
889 * @param element A DOM element on which to add a queued function.
890 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
891 * @param callback The new function to add to the queue.
892 */
893 queue(element: Element, queueName: string, callback: Function): JQuery;
894
895 /**
896 * Remove a previously-stored piece of data.
897 *
898 * @param element A DOM element from which to remove data.
899 * @param name A string naming the piece of data to remove.
900 */
901 removeData(element: Element, name?: string): JQuery;
902
903 /**
904 * 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.
905 *
906 * @param beforeStart A function that is called just before the constructor returns.
907 */
908 Deferred<T>(beforeStart?: (deferred: JQueryDeferred<T>) => any): JQueryDeferred<T>;
909
910 /**
911 * Effects
912 */
913
914 easing: JQueryEasingFunctions;
915
916 fx: {
917 tick: () => void;
918 /**
919 * The rate (in milliseconds) at which animations fire.
920 */
921 interval: number;
922 stop: () => void;
923 speeds: { slow: number; fast: number; };
924 /**
925 * Globally disable all animations.
926 */
927 off: boolean;
928 step: any;
929 };
930
931 /**
932 * Takes a function and returns a new one that will always have a particular context.
933 *
934 * @param fnction The function whose context will be changed.
935 * @param context The object to which the context (this) of the function should be set.
936 * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument.
937 */
938 proxy(fnction: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any;
939 /**
940 * Takes a function and returns a new one that will always have a particular context.
941 *
942 * @param context The object to which the context (this) of the function should be set.
943 * @param name The name of the function whose context will be changed (should be a property of the context object).
944 * @param additionalArguments Any number of arguments to be passed to the function named in the name argument.
945 */
946 proxy(context: Object, name: string, ...additionalArguments: any[]): any;
947
948 Event: JQueryEventConstructor;
949
950 /**
951 * Takes a string and throws an exception containing it.
952 *
953 * @param message The message to send out.
954 */
955 error(message: any): JQuery;
956
957 expr: any;
958 fn: any; //TODO: Decide how we want to type this
959
960 isReady: boolean;
961
962 // Properties
963 support: JQuerySupport;
964
965 /**
966 * Check to see if a DOM element is a descendant of another DOM element.
967 *
968 * @param container The DOM element that may contain the other element.
969 * @param contained The DOM element that may be contained by (a descendant of) the other element.
970 */
971 contains(container: Element, contained: Element): boolean;
972
973 /**
974 * 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.
975 *
976 * @param collection The object or array to iterate over.
977 * @param callback The function that will be executed on every object.
978 */
979 each<T>(
980 collection: T[],
981 callback: (indexInArray: number, valueOfElement: T) => any
982 ): any;
983
984 /**
985 * 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.
986 *
987 * @param collection The object or array to iterate over.
988 * @param callback The function that will be executed on every object.
989 */
990 each(
991 collection: any,
992 callback: (indexInArray: any, valueOfElement: any) => any
993 ): any;
994
995 /**
996 * Merge the contents of two or more objects together into the first object.
997 *
998 * @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.
999 * @param object1 An object containing additional properties to merge in.
1000 * @param objectN Additional objects containing properties to merge in.
1001 */
1002 extend(target: any, object1?: any, ...objectN: any[]): any;
1003 /**
1004 * Merge the contents of two or more objects together into the first object.
1005 *
1006 * @param deep If true, the merge becomes recursive (aka. deep copy).
1007 * @param target The object to extend. It will receive the new properties.
1008 * @param object1 An object containing additional properties to merge in.
1009 * @param objectN Additional objects containing properties to merge in.
1010 */
1011 extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any;
1012
1013 /**
1014 * Execute some JavaScript code globally.
1015 *
1016 * @param code The JavaScript code to execute.
1017 */
1018 globalEval(code: string): any;
1019
1020 /**
1021 * Finds the elements of an array which satisfy a filter function. The original array is not affected.
1022 *
1023 * @param array The array to search through.
1024 * @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.
1025 * @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.
1026 */
1027 grep<T>(array: T[], func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[];
1028
1029 /**
1030 * Search for a specified value within an array and return its index (or -1 if not found).
1031 *
1032 * @param value The value to search for.
1033 * @param array An array through which to search.
1034 * @param fromIndex he index of the array at which to begin the search. The default is 0, which will search the whole array.
1035 */
1036 inArray<T>(value: T, array: T[], fromIndex?: number): number;
1037
1038 /**
1039 * Determine whether the argument is an array.
1040 *
1041 * @param obj Object to test whether or not it is an array.
1042 */
1043 isArray(obj: any): boolean;
1044 /**
1045 * Check to see if an object is empty (contains no enumerable properties).
1046 *
1047 * @param obj The object that will be checked to see if it's empty.
1048 */
1049 isEmptyObject(obj: any): boolean;
1050 /**
1051 * Determine if the argument passed is a Javascript function object.
1052 *
1053 * @param obj Object to test whether or not it is a function.
1054 */
1055 isFunction(obj: any): boolean;
1056 /**
1057 * Determines whether its argument is a number.
1058 *
1059 * @param obj The value to be tested.
1060 */
1061 isNumeric(value: any): boolean;
1062 /**
1063 * Check to see if an object is a plain object (created using "{}" or "new Object").
1064 *
1065 * @param obj The object that will be checked to see if it's a plain object.
1066 */
1067 isPlainObject(obj: any): boolean;
1068 /**
1069 * Determine whether the argument is a window.
1070 *
1071 * @param obj Object to test whether or not it is a window.
1072 */
1073 isWindow(obj: any): boolean;
1074 /**
1075 * Check to see if a DOM node is within an XML document (or is an XML document).
1076 *
1077 * @param node he DOM node that will be checked to see if it's in an XML document.
1078 */
1079 isXMLDoc(node: Node): boolean;
1080
1081 /**
1082 * Convert an array-like object into a true JavaScript array.
1083 *
1084 * @param obj Any object to turn into a native Array.
1085 */
1086 makeArray(obj: any): any[];
1087
1088 /**
1089 * Translate all items in an array or object to new array of items.
1090 *
1091 * @param array The Array to translate.
1092 * @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.
1093 */
1094 map<T, U>(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[];
1095 /**
1096 * Translate all items in an array or object to new array of items.
1097 *
1098 * @param arrayOrObject The Array or Object to translate.
1099 * @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.
1100 */
1101 map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any;
1102
1103 /**
1104 * Merge the contents of two arrays together into the first array.
1105 *
1106 * @param first The first array to merge, the elements of second added.
1107 * @param second The second array to merge into the first, unaltered.
1108 */
1109 merge<T>(first: T[], second: T[]): T[];
1110
1111 /**
1112 * An empty function.
1113 */
1114 noop(): any;
1115
1116 /**
1117 * Return a number representing the current time.
1118 */
1119 now(): number;
1120
1121 /**
1122 * Takes a well-formed JSON string and returns the resulting JavaScript object.
1123 *
1124 * @param json The JSON string to parse.
1125 */
1126 parseJSON(json: string): any;
1127
1128 /**
1129 * Parses a string into an XML document.
1130 *
1131 * @param data a well-formed XML string to be parsed
1132 */
1133 parseXML(data: string): XMLDocument;
1134
1135 /**
1136 * Remove the whitespace from the beginning and end of a string.
1137 *
1138 * @param str Remove the whitespace from the beginning and end of a string.
1139 */
1140 trim(str: string): string;
1141
1142 /**
1143 * Determine the internal JavaScript [[Class]] of an object.
1144 *
1145 * @param obj Object to get the internal JavaScript [[Class]] of.
1146 */
1147 type(obj: any): string;
1148
1149 /**
1150 * 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.
1151 *
1152 * @param array The Array of DOM elements.
1153 */
1154 unique(array: Element[]): Element[];
1155
1156 /**
1157 * Parses a string into an array of DOM nodes.
1158 *
1159 * @param data HTML string to be parsed
1160 * @param context DOM element to serve as the context in which the HTML fragment will be created
1161 * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
1162 */
1163 parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[];
1164
1165 /**
1166 * Parses a string into an array of DOM nodes.
1167 *
1168 * @param data HTML string to be parsed
1169 * @param context DOM element to serve as the context in which the HTML fragment will be created
1170 * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
1171 */
1172 parseHTML(data: string, context?: Document, keepScripts?: boolean): any[];
1173 }
1174
1175 /**
1176 * The jQuery instance members
1177 */
1178 interface JQuery {
1179 /**
1180 * Register a handler to be called when Ajax requests complete. This is an AjaxEvent.
1181 *
1182 * @param handler The function to be invoked.
1183 */
1184 ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery;
1185 /**
1186 * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event.
1187 *
1188 * @param handler The function to be invoked.
1189 */
1190 ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery;
1191 /**
1192 * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event.
1193 *
1194 * @param handler The function to be invoked.
1195 */
1196 ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery;
1197 /**
1198 * Register a handler to be called when the first Ajax request begins. This is an Ajax Event.
1199 *
1200 * @param handler The function to be invoked.
1201 */
1202 ajaxStart(handler: () => any): JQuery;
1203 /**
1204 * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event.
1205 *
1206 * @param handler The function to be invoked.
1207 */
1208 ajaxStop(handler: () => any): JQuery;
1209 /**
1210 * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event.
1211 *
1212 * @param handler The function to be invoked.
1213 */
1214 ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery;
1215
1216 /**
1217 * Load data from the server and place the returned HTML into the matched element.
1218 *
1219 * @param url A string containing the URL to which the request is sent.
1220 * @param data A plain object or string that is sent to the server with the request.
1221 * @param complete A callback function that is executed when the request completes.
1222 */
1223 load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery;
1224
1225 /**
1226 * Encode a set of form elements as a string for submission.
1227 */
1228 serialize(): string;
1229 /**
1230 * Encode a set of form elements as an array of names and values.
1231 */
1232 serializeArray(): JQuerySerializeArrayElement[];
1233
1234 /**
1235 * Adds the specified class(es) to each of the set of matched elements.
1236 *
1237 * @param className One or more space-separated classes to be added to the class attribute of each matched element.
1238 */
1239 addClass(className: string): JQuery;
1240 /**
1241 * Adds the specified class(es) to each of the set of matched elements.
1242 *
1243 * @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.
1244 */
1245 addClass(func: (index: number, className: string) => string): JQuery;
1246
1247 /**
1248 * Add the previous set of elements on the stack to the current set, optionally filtered by a selector.
1249 */
1250 addBack(selector?: string): JQuery;
1251
1252 /**
1253 * Get the value of an attribute for the first element in the set of matched elements.
1254 *
1255 * @param attributeName The name of the attribute to get.
1256 */
1257 attr(attributeName: string): string;
1258 /**
1259 * Set one or more attributes for the set of matched elements.
1260 *
1261 * @param attributeName The name of the attribute to set.
1262 * @param value A value to set for the attribute.
1263 */
1264 attr(attributeName: string, value: string|number): JQuery;
1265 /**
1266 * Set one or more attributes for the set of matched elements.
1267 *
1268 * @param attributeName The name of the attribute to set.
1269 * @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.
1270 */
1271 attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery;
1272 /**
1273 * Set one or more attributes for the set of matched elements.
1274 *
1275 * @param attributes An object of attribute-value pairs to set.
1276 */
1277 attr(attributes: Object): JQuery;
1278
1279 /**
1280 * Determine whether any of the matched elements are assigned the given class.
1281 *
1282 * @param className The class name to search for.
1283 */
1284 hasClass(className: string): boolean;
1285
1286 /**
1287 * Get the HTML contents of the first element in the set of matched elements.
1288 */
1289 html(): string;
1290 /**
1291 * Set the HTML contents of each element in the set of matched elements.
1292 *
1293 * @param htmlString A string of HTML to set as the content of each matched element.
1294 */
1295 html(htmlString: string): JQuery;
1296 /**
1297 * Set the HTML contents of each element in the set of matched elements.
1298 *
1299 * @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.
1300 */
1301 html(func: (index: number, oldhtml: string) => string): JQuery;
1302 /**
1303 * Set the HTML contents of each element in the set of matched elements.
1304 *
1305 * @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.
1306 */
1307
1308 /**
1309 * Get the value of a property for the first element in the set of matched elements.
1310 *
1311 * @param propertyName The name of the property to get.
1312 */
1313 prop(propertyName: string): any;
1314 /**
1315 * Set one or more properties for the set of matched elements.
1316 *
1317 * @param propertyName The name of the property to set.
1318 * @param value A value to set for the property.
1319 */
1320 prop(propertyName: string, value: string|number|boolean): JQuery;
1321 /**
1322 * Set one or more properties for the set of matched elements.
1323 *
1324 * @param properties An object of property-value pairs to set.
1325 */
1326 prop(properties: Object): JQuery;
1327 /**
1328 * Set one or more properties for the set of matched elements.
1329 *
1330 * @param propertyName The name of the property to set.
1331 * @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.
1332 */
1333 prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery;
1334
1335 /**
1336 * Remove an attribute from each element in the set of matched elements.
1337 *
1338 * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes.
1339 */
1340 removeAttr(attributeName: string): JQuery;
1341
1342 /**
1343 * Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
1344 *
1345 * @param className One or more space-separated classes to be removed from the class attribute of each matched element.
1346 */
1347 removeClass(className?: string): JQuery;
1348 /**
1349 * Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
1350 *
1351 * @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.
1352 */
1353 removeClass(func: (index: number, className: string) => string): JQuery;
1354
1355 /**
1356 * Remove a property for the set of matched elements.
1357 *
1358 * @param propertyName The name of the property to remove.
1359 */
1360 removeProp(propertyName: string): JQuery;
1361
1362 /**
1363 * 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.
1364 *
1365 * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set.
1366 * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.
1367 */
1368 toggleClass(className: string, swtch?: boolean): JQuery;
1369 /**
1370 * 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.
1371 *
1372 * @param swtch A boolean value to determine whether the class should be added or removed.
1373 */
1374 toggleClass(swtch?: boolean): JQuery;
1375 /**
1376 * 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.
1377 *
1378 * @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.
1379 * @param swtch A boolean value to determine whether the class should be added or removed.
1380 */
1381 toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery;
1382
1383 /**
1384 * Get the current value of the first element in the set of matched elements.
1385 */
1386 val(): any;
1387 /**
1388 * Set the value of each element in the set of matched elements.
1389 *
1390 * @param value A string of text, an array of strings or number corresponding to the value of each matched element to set as selected/checked.
1391 */
1392 val(value: string|string[]|number): JQuery;
1393 /**
1394 * Set the value of each element in the set of matched elements.
1395 *
1396 * @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.
1397 */
1398 val(func: (index: number, value: string) => string): JQuery;
1399
1400
1401 /**
1402 * Get the value of style properties for the first element in the set of matched elements.
1403 *
1404 * @param propertyName A CSS property.
1405 */
1406 css(propertyName: string): string;
1407 /**
1408 * Set one or more CSS properties for the set of matched elements.
1409 *
1410 * @param propertyName A CSS property name.
1411 * @param value A value to set for the property.
1412 */
1413 css(propertyName: string, value: string|number): JQuery;
1414 /**
1415 * Set one or more CSS properties for the set of matched elements.
1416 *
1417 * @param propertyName A CSS property name.
1418 * @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.
1419 */
1420 css(propertyName: string, value: (index: number, value: string) => string|number): JQuery;
1421 /**
1422 * Set one or more CSS properties for the set of matched elements.
1423 *
1424 * @param properties An object of property-value pairs to set.
1425 */
1426 css(properties: Object): JQuery;
1427
1428 /**
1429 * Get the current computed height for the first element in the set of matched elements.
1430 */
1431 height(): number;
1432 /**
1433 * Set the CSS height of every matched element.
1434 *
1435 * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string).
1436 */
1437 height(value: number|string): JQuery;
1438 /**
1439 * Set the CSS height of every matched element.
1440 *
1441 * @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.
1442 */
1443 height(func: (index: number, height: number) => number|string): JQuery;
1444
1445 /**
1446 * Get the current computed height for the first element in the set of matched elements, including padding but not border.
1447 */
1448 innerHeight(): number;
1449
1450 /**
1451 * Sets the inner height on elements in the set of matched elements, including padding but not border.
1452 *
1453 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1454 */
1455 innerHeight(height: number|string): JQuery;
1456
1457 /**
1458 * Get the current computed width for the first element in the set of matched elements, including padding but not border.
1459 */
1460 innerWidth(): number;
1461
1462 /**
1463 * Sets the inner width on elements in the set of matched elements, including padding but not border.
1464 *
1465 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1466 */
1467 innerWidth(width: number|string): JQuery;
1468
1469 /**
1470 * Get the current coordinates of the first element in the set of matched elements, relative to the document.
1471 */
1472 offset(): JQueryCoordinates;
1473 /**
1474 * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
1475 *
1476 * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
1477 */
1478 offset(coordinates: JQueryCoordinates): JQuery;
1479 /**
1480 * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
1481 *
1482 * @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.
1483 */
1484 offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery;
1485
1486 /**
1487 * 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.
1488 *
1489 * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
1490 */
1491 outerHeight(includeMargin?: boolean): number;
1492
1493 /**
1494 * Sets the outer height on elements in the set of matched elements, including padding and border.
1495 *
1496 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1497 */
1498 outerHeight(height: number|string): JQuery;
1499
1500 /**
1501 * Get the current computed width for the first element in the set of matched elements, including padding and border.
1502 *
1503 * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
1504 */
1505 outerWidth(includeMargin?: boolean): number;
1506
1507 /**
1508 * Sets the outer width on elements in the set of matched elements, including padding and border.
1509 *
1510 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1511 */
1512 outerWidth(width: number|string): JQuery;
1513
1514 /**
1515 * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
1516 */
1517 position(): JQueryCoordinates;
1518
1519 /**
1520 * 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.
1521 */
1522 scrollLeft(): number;
1523 /**
1524 * Set the current horizontal position of the scroll bar for each of the set of matched elements.
1525 *
1526 * @param value An integer indicating the new position to set the scroll bar to.
1527 */
1528 scrollLeft(value: number): JQuery;
1529
1530 /**
1531 * 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.
1532 */
1533 scrollTop(): number;
1534 /**
1535 * Set the current vertical position of the scroll bar for each of the set of matched elements.
1536 *
1537 * @param value An integer indicating the new position to set the scroll bar to.
1538 */
1539 scrollTop(value: number): JQuery;
1540
1541 /**
1542 * Get the current computed width for the first element in the set of matched elements.
1543 */
1544 width(): number;
1545 /**
1546 * Set the CSS width of each element in the set of matched elements.
1547 *
1548 * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
1549 */
1550 width(value: number|string): JQuery;
1551 /**
1552 * Set the CSS width of each element in the set of matched elements.
1553 *
1554 * @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.
1555 */
1556 width(func: (index: number, width: number) => number|string): JQuery;
1557
1558 /**
1559 * Remove from the queue all items that have not yet been run.
1560 *
1561 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
1562 */
1563 clearQueue(queueName?: string): JQuery;
1564
1565 /**
1566 * Store arbitrary data associated with the matched elements.
1567 *
1568 * @param key A string naming the piece of data to set.
1569 * @param value The new data value; it can be any Javascript type including Array or Object.
1570 */
1571 data(key: string, value: any): JQuery;
1572 /**
1573 * 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.
1574 *
1575 * @param key Name of the data stored.
1576 */
1577 data(key: string): any;
1578 /**
1579 * Store arbitrary data associated with the matched elements.
1580 *
1581 * @param obj An object of key-value pairs of data to update.
1582 */
1583 data(obj: { [key: string]: any; }): JQuery;
1584 /**
1585 * 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.
1586 */
1587 data(): any;
1588
1589 /**
1590 * Execute the next function on the queue for the matched elements.
1591 *
1592 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
1593 */
1594 dequeue(queueName?: string): JQuery;
1595
1596 /**
1597 * Remove a previously-stored piece of data.
1598 *
1599 * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete.
1600 */
1601 removeData(name: string): JQuery;
1602 /**
1603 * Remove a previously-stored piece of data.
1604 *
1605 * @param list An array of strings naming the pieces of data to delete.
1606 */
1607 removeData(list: string[]): JQuery;
1608 /**
1609 * Remove all previously-stored piece of data.
1610 */
1611 removeData(): JQuery;
1612
1613 /**
1614 * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.
1615 *
1616 * @param type The type of queue that needs to be observed. (default: fx)
1617 * @param target Object onto which the promise methods have to be attached
1618 */
1619 promise(type?: string, target?: Object): JQueryPromise<any>;
1620
1621 /**
1622 * Perform a custom animation of a set of CSS properties.
1623 *
1624 * @param properties An object of CSS properties and values that the animation will move toward.
1625 * @param duration A string or number determining how long the animation will run.
1626 * @param complete A function to call once the animation is complete.
1627 */
1628 animate(properties: Object, duration?: string|number, complete?: Function): JQuery;
1629 /**
1630 * Perform a custom animation of a set of CSS properties.
1631 *
1632 * @param properties An object of CSS properties and values that the animation will move toward.
1633 * @param duration A string or number determining how long the animation will run.
1634 * @param easing A string indicating which easing function to use for the transition. (default: swing)
1635 * @param complete A function to call once the animation is complete.
1636 */
1637 animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): JQuery;
1638 /**
1639 * Perform a custom animation of a set of CSS properties.
1640 *
1641 * @param properties An object of CSS properties and values that the animation will move toward.
1642 * @param options A map of additional options to pass to the method.
1643 */
1644 animate(properties: Object, options: JQueryAnimationOptions): JQuery;
1645
1646 /**
1647 * Set a timer to delay execution of subsequent items in the queue.
1648 *
1649 * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue.
1650 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
1651 */
1652 delay(duration: number, queueName?: string): JQuery;
1653
1654 /**
1655 * Display the matched elements by fading them to opaque.
1656 *
1657 * @param duration A string or number determining how long the animation will run.
1658 * @param complete A function to call once the animation is complete.
1659 */
1660 fadeIn(duration?: number|string, complete?: Function): JQuery;
1661 /**
1662 * Display the matched elements by fading them to opaque.
1663 *
1664 * @param duration A string or number determining how long the animation will run.
1665 * @param easing A string indicating which easing function to use for the transition.
1666 * @param complete A function to call once the animation is complete.
1667 */
1668 fadeIn(duration?: number|string, easing?: string, complete?: Function): JQuery;
1669 /**
1670 * Display the matched elements by fading them to opaque.
1671 *
1672 * @param options A map of additional options to pass to the method.
1673 */
1674 fadeIn(options: JQueryAnimationOptions): JQuery;
1675
1676 /**
1677 * Hide the matched elements by fading them to transparent.
1678 *
1679 * @param duration A string or number determining how long the animation will run.
1680 * @param complete A function to call once the animation is complete.
1681 */
1682 fadeOut(duration?: number|string, complete?: Function): JQuery;
1683 /**
1684 * Hide the matched elements by fading them to transparent.
1685 *
1686 * @param duration A string or number determining how long the animation will run.
1687 * @param easing A string indicating which easing function to use for the transition.
1688 * @param complete A function to call once the animation is complete.
1689 */
1690 fadeOut(duration?: number|string, easing?: string, complete?: Function): JQuery;
1691 /**
1692 * Hide the matched elements by fading them to transparent.
1693 *
1694 * @param options A map of additional options to pass to the method.
1695 */
1696 fadeOut(options: JQueryAnimationOptions): JQuery;
1697
1698 /**
1699 * Adjust the opacity of the matched elements.
1700 *
1701 * @param duration A string or number determining how long the animation will run.
1702 * @param opacity A number between 0 and 1 denoting the target opacity.
1703 * @param complete A function to call once the animation is complete.
1704 */
1705 fadeTo(duration: string|number, opacity: number, complete?: Function): JQuery;
1706 /**
1707 * Adjust the opacity of the matched elements.
1708 *
1709 * @param duration A string or number determining how long the animation will run.
1710 * @param opacity A number between 0 and 1 denoting the target opacity.
1711 * @param easing A string indicating which easing function to use for the transition.
1712 * @param complete A function to call once the animation is complete.
1713 */
1714 fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): JQuery;
1715
1716 /**
1717 * Display or hide the matched elements by animating their opacity.
1718 *
1719 * @param duration A string or number determining how long the animation will run.
1720 * @param complete A function to call once the animation is complete.
1721 */
1722 fadeToggle(duration?: number|string, complete?: Function): JQuery;
1723 /**
1724 * Display or hide the matched elements by animating their opacity.
1725 *
1726 * @param duration A string or number determining how long the animation will run.
1727 * @param easing A string indicating which easing function to use for the transition.
1728 * @param complete A function to call once the animation is complete.
1729 */
1730 fadeToggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
1731 /**
1732 * Display or hide the matched elements by animating their opacity.
1733 *
1734 * @param options A map of additional options to pass to the method.
1735 */
1736 fadeToggle(options: JQueryAnimationOptions): JQuery;
1737
1738 /**
1739 * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements.
1740 *
1741 * @param queue The name of the queue in which to stop animations.
1742 */
1743 finish(queue?: string): JQuery;
1744
1745 /**
1746 * Hide the matched elements.
1747 *
1748 * @param duration A string or number determining how long the animation will run.
1749 * @param complete A function to call once the animation is complete.
1750 */
1751 hide(duration?: number|string, complete?: Function): JQuery;
1752 /**
1753 * Hide the matched elements.
1754 *
1755 * @param duration A string or number determining how long the animation will run.
1756 * @param easing A string indicating which easing function to use for the transition.
1757 * @param complete A function to call once the animation is complete.
1758 */
1759 hide(duration?: number|string, easing?: string, complete?: Function): JQuery;
1760 /**
1761 * Hide the matched elements.
1762 *
1763 * @param options A map of additional options to pass to the method.
1764 */
1765 hide(options: JQueryAnimationOptions): JQuery;
1766
1767 /**
1768 * Display the matched elements.
1769 *
1770 * @param duration A string or number determining how long the animation will run.
1771 * @param complete A function to call once the animation is complete.
1772 */
1773 show(duration?: number|string, complete?: Function): JQuery;
1774 /**
1775 * Display the matched elements.
1776 *
1777 * @param duration A string or number determining how long the animation will run.
1778 * @param easing A string indicating which easing function to use for the transition.
1779 * @param complete A function to call once the animation is complete.
1780 */
1781 show(duration?: number|string, easing?: string, complete?: Function): JQuery;
1782 /**
1783 * Display the matched elements.
1784 *
1785 * @param options A map of additional options to pass to the method.
1786 */
1787 show(options: JQueryAnimationOptions): JQuery;
1788
1789 /**
1790 * Display the matched elements with a sliding motion.
1791 *
1792 * @param duration A string or number determining how long the animation will run.
1793 * @param complete A function to call once the animation is complete.
1794 */
1795 slideDown(duration?: number|string, complete?: Function): JQuery;
1796 /**
1797 * Display the matched elements with a sliding motion.
1798 *
1799 * @param duration A string or number determining how long the animation will run.
1800 * @param easing A string indicating which easing function to use for the transition.
1801 * @param complete A function to call once the animation is complete.
1802 */
1803 slideDown(duration?: number|string, easing?: string, complete?: Function): JQuery;
1804 /**
1805 * Display the matched elements with a sliding motion.
1806 *
1807 * @param options A map of additional options to pass to the method.
1808 */
1809 slideDown(options: JQueryAnimationOptions): JQuery;
1810
1811 /**
1812 * Display or hide the matched elements with a sliding motion.
1813 *
1814 * @param duration A string or number determining how long the animation will run.
1815 * @param complete A function to call once the animation is complete.
1816 */
1817 slideToggle(duration?: number|string, complete?: Function): JQuery;
1818 /**
1819 * Display or hide the matched elements with a sliding motion.
1820 *
1821 * @param duration A string or number determining how long the animation will run.
1822 * @param easing A string indicating which easing function to use for the transition.
1823 * @param complete A function to call once the animation is complete.
1824 */
1825 slideToggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
1826 /**
1827 * Display or hide the matched elements with a sliding motion.
1828 *
1829 * @param options A map of additional options to pass to the method.
1830 */
1831 slideToggle(options: JQueryAnimationOptions): JQuery;
1832
1833 /**
1834 * Hide the matched elements with a sliding motion.
1835 *
1836 * @param duration A string or number determining how long the animation will run.
1837 * @param complete A function to call once the animation is complete.
1838 */
1839 slideUp(duration?: number|string, complete?: Function): JQuery;
1840 /**
1841 * Hide the matched elements with a sliding motion.
1842 *
1843 * @param duration A string or number determining how long the animation will run.
1844 * @param easing A string indicating which easing function to use for the transition.
1845 * @param complete A function to call once the animation is complete.
1846 */
1847 slideUp(duration?: number|string, easing?: string, complete?: Function): JQuery;
1848 /**
1849 * Hide the matched elements with a sliding motion.
1850 *
1851 * @param options A map of additional options to pass to the method.
1852 */
1853 slideUp(options: JQueryAnimationOptions): JQuery;
1854
1855 /**
1856 * Stop the currently-running animation on the matched elements.
1857 *
1858 * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
1859 * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
1860 */
1861 stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery;
1862 /**
1863 * Stop the currently-running animation on the matched elements.
1864 *
1865 * @param queue The name of the queue in which to stop animations.
1866 * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
1867 * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
1868 */
1869 stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery;
1870
1871 /**
1872 * Display or hide the matched elements.
1873 *
1874 * @param duration A string or number determining how long the animation will run.
1875 * @param complete A function to call once the animation is complete.
1876 */
1877 toggle(duration?: number|string, complete?: Function): JQuery;
1878 /**
1879 * Display or hide the matched elements.
1880 *
1881 * @param duration A string or number determining how long the animation will run.
1882 * @param easing A string indicating which easing function to use for the transition.
1883 * @param complete A function to call once the animation is complete.
1884 */
1885 toggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
1886 /**
1887 * Display or hide the matched elements.
1888 *
1889 * @param options A map of additional options to pass to the method.
1890 */
1891 toggle(options: JQueryAnimationOptions): JQuery;
1892 /**
1893 * Display or hide the matched elements.
1894 *
1895 * @param showOrHide A Boolean indicating whether to show or hide the elements.
1896 */
1897 toggle(showOrHide: boolean): JQuery;
1898
1899 /**
1900 * Attach a handler to an event for the elements.
1901 *
1902 * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
1903 * @param eventData An object containing data that will be passed to the event handler.
1904 * @param handler A function to execute each time the event is triggered.
1905 */
1906 bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
1907 /**
1908 * Attach a handler to an event for the elements.
1909 *
1910 * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
1911 * @param handler A function to execute each time the event is triggered.
1912 */
1913 bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
1914 /**
1915 * Attach a handler to an event for the elements.
1916 *
1917 * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
1918 * @param eventData An object containing data that will be passed to the event handler.
1919 * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true.
1920 */
1921 bind(eventType: string, eventData: any, preventBubble: boolean): JQuery;
1922 /**
1923 * Attach a handler to an event for the elements.
1924 *
1925 * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
1926 * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true.
1927 */
1928 bind(eventType: string, preventBubble: boolean): JQuery;
1929 /**
1930 * Attach a handler to an event for the elements.
1931 *
1932 * @param events An object containing one or more DOM event types and functions to execute for them.
1933 */
1934 bind(events: any): JQuery;
1935
1936 /**
1937 * Trigger the "blur" event on an element
1938 */
1939 blur(): JQuery;
1940 /**
1941 * Bind an event handler to the "blur" JavaScript event
1942 *
1943 * @param handler A function to execute each time the event is triggered.
1944 */
1945 blur(handler: (eventObject: JQueryEventObject) => any): JQuery;
1946 /**
1947 * Bind an event handler to the "blur" JavaScript event
1948 *
1949 * @param eventData An object containing data that will be passed to the event handler.
1950 * @param handler A function to execute each time the event is triggered.
1951 */
1952 blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
1953
1954 /**
1955 * Trigger the "change" event on an element.
1956 */
1957 change(): JQuery;
1958 /**
1959 * Bind an event handler to the "change" JavaScript event
1960 *
1961 * @param handler A function to execute each time the event is triggered.
1962 */
1963 change(handler: (eventObject: JQueryEventObject) => any): JQuery;
1964 /**
1965 * Bind an event handler to the "change" JavaScript event
1966 *
1967 * @param eventData An object containing data that will be passed to the event handler.
1968 * @param handler A function to execute each time the event is triggered.
1969 */
1970 change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
1971
1972 /**
1973 * Trigger the "click" event on an element.
1974 */
1975 click(): JQuery;
1976 /**
1977 * Bind an event handler to the "click" JavaScript event
1978 *
1979 * @param eventData An object containing data that will be passed to the event handler.
1980 */
1981 click(handler: (eventObject: JQueryEventObject) => any): JQuery;
1982 /**
1983 * Bind an event handler to the "click" JavaScript event
1984 *
1985 * @param eventData An object containing data that will be passed to the event handler.
1986 * @param handler A function to execute each time the event is triggered.
1987 */
1988 click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
1989
1990 /**
1991 * Trigger the "dblclick" event on an element.
1992 */
1993 dblclick(): JQuery;
1994 /**
1995 * Bind an event handler to the "dblclick" JavaScript event
1996 *
1997 * @param handler A function to execute each time the event is triggered.
1998 */
1999 dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery;
2000 /**
2001 * Bind an event handler to the "dblclick" JavaScript event
2002 *
2003 * @param eventData An object containing data that will be passed to the event handler.
2004 * @param handler A function to execute each time the event is triggered.
2005 */
2006 dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2007
2008 delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
2009 delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
2010
2011 /**
2012 * Trigger the "focus" event on an element.
2013 */
2014 focus(): JQuery;
2015 /**
2016 * Bind an event handler to the "focus" JavaScript event
2017 *
2018 * @param handler A function to execute each time the event is triggered.
2019 */
2020 focus(handler: (eventObject: JQueryEventObject) => any): JQuery;
2021 /**
2022 * Bind an event handler to the "focus" JavaScript event
2023 *
2024 * @param eventData An object containing data that will be passed to the event handler.
2025 * @param handler A function to execute each time the event is triggered.
2026 */
2027 focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2028
2029 /**
2030 * Trigger the "focusin" event on an element.
2031 */
2032 focusin(): JQuery;
2033 /**
2034 * Bind an event handler to the "focusin" JavaScript event
2035 *
2036 * @param handler A function to execute each time the event is triggered.
2037 */
2038 focusin(handler: (eventObject: JQueryEventObject) => any): JQuery;
2039 /**
2040 * Bind an event handler to the "focusin" JavaScript event
2041 *
2042 * @param eventData An object containing data that will be passed to the event handler.
2043 * @param handler A function to execute each time the event is triggered.
2044 */
2045 focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2046
2047 /**
2048 * Trigger the "focusout" event on an element.
2049 */
2050 focusout(): JQuery;
2051 /**
2052 * Bind an event handler to the "focusout" JavaScript event
2053 *
2054 * @param handler A function to execute each time the event is triggered.
2055 */
2056 focusout(handler: (eventObject: JQueryEventObject) => any): JQuery;
2057 /**
2058 * Bind an event handler to the "focusout" JavaScript event
2059 *
2060 * @param eventData An object containing data that will be passed to the event handler.
2061 * @param handler A function to execute each time the event is triggered.
2062 */
2063 focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2064
2065 /**
2066 * Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.
2067 *
2068 * @param handlerIn A function to execute when the mouse pointer enters the element.
2069 * @param handlerOut A function to execute when the mouse pointer leaves the element.
2070 */
2071 hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery;
2072 /**
2073 * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements.
2074 *
2075 * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element.
2076 */
2077 hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery;
2078
2079 /**
2080 * Trigger the "keydown" event on an element.
2081 */
2082 keydown(): JQuery;
2083 /**
2084 * Bind an event handler to the "keydown" JavaScript event
2085 *
2086 * @param handler A function to execute each time the event is triggered.
2087 */
2088 keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
2089 /**
2090 * Bind an event handler to the "keydown" JavaScript event
2091 *
2092 * @param eventData An object containing data that will be passed to the event handler.
2093 * @param handler A function to execute each time the event is triggered.
2094 */
2095 keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
2096
2097 /**
2098 * Trigger the "keypress" event on an element.
2099 */
2100 keypress(): JQuery;
2101 /**
2102 * Bind an event handler to the "keypress" JavaScript event
2103 *
2104 * @param handler A function to execute each time the event is triggered.
2105 */
2106 keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
2107 /**
2108 * Bind an event handler to the "keypress" JavaScript event
2109 *
2110 * @param eventData An object containing data that will be passed to the event handler.
2111 * @param handler A function to execute each time the event is triggered.
2112 */
2113 keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
2114
2115 /**
2116 * Trigger the "keyup" event on an element.
2117 */
2118 keyup(): JQuery;
2119 /**
2120 * Bind an event handler to the "keyup" JavaScript event
2121 *
2122 * @param handler A function to execute each time the event is triggered.
2123 */
2124 keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
2125 /**
2126 * Bind an event handler to the "keyup" JavaScript event
2127 *
2128 * @param eventData An object containing data that will be passed to the event handler.
2129 * @param handler A function to execute each time the event is triggered.
2130 */
2131 keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
2132
2133 /**
2134 * Bind an event handler to the "load" JavaScript event.
2135 *
2136 * @param handler A function to execute when the event is triggered.
2137 */
2138 load(handler: (eventObject: JQueryEventObject) => any): JQuery;
2139 /**
2140 * Bind an event handler to the "load" JavaScript event.
2141 *
2142 * @param eventData An object containing data that will be passed to the event handler.
2143 * @param handler A function to execute when the event is triggered.
2144 */
2145 load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2146
2147 /**
2148 * Trigger the "mousedown" event on an element.
2149 */
2150 mousedown(): JQuery;
2151 /**
2152 * Bind an event handler to the "mousedown" JavaScript event.
2153 *
2154 * @param handler A function to execute when the event is triggered.
2155 */
2156 mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2157 /**
2158 * Bind an event handler to the "mousedown" JavaScript event.
2159 *
2160 * @param eventData An object containing data that will be passed to the event handler.
2161 * @param handler A function to execute when the event is triggered.
2162 */
2163 mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2164
2165 /**
2166 * Trigger the "mouseenter" event on an element.
2167 */
2168 mouseenter(): JQuery;
2169 /**
2170 * Bind an event handler to be fired when the mouse enters an element.
2171 *
2172 * @param handler A function to execute when the event is triggered.
2173 */
2174 mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2175 /**
2176 * Bind an event handler to be fired when the mouse enters an element.
2177 *
2178 * @param eventData An object containing data that will be passed to the event handler.
2179 * @param handler A function to execute when the event is triggered.
2180 */
2181 mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2182
2183 /**
2184 * Trigger the "mouseleave" event on an element.
2185 */
2186 mouseleave(): JQuery;
2187 /**
2188 * Bind an event handler to be fired when the mouse leaves an element.
2189 *
2190 * @param handler A function to execute when the event is triggered.
2191 */
2192 mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2193 /**
2194 * Bind an event handler to be fired when the mouse leaves an element.
2195 *
2196 * @param eventData An object containing data that will be passed to the event handler.
2197 * @param handler A function to execute when the event is triggered.
2198 */
2199 mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2200
2201 /**
2202 * Trigger the "mousemove" event on an element.
2203 */
2204 mousemove(): JQuery;
2205 /**
2206 * Bind an event handler to the "mousemove" JavaScript event.
2207 *
2208 * @param handler A function to execute when the event is triggered.
2209 */
2210 mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2211 /**
2212 * Bind an event handler to the "mousemove" JavaScript event.
2213 *
2214 * @param eventData An object containing data that will be passed to the event handler.
2215 * @param handler A function to execute when the event is triggered.
2216 */
2217 mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2218
2219 /**
2220 * Trigger the "mouseout" event on an element.
2221 */
2222 mouseout(): JQuery;
2223 /**
2224 * Bind an event handler to the "mouseout" JavaScript event.
2225 *
2226 * @param handler A function to execute when the event is triggered.
2227 */
2228 mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2229 /**
2230 * Bind an event handler to the "mouseout" JavaScript event.
2231 *
2232 * @param eventData An object containing data that will be passed to the event handler.
2233 * @param handler A function to execute when the event is triggered.
2234 */
2235 mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2236
2237 /**
2238 * Trigger the "mouseover" event on an element.
2239 */
2240 mouseover(): JQuery;
2241 /**
2242 * Bind an event handler to the "mouseover" JavaScript event.
2243 *
2244 * @param handler A function to execute when the event is triggered.
2245 */
2246 mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2247 /**
2248 * Bind an event handler to the "mouseover" JavaScript event.
2249 *
2250 * @param eventData An object containing data that will be passed to the event handler.
2251 * @param handler A function to execute when the event is triggered.
2252 */
2253 mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2254
2255 /**
2256 * Trigger the "mouseup" event on an element.
2257 */
2258 mouseup(): JQuery;
2259 /**
2260 * Bind an event handler to the "mouseup" JavaScript event.
2261 *
2262 * @param handler A function to execute when the event is triggered.
2263 */
2264 mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2265 /**
2266 * Bind an event handler to the "mouseup" JavaScript event.
2267 *
2268 * @param eventData An object containing data that will be passed to the event handler.
2269 * @param handler A function to execute when the event is triggered.
2270 */
2271 mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
2272
2273 /**
2274 * Remove an event handler.
2275 */
2276 off(): JQuery;
2277 /**
2278 * Remove an event handler.
2279 *
2280 * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
2281 * @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
2282 * @param handler A handler function previously attached for the event(s), or the special value false.
2283 */
2284 off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2285 /**
2286 * Remove an event handler.
2287 *
2288 * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
2289 * @param handler A handler function previously attached for the event(s), or the special value false. Takes handler with extra args that can be attached with on().
2290 */
2291 off(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery;
2292 /**
2293 * Remove an event handler.
2294 *
2295 * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
2296 * @param handler A handler function previously attached for the event(s), or the special value false.
2297 */
2298 off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
2299 /**
2300 * Remove an event handler.
2301 *
2302 * @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).
2303 * @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
2304 */
2305 off(events: { [key: string]: any; }, selector?: string): JQuery;
2306
2307 /**
2308 * Attach an event handler function for one or more events to the selected elements.
2309 *
2310 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2311 * @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).
2312 */
2313 on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery;
2314 /**
2315 * Attach an event handler function for one or more events to the selected elements.
2316 *
2317 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2318 * @param data Data to be passed to the handler in event.data when an event is triggered.
2319 * @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.
2320 */
2321 on(events: string, data : any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery;
2322 /**
2323 * Attach an event handler function for one or more events to the selected elements.
2324 *
2325 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2326 * @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.
2327 * @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.
2328 */
2329 on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery;
2330 /**
2331 * Attach an event handler function for one or more events to the selected elements.
2332 *
2333 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2334 * @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.
2335 * @param data Data to be passed to the handler in event.data when an event is triggered.
2336 * @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.
2337 */
2338 on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery;
2339 /**
2340 * Attach an event handler function for one or more events to the selected elements.
2341 *
2342 * @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).
2343 * @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.
2344 * @param data Data to be passed to the handler in event.data when an event occurs.
2345 */
2346 on(events: { [key: string]: any; }, selector?: string, data?: any): JQuery;
2347 /**
2348 * Attach an event handler function for one or more events to the selected elements.
2349 *
2350 * @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).
2351 * @param data Data to be passed to the handler in event.data when an event occurs.
2352 */
2353 on(events: { [key: string]: any; }, data?: any): JQuery;
2354
2355 /**
2356 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2357 *
2358 * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
2359 * @param handler A function to execute at the time the event is triggered.
2360 */
2361 one(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
2362 /**
2363 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2364 *
2365 * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
2366 * @param data An object containing data that will be passed to the event handler.
2367 * @param handler A function to execute at the time the event is triggered.
2368 */
2369 one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2370
2371 /**
2372 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2373 *
2374 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2375 * @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.
2376 * @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.
2377 */
2378 one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
2379 /**
2380 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2381 *
2382 * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
2383 * @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.
2384 * @param data Data to be passed to the handler in event.data when an event is triggered.
2385 * @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.
2386 */
2387 one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
2388
2389 /**
2390 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2391 *
2392 * @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).
2393 * @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.
2394 * @param data Data to be passed to the handler in event.data when an event occurs.
2395 */
2396 one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery;
2397
2398 /**
2399 * Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
2400 *
2401 * @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).
2402 * @param data Data to be passed to the handler in event.data when an event occurs.
2403 */
2404 one(events: { [key: string]: any; }, data?: any): JQuery;
2405
2406
2407 /**
2408 * Specify a function to execute when the DOM is fully loaded.
2409 *
2410 * @param handler A function to execute after the DOM is ready.
2411 */
2412 ready(handler: (jQueryAlias?: JQueryStatic) => any): JQuery;
2413
2414 /**
2415 * Trigger the "resize" event on an element.
2416 */
2417 resize(): JQuery;
2418 /**
2419 * Bind an event handler to the "resize" JavaScript event.
2420 *
2421 * @param handler A function to execute each time the event is triggered.
2422 */
2423 resize(handler: (eventObject: JQueryEventObject) => any): JQuery;
2424 /**
2425 * Bind an event handler to the "resize" JavaScript event.
2426 *
2427 * @param eventData An object containing data that will be passed to the event handler.
2428 * @param handler A function to execute each time the event is triggered.
2429 */
2430 resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2431
2432 /**
2433 * Trigger the "scroll" event on an element.
2434 */
2435 scroll(): JQuery;
2436 /**
2437 * Bind an event handler to the "scroll" JavaScript event.
2438 *
2439 * @param handler A function to execute each time the event is triggered.
2440 */
2441 scroll(handler: (eventObject: JQueryEventObject) => any): JQuery;
2442 /**
2443 * Bind an event handler to the "scroll" JavaScript event.
2444 *
2445 * @param eventData An object containing data that will be passed to the event handler.
2446 * @param handler A function to execute each time the event is triggered.
2447 */
2448 scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2449
2450 /**
2451 * Trigger the "select" event on an element.
2452 */
2453 select(): JQuery;
2454 /**
2455 * Bind an event handler to the "select" JavaScript event.
2456 *
2457 * @param handler A function to execute each time the event is triggered.
2458 */
2459 select(handler: (eventObject: JQueryEventObject) => any): JQuery;
2460 /**
2461 * Bind an event handler to the "select" JavaScript event.
2462 *
2463 * @param eventData An object containing data that will be passed to the event handler.
2464 * @param handler A function to execute each time the event is triggered.
2465 */
2466 select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
2467
2468 /**
2469 * Trigger the "submit" event on an element.
2470 */
2471 submit(): JQuery;
2472 /**
2473 * Bind an event handler to the "submit" JavaScript event
2474 *
2475 * @param handler A function to execute each time the event is triggered.
2476 */
2477 submit(handler: (eventObject: JQueryEventObject) => any): JQuery;
2478 /**
2479 * Bind an event handler to the "submit" JavaScript event
2480 *
2481 * @param eventData An object containing data that will be passed to the event handler.
2482 * @param handler A function to execute each time the event is triggered.
2483 */
2484 submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2485
2486 /**
2487 * Execute all handlers and behaviors attached to the matched elements for the given event type.
2488 *
2489 * @param eventType A string containing a JavaScript event type, such as click or submit.
2490 * @param extraParameters Additional parameters to pass along to the event handler.
2491 */
2492 trigger(eventType: string, extraParameters?: any[]|Object): JQuery;
2493 /**
2494 * Execute all handlers and behaviors attached to the matched elements for the given event type.
2495 *
2496 * @param event A jQuery.Event object.
2497 * @param extraParameters Additional parameters to pass along to the event handler.
2498 */
2499 trigger(event: JQueryEventObject, extraParameters?: any[]|Object): JQuery;
2500
2501 /**
2502 * Execute all handlers attached to an element for an event.
2503 *
2504 * @param eventType A string containing a JavaScript event type, such as click or submit.
2505 * @param extraParameters An array of additional parameters to pass along to the event handler.
2506 */
2507 triggerHandler(eventType: string, ...extraParameters: any[]): Object;
2508
2509 /**
2510 * Execute all handlers attached to an element for an event.
2511 *
2512 * @param event A jQuery.Event object.
2513 * @param extraParameters An array of additional parameters to pass along to the event handler.
2514 */
2515 triggerHandler(event: JQueryEventObject, ...extraParameters: any[]): Object;
2516
2517 /**
2518 * Remove a previously-attached event handler from the elements.
2519 *
2520 * @param eventType A string containing a JavaScript event type, such as click or submit.
2521 * @param handler The function that is to be no longer executed.
2522 */
2523 unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2524 /**
2525 * Remove a previously-attached event handler from the elements.
2526 *
2527 * @param eventType A string containing a JavaScript event type, such as click or submit.
2528 * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ).
2529 */
2530 unbind(eventType: string, fls: boolean): JQuery;
2531 /**
2532 * Remove a previously-attached event handler from the elements.
2533 *
2534 * @param evt A JavaScript event object as passed to an event handler.
2535 */
2536 unbind(evt: any): JQuery;
2537
2538 /**
2539 * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
2540 */
2541 undelegate(): JQuery;
2542 /**
2543 * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
2544 *
2545 * @param selector A selector which will be used to filter the event results.
2546 * @param eventType A string containing a JavaScript event type, such as "click" or "keydown"
2547 * @param handler A function to execute at the time the event is triggered.
2548 */
2549 undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2550 /**
2551 * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
2552 *
2553 * @param selector A selector which will be used to filter the event results.
2554 * @param events An object of one or more event types and previously bound functions to unbind from them.
2555 */
2556 undelegate(selector: string, events: Object): JQuery;
2557 /**
2558 * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
2559 *
2560 * @param namespace A string containing a namespace to unbind all events from.
2561 */
2562 undelegate(namespace: string): JQuery;
2563
2564 /**
2565 * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8)
2566 *
2567 * @param handler A function to execute when the event is triggered.
2568 */
2569 unload(handler: (eventObject: JQueryEventObject) => any): JQuery;
2570 /**
2571 * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8)
2572 *
2573 * @param eventData A plain object of data that will be passed to the event handler.
2574 * @param handler A function to execute when the event is triggered.
2575 */
2576 unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
2577
2578 /**
2579 * The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10)
2580 */
2581 context: Element;
2582
2583 jquery: string;
2584
2585 /**
2586 * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8)
2587 *
2588 * @param handler A function to execute when the event is triggered.
2589 */
2590 error(handler: (eventObject: JQueryEventObject) => any): JQuery;
2591 /**
2592 * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8)
2593 *
2594 * @param eventData A plain object of data that will be passed to the event handler.
2595 * @param handler A function to execute when the event is triggered.
2596 */
2597 error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
2598
2599 /**
2600 * Add a collection of DOM elements onto the jQuery stack.
2601 *
2602 * @param elements An array of elements to push onto the stack and make into a new jQuery object.
2603 */
2604 pushStack(elements: any[]): JQuery;
2605 /**
2606 * Add a collection of DOM elements onto the jQuery stack.
2607 *
2608 * @param elements An array of elements to push onto the stack and make into a new jQuery object.
2609 * @param name The name of a jQuery method that generated the array of elements.
2610 * @param arguments The arguments that were passed in to the jQuery method (for serialization).
2611 */
2612 pushStack(elements: any[], name: string, arguments: any[]): JQuery;
2613
2614 /**
2615 * Insert content, specified by the parameter, after each element in the set of matched elements.
2616 *
2617 * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements.
2618 * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements.
2619 */
2620 after(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
2621 /**
2622 * Insert content, specified by the parameter, after each element in the set of matched elements.
2623 *
2624 * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
2625 */
2626 after(func: (index: number, html: string) => string|Element|JQuery): JQuery;
2627
2628 /**
2629 * Insert content, specified by the parameter, to the end of each element in the set of matched elements.
2630 *
2631 * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements.
2632 * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements.
2633 */
2634 append(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
2635 /**
2636 * Insert content, specified by the parameter, to the end of each element in the set of matched elements.
2637 *
2638 * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
2639 */
2640 append(func: (index: number, html: string) => string|Element|JQuery): JQuery;
2641
2642 /**
2643 * Insert every element in the set of matched elements to the end of the target.
2644 *
2645 * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter.
2646 */
2647 appendTo(target: JQuery|any[]|Element|string): JQuery;
2648
2649 /**
2650 * Insert content, specified by the parameter, before each element in the set of matched elements.
2651 *
2652 * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements.
2653 * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements.
2654 */
2655 before(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
2656 /**
2657 * Insert content, specified by the parameter, before each element in the set of matched elements.
2658 *
2659 * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
2660 */
2661 before(func: (index: number, html: string) => string|Element|JQuery): JQuery;
2662
2663 /**
2664 * Create a deep copy of the set of matched elements.
2665 *
2666 * param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false.
2667 * param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false).
2668 */
2669 clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery;
2670
2671 /**
2672 * Remove the set of matched elements from the DOM.
2673 *
2674 * param selector A selector expression that filters the set of matched elements to be removed.
2675 */
2676 detach(selector?: string): JQuery;
2677
2678 /**
2679 * Remove all child nodes of the set of matched elements from the DOM.
2680 */
2681 empty(): JQuery;
2682
2683 /**
2684 * Insert every element in the set of matched elements after the target.
2685 *
2686 * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter.
2687 */
2688 insertAfter(target: JQuery|any[]|Element|Text|string): JQuery;
2689
2690 /**
2691 * Insert every element in the set of matched elements before the target.
2692 *
2693 * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter.
2694 */
2695 insertBefore(target: JQuery|any[]|Element|Text|string): JQuery;
2696
2697 /**
2698 * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
2699 *
2700 * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements.
2701 * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements.
2702 */
2703 prepend(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
2704 /**
2705 * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
2706 *
2707 * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
2708 */
2709 prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery;
2710
2711 /**
2712 * Insert every element in the set of matched elements to the beginning of the target.
2713 *
2714 * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter.
2715 */
2716 prependTo(target: JQuery|any[]|Element|string): JQuery;
2717
2718 /**
2719 * Remove the set of matched elements from the DOM.
2720 *
2721 * @param selector A selector expression that filters the set of matched elements to be removed.
2722 */
2723 remove(selector?: string): JQuery;
2724
2725 /**
2726 * Replace each target element with the set of matched elements.
2727 *
2728 * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace.
2729 */
2730 replaceAll(target: JQuery|any[]|Element|string): JQuery;
2731
2732 /**
2733 * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
2734 *
2735 * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object.
2736 */
2737 replaceWith(newContent: JQuery|any[]|Element|Text|string): JQuery;
2738 /**
2739 * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
2740 *
2741 * param func A function that returns content with which to replace the set of matched elements.
2742 */
2743 replaceWith(func: () => Element|JQuery): JQuery;
2744
2745 /**
2746 * Get the combined text contents of each element in the set of matched elements, including their descendants.
2747 */
2748 text(): string;
2749 /**
2750 * Set the content of each element in the set of matched elements to the specified text.
2751 *
2752 * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation.
2753 */
2754 text(text: string|number|boolean): JQuery;
2755 /**
2756 * Set the content of each element in the set of matched elements to the specified text.
2757 *
2758 * @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments.
2759 */
2760 text(func: (index: number, text: string) => string): JQuery;
2761
2762 /**
2763 * Retrieve all the elements contained in the jQuery set, as an array.
2764 */
2765 toArray(): any[];
2766
2767 /**
2768 * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
2769 */
2770 unwrap(): JQuery;
2771
2772 /**
2773 * Wrap an HTML structure around each element in the set of matched elements.
2774 *
2775 * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
2776 */
2777 wrap(wrappingElement: JQuery|Element|string): JQuery;
2778 /**
2779 * Wrap an HTML structure around each element in the set of matched elements.
2780 *
2781 * @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
2782 */
2783 wrap(func: (index: number) => string|JQuery): JQuery;
2784
2785 /**
2786 * Wrap an HTML structure around all elements in the set of matched elements.
2787 *
2788 * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
2789 */
2790 wrapAll(wrappingElement: JQuery|Element|string): JQuery;
2791 wrapAll(func: (index: number) => string): JQuery;
2792
2793 /**
2794 * Wrap an HTML structure around the content of each element in the set of matched elements.
2795 *
2796 * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements.
2797 */
2798 wrapInner(wrappingElement: JQuery|Element|string): JQuery;
2799 /**
2800 * Wrap an HTML structure around the content of each element in the set of matched elements.
2801 *
2802 * @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
2803 */
2804 wrapInner(func: (index: number) => string): JQuery;
2805
2806 /**
2807 * Iterate over a jQuery object, executing a function for each matched element.
2808 *
2809 * @param func A function to execute for each matched element.
2810 */
2811 each(func: (index: number, elem: Element) => any): JQuery;
2812
2813 /**
2814 * Retrieve one of the elements matched by the jQuery object.
2815 *
2816 * @param index A zero-based integer indicating which element to retrieve.
2817 */
2818 get(index: number): HTMLElement;
2819 /**
2820 * Retrieve the elements matched by the jQuery object.
2821 */
2822 get(): any[];
2823
2824 /**
2825 * Search for a given element from among the matched elements.
2826 */
2827 index(): number;
2828 /**
2829 * Search for a given element from among the matched elements.
2830 *
2831 * @param selector A selector representing a jQuery collection in which to look for an element.
2832 */
2833 index(selector: string|JQuery|Element): number;
2834
2835 /**
2836 * The number of elements in the jQuery object.
2837 */
2838 length: number;
2839 /**
2840 * A selector representing selector passed to jQuery(), if any, when creating the original set.
2841 * version deprecated: 1.7, removed: 1.9
2842 */
2843 selector: string;
2844 [index: string]: any;
2845 [index: number]: HTMLElement;
2846
2847 /**
2848 * Add elements to the set of matched elements.
2849 *
2850 * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements.
2851 * @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method.
2852 */
2853 add(selector: string, context?: Element): JQuery;
2854 /**
2855 * Add elements to the set of matched elements.
2856 *
2857 * @param elements One or more elements to add to the set of matched elements.
2858 */
2859 add(...elements: Element[]): JQuery;
2860 /**
2861 * Add elements to the set of matched elements.
2862 *
2863 * @param html An HTML fragment to add to the set of matched elements.
2864 */
2865 add(html: string): JQuery;
2866 /**
2867 * Add elements to the set of matched elements.
2868 *
2869 * @param obj An existing jQuery object to add to the set of matched elements.
2870 */
2871 add(obj: JQuery): JQuery;
2872
2873 /**
2874 * Get the children of each element in the set of matched elements, optionally filtered by a selector.
2875 *
2876 * @param selector A string containing a selector expression to match elements against.
2877 */
2878 children(selector?: string): JQuery;
2879
2880 /**
2881 * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
2882 *
2883 * @param selector A string containing a selector expression to match elements against.
2884 */
2885 closest(selector: string): JQuery;
2886 /**
2887 * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
2888 *
2889 * @param selector A string containing a selector expression to match elements against.
2890 * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead.
2891 */
2892 closest(selector: string, context?: Element): JQuery;
2893 /**
2894 * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
2895 *
2896 * @param obj A jQuery object to match elements against.
2897 */
2898 closest(obj: JQuery): JQuery;
2899 /**
2900 * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
2901 *
2902 * @param element An element to match elements against.
2903 */
2904 closest(element: Element): JQuery;
2905
2906 /**
2907 * Get an array of all the elements and selectors matched against the current element up through the DOM tree.
2908 *
2909 * @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object).
2910 * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead.
2911 */
2912 closest(selectors: any, context?: Element): any[];
2913
2914 /**
2915 * Get the children of each element in the set of matched elements, including text and comment nodes.
2916 */
2917 contents(): JQuery;
2918
2919 /**
2920 * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state.
2921 */
2922 end(): JQuery;
2923
2924 /**
2925 * Reduce the set of matched elements to the one at the specified index.
2926 *
2927 * @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set.
2928 *
2929 */
2930 eq(index: number): JQuery;
2931
2932 /**
2933 * Reduce the set of matched elements to those that match the selector or pass the function's test.
2934 *
2935 * @param selector A string containing a selector expression to match the current set of elements against.
2936 */
2937 filter(selector: string): JQuery;
2938 /**
2939 * Reduce the set of matched elements to those that match the selector or pass the function's test.
2940 *
2941 * @param func A function used as a test for each element in the set. this is the current DOM element.
2942 */
2943 filter(func: (index: number, element: Element) => any): JQuery;
2944 /**
2945 * Reduce the set of matched elements to those that match the selector or pass the function's test.
2946 *
2947 * @param element An element to match the current set of elements against.
2948 */
2949 filter(element: Element): JQuery;
2950 /**
2951 * Reduce the set of matched elements to those that match the selector or pass the function's test.
2952 *
2953 * @param obj An existing jQuery object to match the current set of elements against.
2954 */
2955 filter(obj: JQuery): JQuery;
2956
2957 /**
2958 * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
2959 *
2960 * @param selector A string containing a selector expression to match elements against.
2961 */
2962 find(selector: string): JQuery;
2963 /**
2964 * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
2965 *
2966 * @param element An element to match elements against.
2967 */
2968 find(element: Element): JQuery;
2969 /**
2970 * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
2971 *
2972 * @param obj A jQuery object to match elements against.
2973 */
2974 find(obj: JQuery): JQuery;
2975
2976 /**
2977 * Reduce the set of matched elements to the first in the set.
2978 */
2979 first(): JQuery;
2980
2981 /**
2982 * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
2983 *
2984 * @param selector A string containing a selector expression to match elements against.
2985 */
2986 has(selector: string): JQuery;
2987 /**
2988 * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
2989 *
2990 * @param contained A DOM element to match elements against.
2991 */
2992 has(contained: Element): JQuery;
2993
2994 /**
2995 * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
2996 *
2997 * @param selector A string containing a selector expression to match elements against.
2998 */
2999 is(selector: string): boolean;
3000 /**
3001 * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
3002 *
3003 * @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element.
3004 */
3005 is(func: (index: number, element: Element) => boolean): boolean;
3006 /**
3007 * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
3008 *
3009 * @param obj An existing jQuery object to match the current set of elements against.
3010 */
3011 is(obj: JQuery): boolean;
3012 /**
3013 * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
3014 *
3015 * @param elements One or more elements to match the current set of elements against.
3016 */
3017 is(elements: any): boolean;
3018
3019 /**
3020 * Reduce the set of matched elements to the final one in the set.
3021 */
3022 last(): JQuery;
3023
3024 /**
3025 * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values.
3026 *
3027 * @param callback A function object that will be invoked for each element in the current set.
3028 */
3029 map(callback: (index: number, domElement: Element) => any): JQuery;
3030
3031 /**
3032 * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.
3033 *
3034 * @param selector A string containing a selector expression to match elements against.
3035 */
3036 next(selector?: string): JQuery;
3037
3038 /**
3039 * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.
3040 *
3041 * @param selector A string containing a selector expression to match elements against.
3042 */
3043 nextAll(selector?: string): JQuery;
3044
3045 /**
3046 * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
3047 *
3048 * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements.
3049 * @param filter A string containing a selector expression to match elements against.
3050 */
3051 nextUntil(selector?: string, filter?: string): JQuery;
3052 /**
3053 * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
3054 *
3055 * @param element A DOM node or jQuery object indicating where to stop matching following sibling elements.
3056 * @param filter A string containing a selector expression to match elements against.
3057 */
3058 nextUntil(element?: Element, filter?: string): JQuery;
3059 /**
3060 * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
3061 *
3062 * @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements.
3063 * @param filter A string containing a selector expression to match elements against.
3064 */
3065 nextUntil(obj?: JQuery, filter?: string): JQuery;
3066
3067 /**
3068 * Remove elements from the set of matched elements.
3069 *
3070 * @param selector A string containing a selector expression to match elements against.
3071 */
3072 not(selector: string): JQuery;
3073 /**
3074 * Remove elements from the set of matched elements.
3075 *
3076 * @param func A function used as a test for each element in the set. this is the current DOM element.
3077 */
3078 not(func: (index: number, element: Element) => boolean): JQuery;
3079 /**
3080 * Remove elements from the set of matched elements.
3081 *
3082 * @param elements One or more DOM elements to remove from the matched set.
3083 */
3084 not(elements: Element|Element[]): JQuery;
3085 /**
3086 * Remove elements from the set of matched elements.
3087 *
3088 * @param obj An existing jQuery object to match the current set of elements against.
3089 */
3090 not(obj: JQuery): JQuery;
3091
3092 /**
3093 * Get the closest ancestor element that is positioned.
3094 */
3095 offsetParent(): JQuery;
3096
3097 /**
3098 * Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
3099 *
3100 * @param selector A string containing a selector expression to match elements against.
3101 */
3102 parent(selector?: string): JQuery;
3103
3104 /**
3105 * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.
3106 *
3107 * @param selector A string containing a selector expression to match elements against.
3108 */
3109 parents(selector?: string): JQuery;
3110
3111 /**
3112 * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
3113 *
3114 * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements.
3115 * @param filter A string containing a selector expression to match elements against.
3116 */
3117 parentsUntil(selector?: string, filter?: string): JQuery;
3118 /**
3119 * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
3120 *
3121 * @param element A DOM node or jQuery object indicating where to stop matching ancestor elements.
3122 * @param filter A string containing a selector expression to match elements against.
3123 */
3124 parentsUntil(element?: Element, filter?: string): JQuery;
3125 /**
3126 * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
3127 *
3128 * @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements.
3129 * @param filter A string containing a selector expression to match elements against.
3130 */
3131 parentsUntil(obj?: JQuery, filter?: string): JQuery;
3132
3133 /**
3134 * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector.
3135 *
3136 * @param selector A string containing a selector expression to match elements against.
3137 */
3138 prev(selector?: string): JQuery;
3139
3140 /**
3141 * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.
3142 *
3143 * @param selector A string containing a selector expression to match elements against.
3144 */
3145 prevAll(selector?: string): JQuery;
3146
3147 /**
3148 * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
3149 *
3150 * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements.
3151 * @param filter A string containing a selector expression to match elements against.
3152 */
3153 prevUntil(selector?: string, filter?: string): JQuery;
3154 /**
3155 * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
3156 *
3157 * @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements.
3158 * @param filter A string containing a selector expression to match elements against.
3159 */
3160 prevUntil(element?: Element, filter?: string): JQuery;
3161 /**
3162 * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
3163 *
3164 * @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements.
3165 * @param filter A string containing a selector expression to match elements against.
3166 */
3167 prevUntil(obj?: JQuery, filter?: string): JQuery;
3168
3169 /**
3170 * Get the siblings of each element in the set of matched elements, optionally filtered by a selector.
3171 *
3172 * @param selector A string containing a selector expression to match elements against.
3173 */
3174 siblings(selector?: string): JQuery;
3175
3176 /**
3177 * Reduce the set of matched elements to a subset specified by a range of indices.
3178 *
3179 * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set.
3180 * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set.
3181 */
3182 slice(start: number, end?: number): JQuery;
3183
3184 /**
3185 * Show the queue of functions to be executed on the matched elements.
3186 *
3187 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
3188 */
3189 queue(queueName?: string): any[];
3190 /**
3191 * Manipulate the queue of functions to be executed, once for each matched element.
3192 *
3193 * @param newQueue An array of functions to replace the current queue contents.
3194 */
3195 queue(newQueue: Function[]): JQuery;
3196 /**
3197 * Manipulate the queue of functions to be executed, once for each matched element.
3198 *
3199 * @param callback The new function to add to the queue, with a function to call that will dequeue the next item.
3200 */
3201 queue(callback: Function): JQuery;
3202 /**
3203 * Manipulate the queue of functions to be executed, once for each matched element.
3204 *
3205 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
3206 * @param newQueue An array of functions to replace the current queue contents.
3207 */
3208 queue(queueName: string, newQueue: Function[]): JQuery;
3209 /**
3210 * Manipulate the queue of functions to be executed, once for each matched element.
3211 *
3212 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
3213 * @param callback The new function to add to the queue, with a function to call that will dequeue the next item.
3214 */
3215 queue(queueName: string, callback: Function): JQuery;
3216 }
3217 declare module "jquery" {
3218 export = $;
3219 }
3220 declare var jQuery: JQueryStatic;
3221 declare var $: JQueryStatic;