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