UNPKG

453 kBTypeScriptView Raw
1// tslint:disable:jsdoc-format
2// tslint:disable:max-line-length
3// tslint:disable:no-irregular-whitespace
4
5interface JQueryStatic {
6 /**
7 * @see \`{@link https://api.jquery.com/jquery.ajax/#jQuery-ajax1 }\`
8 * @deprecated ​ Deprecated. Use \`{@link ajaxSetup }\`.
9 */
10 ajaxSettings: JQuery.AjaxSettings;
11 Animation: JQuery.AnimationStatic;
12 Callbacks: JQuery.CallbacksStatic;
13 /**
14 * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties.
15 * @see \`{@link https://api.jquery.com/jQuery.cssHooks/ }\`
16 * @since 1.4.3
17 */
18 cssHooks: JQuery.CSSHooks;
19 /**
20 * An object containing all CSS properties that may be used without a unit. The .css() method uses this object to see if it may append px to unitless values.
21 * @see \`{@link https://api.jquery.com/jQuery.cssNumber/ }\`
22 * @since 1.4.3
23 */
24 cssNumber: JQuery.PlainObject<boolean>;
25 Deferred: JQuery.DeferredStatic;
26 easing: JQuery.Easings;
27 Event: JQuery.EventStatic;
28 /**
29 * @see \`{@link https://learn.jquery.com/events/event-extensions/ }\`
30 */
31 event: JQuery.EventExtensions;
32 expr: JQuery.Selectors;
33 // Set to HTMLElement to minimize breaks but should probably be Element.
34 readonly fn: JQuery;
35 fx: JQuery.Effects;
36 /**
37 * A Promise-like object (or "thenable") that resolves when the document is ready.
38 * @see \`{@link https://api.jquery.com/jQuery.ready/ }\`
39 * @since 1.8
40 * @example ​ ````Listen for document ready using jQuery.when.
41```javascript
42$.when( $.ready ).then(function() {
43 // Document is ready.
44});
45```
46 * @example ​ ````Typical usage involving another promise, using jQuery.when.
47```javascript
48$.when(
49 $.getJSON( "ajax/test.json" ),
50 $.ready
51).done(function( data ) {
52 // Document is ready.
53 // Value of test.json is passed as `data`.
54});
55```
56 */
57 ready: JQuery.Thenable<JQueryStatic>;
58 /**
59 * A collection of properties that represent the presence of different browser features or bugs. Intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally to improve page startup performance. For your own project's feature-detection needs, we strongly recommend the use of an external library such as Modernizr instead of dependency on properties in jQuery.support.
60 * @see \`{@link https://api.jquery.com/jQuery.support/ }\`
61 * @since 1.3
62 * @deprecated ​ Deprecated since 1.9. See \`{@link https://api.jquery.com/jQuery.support/ }\`.
63 */
64 support: JQuery.PlainObject;
65 timers: Array<JQuery.TickFunction<any>>;
66 Tween: JQuery.TweenStatic;
67 valHooks: JQuery.ValHooks;
68 // HACK: This is the factory function returned when importing jQuery without a DOM. Declaring it separately breaks using the type parameter on JQueryStatic.
69 // HACK: The discriminator parameter handles the edge case of passing a Window object to JQueryStatic. It doesn't actually exist on the factory function.
70 (window: Window, discriminator: boolean): JQueryStatic;
71 /**
72 * Creates DOM elements on the fly from the provided string of raw HTML.
73 * @param html _&#x40;param_ `html`
74 * <br>
75 * * `html (ownerDocument)` — A string of HTML to create on the fly. Note that this parses HTML, not XML. <br>
76 * * `html (attributes)` — A string defining a single, standalone, HTML element (e.g. &lt;div/&gt; or &lt;div&gt;&lt;/div&gt;).
77 * @param ownerDocument_attributes _&#x40;param_ `ownerDocument_attributes`
78 * <br>
79 * * `ownerDocument` — A document in which the new elements will be created. <br>
80 * * `attributes` — An object of attributes, events, and methods to call on the newly-created element.
81 * @see \`{@link https://api.jquery.com/jQuery/ }\`
82 * @since 1.0
83 * @since 1.4
84 * @example ​ ````Create a div element (and all of its contents) dynamically and append it to the body element. Internally, an element is created and its innerHTML property set to the given markup.
85```javascript
86$( "<div><p>Hello</p></div>" ).appendTo( "body" )
87```
88 * @example ​ ````Create some DOM elements.
89```javascript
90$( "<div/>", {
91 "class": "test",
92 text: "Click me!",
93 click: function() {
94 $( this ).toggleClass( "test" );
95 }
96})
97 .appendTo( "body" );
98```
99 */
100 // eslint-disable-next-line no-unnecessary-generics
101 <TElement extends HTMLElement = HTMLElement>(html: JQuery.htmlString, ownerDocument_attributes?: Document | JQuery.PlainObject): JQuery<TElement>;
102 /**
103 * Accepts a string containing a CSS selector which is then used to match a set of elements.
104 * @param selector A string containing a selector expression
105 * @param context A DOM Element, Document, Selector or jQuery to use as context
106 * @see \`{@link https://api.jquery.com/jQuery/ }\`
107 * @since 1.0
108 * @example ​ ````Find all p elements that are children of a div element and apply a border to them.
109```html
110<!doctype html>
111<html lang="en">
112<head>
113 <meta charset="utf-8">
114 <title>jQuery demo</title>
115 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
116</head>
117<body>
118
119<p>one</p>
120<div><p>two</p></div>
121<p>three</p>
122
123<script>
124$( "div > p" ).css( "border", "1px solid gray" );
125</script>
126</body>
127</html>
128```
129 * @example ​ ````Find all inputs of type radio within the first form in the document.
130```javascript
131$( "input:radio", document.forms[ 0 ] );
132```
133 * @example ​ ````Find all div elements within an XML document from an Ajax response.
134```javascript
135$( "div", xml.responseXML );
136```
137
138 */
139 // eslint-disable-next-line no-unnecessary-generics
140 <TElement extends Element = HTMLElement>(selector: JQuery.Selector, context?: Element | Document | JQuery | JQuery.Selector): JQuery<TElement>;
141 /**
142 * Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string.
143 * @param element A DOM element to wrap in a jQuery object.
144 * @see \`{@link https://api.jquery.com/jQuery/ }\`
145 * @since 1.0
146 * @example ​ ````Set the background color of the page to black.
147```javascript
148$( document.body ).css( "background", "black" );
149```
150 */
151 // NOTE: `HTMLSelectElement` is both an Element and an Array-Like Object but jQuery treats it as an Element.
152 (element: HTMLSelectElement): JQuery<HTMLSelectElement>;
153 /**
154 * Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string.
155 * @param element_elementArray _&#x40;param_ `element_elementArray`
156 * <br>
157 * * `element` — A DOM element to wrap in a jQuery object. <br>
158 * * `elementArray` — An array containing a set of DOM elements to wrap in a jQuery object.
159 * @see \`{@link https://api.jquery.com/jQuery/ }\`
160 * @since 1.0
161 * @example ​ ````Set the background color of the page to black.
162```javascript
163$( document.body ).css( "background", "black" );
164```
165 * @example ​ ````Hide all the input elements within a form.
166```javascript
167$( myForm.elements ).hide();
168```
169 */
170 <T extends Element>(element_elementArray: T | ArrayLike<T>): JQuery<T>;
171 /**
172 * Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string.
173 * @param selection An existing jQuery object to clone.
174 * @see \`{@link https://api.jquery.com/jQuery/ }\`
175 * @since 1.0
176 */
177 <T>(selection: JQuery<T>): JQuery<T>;
178 /**
179 * Binds a function to be executed when the DOM has finished loading.
180 * @param callback The function to execute when the DOM is ready.
181 * @see \`{@link https://api.jquery.com/jQuery/ }\`
182 * @since 1.0
183 * @example ​ ````Execute the function when the DOM is ready to be used.
184```javascript
185$(function() {
186 // Document is ready
187});
188```
189 * @example ​ ````Use both the shortcut for $(document).ready() and the argument to write failsafe jQuery code using the $ alias, without relying on the global alias.
190```javascript
191jQuery(function( $ ) {
192 // Your code using failsafe $ alias here...
193});
194```
195 */
196 /* eslint-disable no-unnecessary-generics */
197 // tslint:disable-next-line:unified-signatures
198 <TElement = HTMLElement>(callback: ((this: Document, $: JQueryStatic) => void)): JQuery<TElement>;
199 /* eslint-enable no-unnecessary-generics */
200 /**
201 * Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string.
202 * @param object A plain object to wrap in a jQuery object.
203 * @see \`{@link https://api.jquery.com/jQuery/ }\`
204 * @since 1.0
205 */
206 <T extends JQuery.PlainObject>(object: T): JQuery<T>;
207 /**
208 * Returns an empty jQuery set.
209 * @see \`{@link https://api.jquery.com/jQuery/ }\`
210 * @since 1.4
211 */
212 // eslint-disable-next-line no-unnecessary-generics
213 <TElement = HTMLElement>(): JQuery<TElement>;
214 /**
215 * Perform an asynchronous HTTP (Ajax) request.
216 * @param url A string containing the URL to which the request is sent.
217 * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can
218 * be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings.
219 * @see \`{@link https://api.jquery.com/jQuery.ajax/ }\`
220 * @since 1.5
221 */
222 ajax(url: string, settings?: JQuery.AjaxSettings): JQuery.jqXHR;
223 /**
224 * Perform an asynchronous HTTP (Ajax) request.
225 * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can
226 * be set for any option with $.ajaxSetup().
227 * @see \`{@link https://api.jquery.com/jQuery.ajax/ }\`
228 * @since 1.0
229 * @example ​ ````Save some data to the server and notify the user once it&#39;s complete.
230```javascript
231$.ajax({
232 method: "POST",
233 url: "some.php",
234 data: { name: "John", location: "Boston" }
235})
236 .done(function( msg ) {
237 alert( "Data Saved: " + msg );
238 });
239```
240 * @example ​ ````Retrieve the latest version of an HTML page.
241```javascript
242$.ajax({
243 url: "test.html",
244 cache: false
245})
246 .done(function( html ) {
247 $( "#results" ).append( html );
248 });
249```
250 * @example ​ ````Send an xml document as data to the server. By setting the processData
251 option to false, the automatic conversion of data to strings is prevented.
252```javascript
253var xmlDocument = [create xml document];
254var xmlRequest = $.ajax({
255 url: "page.php",
256 processData: false,
257 data: xmlDocument
258});
259
260xmlRequest.done( handleResponse );
261```
262 * @example ​ ````Send an id as data to the server, save some data to the server, and notify the user once it&#39;s complete. If the request fails, alert the user.
263```javascript
264var menuId = $( "ul.nav" ).first().attr( "id" );
265var request = $.ajax({
266 url: "script.php",
267 method: "POST",
268 data: { id : menuId },
269 dataType: "html"
270});
271
272request.done(function( msg ) {
273 $( "#log" ).html( msg );
274});
275
276request.fail(function( jqXHR, textStatus ) {
277 alert( "Request failed: " + textStatus );
278});
279```
280 * @example ​ ````Load and execute a JavaScript file.
281```javascript
282$.ajax({
283 method: "GET",
284 url: "test.js",
285 dataType: "script"
286});
287```
288 */
289 ajax(settings?: JQuery.AjaxSettings): JQuery.jqXHR;
290 /**
291 * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
292 * @param dataTypes An optional string containing one or more space-separated dataTypes
293 * @param handler A handler to set default values for future Ajax requests.
294 * @see \`{@link https://api.jquery.com/jQuery.ajaxPrefilter/ }\`
295 * @since 1.5
296 */
297 ajaxPrefilter(dataTypes: string,
298 handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void;
299 /**
300 * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
301 * @param handler A handler to set default values for future Ajax requests.
302 * @see \`{@link https://api.jquery.com/jQuery.ajaxPrefilter/ }\`
303 * @since 1.5
304 */
305 ajaxPrefilter(handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void;
306 /**
307 * Set default values for future Ajax requests. Its use is not recommended.
308 * @param options A set of key/value pairs that configure the default Ajax request. All options are optional.
309 * @see \`{@link https://api.jquery.com/jQuery.ajaxSetup/ }\`
310 * @since 1.1
311 * @example ​ ````Sets the defaults for Ajax requests to the url &quot;/xmlhttp/&quot;, disables global handlers and uses POST instead of GET. The following Ajax requests then sends some data without having to set anything else.
312```javascript
313$.ajaxSetup({
314 url: "/xmlhttp/",
315 global: false,
316 type: "POST"
317});
318$.ajax({ data: myData });
319```
320 */
321 ajaxSetup(options: JQuery.AjaxSettings): JQuery.AjaxSettings;
322 /**
323 * Creates an object that handles the actual transmission of Ajax data.
324 * @param dataType A string identifying the data type to use
325 * @param handler A handler to return the new transport object to use with the data type provided in the first argument.
326 * @see \`{@link https://api.jquery.com/jQuery.ajaxTransport/ }\`
327 * @since 1.5
328 */
329 ajaxTransport(dataType: string,
330 handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => JQuery.Transport | void): void;
331 /**
332 * @deprecatedDeprecated since 3.3. Internal. See \`{@link https://github.com/jquery/jquery/issues/3384 }\`.
333 */
334 camelCase(value: string): string;
335 cleanData(elems: ArrayLike<Element | Document | Window | JQuery.PlainObject>): void;
336 /**
337 * Check to see if a DOM element is a descendant of another DOM element.
338 * @param container The DOM element that may contain the other element.
339 * @param contained The DOM element that may be contained by (a descendant of) the other element.
340 * @see \`{@link https://api.jquery.com/jQuery.contains/ }\`
341 * @since 1.4
342 * @example ​ ````Check if an element is a descendant of another.
343```javascript
344$.contains( document.documentElement, document.body ); // true
345$.contains( document.body, document.documentElement ); // false
346```
347 */
348 contains(container: Element, contained: Element): boolean;
349 css(elem: Element, name: string): any;
350 /**
351 * Store arbitrary data associated with the specified element. Returns the value that was set.
352 * @param element The DOM element to associate with the data.
353 * @param key A string naming the piece of data to set.
354 * @param value The new data value; this can be any Javascript type except `undefined`.
355 * @see \`{@link https://api.jquery.com/jQuery.data/ }\`
356 * @since 1.2.3
357 * @example ​ ````Get the data named &quot;blah&quot; stored at for an element.
358```html
359<!doctype html>
360<html lang="en">
361<head>
362 <meta charset="utf-8">
363 <title>jQuery.data demo</title>
364 <style>
365 div {
366 margin: 5px;
367 background: yellow;
368 }
369 button {
370 margin: 5px;
371 font-size: 14px;
372 }
373 p {
374 margin: 5px;
375 color: blue;
376 }
377 span {
378 color: red;
379 }
380 </style>
381 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
382</head>
383<body>
384
385<div>A div</div>
386<button>Get "blah" from the div</button>
387<button>Set "blah" to "hello"</button>
388<button>Set "blah" to 86</button>
389<button>Remove "blah" from the div</button>
390<p>The "blah" value of this div is <span>?</span></p>
391
392<script>
393$( "button" ).click( function() {
394 var value,
395 div = $( "div" )[ 0 ];
396 switch ( $( "button" ).index( this ) ) {
397 case 0 :
398 value = jQuery.data( div, "blah" );
399 break;
400 case 1 :
401 jQuery.data( div, "blah", "hello" );
402 value = "Stored!";
403 break;
404 case 2 :
405 jQuery.data( div, "blah", 86 );
406 value = "Stored!";
407 break;
408 case 3 :
409 jQuery.removeData( div, "blah" );
410 value = "Removed!";
411 break;
412 }
413 $( "span" ).text( "" + value );
414});
415</script>
416
417</body>
418</html>
419```
420 */
421 data<T extends string | number | boolean | symbol | object | null>(element: Element | Document | Window | JQuery.PlainObject, key: string, value: T): T;
422 /**
423 * 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.
424 * @param element The DOM element to query for the data.
425 * @param key Name of the data stored.
426 * @param value `undefined` is not recognized as a data value. Calls such as `jQuery.data( el, "name", undefined )`
427 * will return the corresponding data for "name", and is therefore the same as `jQuery.data( el, "name" )`
428 * @see \`{@link https://api.jquery.com/jQuery.data/ }\`
429 * @since 1.2.3
430 */
431 // `unified-signatures` is disabled so that behavior when passing `undefined` to `value` can be documented. Unifying the signatures
432 // results in potential confusion for users from an unexpected parameter.
433 // tslint:disable-next-line:unified-signatures
434 data(element: Element | Document | Window | JQuery.PlainObject, key: string, value: undefined): any;
435 /**
436 * 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.
437 * @param element The DOM element to query for the data.
438 * @param key Name of the data stored.
439 * @see \`{@link https://api.jquery.com/jQuery.data/ }\`
440 * @since 1.2.3
441 * @since 1.4
442 * @example ​ ````Store then retrieve a value from the div element.
443```html
444<!doctype html>
445<html lang="en">
446<head>
447 <meta charset="utf-8">
448 <title>jQuery.data demo</title>
449 <style>
450 div {
451 color: blue;
452 }
453 span {
454 color: red;
455 }
456 </style>
457 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
458</head>
459<body>
460
461<div>
462 The values stored were
463 <span></span>
464 and
465 <span></span>
466</div>
467
468<script>
469var div = $( "div" )[ 0 ];
470jQuery.data( div, "test", {
471 first: 16,
472 last: "pizza!"
473});
474$( "span:first" ).text( jQuery.data( div, "test" ).first );
475$( "span:last" ).text( jQuery.data( div, "test" ).last );
476</script>
477
478</body>
479</html>
480```
481 */
482 data(element: Element | Document | Window | JQuery.PlainObject, key?: string): any;
483 /**
484 * Execute the next function on the queue for the matched element.
485 * @param element A DOM element from which to remove and execute a queued function.
486 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
487 * @see \`{@link https://api.jquery.com/jQuery.dequeue/ }\`
488 * @since 1.3
489 * @example ​ ````Use jQuery.dequeue() to end a custom queue function which allows the queue to keep going.
490```html
491<!doctype html>
492<html lang="en">
493<head>
494 <meta charset="utf-8">
495 <title>jQuery.dequeue demo</title>
496 <style>
497 div {
498 margin: 3px;
499 width: 50px;
500 position: absolute;
501 height: 50px;
502 left: 10px;
503 top: 30px;
504 background-color: yellow;
505 }
506 div.red {
507 background-color: red;
508 }
509 </style>
510 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
511</head>
512<body>
513
514<button>Start</button>
515<div></div>
516
517<script>
518$( "button" ).click(function() {
519 $( "div" )
520 .animate({ left: '+=200px' }, 2000 )
521 .animate({ top: '0px' }, 600 )
522 .queue(function() {
523 $( this ).toggleClass( "red" );
524 $.dequeue( this );
525 })
526 .animate({ left:'10px', top:'30px' }, 700 );
527});
528</script>
529
530</body>
531</html>
532```
533 */
534 dequeue(element: Element, queueName?: string): void;
535 /**
536 * 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.
537 * @param array The array to iterate over.
538 * @param callback The function that will be executed on every object.
539 * @see \`{@link https://api.jquery.com/jQuery.each/ }\`
540 * @since 1.0
541 * @example ​ ````Iterates through the array displaying each number as both a word and numeral
542```html
543<!doctype html>
544<html lang="en">
545<head>
546 <meta charset="utf-8">
547 <title>jQuery.each demo</title>
548 <style>
549 div {
550 color: blue;
551 }
552 div#five {
553 color: red;
554 }
555 </style>
556 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
557</head>
558<body>
559
560<div id="one"></div>
561<div id="two"></div>
562<div id="three"></div>
563<div id="four"></div>
564<div id="five"></div>
565
566<script>
567var arr = [ "one", "two", "three", "four", "five" ];
568var obj = { one: 1, two: 2, three: 3, four: 4, five: 5 };
569
570jQuery.each( arr, function( i, val ) {
571 $( "#" + val ).text( "Mine is " + val + "." );
572
573 // Will stop running after "three"
574 return ( val !== "three" );
575});
576
577jQuery.each( obj, function( i, val ) {
578 $( "#" + i ).append( document.createTextNode( " - " + val ) );
579});
580</script>
581
582</body>
583</html>
584```
585 * @example ​ ````Iterates over items in an array, accessing both the current item and its index.
586```javascript
587$.each( [ "a", "b", "c" ], function( i, l ){
588 alert( "Index #" + i + ": " + l );
589});
590```
591 */
592 each<T>(array: ArrayLike<T>, callback: (this: T, indexInArray: number, value: T) => any): ArrayLike<T>;
593 /**
594 * 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.
595 * @param obj The object to iterate over.
596 * @param callback The function that will be executed on every object.
597 * @see \`{@link https://api.jquery.com/jQuery.each/ }\`
598 * @since 1.0
599 * @example ​ ````Iterates through the array displaying each number as both a word and numeral
600```html
601<!doctype html>
602<html lang="en">
603<head>
604 <meta charset="utf-8">
605 <title>jQuery.each demo</title>
606 <style>
607 div {
608 color: blue;
609 }
610 div#five {
611 color: red;
612 }
613 </style>
614 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
615</head>
616<body>
617
618<div id="one"></div>
619<div id="two"></div>
620<div id="three"></div>
621<div id="four"></div>
622<div id="five"></div>
623
624<script>
625var arr = [ "one", "two", "three", "four", "five" ];
626var obj = { one: 1, two: 2, three: 3, four: 4, five: 5 };
627
628jQuery.each( arr, function( i, val ) {
629 $( "#" + val ).text( "Mine is " + val + "." );
630
631 // Will stop running after "three"
632 return ( val !== "three" );
633});
634
635jQuery.each( obj, function( i, val ) {
636 $( "#" + i ).append( document.createTextNode( " - " + val ) );
637});
638</script>
639
640</body>
641</html>
642```
643 * @example ​ ````Iterates over the properties in an object, accessing both the current item and its key.
644```javascript
645$.each({ name: "John", lang: "JS" }, function( k, v ) {
646 alert( "Key: " + k + ", Value: " + v );
647});
648```
649 */
650 each<T, K extends keyof T>(obj: T, callback: (this: T[K], propertyName: K, valueOfProperty: T[K]) => any): T;
651 /**
652 * Takes a string and throws an exception containing it.
653 * @param message The message to send out.
654 * @see \`{@link https://api.jquery.com/jQuery.error/ }\`
655 * @since 1.4.1
656 * @example ​ ````Override jQuery.error for display in Firebug.
657```javascript
658jQuery.error = console.error;
659```
660 */
661 error(message: string): any;
662 /**
663 * Escapes any character that has a special meaning in a CSS selector.
664 * @param selector A string containing a selector expression to escape.
665 * @see \`{@link https://api.jquery.com/jQuery.escapeSelector/ }\`
666 * @since 3.0
667 * @example ​ ````Escape an ID containing a hash.
668```javascript
669$.escapeSelector( "#target" ); // "\#target"
670```
671 * @example ​ ````Select all the elements having a class name of .box inside a div.
672```javascript
673$( "div" ).find( "." + $.escapeSelector( ".box" ) );
674```
675 */
676 escapeSelector(selector: JQuery.Selector): JQuery.Selector;
677 /**
678 * Merge the contents of two or more objects together into the first object.
679 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
680 * @param target The object to extend. It will receive the new properties.
681 * @param object1 An object containing additional properties to merge in.
682 * @param object2 An object containing additional properties to merge in.
683 * @param object3 An object containing additional properties to merge in.
684 * @param object4 An object containing additional properties to merge in.
685 * @param object5 An object containing additional properties to merge in.
686 * @param object6 An object containing additional properties to merge in.
687 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
688 * @since 1.1.4
689 * @example ​ ````Merge two objects recursively, modifying the first.
690```html
691<!doctype html>
692<html lang="en">
693<head>
694 <meta charset="utf-8">
695 <title>jQuery.extend demo</title>
696 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
697</head>
698<body>
699
700<div id="log"></div>
701
702<script>
703var object1 = {
704 apple: 0,
705 banana: { weight: 52, price: 100 },
706 cherry: 97
707};
708var object2 = {
709 banana: { price: 200 },
710 durian: 100
711};
712
713// Merge object2 into object1, recursively
714$.extend( true, object1, object2 );
715
716// Assuming JSON.stringify - not available in IE<8
717$( "#log" ).append( JSON.stringify( object1 ) );
718</script>
719
720</body>
721</html>
722```
723 */
724 extend<T, U, V, W, X, Y, Z>(deep: true, target: T, object1: U, object2: V, object3: W, object4: X, object5: Y, object6: Z): T & U & V & W & X & Y & Z;
725 /**
726 * Merge the contents of two or more objects together into the first object.
727 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
728 * @param target The object to extend. It will receive the new properties.
729 * @param object1 An object containing additional properties to merge in.
730 * @param object2 An object containing additional properties to merge in.
731 * @param object3 An object containing additional properties to merge in.
732 * @param object4 An object containing additional properties to merge in.
733 * @param object5 An object containing additional properties to merge in.
734 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
735 * @since 1.1.4
736 * @example ​ ````Merge two objects recursively, modifying the first.
737```html
738<!doctype html>
739<html lang="en">
740<head>
741 <meta charset="utf-8">
742 <title>jQuery.extend demo</title>
743 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
744</head>
745<body>
746
747<div id="log"></div>
748
749<script>
750var object1 = {
751 apple: 0,
752 banana: { weight: 52, price: 100 },
753 cherry: 97
754};
755var object2 = {
756 banana: { price: 200 },
757 durian: 100
758};
759
760// Merge object2 into object1, recursively
761$.extend( true, object1, object2 );
762
763// Assuming JSON.stringify - not available in IE<8
764$( "#log" ).append( JSON.stringify( object1 ) );
765</script>
766
767</body>
768</html>
769```
770 */
771 extend<T, U, V, W, X, Y>(deep: true, target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T & U & V & W & X & Y;
772 /**
773 * Merge the contents of two or more objects together into the first object.
774 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
775 * @param target The object to extend. It will receive the new properties.
776 * @param object1 An object containing additional properties to merge in.
777 * @param object2 An object containing additional properties to merge in.
778 * @param object3 An object containing additional properties to merge in.
779 * @param object4 An object containing additional properties to merge in.
780 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
781 * @since 1.1.4
782 * @example ​ ````Merge two objects recursively, modifying the first.
783```html
784<!doctype html>
785<html lang="en">
786<head>
787 <meta charset="utf-8">
788 <title>jQuery.extend demo</title>
789 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
790</head>
791<body>
792
793<div id="log"></div>
794
795<script>
796var object1 = {
797 apple: 0,
798 banana: { weight: 52, price: 100 },
799 cherry: 97
800};
801var object2 = {
802 banana: { price: 200 },
803 durian: 100
804};
805
806// Merge object2 into object1, recursively
807$.extend( true, object1, object2 );
808
809// Assuming JSON.stringify - not available in IE<8
810$( "#log" ).append( JSON.stringify( object1 ) );
811</script>
812
813</body>
814</html>
815```
816 */
817 extend<T, U, V, W, X>(deep: true, target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X;
818 /**
819 * Merge the contents of two or more objects together into the first object.
820 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
821 * @param target The object to extend. It will receive the new properties.
822 * @param object1 An object containing additional properties to merge in.
823 * @param object2 An object containing additional properties to merge in.
824 * @param object3 An object containing additional properties to merge in.
825 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
826 * @since 1.1.4
827 * @example ​ ````Merge two objects recursively, modifying the first.
828```html
829<!doctype html>
830<html lang="en">
831<head>
832 <meta charset="utf-8">
833 <title>jQuery.extend demo</title>
834 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
835</head>
836<body>
837
838<div id="log"></div>
839
840<script>
841var object1 = {
842 apple: 0,
843 banana: { weight: 52, price: 100 },
844 cherry: 97
845};
846var object2 = {
847 banana: { price: 200 },
848 durian: 100
849};
850
851// Merge object2 into object1, recursively
852$.extend( true, object1, object2 );
853
854// Assuming JSON.stringify - not available in IE<8
855$( "#log" ).append( JSON.stringify( object1 ) );
856</script>
857
858</body>
859</html>
860```
861 */
862 extend<T, U, V, W>(deep: true, target: T, object1: U, object2: V, object3: W): T & U & V & W;
863 /**
864 * Merge the contents of two or more objects together into the first object.
865 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
866 * @param target The object to extend. It will receive the new properties.
867 * @param object1 An object containing additional properties to merge in.
868 * @param object2 An object containing additional properties to merge in.
869 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
870 * @since 1.1.4
871 * @example ​ ````Merge two objects recursively, modifying the first.
872```html
873<!doctype html>
874<html lang="en">
875<head>
876 <meta charset="utf-8">
877 <title>jQuery.extend demo</title>
878 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
879</head>
880<body>
881
882<div id="log"></div>
883
884<script>
885var object1 = {
886 apple: 0,
887 banana: { weight: 52, price: 100 },
888 cherry: 97
889};
890var object2 = {
891 banana: { price: 200 },
892 durian: 100
893};
894
895// Merge object2 into object1, recursively
896$.extend( true, object1, object2 );
897
898// Assuming JSON.stringify - not available in IE<8
899$( "#log" ).append( JSON.stringify( object1 ) );
900</script>
901
902</body>
903</html>
904```
905 */
906 extend<T, U, V>(deep: true, target: T, object1: U, object2: V): T & U & V;
907 /**
908 * Merge the contents of two or more objects together into the first object.
909 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
910 * @param target The object to extend. It will receive the new properties.
911 * @param object1 An object containing additional properties to merge in.
912 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
913 * @since 1.1.4
914 * @example ​ ````Merge two objects recursively, modifying the first.
915```html
916<!doctype html>
917<html lang="en">
918<head>
919 <meta charset="utf-8">
920 <title>jQuery.extend demo</title>
921 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
922</head>
923<body>
924
925<div id="log"></div>
926
927<script>
928var object1 = {
929 apple: 0,
930 banana: { weight: 52, price: 100 },
931 cherry: 97
932};
933var object2 = {
934 banana: { price: 200 },
935 durian: 100
936};
937
938// Merge object2 into object1, recursively
939$.extend( true, object1, object2 );
940
941// Assuming JSON.stringify - not available in IE<8
942$( "#log" ).append( JSON.stringify( object1 ) );
943</script>
944
945</body>
946</html>
947```
948 */
949 extend<T, U>(deep: true, target: T, object1: U): T & U;
950 /**
951 * Merge the contents of two or more objects together into the first object.
952 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
953 * @param target The object to extend. It will receive the new properties.
954 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
955 * @since 1.1.4
956 */
957 extend<T>(deep: true, target: T): this & T;
958 /**
959 * Merge the contents of two or more objects together into the first object.
960 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
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 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
965 * @since 1.1.4
966 * @example ​ ````Merge two objects recursively, modifying the first.
967```html
968<!doctype html>
969<html lang="en">
970<head>
971 <meta charset="utf-8">
972 <title>jQuery.extend demo</title>
973 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
974</head>
975<body>
976
977<div id="log"></div>
978
979<script>
980var object1 = {
981 apple: 0,
982 banana: { weight: 52, price: 100 },
983 cherry: 97
984};
985var object2 = {
986 banana: { price: 200 },
987 durian: 100
988};
989
990// Merge object2 into object1, recursively
991$.extend( true, object1, object2 );
992
993// Assuming JSON.stringify - not available in IE<8
994$( "#log" ).append( JSON.stringify( object1 ) );
995</script>
996
997</body>
998</html>
999```
1000 */
1001 extend(deep: true, target: any, object1: any, ...objectN: any[]): any;
1002 /**
1003 * Merge the contents of two or more objects together into the first object.
1004 * @param target An object that will receive the new properties if additional objects are passed in or that will
1005 * extend the jQuery namespace if it is the sole argument.
1006 * @param object1 An object containing additional properties to merge in.
1007 * @param object2 An object containing additional properties to merge in.
1008 * @param object3 An object containing additional properties to merge in.
1009 * @param object4 An object containing additional properties to merge in.
1010 * @param object5 An object containing additional properties to merge in.
1011 * @param object6 An object containing additional properties to merge in.
1012 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
1013 * @since 1.0
1014 * @example ​ ````Merge two objects, modifying the first.
1015```html
1016<!doctype html>
1017<html lang="en">
1018<head>
1019 <meta charset="utf-8">
1020 <title>jQuery.extend demo</title>
1021 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1022</head>
1023<body>
1024
1025<div id="log"></div>
1026
1027<script>
1028var object1 = {
1029 apple: 0,
1030 banana: { weight: 52, price: 100 },
1031 cherry: 97
1032};
1033var object2 = {
1034 banana: { price: 200 },
1035 durian: 100
1036};
1037
1038// Merge object2 into object1
1039$.extend( object1, object2 );
1040
1041// Assuming JSON.stringify - not available in IE<8
1042$( "#log" ).append( JSON.stringify( object1 ) );
1043</script>
1044
1045</body>
1046</html>
1047```
1048 * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern.
1049```html
1050<!doctype html>
1051<html lang="en">
1052<head>
1053 <meta charset="utf-8">
1054 <title>jQuery.extend demo</title>
1055 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1056</head>
1057<body>
1058
1059<div id="log"></div>
1060
1061<script>
1062var defaults = { validate: false, limit: 5, name: "foo" };
1063var options = { validate: true, name: "bar" };
1064
1065// Merge defaults and options, without modifying defaults
1066var settings = $.extend( {}, defaults, options );
1067
1068// Assuming JSON.stringify - not available in IE<8
1069$( "#log" ).append( "<div><b>defaults -- </b>" + JSON.stringify( defaults ) + "</div>" );
1070$( "#log" ).append( "<div><b>options -- </b>" + JSON.stringify( options ) + "</div>" );
1071$( "#log" ).append( "<div><b>settings -- </b>" + JSON.stringify( settings ) + "</div>" );
1072</script>
1073
1074</body>
1075</html>
1076```
1077 */
1078 extend<T, U, V, W, X, Y, Z>(target: T, object1: U, object2: V, object3: W, object4: X, object5: Y, object6: Z): T & U & V & W & X & Y & Z;
1079 /**
1080 * Merge the contents of two or more objects together into the first object.
1081 * @param target An object that will receive the new properties if additional objects are passed in or that will
1082 * extend the jQuery namespace if it is the sole argument.
1083 * @param object1 An object containing additional properties to merge in.
1084 * @param object2 An object containing additional properties to merge in.
1085 * @param object3 An object containing additional properties to merge in.
1086 * @param object4 An object containing additional properties to merge in.
1087 * @param object5 An object containing additional properties to merge in.
1088 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
1089 * @since 1.0
1090 * @example ​ ````Merge two objects, modifying the first.
1091```html
1092<!doctype html>
1093<html lang="en">
1094<head>
1095 <meta charset="utf-8">
1096 <title>jQuery.extend demo</title>
1097 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1098</head>
1099<body>
1100
1101<div id="log"></div>
1102
1103<script>
1104var object1 = {
1105 apple: 0,
1106 banana: { weight: 52, price: 100 },
1107 cherry: 97
1108};
1109var object2 = {
1110 banana: { price: 200 },
1111 durian: 100
1112};
1113
1114// Merge object2 into object1
1115$.extend( object1, object2 );
1116
1117// Assuming JSON.stringify - not available in IE<8
1118$( "#log" ).append( JSON.stringify( object1 ) );
1119</script>
1120
1121</body>
1122</html>
1123```
1124 * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern.
1125```html
1126<!doctype html>
1127<html lang="en">
1128<head>
1129 <meta charset="utf-8">
1130 <title>jQuery.extend demo</title>
1131 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1132</head>
1133<body>
1134
1135<div id="log"></div>
1136
1137<script>
1138var defaults = { validate: false, limit: 5, name: "foo" };
1139var options = { validate: true, name: "bar" };
1140
1141// Merge defaults and options, without modifying defaults
1142var settings = $.extend( {}, defaults, options );
1143
1144// Assuming JSON.stringify - not available in IE<8
1145$( "#log" ).append( "<div><b>defaults -- </b>" + JSON.stringify( defaults ) + "</div>" );
1146$( "#log" ).append( "<div><b>options -- </b>" + JSON.stringify( options ) + "</div>" );
1147$( "#log" ).append( "<div><b>settings -- </b>" + JSON.stringify( settings ) + "</div>" );
1148</script>
1149
1150</body>
1151</html>
1152```
1153 */
1154 extend<T, U, V, W, X, Y>(target: T, object1: U, object2: V, object3: W, object4: X, object5: Y): T & U & V & W & X & Y;
1155 /**
1156 * Merge the contents of two or more objects together into the first object.
1157 * @param target An object that will receive the new properties if additional objects are passed in or that will
1158 * extend the jQuery namespace if it is the sole argument.
1159 * @param object1 An object containing additional properties to merge in.
1160 * @param object2 An object containing additional properties to merge in.
1161 * @param object3 An object containing additional properties to merge in.
1162 * @param object4 An object containing additional properties to merge in.
1163 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
1164 * @since 1.0
1165 * @example ​ ````Merge two objects, modifying the first.
1166```html
1167<!doctype html>
1168<html lang="en">
1169<head>
1170 <meta charset="utf-8">
1171 <title>jQuery.extend demo</title>
1172 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1173</head>
1174<body>
1175
1176<div id="log"></div>
1177
1178<script>
1179var object1 = {
1180 apple: 0,
1181 banana: { weight: 52, price: 100 },
1182 cherry: 97
1183};
1184var object2 = {
1185 banana: { price: 200 },
1186 durian: 100
1187};
1188
1189// Merge object2 into object1
1190$.extend( object1, object2 );
1191
1192// Assuming JSON.stringify - not available in IE<8
1193$( "#log" ).append( JSON.stringify( object1 ) );
1194</script>
1195
1196</body>
1197</html>
1198```
1199 * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern.
1200```html
1201<!doctype html>
1202<html lang="en">
1203<head>
1204 <meta charset="utf-8">
1205 <title>jQuery.extend demo</title>
1206 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1207</head>
1208<body>
1209
1210<div id="log"></div>
1211
1212<script>
1213var defaults = { validate: false, limit: 5, name: "foo" };
1214var options = { validate: true, name: "bar" };
1215
1216// Merge defaults and options, without modifying defaults
1217var settings = $.extend( {}, defaults, options );
1218
1219// Assuming JSON.stringify - not available in IE<8
1220$( "#log" ).append( "<div><b>defaults -- </b>" + JSON.stringify( defaults ) + "</div>" );
1221$( "#log" ).append( "<div><b>options -- </b>" + JSON.stringify( options ) + "</div>" );
1222$( "#log" ).append( "<div><b>settings -- </b>" + JSON.stringify( settings ) + "</div>" );
1223</script>
1224
1225</body>
1226</html>
1227```
1228 */
1229 extend<T, U, V, W, X>(target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X;
1230 /**
1231 * Merge the contents of two or more objects together into the first object.
1232 * @param target An object that will receive the new properties if additional objects are passed in or that will
1233 * extend the jQuery namespace if it is the sole argument.
1234 * @param object1 An object containing additional properties to merge in.
1235 * @param object2 An object containing additional properties to merge in.
1236 * @param object3 An object containing additional properties to merge in.
1237 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
1238 * @since 1.0
1239 * @example ​ ````Merge two objects, modifying the first.
1240```html
1241<!doctype html>
1242<html lang="en">
1243<head>
1244 <meta charset="utf-8">
1245 <title>jQuery.extend demo</title>
1246 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1247</head>
1248<body>
1249
1250<div id="log"></div>
1251
1252<script>
1253var object1 = {
1254 apple: 0,
1255 banana: { weight: 52, price: 100 },
1256 cherry: 97
1257};
1258var object2 = {
1259 banana: { price: 200 },
1260 durian: 100
1261};
1262
1263// Merge object2 into object1
1264$.extend( object1, object2 );
1265
1266// Assuming JSON.stringify - not available in IE<8
1267$( "#log" ).append( JSON.stringify( object1 ) );
1268</script>
1269
1270</body>
1271</html>
1272```
1273 * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern.
1274```html
1275<!doctype html>
1276<html lang="en">
1277<head>
1278 <meta charset="utf-8">
1279 <title>jQuery.extend demo</title>
1280 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1281</head>
1282<body>
1283
1284<div id="log"></div>
1285
1286<script>
1287var defaults = { validate: false, limit: 5, name: "foo" };
1288var options = { validate: true, name: "bar" };
1289
1290// Merge defaults and options, without modifying defaults
1291var settings = $.extend( {}, defaults, options );
1292
1293// Assuming JSON.stringify - not available in IE<8
1294$( "#log" ).append( "<div><b>defaults -- </b>" + JSON.stringify( defaults ) + "</div>" );
1295$( "#log" ).append( "<div><b>options -- </b>" + JSON.stringify( options ) + "</div>" );
1296$( "#log" ).append( "<div><b>settings -- </b>" + JSON.stringify( settings ) + "</div>" );
1297</script>
1298
1299</body>
1300</html>
1301```
1302 */
1303 extend<T, U, V, W>(target: T, object1: U, object2: V, object3: W): T & U & V & W;
1304 /**
1305 * Merge the contents of two or more objects together into the first object.
1306 * @param target An object that will receive the new properties if additional objects are passed in or that will
1307 * extend the jQuery namespace if it is the sole argument.
1308 * @param object1 An object containing additional properties to merge in.
1309 * @param object2 An object containing additional properties to merge in.
1310 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
1311 * @since 1.0
1312 * @example ​ ````Merge two objects, modifying the first.
1313```html
1314<!doctype html>
1315<html lang="en">
1316<head>
1317 <meta charset="utf-8">
1318 <title>jQuery.extend demo</title>
1319 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1320</head>
1321<body>
1322
1323<div id="log"></div>
1324
1325<script>
1326var object1 = {
1327 apple: 0,
1328 banana: { weight: 52, price: 100 },
1329 cherry: 97
1330};
1331var object2 = {
1332 banana: { price: 200 },
1333 durian: 100
1334};
1335
1336// Merge object2 into object1
1337$.extend( object1, object2 );
1338
1339// Assuming JSON.stringify - not available in IE<8
1340$( "#log" ).append( JSON.stringify( object1 ) );
1341</script>
1342
1343</body>
1344</html>
1345```
1346 * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern.
1347```html
1348<!doctype html>
1349<html lang="en">
1350<head>
1351 <meta charset="utf-8">
1352 <title>jQuery.extend demo</title>
1353 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1354</head>
1355<body>
1356
1357<div id="log"></div>
1358
1359<script>
1360var defaults = { validate: false, limit: 5, name: "foo" };
1361var options = { validate: true, name: "bar" };
1362
1363// Merge defaults and options, without modifying defaults
1364var settings = $.extend( {}, defaults, options );
1365
1366// Assuming JSON.stringify - not available in IE<8
1367$( "#log" ).append( "<div><b>defaults -- </b>" + JSON.stringify( defaults ) + "</div>" );
1368$( "#log" ).append( "<div><b>options -- </b>" + JSON.stringify( options ) + "</div>" );
1369$( "#log" ).append( "<div><b>settings -- </b>" + JSON.stringify( settings ) + "</div>" );
1370</script>
1371
1372</body>
1373</html>
1374```
1375 */
1376 extend<T, U, V>(target: T, object1: U, object2: V): T & U & V;
1377 /**
1378 * Merge the contents of two or more objects together into the first object.
1379 * @param target An object that will receive the new properties if additional objects are passed in or that will
1380 * extend the jQuery namespace if it is the sole argument.
1381 * @param object1 An object containing additional properties to merge in.
1382 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
1383 * @since 1.0
1384 * @example ​ ````Merge two objects, modifying the first.
1385```html
1386<!doctype html>
1387<html lang="en">
1388<head>
1389 <meta charset="utf-8">
1390 <title>jQuery.extend demo</title>
1391 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1392</head>
1393<body>
1394
1395<div id="log"></div>
1396
1397<script>
1398var object1 = {
1399 apple: 0,
1400 banana: { weight: 52, price: 100 },
1401 cherry: 97
1402};
1403var object2 = {
1404 banana: { price: 200 },
1405 durian: 100
1406};
1407
1408// Merge object2 into object1
1409$.extend( object1, object2 );
1410
1411// Assuming JSON.stringify - not available in IE<8
1412$( "#log" ).append( JSON.stringify( object1 ) );
1413</script>
1414
1415</body>
1416</html>
1417```
1418 * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern.
1419```html
1420<!doctype html>
1421<html lang="en">
1422<head>
1423 <meta charset="utf-8">
1424 <title>jQuery.extend demo</title>
1425 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1426</head>
1427<body>
1428
1429<div id="log"></div>
1430
1431<script>
1432var defaults = { validate: false, limit: 5, name: "foo" };
1433var options = { validate: true, name: "bar" };
1434
1435// Merge defaults and options, without modifying defaults
1436var settings = $.extend( {}, defaults, options );
1437
1438// Assuming JSON.stringify - not available in IE<8
1439$( "#log" ).append( "<div><b>defaults -- </b>" + JSON.stringify( defaults ) + "</div>" );
1440$( "#log" ).append( "<div><b>options -- </b>" + JSON.stringify( options ) + "</div>" );
1441$( "#log" ).append( "<div><b>settings -- </b>" + JSON.stringify( settings ) + "</div>" );
1442</script>
1443
1444</body>
1445</html>
1446```
1447 */
1448 extend<T, U>(target: T, object1: U): T & U;
1449 /**
1450 * Merge the contents of two or more objects together into the first object.
1451 * @param target An object that will receive the new properties if additional objects are passed in or that will
1452 * extend the jQuery namespace if it is the sole argument.
1453 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
1454 * @since 1.0
1455 */
1456 extend<T>(target: T): this & T;
1457 /**
1458 * Merge the contents of two or more objects together into the first object.
1459 * @param target An object that will receive the new properties if additional objects are passed in or that will
1460 * extend the jQuery namespace if it is the sole argument.
1461 * @param object1 An object containing additional properties to merge in.
1462 * @param objectN Additional objects containing properties to merge in.
1463 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
1464 * @since 1.0
1465 * @example ​ ````Merge two objects, modifying the first.
1466```html
1467<!doctype html>
1468<html lang="en">
1469<head>
1470 <meta charset="utf-8">
1471 <title>jQuery.extend demo</title>
1472 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1473</head>
1474<body>
1475
1476<div id="log"></div>
1477
1478<script>
1479var object1 = {
1480 apple: 0,
1481 banana: { weight: 52, price: 100 },
1482 cherry: 97
1483};
1484var object2 = {
1485 banana: { price: 200 },
1486 durian: 100
1487};
1488
1489// Merge object2 into object1
1490$.extend( object1, object2 );
1491
1492// Assuming JSON.stringify - not available in IE<8
1493$( "#log" ).append( JSON.stringify( object1 ) );
1494</script>
1495
1496</body>
1497</html>
1498```
1499 * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern.
1500```html
1501<!doctype html>
1502<html lang="en">
1503<head>
1504 <meta charset="utf-8">
1505 <title>jQuery.extend demo</title>
1506 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1507</head>
1508<body>
1509
1510<div id="log"></div>
1511
1512<script>
1513var defaults = { validate: false, limit: 5, name: "foo" };
1514var options = { validate: true, name: "bar" };
1515
1516// Merge defaults and options, without modifying defaults
1517var settings = $.extend( {}, defaults, options );
1518
1519// Assuming JSON.stringify - not available in IE<8
1520$( "#log" ).append( "<div><b>defaults -- </b>" + JSON.stringify( defaults ) + "</div>" );
1521$( "#log" ).append( "<div><b>options -- </b>" + JSON.stringify( options ) + "</div>" );
1522$( "#log" ).append( "<div><b>settings -- </b>" + JSON.stringify( settings ) + "</div>" );
1523</script>
1524
1525</body>
1526</html>
1527```
1528 */
1529 extend(target: any, object1: any, ...objectN: any[]): any;
1530 /**
1531 * Load data from the server using a HTTP GET request.
1532 * @param url A string containing the URL to which the request is sent.
1533 * @param data A plain object or string that is sent to the server with the request.
1534 * @param success A callback function that is executed if the request succeeds. Required if `dataType` is provided,
1535 * but you can use `null` or \`{@link noop jQuery.noop}\` as a placeholder.
1536 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
1537 * @see \`{@link https://api.jquery.com/jQuery.get/ }\`
1538 * @since 1.0
1539 */
1540 get(url: string,
1541 data: JQuery.PlainObject | string,
1542 success: JQuery.jqXHR.DoneCallback | null,
1543 dataType?: string): JQuery.jqXHR;
1544 /**
1545 * Load data from the server using a HTTP GET request.
1546 * @param url A string containing the URL to which the request is sent.
1547 * @param success_data _&#x40;param_ `success_data`
1548 * <br>
1549 * * `success` — A callback function that is executed if the request succeeds. Required if `dataType` is provided,
1550 * but you can use `null` or \`{@link noop jQuery.noop}\` as a placeholder. <br>
1551 * * `data` — A plain object or string that is sent to the server with the request.
1552 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
1553 * @see \`{@link https://api.jquery.com/jQuery.get/ }\`
1554 * @since 1.0
1555 * @example ​ ````Get the test.php page contents, which has been returned in json format (&lt;?php echo json_encode( array( &quot;name&quot;=&gt;&quot;John&quot;,&quot;time&quot;=&gt;&quot;2pm&quot; ) ); ?&gt;), and add it to the page.
1556```javascript
1557$.get( "test.php", function( data ) {
1558 $( "body" )
1559 .append( "Name: " + data.name ) // John
1560 .append( "Time: " + data.time ); // 2pm
1561}, "json" );
1562```
1563 */
1564 get(url: string,
1565 data_success: JQuery.PlainObject | string | JQuery.jqXHR.DoneCallback | null,
1566 dataType: string): JQuery.jqXHR;
1567 /**
1568 * Load data from the server using a HTTP GET request.
1569 * @param url A string containing the URL to which the request is sent.
1570 * @param success_data _&#x40;param_ `success_data`
1571 * <br>
1572 * * `success` — A callback function that is executed if the request succeeds. Required if `dataType` is provided,
1573 * but you can use `null` or \`{@link noop jQuery.noop}\` as a placeholder. <br>
1574 * * `data` — A plain object or string that is sent to the server with the request.
1575 * @see \`{@link https://api.jquery.com/jQuery.get/ }\`
1576 * @since 1.0
1577 * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results).
1578```javascript
1579$.get( "test.php", { name: "John", time: "2pm" } );
1580```
1581 * @example ​ ````Pass arrays of data to the server (while still ignoring the return results).
1582```javascript
1583$.get( "test.php", { "choices[]": ["Jon", "Susan"] } );
1584```
1585 * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned).
1586```javascript
1587$.get( "test.php", function( data ) {
1588 alert( "Data Loaded: " + data );
1589});
1590```
1591 * @example ​ ````Alert the results from requesting test.cgi with an additional payload of data (HTML or XML, depending on what was returned).
1592```javascript
1593$.get( "test.cgi", { name: "John", time: "2pm" } )
1594 .done(function( data ) {
1595 alert( "Data Loaded: " + data );
1596 });
1597```
1598 */
1599 get(url: string,
1600 success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR;
1601 /**
1602 * Load data from the server using a HTTP GET request.
1603 * @param url_settings _&#x40;param_ `url_settings`
1604 * <br>
1605 * * `url` — A string containing the URL to which the request is sent. <br>
1606 * * `settings` — A set of key/value pairs that configure the Ajax request. All properties except for `url` are
1607 * optional. A default can be set for any option with \`{@link ajaxSetup $.ajaxSetup()}\`. See \`{@link https://api.jquery.com/jquery.ajax/#jQuery-ajax-settings jQuery.ajax( settings )}\`
1608 * for a complete list of all settings. The type option will automatically be set to `GET`.
1609 * @see \`{@link https://api.jquery.com/jQuery.get/ }\`
1610 * @since 1.0
1611 * @since 1.12
1612 * @since 2.2
1613 * @example ​ ````Request the test.php page, but ignore the return results.
1614```javascript
1615$.get( "test.php" );
1616```
1617 */
1618 get(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR;
1619 /**
1620 * Load JSON-encoded data from the server using a GET HTTP request.
1621 * @param url A string containing the URL to which the request is sent.
1622 * @param data A plain object or string that is sent to the server with the request.
1623 * @param success A callback function that is executed if the request succeeds.
1624 * @see \`{@link https://api.jquery.com/jQuery.getJSON/ }\`
1625 * @since 1.0
1626 */
1627 getJSON(url: string,
1628 data: JQuery.PlainObject | string,
1629 success: JQuery.jqXHR.DoneCallback): JQuery.jqXHR;
1630 /**
1631 * Load JSON-encoded data from the server using a GET HTTP request.
1632 * @param url A string containing the URL to which the request is sent.
1633 * @param success_data _&#x40;param_ `url_settings`
1634 * <br>
1635 * * `success` — A callback function that is executed if the request succeeds. <br>
1636 * * `data` — A plain object or string that is sent to the server with the request.
1637 * @see \`{@link https://api.jquery.com/jQuery.getJSON/ }\`
1638 * @since 1.0
1639 * @example ​ ````Loads the four most recent pictures of Mount Rainier from the Flickr JSONP API.
1640```html
1641<!doctype html>
1642<html lang="en">
1643<head>
1644 <meta charset="utf-8">
1645 <title>jQuery.getJSON demo</title>
1646 <style>
1647 img {
1648 height: 100px;
1649 float: left;
1650 }
1651 </style>
1652 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1653</head>
1654<body>
1655
1656<div id="images"></div>
1657
1658<script>
1659(function() {
1660 var flickerAPI = "https://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?";
1661 $.getJSON( flickerAPI, {
1662 tags: "mount rainier",
1663 tagmode: "any",
1664 format: "json"
1665 })
1666 .done(function( data ) {
1667 $.each( data.items, function( i, item ) {
1668 $( "<img>" ).attr( "src", item.media.m ).appendTo( "#images" );
1669 if ( i === 3 ) {
1670 return false;
1671 }
1672 });
1673 });
1674})();
1675</script>
1676
1677</body>
1678</html>
1679```
1680 * @example ​ ````Load the JSON data from test.js and access a name from the returned JSON data.
1681```javascript
1682$.getJSON( "test.js", function( json ) {
1683 console.log( "JSON Data: " + json.users[ 3 ].name );
1684 });
1685 ```
1686 * @example ​ ````Load the JSON data from test.js, passing along additional data, and access a name from the returned JSON data.
1687 If an error occurs, log an error message instead.
1688```javascript
1689$.getJSON( "test.js", { name: "John", time: "2pm" } )
1690 .done(function( json ) {
1691 console.log( "JSON Data: " + json.users[ 3 ].name );
1692 })
1693 .fail(function( jqxhr, textStatus, error ) {
1694 var err = textStatus + ", " + error;
1695 console.log( "Request Failed: " + err );
1696});
1697```
1698 */
1699 getJSON(url: string,
1700 success_data?: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR;
1701 /**
1702 * Load a JavaScript file from the server using a GET HTTP request, then execute it.
1703 * @param url A string containing the URL to which the request is sent.
1704 * @param success A callback function that is executed if the request succeeds.
1705 * @see \`{@link https://api.jquery.com/jQuery.getScript/ }\`
1706 * @since 1.0
1707 * @example ​ ````Define a $.cachedScript() method that allows fetching a cached script:
1708```javascript
1709jQuery.cachedScript = function( url, options ) {
1710
1711 // Allow user to set any option except for dataType, cache, and url
1712 options = $.extend( options || {}, {
1713 dataType: "script",
1714 cache: true,
1715 url: url
1716 });
1717
1718 // Use $.ajax() since it is more flexible than $.getScript
1719 // Return the jqXHR object so we can chain callbacks
1720 return jQuery.ajax( options );
1721};
1722
1723// Usage
1724$.cachedScript( "ajax/test.js" ).done(function( script, textStatus ) {
1725 console.log( textStatus );
1726});
1727```
1728 * @example ​ ````Load the official jQuery Color Animation plugin dynamically and bind some color animations to occur once the new functionality is loaded.
1729```html
1730<!doctype html>
1731<html lang="en">
1732<head>
1733 <meta charset="utf-8">
1734 <title>jQuery.getScript demo</title>
1735 <style>
1736 .block {
1737 background-color: blue;
1738 width: 150px;
1739 height: 70px;
1740 margin: 10px;
1741 }
1742 </style>
1743 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1744</head>
1745<body>
1746
1747<button id="go">&raquo; Run</button>
1748<div class="block"></div>
1749
1750<script>
1751var url = "https://code.jquery.com/color/jquery.color.js";
1752$.getScript( url, function() {
1753 $( "#go" ).click(function() {
1754 $( ".block" )
1755 .animate({
1756 backgroundColor: "rgb(255, 180, 180)"
1757 }, 1000 )
1758 .delay( 500 )
1759 .animate({
1760 backgroundColor: "olive"
1761 }, 1000 )
1762 .delay( 500 )
1763 .animate({
1764 backgroundColor: "#00f"
1765 }, 1000 );
1766 });
1767});
1768</script>
1769
1770</body>
1771</html>
1772```
1773 */
1774 getScript(url: string,
1775 success?: JQuery.jqXHR.DoneCallback<string | undefined>): JQuery.jqXHR<string | undefined>;
1776 /**
1777 * Load a JavaScript file from the server using a GET HTTP request, then execute it.
1778 * @see \`{@link https://api.jquery.com/jQuery.getScript/ }\`
1779 * @since 1.12
1780 * @since 2.2
1781 */
1782 getScript(options: JQuery.UrlAjaxSettings): JQuery.jqXHR<string | undefined>;
1783 /**
1784 * Execute some JavaScript code globally.
1785 * @param code The JavaScript code to execute.
1786 * @see \`{@link https://api.jquery.com/jQuery.globalEval/ }\`
1787 * @since 1.0.4
1788 * @example ​ ````Execute a script in the global context.
1789```javascript
1790function test() {
1791 jQuery.globalEval( "var newVar = true;" )
1792}
1793test();
1794// newVar === true
1795```
1796 */
1797 globalEval(code: string): void;
1798 /**
1799 * Finds the elements of an array which satisfy a filter function. The original array is not affected.
1800 * @param array The array-like object to search through.
1801 * @param funсtion The function to process each item against. The first argument to the function is the item, and the
1802 * second argument is the index. The function should return a Boolean value. `this` will be the global
1803 * window object.
1804 * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements
1805 * for which "callback" returns true. If "invert" is true, then the function returns an array
1806 * consisting of all elements for which "callback" returns false.
1807 * @see \`{@link https://api.jquery.com/jQuery.grep/ }\`
1808 * @since 1.0
1809 * @example ​ ````Filters the original array of numbers leaving that are not 5 and have an index greater than 4. Then it removes all 9s.
1810```html
1811<!doctype html>
1812<html lang="en">
1813<head>
1814 <meta charset="utf-8">
1815 <title>jQuery.grep demo</title>
1816 <style>
1817 div {
1818 color: blue;
1819 }
1820 p {
1821 color: green;
1822 margin: 0;
1823 }
1824 span {
1825 color: red;
1826 }
1827 </style>
1828 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1829</head>
1830<body>
1831
1832<div></div>
1833<p></p>
1834<span></span>
1835
1836<script>
1837var arr = [ 1, 9, 3, 8, 6, 1, 5, 9, 4, 7, 3, 8, 6, 9, 1 ];
1838$( "div" ).text( arr.join( ", " ) );
1839
1840arr = jQuery.grep(arr, function( n, i ) {
1841 return ( n !== 5 && i > 4 );
1842});
1843$( "p" ).text( arr.join( ", " ) );
1844
1845arr = jQuery.grep(arr, function( a ) {
1846 return a !== 9;
1847});
1848
1849$( "span" ).text( arr.join( ", " ) );
1850</script>
1851
1852</body>
1853</html>
1854```
1855 * @example ​ ````Filter an array of numbers to include only numbers bigger then zero.
1856```javascript
1857$.grep( [ 0, 1, 2 ], function( n, i ) {
1858 return n > 0;
1859});
1860```
1861 * @example ​ ````Filter an array of numbers to include numbers that are not bigger than zero.
1862```javascript
1863$.grep( [ 0, 1, 2 ], function( n, i ) {
1864 return n > 0;
1865}, true );
1866```
1867 */
1868 grep<T>(array: ArrayLike<T>,
1869 funсtion: (elementOfArray: T, indexInArray: number) => boolean,
1870 invert?: boolean): T[];
1871 /**
1872 * Determine whether an element has any jQuery data associated with it.
1873 * @param element A DOM element to be checked for data.
1874 * @see \`{@link https://api.jquery.com/jQuery.hasData/ }\`
1875 * @since 1.5
1876 * @example ​ ````Set data on an element and see the results of hasData.
1877```html
1878<!doctype html>
1879<html lang="en">
1880<head>
1881 <meta charset="utf-8">
1882 <title>jQuery.hasData demo</title>
1883 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1884</head>
1885<body>
1886
1887<p>Results: </p>
1888
1889<script>
1890var $p = jQuery( "p" ), p = $p[ 0 ];
1891$p.append( jQuery.hasData( p ) + " " ); // false
1892
1893$.data( p, "testing", 123 );
1894$p.append( jQuery.hasData( p ) + " " ); // true
1895
1896$.removeData( p, "testing" );
1897$p.append( jQuery.hasData( p ) + " " ); // false
1898
1899$p.on( "click", function() {} );
1900$p.append( jQuery.hasData( p ) + " " ); // true
1901
1902$p.off( "click" );
1903$p.append( jQuery.hasData( p ) + " " ); // false
1904</script>
1905
1906</body>
1907</html>
1908```
1909 */
1910 hasData(element: Element | Document | Window | JQuery.PlainObject): boolean;
1911 /**
1912 * Holds or releases the execution of jQuery's ready event.
1913 * @param hold Indicates whether the ready hold is being requested or released
1914 * @see \`{@link https://api.jquery.com/jQuery.holdReady/ }\`
1915 * @since 1.6
1916 * @deprecatedDeprecated since 3.2. See \`{@link https://github.com/jquery/jquery/issues/3288 }\`.
1917 *
1918 * **Cause**: The `jQuery.holdReady()` method has been deprecated due to its detrimental effect on the global performance of the page. This method can prevent all the code on the page from initializing for extended lengths of time.
1919 *
1920 * **Solution**: Rewrite the page so that it does not require all jQuery ready handlers to be delayed. This might be accomplished, for example, by late-loading only the code that requires the delay when it is safe to run. Due to the complexity of this method, jQuery Migrate does not attempt to fill the functionality. If the underlying version of jQuery used with jQuery Migrate no longer contains `jQuery.holdReady()` the code will fail shortly after this warning appears.
1921 * @example ​ ````Delay the ready event until a custom plugin has loaded.
1922```javascript
1923$.holdReady( true );
1924$.getScript( "myplugin.js", function() {
1925 $.holdReady( false );
1926});
1927```
1928 */
1929 holdReady(hold: boolean): void;
1930 /**
1931 * Modify and filter HTML strings passed through jQuery manipulation methods.
1932 * @param html The HTML string on which to operate.
1933 * @see \`{@link https://api.jquery.com/jQuery.htmlPrefilter/ }\`
1934 * @since 1.12
1935 * @since 2.2
1936 */
1937 htmlPrefilter(html: JQuery.htmlString): JQuery.htmlString;
1938 /**
1939 * Search for a specified value within an array and return its index (or -1 if not found).
1940 * @param value The value to search for.
1941 * @param array An array through which to search.
1942 * @param fromIndex The index of the array at which to begin the search. The default is 0, which will search the whole array.
1943 * @see \`{@link https://api.jquery.com/jQuery.inArray/ }\`
1944 * @since 1.2
1945 * @example ​ ````Report the index of some elements in the array.
1946```html
1947<!doctype html>
1948<html lang="en">
1949<head>
1950 <meta charset="utf-8">
1951 <title>jQuery.inArray demo</title>
1952 <style>
1953 div {
1954 color: blue;
1955 }
1956 span {
1957 color: red;
1958 }
1959 </style>
1960 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1961</head>
1962<body>
1963
1964<div>"John" found at <span></span></div>
1965<div>4 found at <span></span></div>
1966<div>"Karl" not found, so <span></span></div>
1967<div>"Pete" is in the array, but not at or after index 2, so <span></span></div>
1968
1969<script>
1970var arr = [ 4, "Pete", 8, "John" ];
1971var $spans = $( "span" );
1972$spans.eq( 0 ).text( jQuery.inArray( "John", arr ) );
1973$spans.eq( 1 ).text( jQuery.inArray( 4, arr ) );
1974$spans.eq( 2 ).text( jQuery.inArray( "Karl", arr ) );
1975$spans.eq( 3 ).text( jQuery.inArray( "Pete", arr, 2 ) );
1976</script>
1977
1978</body>
1979</html>
1980```
1981 */
1982 inArray<T>(value: T, array: T[], fromIndex?: number): number;
1983 /**
1984 * Determine whether the argument is an array.
1985 * @param obj Object to test whether or not it is an array.
1986 * @see \`{@link https://api.jquery.com/jQuery.isArray/ }\`
1987 * @since 1.3
1988 * @deprecatedDeprecated since 3.2. Use \`{@link ArrayConstructor.isArray Array.isArray}\`.
1989 * @example ​ ````Finds out if the parameter is an array.
1990```html
1991<!doctype html>
1992<html lang="en">
1993<head>
1994 <meta charset="utf-8">
1995 <title>jQuery.isArray demo</title>
1996 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1997</head>
1998<body>
1999
2000Is [] an Array? <b></b>
2001
2002<script>
2003$( "b" ).append( "" + $.isArray([]) );
2004</script>
2005
2006</body>
2007</html>
2008```
2009 */
2010 isArray(obj: any): obj is any[];
2011 /**
2012 * Check to see if an object is empty (contains no enumerable properties).
2013 * @param obj The object that will be checked to see if it's empty.
2014 * @see \`{@link https://api.jquery.com/jQuery.isEmptyObject/ }\`
2015 * @since 1.4
2016 * @example ​ ````Check an object to see if it&#39;s empty.
2017```javascript
2018jQuery.isEmptyObject({}); // true
2019jQuery.isEmptyObject({ foo: "bar" }); // false
2020```
2021 */
2022 isEmptyObject(obj: any): boolean;
2023 /**
2024 * Determine if the argument passed is a JavaScript function object.
2025 * @param obj Object to test whether or not it is a function.
2026 * @see \`{@link https://api.jquery.com/jQuery.isFunction/ }\`
2027 * @since 1.2
2028 * @deprecatedDeprecated since 3.3. Use `typeof x === "function"`.
2029 * @example ​ ````Test a few parameter examples.
2030```html
2031<!doctype html>
2032<html lang="en">
2033<head>
2034 <meta charset="utf-8">
2035 <title>jQuery.isFunction demo</title>
2036 <style>
2037 div {
2038 color: blue;
2039 margin: 2px;
2040 font-size: 14px;
2041 }
2042 span {
2043 color: red;
2044 }
2045 </style>
2046 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2047</head>
2048<body>
2049
2050<div>jQuery.isFunction( objs[ 0 ] ) = <span></span></div>
2051<div>jQuery.isFunction( objs[ 1 ] ) = <span></span></div>
2052<div>jQuery.isFunction( objs[ 2 ] ) = <span></span></div>
2053<div>jQuery.isFunction( objs[ 3 ] ) = <span></span></div>
2054<div>jQuery.isFunction( objs[ 4 ] ) = <span></span></div>
2055
2056<script>
2057function stub() {}
2058var objs = [
2059 function() {},
2060 { x:15, y:20 },
2061 null,
2062 stub,
2063 "function"
2064];
2065
2066jQuery.each( objs, function( i ) {
2067 var isFunc = jQuery.isFunction( objs[ i ]);
2068 $( "span" ).eq( i ).text( isFunc );
2069});
2070</script>
2071
2072</body>
2073</html>
2074```
2075 * @example ​ ````Finds out if the parameter is a function.
2076```javascript
2077$.isFunction(function() {});
2078```
2079 */
2080 // tslint:disable-next-line:ban-types
2081 isFunction(obj: any): obj is Function;
2082 /**
2083 * Determines whether its argument represents a JavaScript number.
2084 * @param value The value to be tested.
2085 * @see \`{@link https://api.jquery.com/jQuery.isNumeric/ }\`
2086 * @since 1.7
2087 * @deprecatedDeprecated since 3.3. Internal. See \`{@link https://github.com/jquery/jquery/issues/2960 }\`.
2088 * @example ​ ````Sample return values of $.isNumeric with various inputs.
2089```javascript
2090// true (numeric)
2091$.isNumeric( "-10" )
2092$.isNumeric( "0" )
2093$.isNumeric( 0xFF )
2094$.isNumeric( "0xFF" )
2095$.isNumeric( "8e5" )
2096$.isNumeric( "3.1415" )
2097$.isNumeric( +10 )
2098$.isNumeric( 0144 )
2099
2100// false (non-numeric)
2101$.isNumeric( "-0x42" )
2102$.isNumeric( "7.2acdgs" )
2103$.isNumeric( "" )
2104$.isNumeric( {} )
2105$.isNumeric( NaN )
2106$.isNumeric( null )
2107$.isNumeric( true )
2108$.isNumeric( Infinity )
2109$.isNumeric( undefined )
2110```
2111 */
2112 isNumeric(value: any): boolean;
2113 /**
2114 * Check to see if an object is a plain object (created using "{}" or "new Object").
2115 * @param obj The object that will be checked to see if it's a plain object.
2116 * @see \`{@link https://api.jquery.com/jQuery.isPlainObject/ }\`
2117 * @since 1.4
2118 * @example ​ ````Check an object to see if it&#39;s a plain object.
2119```javascript
2120jQuery.isPlainObject({}) // true
2121jQuery.isPlainObject( "test" ) // false
2122```
2123 */
2124 isPlainObject(obj: any): boolean;
2125 /**
2126 * Determine whether the argument is a window.
2127 * @param obj Object to test whether or not it is a window.
2128 * @see \`{@link https://api.jquery.com/jQuery.isWindow/ }\`
2129 * @since 1.4.3
2130 * @deprecatedDeprecated since 3.3. Internal. See \`{@link https://github.com/jquery/jquery/issues/3629 }\`.
2131 *
2132 * **Cause**: This method returns `true` if its argument is thought to be a `window` element. It was created for internal use and is not a reliable way of detecting `window` for public needs.
2133 *
2134 * **Solution**: Remove any use of `jQuery.isWindow()` from code. If it is truly needed it can be replaced with a check for `obj != null && obj === obj.window` which was the test used inside this method.
2135 * @example ​ ````Finds out if the parameter is a window.
2136```html
2137<!doctype html>
2138<html lang="en">
2139<head>
2140 <meta charset="utf-8">
2141 <title>jQuery.isWindow demo</title>
2142 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2143</head>
2144<body>
2145
2146Is 'window' a window? <b></b>
2147
2148<script>
2149$( "b" ).append( "" + $.isWindow( window ) );
2150</script>
2151
2152</body>
2153</html>
2154```
2155 */
2156 isWindow(obj: any): obj is Window;
2157 /**
2158 * Check to see if a DOM node is within an XML document (or is an XML document).
2159 * @param node The DOM node that will be checked to see if it's in an XML document.
2160 * @see \`{@link https://api.jquery.com/jQuery.isXMLDoc/ }\`
2161 * @since 1.1.4
2162 * @example ​ ````Check an object to see if it&#39;s in an XML document.
2163```javascript
2164jQuery.isXMLDoc( document ) // false
2165jQuery.isXMLDoc( document.body ) // false
2166```
2167 */
2168 isXMLDoc(node: Node): boolean;
2169 /**
2170 * Convert an array-like object into a true JavaScript array.
2171 * @param obj Any object to turn into a native Array.
2172 * @see \`{@link https://api.jquery.com/jQuery.makeArray/ }\`
2173 * @since 1.2
2174 * @example ​ ````Turn a collection of HTMLElements into an Array of them.
2175```html
2176<!doctype html>
2177<html lang="en">
2178<head>
2179 <meta charset="utf-8">
2180 <title>jQuery.makeArray demo</title>
2181 <style>
2182 div {
2183 color: red;
2184 }
2185 </style>
2186 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2187</head>
2188<body>
2189
2190<div>First</div>
2191<div>Second</div>
2192<div>Third</div>
2193<div>Fourth</div>
2194
2195<script>
2196// Returns a NodeList
2197var elems = document.getElementsByTagName( "div" );
2198// Convert the NodeList to an Array
2199var arr = jQuery.makeArray( elems );
2200// Use an Array method on list of dom elements
2201arr.reverse();
2202$( arr ).appendTo( document.body );
2203</script>
2204
2205</body>
2206</html>
2207```
2208 * @example ​ ````Turn a jQuery object into an array
2209```javascript
2210var obj = $( "li" );
2211var arr = $.makeArray( obj );
2212```
2213 */
2214 makeArray<T>(obj: ArrayLike<T>): T[];
2215 /**
2216 * Translate all items in an array or object to new array of items.
2217 * @param array The Array to translate.
2218 * @param callback The function to process each item against. The first argument to the function is the array item, the
2219 * second argument is the index in array The function can return any value. A returned array will be
2220 * flattened into the resulting array. Within the function, this refers to the global (window) object.
2221 * @see \`{@link https://api.jquery.com/jQuery.map/ }\`
2222 * @since 1.0
2223 * @example ​ ````Use $.map() to change the values of an array.
2224```html
2225<!doctype html>
2226<html lang="en">
2227<head>
2228 <meta charset="utf-8">
2229 <title>jQuery.map demo</title>
2230 <style>
2231 div {
2232 color: blue;
2233 }
2234 p {
2235 color: green;
2236 margin: 0;
2237 }
2238 span {
2239 color: red;
2240 }
2241 </style>
2242 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2243</head>
2244<body>
2245
2246<div></div>
2247<p></p>
2248<span></span>
2249
2250<script>
2251var arr = [ "a", "b", "c", "d", "e" ];
2252$( "div" ).text( arr.join( ", " ) );
2253
2254arr = jQuery.map( arr, function( n, i ) {
2255 return ( n.toUpperCase() + i );
2256});
2257$( "p" ).text( arr.join( ", " ) );
2258
2259arr = jQuery.map( arr, function( a ) {
2260 return a + a;
2261});
2262$( "span" ).text( arr.join( ", " ) );
2263</script>
2264
2265</body>
2266</html>
2267```
2268 * @example ​ ````Map the original array to a new one and add 4 to each value.
2269```javascript
2270$.map( [ 0, 1, 2 ], function( n ) {
2271 return n + 4;
2272});
2273```
2274 * @example ​ ````Map the original array to a new one, adding 1 to each value if it is bigger then zero and removing it if not.
2275```javascript
2276$.map( [ 0, 1, 2 ], function( n ) {
2277 return n > 0 ? n + 1 : null;
2278});
2279```
2280 * @example ​ ````Map the original array to a new one; each element is added with its original value and the value plus one.
2281```javascript
2282$.map( [ 0, 1, 2 ], function( n ) {
2283 return [ n, n + 1 ];
2284});
2285```
2286 * @example ​ ````Map the original array to a new one; each element is squared.
2287```javascript
2288$.map( [ 0, 1, 2, 3 ], function( a ) {
2289 return a * a;
2290});
2291```
2292 * @example ​ ````Map the original array to a new one, removing numbers less than 50 by returning null and subtracting 45 from the rest.
2293```javascript
2294$.map( [ 0, 1, 52, 97 ], function( a ) {
2295 return (a > 50 ? a - 45 : null);
2296});
2297```
2298 * @example ​ ````Augment the resulting array by returning an array inside the function.
2299```javascript
2300var array = [ 0, 1, 52, 97 ];
2301array = $.map( array, function( a, index ) {
2302 return [ a - 45, index ];
2303});
2304```
2305 */
2306 map<T, TReturn>(array: T[], callback: (this: Window, elementOfArray: T, indexInArray: number) => JQuery.TypeOrArray<TReturn> | null | undefined): TReturn[];
2307 /**
2308 * Translate all items in an array or object to new array of items.
2309 * @param obj The Object to translate.
2310 * @param callback The function to process each item against. The first argument to the function is the value; the
2311 * second argument is the key of the object property. The function can return any value to add to the
2312 * array. A returned array will be flattened into the resulting array. Within the function, this refers
2313 * to the global (window) object.
2314 * @see \`{@link https://api.jquery.com/jQuery.map/ }\`
2315 * @since 1.6
2316 * @example ​ ````Map the original object to a new array and double each value.
2317```javascript
2318var dimensions = { width: 10, height: 15, length: 20 };
2319dimensions = $.map( dimensions, function( value, index ) {
2320 return value * 2;
2321});
2322```
2323 * @example ​ ````Map an object&#39;s keys to an array.
2324```javascript
2325var dimensions = { width: 10, height: 15, length: 20 };
2326var keys = $.map( dimensions, function( value, key ) {
2327 return key;
2328});
2329```
2330 */
2331 map<T, K extends keyof T, TReturn>(obj: T, callback: (this: Window, propertyOfObject: T[K], key: K) => JQuery.TypeOrArray<TReturn> | null | undefined): TReturn[];
2332 /**
2333 * Merge the contents of two arrays together into the first array.
2334 * @param first The first array-like object to merge, the elements of second added.
2335 * @param second The second array-like object to merge into the first, unaltered.
2336 * @see \`{@link https://api.jquery.com/jQuery.merge/ }\`
2337 * @since 1.0
2338 * @example ​ ````Merges two arrays, altering the first argument.
2339```javascript
2340$.merge( [ 0, 1, 2 ], [ 2, 3, 4 ] )
2341```
2342 * @example ​ ````Merges two arrays, altering the first argument.
2343```javascript
2344$.merge( [ 3, 2, 1 ], [ 4, 3, 2 ] )
2345```
2346 * @example ​ ````Merges two arrays, but uses a copy, so the original isn&#39;t altered.
2347```javascript
2348var first = [ "a", "b", "c" ];
2349var second = [ "d", "e", "f" ];
2350$.merge( $.merge( [], first ), second );
2351```
2352 */
2353 merge<T, U>(first: ArrayLike<T>, second: ArrayLike<U>): Array<T | U>;
2354 /**
2355 * Relinquish jQuery's control of the $ variable.
2356 * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).
2357 * @see \`{@link https://api.jquery.com/jQuery.noConflict/ }\`
2358 * @since 1.0
2359 * @example ​ ````Map the original object that was referenced by $ back to $.
2360```javascript
2361jQuery.noConflict();
2362// Do something with jQuery
2363jQuery( "div p" ).hide();
2364// Do something with another library's $()
2365$( "content" ).style.display = "none";
2366```
2367 * @example ​ ````Revert the $ alias and then create and execute a function to provide the $ as a jQuery alias inside the function&#39;s scope. Inside the function the original $ object is not available. This works well for most plugins that don&#39;t rely on any other library.
2368```javascript
2369jQuery.noConflict();
2370(function( $ ) {
2371 $(function() {
2372 // More code using $ as alias to jQuery
2373 });
2374})(jQuery);
2375
2376// Other code using $ as an alias to the other library
2377```
2378 * @example ​ ````Create a different alias instead of jQuery to use in the rest of the script.
2379```javascript
2380var j = jQuery.noConflict();
2381
2382// Do something with jQuery
2383j( "div p" ).hide();
2384
2385// Do something with another library's $()
2386$( "content" ).style.display = "none";
2387```
2388 * @example ​ ````Completely move jQuery to a new namespace in another object.
2389```javascript
2390var dom = {};
2391dom.query = jQuery.noConflict( true );
2392```
2393 * @example ​ ````Load two versions of jQuery (not recommended). Then, restore jQuery&#39;s globally scoped variables to the first loaded jQuery.
2394```html
2395<!doctype html>
2396<html lang="en">
2397<head>
2398 <meta charset="utf-8">
2399 <title>jQuery.noConflict demo</title>
2400 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2401</head>
2402<body>
2403
2404<div id="log">
2405 <h3>Before $.noConflict(true)</h3>
2406</div>
2407<script src="https://code.jquery.com/jquery-1.6.2.js"></script>
2408
2409<script>
2410var $log = $( "#log" );
2411
2412$log.append( "2nd loaded jQuery version ($): " + $.fn.jquery + "<br>" );
2413
2414// Restore globally scoped jQuery variables to the first version loaded
2415// (the newer version)
2416
2417jq162 = jQuery.noConflict( true );
2418
2419$log.append( "<h3>After $.noConflict(true)</h3>" );
2420$log.append( "1st loaded jQuery version ($): " + $.fn.jquery + "<br>" );
2421$log.append( "2nd loaded jQuery version (jq162): " + jq162.fn.jquery + "<br>" );
2422</script>
2423
2424</body>
2425</html>
2426```
2427 */
2428 noConflict(removeAll?: boolean): this;
2429 /**
2430 * @deprecatedDeprecated since 3.2.
2431 *
2432 * **Cause**: This public but never-documented method has been deprecated as of jQuery 3.2.0.
2433 *
2434 * **Solution**: Replace calls such as `jQuery.nodeName( elem, "div" )` with a test such as `elem.nodeName.toLowerCase() === "div"`.
2435 */
2436 nodeName(elem: Node, name: string): boolean;
2437 /**
2438 * An empty function.
2439 * @see \`{@link https://api.jquery.com/jQuery.noop/ }\`
2440 * @since 1.4
2441 */
2442 noop(): undefined;
2443 /**
2444 * Return a number representing the current time.
2445 * @see \`{@link https://api.jquery.com/jQuery.now/ }\`
2446 * @since 1.4.3
2447 * @deprecatedDeprecated since 3.3. Use \`{@link DateConstructor.now Date.now}\`.
2448 */
2449 now(): number;
2450 /**
2451 * Create a serialized representation of an array, a plain object, or a jQuery object suitable for use in a URL query string or Ajax request. In case a jQuery object is passed, it should contain input elements with name/value properties.
2452 * @param obj An array, a plain object, or a jQuery object to serialize.
2453 * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization.
2454 * @see \`{@link https://api.jquery.com/jQuery.param/ }\`
2455 * @since 1.2
2456 * @since 1.4
2457 * @example ​ ````Serialize a key/value object.
2458```html
2459<!doctype html>
2460<html lang="en">
2461<head>
2462 <meta charset="utf-8">
2463 <title>jQuery.param demo</title>
2464 <style>
2465 div {
2466 color: red;
2467 }
2468 </style>
2469 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2470</head>
2471<body>
2472
2473<div id="results"></div>
2474
2475<script>
2476var params = { width:1680, height:1050 };
2477var str = jQuery.param( params );
2478$( "#results" ).text( str );
2479</script>
2480
2481</body>
2482</html>
2483```
2484 * @example ​ ````Serialize a few complex objects
2485```html
2486<!doctype html>
2487<html lang="en">
2488<head>
2489 <meta charset="utf-8">
2490 <title>jQuery.param demo</title>
2491 <style>
2492 div {
2493 color: red;
2494 }
2495 </style>
2496 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2497</head>
2498<body>
2499​​
2500<script>
2501// <=1.3.2:
2502$.param({ a: [ 2, 3, 4 ] }); // "a=2&a=3&a=4"
2503// >=1.4:
2504$.param({ a: [ 2, 3, 4 ] }); // "a[]=2&a[]=3&a[]=4"
2505
2506// <=1.3.2:
2507$.param({ a: { b: 1, c: 2 }, d: [ 3, 4, { e: 5 } ] });
2508// "a=[object+Object]&d=3&d=4&d=[object+Object]"
2509
2510// >=1.4:
2511$.param({ a: { b: 1, c: 2 }, d: [ 3, 4, { e: 5 } ] });
2512// "a[b]=1&a[c]=2&d[]=3&d[]=4&d[2][e]=5"
2513</script>
2514
2515</body>
2516</html>
2517```
2518 */
2519 param(obj: any[] | JQuery.PlainObject | JQuery, traditional?: boolean): string;
2520 /**
2521 * Parses a string into an array of DOM nodes.
2522 * @param data HTML string to be parsed
2523 * @param context Document element to serve as the context in which the HTML fragment will be created
2524 * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
2525 * @see \`{@link https://api.jquery.com/jQuery.parseHTML/ }\`
2526 * @since 1.8
2527 */
2528 parseHTML(data: string, context: Document | null | undefined, keepScripts: boolean): JQuery.Node[];
2529 /**
2530 * Parses a string into an array of DOM nodes.
2531 * @param data HTML string to be parsed
2532 * @param context_keepScripts _&#x40;param_ `context_keepScripts`
2533 * <br>
2534 * * `context` — Document element to serve as the context in which the HTML fragment will be created <br>
2535 * * `keepScripts` — A Boolean indicating whether to include scripts passed in the HTML string
2536 * @see \`{@link https://api.jquery.com/jQuery.parseHTML/ }\`
2537 * @since 1.8
2538 * @example ​ ````Create an array of DOM nodes using an HTML string and insert it into a div.
2539```html
2540<!doctype html>
2541<html lang="en">
2542<head>
2543 <meta charset="utf-8">
2544 <title>jQuery.parseHTML demo</title>
2545 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2546</head>
2547<body>
2548
2549<div id="log">
2550 <h3>Content:</h3>
2551</div>
2552
2553<script>
2554var $log = $( "#log" ),
2555 str = "hello, <b>my name is</b> jQuery.",
2556 html = $.parseHTML( str ),
2557 nodeNames = [];
2558
2559// Append the parsed HTML
2560$log.append( html );
2561
2562// Gather the parsed HTML's node names
2563$.each( html, function( i, el ) {
2564 nodeNames[ i ] = "<li>" + el.nodeName + "</li>";
2565});
2566
2567// Insert the node names
2568$log.append( "<h3>Node Names:</h3>" );
2569$( "<ol></ol>" )
2570 .append( nodeNames.join( "" ) )
2571 .appendTo( $log );
2572</script>
2573
2574</body>
2575</html>
2576```
2577 */
2578 parseHTML(data: string, context_keepScripts?: Document | null | boolean): JQuery.Node[];
2579 /**
2580 * Takes a well-formed JSON string and returns the resulting JavaScript value.
2581 * @param json The JSON string to parse.
2582 * @see \`{@link https://api.jquery.com/jQuery.parseJSON/ }\`
2583 * @since 1.4.1
2584 * @deprecatedDeprecated since 3.0. Use \`{@link JSON.parse }\`.
2585 *
2586 * **Cause**: The `jQuery.parseJSON` method in recent jQuery is identical to the native `JSON.parse`. As of jQuery 3.0 `jQuery.parseJSON` is deprecated.
2587 *
2588 * **Solution**: Replace any use of `jQuery.parseJSON` with `JSON.parse`.
2589 * @example ​ ````Parse a JSON string.
2590```javascript
2591var obj = jQuery.parseJSON( '{ "name": "John" }' );
2592alert( obj.name === "John" );
2593```
2594 */
2595 parseJSON(json: string): any;
2596 /**
2597 * Parses a string into an XML document.
2598 * @param data a well-formed XML string to be parsed
2599 * @see \`{@link https://api.jquery.com/jQuery.parseXML/ }\`
2600 * @since 1.5
2601 * @example ​ ````Create a jQuery object using an XML string and obtain the value of the title node.
2602```html
2603<!doctype html>
2604<html lang="en">
2605<head>
2606 <meta charset="utf-8">
2607 <title>jQuery.parseXML demo</title>
2608 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2609</head>
2610<body>
2611
2612<p id="someElement"></p>
2613<p id="anotherElement"></p>
2614
2615<script>
2616var xml = "<rss version='2.0'><channel><title>RSS Title</title></channel></rss>",
2617 xmlDoc = $.parseXML( xml ),
2618 $xml = $( xmlDoc ),
2619 $title = $xml.find( "title" );
2620
2621// Append "RSS Title" to #someElement
2622$( "#someElement" ).append( $title.text() );
2623
2624// Change the title to "XML Title"
2625$title.text( "XML Title" );
2626
2627// Append "XML Title" to #anotherElement
2628$( "#anotherElement" ).append( $title.text() );
2629</script>
2630
2631</body>
2632</html>
2633```
2634 */
2635 parseXML(data: string): XMLDocument;
2636 /**
2637 * Load data from the server using a HTTP POST request.
2638 * @param url A string containing the URL to which the request is sent.
2639 * @param data A plain object or string that is sent to the server with the request.
2640 * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but
2641 * can be null in that case.
2642 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
2643 * @see \`{@link https://api.jquery.com/jQuery.post/ }\`
2644 * @since 1.0
2645 * @example ​ ````Post to the test.php page and get content which has been returned in json format (&lt;?php echo json_encode(array(&quot;name&quot;=&gt;&quot;John&quot;,&quot;time&quot;=&gt;&quot;2pm&quot;)); ?&gt;).
2646```javascript
2647$.post( "test.php", { func: "getNameAndTime" }, function( data ) {
2648 console.log( data.name ); // John
2649 console.log( data.time ); // 2pm
2650}, "json");
2651```
2652 */
2653 post(url: string,
2654 data: JQuery.PlainObject | string,
2655 success: JQuery.jqXHR.DoneCallback | null,
2656 dataType?: string): JQuery.jqXHR;
2657 /**
2658 * Load data from the server using a HTTP POST request.
2659 * @param url A string containing the URL to which the request is sent.
2660 * @param success_data _&#x40;param_ `success_data`
2661 * <br>
2662 * * `success` — A callback function that is executed if the request succeeds. Required if `dataType` is provided,
2663 * but can be `null` in that case. <br>
2664 * * `data` — A plain object or string that is sent to the server with the request.
2665 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
2666 * @see \`{@link https://api.jquery.com/jQuery.post/ }\`
2667 * @since 1.0
2668 */
2669 post(url: string,
2670 data_success: JQuery.PlainObject | string | JQuery.jqXHR.DoneCallback | null,
2671 dataType: string): JQuery.jqXHR;
2672 /**
2673 * Load data from the server using a HTTP POST request.
2674 * @param url A string containing the URL to which the request is sent.
2675 * @param success_data _&#x40;param_ `success_data`
2676 * <br>
2677 * * `success` — A callback function that is executed if the request succeeds. Required if `dataType` is provided,
2678 * but can be `null` in that case. <br>
2679 * * `data` — A plain object or string that is sent to the server with the request.
2680 * @see \`{@link https://api.jquery.com/jQuery.post/ }\`
2681 * @since 1.0
2682 * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results).
2683```javascript
2684$.post( "test.php", { name: "John", time: "2pm" } );
2685```
2686 * @example ​ ````Pass arrays of data to the server (while still ignoring the return results).
2687```javascript
2688$.post( "test.php", { 'choices[]': [ "Jon", "Susan" ] } );
2689```
2690 * @example ​ ````Send form data using Ajax requests
2691```javascript
2692$.post( "test.php", $( "#testform" ).serialize() );
2693```
2694 * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned).
2695```javascript
2696$.post( "test.php", function( data ) {
2697 alert( "Data Loaded: " + data );
2698});
2699```
2700 * @example ​ ````Alert the results from requesting test.php with an additional payload of data (HTML or XML, depending on what was returned).
2701```javascript
2702$.post( "test.php", { name: "John", time: "2pm" })
2703 .done(function( data ) {
2704 alert( "Data Loaded: " + data );
2705 });
2706```
2707 * @example ​ ````Post a form using Ajax and put results in a div
2708```html
2709<!doctype html>
2710<html lang="en">
2711<head>
2712 <meta charset="utf-8">
2713 <title>jQuery.post demo</title>
2714 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2715</head>
2716<body>
2717
2718<form action="/" id="searchForm">
2719 <input type="text" name="s" placeholder="Search...">
2720 <input type="submit" value="Search">
2721</form>
2722<!-- the result of the search will be rendered inside this div -->
2723<div id="result"></div>
2724
2725<script>
2726// Attach a submit handler to the form
2727$( "#searchForm" ).submit(function( event ) {
2728
2729 // Stop form from submitting normally
2730 event.preventDefault();
2731
2732 // Get some values from elements on the page:
2733 var $form = $( this ),
2734 term = $form.find( "input[name='s']" ).val(),
2735 url = $form.attr( "action" );
2736
2737 // Send the data using post
2738 var posting = $.post( url, { s: term } );
2739
2740 // Put the results in a div
2741 posting.done(function( data ) {
2742 var content = $( data ).find( "#content" );
2743 $( "#result" ).empty().append( content );
2744 });
2745});
2746</script>
2747
2748</body>
2749</html>
2750```
2751 */
2752 post(url: string,
2753 success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR;
2754 /**
2755 * Load data from the server using a HTTP POST request.
2756 * @param url_settings _&#x40;param_ `url_settings`
2757 * <br>
2758 * * `url` — A string containing the URL to which the request is sent. <br>
2759 * * `settings` — A set of key/value pairs that configure the Ajax request. All properties except for `url` are optional.
2760 * A default can be set for any option with \`{@link ajaxSetup $.ajaxSetup()}\`. See \`{@link https://api.jquery.com/jquery.ajax/#jQuery-ajax-settings jQuery.ajax( settings )}\`
2761 * for a complete list of all settings. Type will automatically be set to `POST`.
2762 * @see \`{@link https://api.jquery.com/jQuery.post/ }\`
2763 * @since 1.0
2764 * @since 1.12
2765 * @since 2.2
2766 * @example ​ ````Request the test.php page, but ignore the return results.
2767```javascript
2768$.post( "test.php" );
2769```
2770 */
2771 post(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR;
2772
2773 // region proxy
2774 // #region proxy
2775
2776 // region (funсtion, null | undefined)
2777 // #region (funсtion, null | undefined)
2778
2779 // region 0 to 7 additional arguments
2780 // #region 0 to 7 additional arguments
2781
2782 // region 0 parameters
2783 // #region 0 parameters
2784
2785 /**
2786 * Takes a function and returns a new one that will always have a particular context.
2787 * @param funсtion The function whose context will be changed.
2788 * @param context The object to which the context (`this`) of the function should be set.
2789 * @param a An argument to be passed to the function referenced in the `function` argument.
2790 * @param b An argument to be passed to the function referenced in the `function` argument.
2791 * @param c An argument to be passed to the function referenced in the `function` argument.
2792 * @param d An argument to be passed to the function referenced in the `function` argument.
2793 * @param e An argument to be passed to the function referenced in the `function` argument.
2794 * @param f An argument to be passed to the function referenced in the `function` argument.
2795 * @param g An argument to be passed to the function referenced in the `function` argument.
2796 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2797 * @since 1.9
2798 * @deprecatedDeprecated since 3.3. Use \`{@link Function#bind }\`.
2799 */
2800 proxy<TReturn,
2801 A, B, C, D, E, F, G>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => TReturn,
2802 context: null | undefined,
2803 a: A, b: B, c: C, d: D, e: E, f: F, g: G): () => TReturn;
2804 /**
2805 * Takes a function and returns a new one that will always have a particular context.
2806 * @param funсtion The function whose context will be changed.
2807 * @param context The object to which the context (`this`) of the function should be set.
2808 * @param a An argument to be passed to the function referenced in the `function` argument.
2809 * @param b An argument to be passed to the function referenced in the `function` argument.
2810 * @param c An argument to be passed to the function referenced in the `function` argument.
2811 * @param d An argument to be passed to the function referenced in the `function` argument.
2812 * @param e An argument to be passed to the function referenced in the `function` argument.
2813 * @param f An argument to be passed to the function referenced in the `function` argument.
2814 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2815 * @since 1.9
2816 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2817 */
2818 proxy<TReturn,
2819 A, B, C, D, E, F>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F) => TReturn,
2820 context: null | undefined,
2821 a: A, b: B, c: C, d: D, e: E, f: F): () => TReturn;
2822 /**
2823 * Takes a function and returns a new one that will always have a particular context.
2824 * @param funсtion The function whose context will be changed.
2825 * @param context The object to which the context (`this`) of the function should be set.
2826 * @param a An argument to be passed to the function referenced in the `function` argument.
2827 * @param b An argument to be passed to the function referenced in the `function` argument.
2828 * @param c An argument to be passed to the function referenced in the `function` argument.
2829 * @param d An argument to be passed to the function referenced in the `function` argument.
2830 * @param e An argument to be passed to the function referenced in the `function` argument.
2831 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2832 * @since 1.9
2833 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2834 */
2835 proxy<TReturn,
2836 A, B, C, D, E>(funсtion: (a: A, b: B, c: C, d: D, e: E) => TReturn,
2837 context: null | undefined,
2838 a: A, b: B, c: C, d: D, e: E): () => TReturn;
2839 /**
2840 * Takes a function and returns a new one that will always have a particular context.
2841 * @param funсtion The function whose context will be changed.
2842 * @param context The object to which the context (`this`) of the function should be set.
2843 * @param a An argument to be passed to the function referenced in the `function` argument.
2844 * @param b An argument to be passed to the function referenced in the `function` argument.
2845 * @param c An argument to be passed to the function referenced in the `function` argument.
2846 * @param d An argument to be passed to the function referenced in the `function` argument.
2847 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2848 * @since 1.9
2849 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2850 */
2851 proxy<TReturn,
2852 A, B, C, D>(funсtion: (a: A, b: B, c: C, d: D) => TReturn,
2853 context: null | undefined,
2854 a: A, b: B, c: C, d: D): () => TReturn;
2855 /**
2856 * Takes a function and returns a new one that will always have a particular context.
2857 * @param funсtion The function whose context will be changed.
2858 * @param context The object to which the context (`this`) of the function should be set.
2859 * @param a An argument to be passed to the function referenced in the `function` argument.
2860 * @param b An argument to be passed to the function referenced in the `function` argument.
2861 * @param c An argument to be passed to the function referenced in the `function` argument.
2862 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2863 * @since 1.9
2864 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2865 */
2866 proxy<TReturn,
2867 A, B, C>(funсtion: (a: A, b: B, c: C) => TReturn,
2868 context: null | undefined,
2869 a: A, b: B, c: C): () => TReturn;
2870 /**
2871 * Takes a function and returns a new one that will always have a particular context.
2872 * @param funсtion The function whose context will be changed.
2873 * @param context The object to which the context (`this`) of the function should be set.
2874 * @param a An argument to be passed to the function referenced in the `function` argument.
2875 * @param b An argument to be passed to the function referenced in the `function` argument.
2876 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2877 * @since 1.9
2878 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2879 */
2880 proxy<TReturn,
2881 A, B>(funсtion: (a: A, b: B) => TReturn,
2882 context: null | undefined,
2883 a: A, b: B): () => TReturn;
2884 /**
2885 * Takes a function and returns a new one that will always have a particular context.
2886 * @param funсtion The function whose context will be changed.
2887 * @param context The object to which the context (`this`) of the function should be set.
2888 * @param a An argument to be passed to the function referenced in the `function` argument.
2889 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2890 * @since 1.9
2891 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2892 */
2893 proxy<TReturn,
2894 A>(funсtion: (a: A) => TReturn,
2895 context: null | undefined,
2896 a: A): () => TReturn;
2897 /**
2898 * Takes a function and returns a new one that will always have a particular context.
2899 * @param funсtion The function whose context will be changed.
2900 * @param context The object to which the context (`this`) of the function should be set.
2901 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2902 * @since 1.9
2903 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2904 */
2905 proxy<TReturn>(funсtion: () => TReturn,
2906 context: null | undefined): () => TReturn;
2907
2908 // #endregion
2909
2910 // region 1 parameters
2911 // #region 1 parameters
2912
2913 /**
2914 * Takes a function and returns a new one that will always have a particular context.
2915 * @param funсtion The function whose context will be changed.
2916 * @param context The object to which the context (`this`) of the function should be set.
2917 * @param a An argument to be passed to the function referenced in the `function` argument.
2918 * @param b An argument to be passed to the function referenced in the `function` argument.
2919 * @param c An argument to be passed to the function referenced in the `function` argument.
2920 * @param d An argument to be passed to the function referenced in the `function` argument.
2921 * @param e An argument to be passed to the function referenced in the `function` argument.
2922 * @param f An argument to be passed to the function referenced in the `function` argument.
2923 * @param g An argument to be passed to the function referenced in the `function` argument.
2924 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2925 * @since 1.9
2926 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2927 */
2928 proxy<TReturn,
2929 A, B, C, D, E, F, G,
2930 T>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
2931 t: T) => TReturn,
2932 context: null | undefined,
2933 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T) => TReturn;
2934 /**
2935 * Takes a function and returns a new one that will always have a particular context.
2936 * @param funсtion The function whose context will be changed.
2937 * @param context The object to which the context (`this`) of the function should be set.
2938 * @param a An argument to be passed to the function referenced in the `function` argument.
2939 * @param b An argument to be passed to the function referenced in the `function` argument.
2940 * @param c An argument to be passed to the function referenced in the `function` argument.
2941 * @param d An argument to be passed to the function referenced in the `function` argument.
2942 * @param e An argument to be passed to the function referenced in the `function` argument.
2943 * @param f An argument to be passed to the function referenced in the `function` argument.
2944 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2945 * @since 1.9
2946 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2947 */
2948 proxy<TReturn,
2949 A, B, C, D, E, F,
2950 T>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
2951 t: T) => TReturn,
2952 context: null | undefined,
2953 a: A, b: B, c: C, d: D, e: E, f: F): (t: T) => TReturn;
2954 /**
2955 * Takes a function and returns a new one that will always have a particular context.
2956 * @param funсtion The function whose context will be changed.
2957 * @param context The object to which the context (`this`) of the function should be set.
2958 * @param a An argument to be passed to the function referenced in the `function` argument.
2959 * @param b An argument to be passed to the function referenced in the `function` argument.
2960 * @param c An argument to be passed to the function referenced in the `function` argument.
2961 * @param d An argument to be passed to the function referenced in the `function` argument.
2962 * @param e An argument to be passed to the function referenced in the `function` argument.
2963 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2964 * @since 1.9
2965 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2966 */
2967 proxy<TReturn,
2968 A, B, C, D, E,
2969 T>(funсtion: (a: A, b: B, c: C, d: D, e: E,
2970 t: T) => TReturn,
2971 context: null | undefined,
2972 a: A, b: B, c: C, d: D, e: E): (t: T) => TReturn;
2973 /**
2974 * Takes a function and returns a new one that will always have a particular context.
2975 * @param funсtion The function whose context will be changed.
2976 * @param context The object to which the context (`this`) of the function should be set.
2977 * @param a An argument to be passed to the function referenced in the `function` argument.
2978 * @param b An argument to be passed to the function referenced in the `function` argument.
2979 * @param c An argument to be passed to the function referenced in the `function` argument.
2980 * @param d An argument to be passed to the function referenced in the `function` argument.
2981 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2982 * @since 1.9
2983 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2984 */
2985 proxy<TReturn,
2986 A, B, C, D,
2987 T>(funсtion: (a: A, b: B, c: C, d: D,
2988 t: T) => TReturn,
2989 context: null | undefined,
2990 a: A, b: B, c: C, d: D): (t: T) => TReturn;
2991 /**
2992 * Takes a function and returns a new one that will always have a particular context.
2993 * @param funсtion The function whose context will be changed.
2994 * @param context The object to which the context (`this`) of the function should be set.
2995 * @param a An argument to be passed to the function referenced in the `function` argument.
2996 * @param b An argument to be passed to the function referenced in the `function` argument.
2997 * @param c An argument to be passed to the function referenced in the `function` argument.
2998 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2999 * @since 1.9
3000 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3001 */
3002 proxy<TReturn,
3003 A, B, C,
3004 T>(funсtion: (a: A, b: B, c: C,
3005 t: T) => TReturn,
3006 context: null | undefined,
3007 a: A, b: B, c: C): (t: T) => TReturn;
3008 /**
3009 * Takes a function and returns a new one that will always have a particular context.
3010 * @param funсtion The function whose context will be changed.
3011 * @param context The object to which the context (`this`) of the function should be set.
3012 * @param a An argument to be passed to the function referenced in the `function` argument.
3013 * @param b An argument to be passed to the function referenced in the `function` argument.
3014 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3015 * @since 1.9
3016 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3017 */
3018 proxy<TReturn,
3019 A, B,
3020 T>(funсtion: (a: A, b: B,
3021 t: T) => TReturn,
3022 context: null | undefined,
3023 a: A, b: B): (t: T) => TReturn;
3024 /**
3025 * Takes a function and returns a new one that will always have a particular context.
3026 * @param funсtion The function whose context will be changed.
3027 * @param context The object to which the context (`this`) of the function should be set.
3028 * @param a An argument to be passed to the function referenced in the `function` argument.
3029 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3030 * @since 1.9
3031 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3032 */
3033 proxy<TReturn,
3034 A,
3035 T>(funсtion: (a: A,
3036 t: T) => TReturn,
3037 context: null | undefined,
3038 a: A): (t: T) => TReturn;
3039 /**
3040 * Takes a function and returns a new one that will always have a particular context.
3041 * @param funсtion The function whose context will be changed.
3042 * @param context The object to which the context (`this`) of the function should be set.
3043 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3044 * @since 1.9
3045 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3046 */
3047 proxy<TReturn,
3048 T>(funсtion: (t: T) => TReturn,
3049 context: null | undefined): (t: T) => TReturn;
3050
3051 // #endregion
3052
3053 // region 2 parameters
3054 // #region 2 parameters
3055
3056 /**
3057 * Takes a function and returns a new one that will always have a particular context.
3058 * @param funсtion The function whose context will be changed.
3059 * @param context The object to which the context (`this`) of the function should be set.
3060 * @param a An argument to be passed to the function referenced in the `function` argument.
3061 * @param b An argument to be passed to the function referenced in the `function` argument.
3062 * @param c An argument to be passed to the function referenced in the `function` argument.
3063 * @param d An argument to be passed to the function referenced in the `function` argument.
3064 * @param e An argument to be passed to the function referenced in the `function` argument.
3065 * @param f An argument to be passed to the function referenced in the `function` argument.
3066 * @param g An argument to be passed to the function referenced in the `function` argument.
3067 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3068 * @since 1.9
3069 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3070 */
3071 proxy<TReturn,
3072 A, B, C, D, E, F, G,
3073 T, U>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3074 t: T, u: U) => TReturn,
3075 context: null | undefined,
3076 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U) => TReturn;
3077 /**
3078 * Takes a function and returns a new one that will always have a particular context.
3079 * @param funсtion The function whose context will be changed.
3080 * @param context The object to which the context (`this`) of the function should be set.
3081 * @param a An argument to be passed to the function referenced in the `function` argument.
3082 * @param b An argument to be passed to the function referenced in the `function` argument.
3083 * @param c An argument to be passed to the function referenced in the `function` argument.
3084 * @param d An argument to be passed to the function referenced in the `function` argument.
3085 * @param e An argument to be passed to the function referenced in the `function` argument.
3086 * @param f An argument to be passed to the function referenced in the `function` argument.
3087 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3088 * @since 1.9
3089 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3090 */
3091 proxy<TReturn,
3092 A, B, C, D, E, F,
3093 T, U>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3094 t: T, u: U) => TReturn,
3095 context: null | undefined,
3096 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U) => TReturn;
3097 /**
3098 * Takes a function and returns a new one that will always have a particular context.
3099 * @param funсtion The function whose context will be changed.
3100 * @param context The object to which the context (`this`) of the function should be set.
3101 * @param a An argument to be passed to the function referenced in the `function` argument.
3102 * @param b An argument to be passed to the function referenced in the `function` argument.
3103 * @param c An argument to be passed to the function referenced in the `function` argument.
3104 * @param d An argument to be passed to the function referenced in the `function` argument.
3105 * @param e An argument to be passed to the function referenced in the `function` argument.
3106 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3107 * @since 1.9
3108 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3109 */
3110 proxy<TReturn,
3111 A, B, C, D, E,
3112 T, U>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3113 t: T, u: U) => TReturn,
3114 context: null | undefined,
3115 a: A, b: B, c: C, d: D, e: E): (t: T, u: U) => TReturn;
3116 /**
3117 * Takes a function and returns a new one that will always have a particular context.
3118 * @param funсtion The function whose context will be changed.
3119 * @param context The object to which the context (`this`) of the function should be set.
3120 * @param a An argument to be passed to the function referenced in the `function` argument.
3121 * @param b An argument to be passed to the function referenced in the `function` argument.
3122 * @param c An argument to be passed to the function referenced in the `function` argument.
3123 * @param d An argument to be passed to the function referenced in the `function` argument.
3124 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3125 * @since 1.9
3126 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3127 */
3128 proxy<TReturn,
3129 A, B, C, D,
3130 T, U>(funсtion: (a: A, b: B, c: C, d: D,
3131 t: T, u: U) => TReturn,
3132 context: null | undefined,
3133 a: A, b: B, c: C, d: D): (t: T, u: U) => TReturn;
3134 /**
3135 * Takes a function and returns a new one that will always have a particular context.
3136 * @param funсtion The function whose context will be changed.
3137 * @param context The object to which the context (`this`) of the function should be set.
3138 * @param a An argument to be passed to the function referenced in the `function` argument.
3139 * @param b An argument to be passed to the function referenced in the `function` argument.
3140 * @param c An argument to be passed to the function referenced in the `function` argument.
3141 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3142 * @since 1.9
3143 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3144 */
3145 proxy<TReturn,
3146 A, B, C,
3147 T, U>(funсtion: (a: A, b: B, c: C,
3148 t: T, u: U) => TReturn,
3149 context: null | undefined,
3150 a: A, b: B, c: C): (t: T, u: U) => TReturn;
3151 /**
3152 * Takes a function and returns a new one that will always have a particular context.
3153 * @param funсtion The function whose context will be changed.
3154 * @param context The object to which the context (`this`) of the function should be set.
3155 * @param a An argument to be passed to the function referenced in the `function` argument.
3156 * @param b An argument to be passed to the function referenced in the `function` argument.
3157 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3158 * @since 1.9
3159 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3160 */
3161 proxy<TReturn,
3162 A, B,
3163 T, U>(funсtion: (a: A, b: B,
3164 t: T, u: U) => TReturn,
3165 context: null | undefined,
3166 a: A, b: B): (t: T, u: U) => TReturn;
3167 /**
3168 * Takes a function and returns a new one that will always have a particular context.
3169 * @param funсtion The function whose context will be changed.
3170 * @param context The object to which the context (`this`) of the function should be set.
3171 * @param a An argument to be passed to the function referenced in the `function` argument.
3172 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3173 * @since 1.9
3174 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3175 */
3176 proxy<TReturn,
3177 A,
3178 T, U>(funсtion: (a: A,
3179 t: T, u: U) => TReturn,
3180 context: null | undefined,
3181 a: A): (t: T, u: U) => TReturn;
3182 /**
3183 * Takes a function and returns a new one that will always have a particular context.
3184 * @param funсtion The function whose context will be changed.
3185 * @param context The object to which the context (`this`) of the function should be set.
3186 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3187 * @since 1.9
3188 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3189 */
3190 proxy<TReturn,
3191 T, U>(funсtion: (t: T, u: U) => TReturn,
3192 context: null | undefined): (t: T, u: U) => TReturn;
3193
3194 // #endregion
3195
3196 // region 3 parameters
3197 // #region 3 parameters
3198
3199 /**
3200 * Takes a function and returns a new one that will always have a particular context.
3201 * @param funсtion The function whose context will be changed.
3202 * @param context The object to which the context (`this`) of the function should be set.
3203 * @param a An argument to be passed to the function referenced in the `function` argument.
3204 * @param b An argument to be passed to the function referenced in the `function` argument.
3205 * @param c An argument to be passed to the function referenced in the `function` argument.
3206 * @param d An argument to be passed to the function referenced in the `function` argument.
3207 * @param e An argument to be passed to the function referenced in the `function` argument.
3208 * @param f An argument to be passed to the function referenced in the `function` argument.
3209 * @param g An argument to be passed to the function referenced in the `function` argument.
3210 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3211 * @since 1.9
3212 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3213 */
3214 proxy<TReturn,
3215 A, B, C, D, E, F, G,
3216 T, U, V>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3217 t: T, u: U, v: V) => TReturn,
3218 context: null | undefined,
3219 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V) => TReturn;
3220 /**
3221 * Takes a function and returns a new one that will always have a particular context.
3222 * @param funсtion The function whose context will be changed.
3223 * @param context The object to which the context (`this`) of the function should be set.
3224 * @param a An argument to be passed to the function referenced in the `function` argument.
3225 * @param b An argument to be passed to the function referenced in the `function` argument.
3226 * @param c An argument to be passed to the function referenced in the `function` argument.
3227 * @param d An argument to be passed to the function referenced in the `function` argument.
3228 * @param e An argument to be passed to the function referenced in the `function` argument.
3229 * @param f An argument to be passed to the function referenced in the `function` argument.
3230 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3231 * @since 1.9
3232 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3233 */
3234 proxy<TReturn,
3235 A, B, C, D, E, F,
3236 T, U, V>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3237 t: T, u: U, v: V) => TReturn,
3238 context: null | undefined,
3239 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V) => TReturn;
3240 /**
3241 * Takes a function and returns a new one that will always have a particular context.
3242 * @param funсtion The function whose context will be changed.
3243 * @param context The object to which the context (`this`) of the function should be set.
3244 * @param a An argument to be passed to the function referenced in the `function` argument.
3245 * @param b An argument to be passed to the function referenced in the `function` argument.
3246 * @param c An argument to be passed to the function referenced in the `function` argument.
3247 * @param d An argument to be passed to the function referenced in the `function` argument.
3248 * @param e An argument to be passed to the function referenced in the `function` argument.
3249 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3250 * @since 1.9
3251 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3252 */
3253 proxy<TReturn,
3254 A, B, C, D, E,
3255 T, U, V>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3256 t: T, u: U, v: V) => TReturn,
3257 context: null | undefined,
3258 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V) => TReturn;
3259 /**
3260 * Takes a function and returns a new one that will always have a particular context.
3261 * @param funсtion The function whose context will be changed.
3262 * @param context The object to which the context (`this`) of the function should be set.
3263 * @param a An argument to be passed to the function referenced in the `function` argument.
3264 * @param b An argument to be passed to the function referenced in the `function` argument.
3265 * @param c An argument to be passed to the function referenced in the `function` argument.
3266 * @param d An argument to be passed to the function referenced in the `function` argument.
3267 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3268 * @since 1.9
3269 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3270 */
3271 proxy<TReturn,
3272 A, B, C, D,
3273 T, U, V>(funсtion: (a: A, b: B, c: C, d: D,
3274 t: T, u: U, v: V) => TReturn,
3275 context: null | undefined,
3276 a: A, b: B, c: C, d: D): (t: T, u: U, v: V) => TReturn;
3277 /**
3278 * Takes a function and returns a new one that will always have a particular context.
3279 * @param funсtion The function whose context will be changed.
3280 * @param context The object to which the context (`this`) of the function should be set.
3281 * @param a An argument to be passed to the function referenced in the `function` argument.
3282 * @param b An argument to be passed to the function referenced in the `function` argument.
3283 * @param c An argument to be passed to the function referenced in the `function` argument.
3284 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3285 * @since 1.9
3286 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3287 */
3288 proxy<TReturn,
3289 A, B, C,
3290 T, U, V>(funсtion: (a: A, b: B, c: C,
3291 t: T, u: U, v: V) => TReturn,
3292 context: null | undefined,
3293 a: A, b: B, c: C): (t: T, u: U, v: V) => TReturn;
3294 /**
3295 * Takes a function and returns a new one that will always have a particular context.
3296 * @param funсtion The function whose context will be changed.
3297 * @param context The object to which the context (`this`) of the function should be set.
3298 * @param a An argument to be passed to the function referenced in the `function` argument.
3299 * @param b An argument to be passed to the function referenced in the `function` argument.
3300 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3301 * @since 1.9
3302 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3303 */
3304 proxy<TReturn,
3305 A, B,
3306 T, U, V>(funсtion: (a: A, b: B,
3307 t: T, u: U, v: V) => TReturn,
3308 context: null | undefined,
3309 a: A, b: B): (t: T, u: U, v: V) => TReturn;
3310 /**
3311 * Takes a function and returns a new one that will always have a particular context.
3312 * @param funсtion The function whose context will be changed.
3313 * @param context The object to which the context (`this`) of the function should be set.
3314 * @param a An argument to be passed to the function referenced in the `function` argument.
3315 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3316 * @since 1.9
3317 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3318 */
3319 proxy<TReturn,
3320 A,
3321 T, U, V>(funсtion: (a: A,
3322 t: T, u: U, v: V) => TReturn,
3323 context: null | undefined,
3324 a: A): (t: T, u: U, v: V) => TReturn;
3325 /**
3326 * Takes a function and returns a new one that will always have a particular context.
3327 * @param funсtion The function whose context will be changed.
3328 * @param context The object to which the context (`this`) of the function should be set.
3329 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3330 * @since 1.9
3331 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3332 */
3333 proxy<TReturn,
3334 T, U, V>(funсtion: (t: T, u: U, v: V) => TReturn,
3335 context: null | undefined): (t: T, u: U, v: V) => TReturn;
3336
3337 // #endregion
3338
3339 // region 4 parameters
3340 // #region 4 parameters
3341
3342 /**
3343 * Takes a function and returns a new one that will always have a particular context.
3344 * @param funсtion The function whose context will be changed.
3345 * @param context The object to which the context (`this`) of the function should be set.
3346 * @param a An argument to be passed to the function referenced in the `function` argument.
3347 * @param b An argument to be passed to the function referenced in the `function` argument.
3348 * @param c An argument to be passed to the function referenced in the `function` argument.
3349 * @param d An argument to be passed to the function referenced in the `function` argument.
3350 * @param e An argument to be passed to the function referenced in the `function` argument.
3351 * @param f An argument to be passed to the function referenced in the `function` argument.
3352 * @param g An argument to be passed to the function referenced in the `function` argument.
3353 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3354 * @since 1.9
3355 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3356 */
3357 proxy<TReturn,
3358 A, B, C, D, E, F, G,
3359 T, U, V, W>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3360 t: T, u: U, v: V, w: W) => TReturn,
3361 context: null | undefined,
3362 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W) => TReturn;
3363 /**
3364 * Takes a function and returns a new one that will always have a particular context.
3365 * @param funсtion The function whose context will be changed.
3366 * @param context The object to which the context (`this`) of the function should be set.
3367 * @param a An argument to be passed to the function referenced in the `function` argument.
3368 * @param b An argument to be passed to the function referenced in the `function` argument.
3369 * @param c An argument to be passed to the function referenced in the `function` argument.
3370 * @param d An argument to be passed to the function referenced in the `function` argument.
3371 * @param e An argument to be passed to the function referenced in the `function` argument.
3372 * @param f An argument to be passed to the function referenced in the `function` argument.
3373 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3374 * @since 1.9
3375 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3376 */
3377 proxy<TReturn,
3378 A, B, C, D, E, F,
3379 T, U, V, W>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3380 t: T, u: U, v: V, w: W) => TReturn,
3381 context: null | undefined,
3382 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W) => TReturn;
3383 /**
3384 * Takes a function and returns a new one that will always have a particular context.
3385 * @param funсtion The function whose context will be changed.
3386 * @param context The object to which the context (`this`) of the function should be set.
3387 * @param a An argument to be passed to the function referenced in the `function` argument.
3388 * @param b An argument to be passed to the function referenced in the `function` argument.
3389 * @param c An argument to be passed to the function referenced in the `function` argument.
3390 * @param d An argument to be passed to the function referenced in the `function` argument.
3391 * @param e An argument to be passed to the function referenced in the `function` argument.
3392 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3393 * @since 1.9
3394 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3395 */
3396 proxy<TReturn,
3397 A, B, C, D, E,
3398 T, U, V, W>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3399 t: T, u: U, v: V, w: W) => TReturn,
3400 context: null | undefined,
3401 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W) => TReturn;
3402 /**
3403 * Takes a function and returns a new one that will always have a particular context.
3404 * @param funсtion The function whose context will be changed.
3405 * @param context The object to which the context (`this`) of the function should be set.
3406 * @param a An argument to be passed to the function referenced in the `function` argument.
3407 * @param b An argument to be passed to the function referenced in the `function` argument.
3408 * @param c An argument to be passed to the function referenced in the `function` argument.
3409 * @param d An argument to be passed to the function referenced in the `function` argument.
3410 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3411 * @since 1.9
3412 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3413 */
3414 proxy<TReturn,
3415 A, B, C, D,
3416 T, U, V, W>(funсtion: (a: A, b: B, c: C, d: D,
3417 t: T, u: U, v: V, w: W) => TReturn,
3418 context: null | undefined,
3419 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W) => TReturn;
3420 /**
3421 * Takes a function and returns a new one that will always have a particular context.
3422 * @param funсtion The function whose context will be changed.
3423 * @param context The object to which the context (`this`) of the function should be set.
3424 * @param a An argument to be passed to the function referenced in the `function` argument.
3425 * @param b An argument to be passed to the function referenced in the `function` argument.
3426 * @param c An argument to be passed to the function referenced in the `function` argument.
3427 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3428 * @since 1.9
3429 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3430 */
3431 proxy<TReturn,
3432 A, B, C,
3433 T, U, V, W>(funсtion: (a: A, b: B, c: C,
3434 t: T, u: U, v: V, w: W) => TReturn,
3435 context: null | undefined,
3436 a: A, b: B, c: C): (t: T, u: U, v: V, w: W) => TReturn;
3437 /**
3438 * Takes a function and returns a new one that will always have a particular context.
3439 * @param funсtion The function whose context will be changed.
3440 * @param context The object to which the context (`this`) of the function should be set.
3441 * @param a An argument to be passed to the function referenced in the `function` argument.
3442 * @param b An argument to be passed to the function referenced in the `function` argument.
3443 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3444 * @since 1.9
3445 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3446 */
3447 proxy<TReturn,
3448 A, B,
3449 T, U, V, W>(funсtion: (a: A, b: B,
3450 t: T, u: U, v: V, w: W) => TReturn,
3451 context: null | undefined,
3452 a: A, b: B): (t: T, u: U, v: V, w: W) => TReturn;
3453 /**
3454 * Takes a function and returns a new one that will always have a particular context.
3455 * @param funсtion The function whose context will be changed.
3456 * @param context The object to which the context (`this`) of the function should be set.
3457 * @param a An argument to be passed to the function referenced in the `function` argument.
3458 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3459 * @since 1.9
3460 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3461 */
3462 proxy<TReturn,
3463 A,
3464 T, U, V, W>(funсtion: (a: A,
3465 t: T, u: U, v: V, w: W) => TReturn,
3466 context: null | undefined,
3467 a: A): (t: T, u: U, v: V, w: W) => TReturn;
3468 /**
3469 * Takes a function and returns a new one that will always have a particular context.
3470 * @param funсtion The function whose context will be changed.
3471 * @param context The object to which the context (`this`) of the function should be set.
3472 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3473 * @since 1.9
3474 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3475 */
3476 proxy<TReturn,
3477 T, U, V, W>(funсtion: (t: T, u: U, v: V, w: W) => TReturn,
3478 context: null | undefined): (t: T, u: U, v: V, w: W) => TReturn;
3479
3480 // #endregion
3481
3482 // region 5 parameters
3483 // #region 5 parameters
3484
3485 /**
3486 * Takes a function and returns a new one that will always have a particular context.
3487 * @param funсtion The function whose context will be changed.
3488 * @param context The object to which the context (`this`) of the function should be set.
3489 * @param a An argument to be passed to the function referenced in the `function` argument.
3490 * @param b An argument to be passed to the function referenced in the `function` argument.
3491 * @param c An argument to be passed to the function referenced in the `function` argument.
3492 * @param d An argument to be passed to the function referenced in the `function` argument.
3493 * @param e An argument to be passed to the function referenced in the `function` argument.
3494 * @param f An argument to be passed to the function referenced in the `function` argument.
3495 * @param g An argument to be passed to the function referenced in the `function` argument.
3496 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3497 * @since 1.9
3498 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3499 */
3500 proxy<TReturn,
3501 A, B, C, D, E, F, G,
3502 T, U, V, W, X>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3503 t: T, u: U, v: V, w: W, x: X) => TReturn,
3504 context: null | undefined,
3505 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3506 /**
3507 * Takes a function and returns a new one that will always have a particular context.
3508 * @param funсtion The function whose context will be changed.
3509 * @param context The object to which the context (`this`) of the function should be set.
3510 * @param a An argument to be passed to the function referenced in the `function` argument.
3511 * @param b An argument to be passed to the function referenced in the `function` argument.
3512 * @param c An argument to be passed to the function referenced in the `function` argument.
3513 * @param d An argument to be passed to the function referenced in the `function` argument.
3514 * @param e An argument to be passed to the function referenced in the `function` argument.
3515 * @param f An argument to be passed to the function referenced in the `function` argument.
3516 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3517 * @since 1.9
3518 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3519 */
3520 proxy<TReturn,
3521 A, B, C, D, E, F,
3522 T, U, V, W, X>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3523 t: T, u: U, v: V, w: W, x: X) => TReturn,
3524 context: null | undefined,
3525 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3526 /**
3527 * Takes a function and returns a new one that will always have a particular context.
3528 * @param funсtion The function whose context will be changed.
3529 * @param context The object to which the context (`this`) of the function should be set.
3530 * @param a An argument to be passed to the function referenced in the `function` argument.
3531 * @param b An argument to be passed to the function referenced in the `function` argument.
3532 * @param c An argument to be passed to the function referenced in the `function` argument.
3533 * @param d An argument to be passed to the function referenced in the `function` argument.
3534 * @param e An argument to be passed to the function referenced in the `function` argument.
3535 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3536 * @since 1.9
3537 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3538 */
3539 proxy<TReturn,
3540 A, B, C, D, E,
3541 T, U, V, W, X>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3542 t: T, u: U, v: V, w: W, x: X) => TReturn,
3543 context: null | undefined,
3544 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3545 /**
3546 * Takes a function and returns a new one that will always have a particular context.
3547 * @param funсtion The function whose context will be changed.
3548 * @param context The object to which the context (`this`) of the function should be set.
3549 * @param a An argument to be passed to the function referenced in the `function` argument.
3550 * @param b An argument to be passed to the function referenced in the `function` argument.
3551 * @param c An argument to be passed to the function referenced in the `function` argument.
3552 * @param d An argument to be passed to the function referenced in the `function` argument.
3553 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3554 * @since 1.9
3555 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3556 */
3557 proxy<TReturn,
3558 A, B, C, D,
3559 T, U, V, W, X>(funсtion: (a: A, b: B, c: C, d: D,
3560 t: T, u: U, v: V, w: W, x: X) => TReturn,
3561 context: null | undefined,
3562 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3563 /**
3564 * Takes a function and returns a new one that will always have a particular context.
3565 * @param funсtion The function whose context will be changed.
3566 * @param context The object to which the context (`this`) of the function should be set.
3567 * @param a An argument to be passed to the function referenced in the `function` argument.
3568 * @param b An argument to be passed to the function referenced in the `function` argument.
3569 * @param c An argument to be passed to the function referenced in the `function` argument.
3570 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3571 * @since 1.9
3572 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3573 */
3574 proxy<TReturn,
3575 A, B, C,
3576 T, U, V, W, X>(funсtion: (a: A, b: B, c: C,
3577 t: T, u: U, v: V, w: W, x: X) => TReturn,
3578 context: null | undefined,
3579 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3580 /**
3581 * Takes a function and returns a new one that will always have a particular context.
3582 * @param funсtion The function whose context will be changed.
3583 * @param context The object to which the context (`this`) of the function should be set.
3584 * @param a An argument to be passed to the function referenced in the `function` argument.
3585 * @param b An argument to be passed to the function referenced in the `function` argument.
3586 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3587 * @since 1.9
3588 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3589 */
3590 proxy<TReturn,
3591 A, B,
3592 T, U, V, W, X>(funсtion: (a: A, b: B,
3593 t: T, u: U, v: V, w: W, x: X) => TReturn,
3594 context: null | undefined,
3595 a: A, b: B): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3596 /**
3597 * Takes a function and returns a new one that will always have a particular context.
3598 * @param funсtion The function whose context will be changed.
3599 * @param context The object to which the context (`this`) of the function should be set.
3600 * @param a An argument to be passed to the function referenced in the `function` argument.
3601 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3602 * @since 1.9
3603 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3604 */
3605 proxy<TReturn,
3606 A,
3607 T, U, V, W, X>(funсtion: (a: A,
3608 t: T, u: U, v: V, w: W, x: X) => TReturn,
3609 context: null | undefined,
3610 a: A): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3611 /**
3612 * Takes a function and returns a new one that will always have a particular context.
3613 * @param funсtion The function whose context will be changed.
3614 * @param context The object to which the context (`this`) of the function should be set.
3615 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3616 * @since 1.9
3617 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3618 */
3619 proxy<TReturn,
3620 T, U, V, W, X>(funсtion: (t: T, u: U, v: V, w: W, x: X) => TReturn,
3621 context: null | undefined): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3622
3623 // #endregion
3624
3625 // region 6 parameters
3626 // #region 6 parameters
3627
3628 /**
3629 * Takes a function and returns a new one that will always have a particular context.
3630 * @param funсtion The function whose context will be changed.
3631 * @param context The object to which the context (`this`) of the function should be set.
3632 * @param a An argument to be passed to the function referenced in the `function` argument.
3633 * @param b An argument to be passed to the function referenced in the `function` argument.
3634 * @param c An argument to be passed to the function referenced in the `function` argument.
3635 * @param d An argument to be passed to the function referenced in the `function` argument.
3636 * @param e An argument to be passed to the function referenced in the `function` argument.
3637 * @param f An argument to be passed to the function referenced in the `function` argument.
3638 * @param g An argument to be passed to the function referenced in the `function` argument.
3639 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3640 * @since 1.9
3641 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3642 */
3643 proxy<TReturn,
3644 A, B, C, D, E, F, G,
3645 T, U, V, W, X, Y>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3646 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3647 context: null | undefined,
3648 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3649 /**
3650 * Takes a function and returns a new one that will always have a particular context.
3651 * @param funсtion The function whose context will be changed.
3652 * @param context The object to which the context (`this`) of the function should be set.
3653 * @param a An argument to be passed to the function referenced in the `function` argument.
3654 * @param b An argument to be passed to the function referenced in the `function` argument.
3655 * @param c An argument to be passed to the function referenced in the `function` argument.
3656 * @param d An argument to be passed to the function referenced in the `function` argument.
3657 * @param e An argument to be passed to the function referenced in the `function` argument.
3658 * @param f An argument to be passed to the function referenced in the `function` argument.
3659 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3660 * @since 1.9
3661 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3662 */
3663 proxy<TReturn,
3664 A, B, C, D, E, F,
3665 T, U, V, W, X, Y>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3666 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3667 context: null | undefined,
3668 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3669 /**
3670 * Takes a function and returns a new one that will always have a particular context.
3671 * @param funсtion The function whose context will be changed.
3672 * @param context The object to which the context (`this`) of the function should be set.
3673 * @param a An argument to be passed to the function referenced in the `function` argument.
3674 * @param b An argument to be passed to the function referenced in the `function` argument.
3675 * @param c An argument to be passed to the function referenced in the `function` argument.
3676 * @param d An argument to be passed to the function referenced in the `function` argument.
3677 * @param e An argument to be passed to the function referenced in the `function` argument.
3678 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3679 * @since 1.9
3680 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3681 */
3682 proxy<TReturn,
3683 A, B, C, D, E,
3684 T, U, V, W, X, Y>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3685 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3686 context: null | undefined,
3687 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3688 /**
3689 * Takes a function and returns a new one that will always have a particular context.
3690 * @param funсtion The function whose context will be changed.
3691 * @param context The object to which the context (`this`) of the function should be set.
3692 * @param a An argument to be passed to the function referenced in the `function` argument.
3693 * @param b An argument to be passed to the function referenced in the `function` argument.
3694 * @param c An argument to be passed to the function referenced in the `function` argument.
3695 * @param d An argument to be passed to the function referenced in the `function` argument.
3696 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3697 * @since 1.9
3698 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3699 */
3700 proxy<TReturn,
3701 A, B, C, D,
3702 T, U, V, W, X, Y>(funсtion: (a: A, b: B, c: C, d: D,
3703 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3704 context: null | undefined,
3705 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3706 /**
3707 * Takes a function and returns a new one that will always have a particular context.
3708 * @param funсtion The function whose context will be changed.
3709 * @param context The object to which the context (`this`) of the function should be set.
3710 * @param a An argument to be passed to the function referenced in the `function` argument.
3711 * @param b An argument to be passed to the function referenced in the `function` argument.
3712 * @param c An argument to be passed to the function referenced in the `function` argument.
3713 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3714 * @since 1.9
3715 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3716 */
3717 proxy<TReturn,
3718 A, B, C,
3719 T, U, V, W, X, Y>(funсtion: (a: A, b: B, c: C,
3720 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3721 context: null | undefined,
3722 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3723 /**
3724 * Takes a function and returns a new one that will always have a particular context.
3725 * @param funсtion The function whose context will be changed.
3726 * @param context The object to which the context (`this`) of the function should be set.
3727 * @param a An argument to be passed to the function referenced in the `function` argument.
3728 * @param b An argument to be passed to the function referenced in the `function` argument.
3729 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3730 * @since 1.9
3731 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3732 */
3733 proxy<TReturn,
3734 A, B,
3735 T, U, V, W, X, Y>(funсtion: (a: A, b: B,
3736 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3737 context: null | undefined,
3738 a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3739 /**
3740 * Takes a function and returns a new one that will always have a particular context.
3741 * @param funсtion The function whose context will be changed.
3742 * @param context The object to which the context (`this`) of the function should be set.
3743 * @param a An argument to be passed to the function referenced in the `function` argument.
3744 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3745 * @since 1.9
3746 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3747 */
3748 proxy<TReturn,
3749 A,
3750 T, U, V, W, X, Y>(funсtion: (a: A,
3751 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3752 context: null | undefined,
3753 a: A): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3754 /**
3755 * Takes a function and returns a new one that will always have a particular context.
3756 * @param funсtion The function whose context will be changed.
3757 * @param context The object to which the context (`this`) of the function should be set.
3758 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3759 * @since 1.9
3760 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3761 */
3762 proxy<TReturn,
3763 T, U, V, W, X, Y>(funсtion: (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3764 context: null | undefined): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3765
3766 // #endregion
3767
3768 // region 7+ parameters
3769 // #region 7+ parameters
3770
3771 /**
3772 * Takes a function and returns a new one that will always have a particular context.
3773 * @param funсtion The function whose context will be changed.
3774 * @param context The object to which the context (`this`) of the function should be set.
3775 * @param a An argument to be passed to the function referenced in the `function` argument.
3776 * @param b An argument to be passed to the function referenced in the `function` argument.
3777 * @param c An argument to be passed to the function referenced in the `function` argument.
3778 * @param d An argument to be passed to the function referenced in the `function` argument.
3779 * @param e An argument to be passed to the function referenced in the `function` argument.
3780 * @param f An argument to be passed to the function referenced in the `function` argument.
3781 * @param g An argument to be passed to the function referenced in the `function` argument.
3782 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3783 * @since 1.9
3784 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3785 */
3786 proxy<TReturn,
3787 A, B, C, D, E, F, G,
3788 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3789 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3790 context: null | undefined,
3791 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
3792 /**
3793 * Takes a function and returns a new one that will always have a particular context.
3794 * @param funсtion The function whose context will be changed.
3795 * @param context The object to which the context (`this`) of the function should be set.
3796 * @param a An argument to be passed to the function referenced in the `function` argument.
3797 * @param b An argument to be passed to the function referenced in the `function` argument.
3798 * @param c An argument to be passed to the function referenced in the `function` argument.
3799 * @param d An argument to be passed to the function referenced in the `function` argument.
3800 * @param e An argument to be passed to the function referenced in the `function` argument.
3801 * @param f An argument to be passed to the function referenced in the `function` argument.
3802 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3803 * @since 1.9
3804 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3805 */
3806 proxy<TReturn,
3807 A, B, C, D, E, F,
3808 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3809 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3810 context: null | undefined,
3811 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
3812 /**
3813 * Takes a function and returns a new one that will always have a particular context.
3814 * @param funсtion The function whose context will be changed.
3815 * @param context The object to which the context (`this`) of the function should be set.
3816 * @param a An argument to be passed to the function referenced in the `function` argument.
3817 * @param b An argument to be passed to the function referenced in the `function` argument.
3818 * @param c An argument to be passed to the function referenced in the `function` argument.
3819 * @param d An argument to be passed to the function referenced in the `function` argument.
3820 * @param e An argument to be passed to the function referenced in the `function` argument.
3821 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3822 * @since 1.9
3823 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3824 */
3825 proxy<TReturn,
3826 A, B, C, D, E,
3827 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3828 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3829 context: null | undefined,
3830 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
3831 /**
3832 * Takes a function and returns a new one that will always have a particular context.
3833 * @param funсtion The function whose context will be changed.
3834 * @param context The object to which the context (`this`) of the function should be set.
3835 * @param a An argument to be passed to the function referenced in the `function` argument.
3836 * @param b An argument to be passed to the function referenced in the `function` argument.
3837 * @param c An argument to be passed to the function referenced in the `function` argument.
3838 * @param d An argument to be passed to the function referenced in the `function` argument.
3839 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3840 * @since 1.9
3841 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3842 */
3843 proxy<TReturn,
3844 A, B, C, D,
3845 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B, c: C, d: D,
3846 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3847 context: null | undefined,
3848 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
3849 /**
3850 * Takes a function and returns a new one that will always have a particular context.
3851 * @param funсtion The function whose context will be changed.
3852 * @param context The object to which the context (`this`) of the function should be set.
3853 * @param a An argument to be passed to the function referenced in the `function` argument.
3854 * @param b An argument to be passed to the function referenced in the `function` argument.
3855 * @param c An argument to be passed to the function referenced in the `function` argument.
3856 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3857 * @since 1.9
3858 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3859 */
3860 proxy<TReturn,
3861 A, B, C,
3862 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B, c: C,
3863 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3864 context: null | undefined,
3865 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
3866 /**
3867 * Takes a function and returns a new one that will always have a particular context.
3868 * @param funсtion The function whose context will be changed.
3869 * @param context The object to which the context (`this`) of the function should be set.
3870 * @param a An argument to be passed to the function referenced in the `function` argument.
3871 * @param b An argument to be passed to the function referenced in the `function` argument.
3872 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3873 * @since 1.9
3874 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3875 */
3876 proxy<TReturn,
3877 A, B,
3878 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B,
3879 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3880 context: null | undefined,
3881 a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
3882 /**
3883 * Takes a function and returns a new one that will always have a particular context.
3884 * @param funсtion The function whose context will be changed.
3885 * @param context The object to which the context (`this`) of the function should be set.
3886 * @param a An argument to be passed to the function referenced in the `function` argument.
3887 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3888 * @since 1.9
3889 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3890 */
3891 proxy<TReturn,
3892 A,
3893 T, U, V, W, X, Y, Z>(funсtion: (a: A,
3894 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3895 context: null | undefined,
3896 a: A): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
3897 /**
3898 * Takes a function and returns a new one that will always have a particular context.
3899 * @param funсtion The function whose context will be changed.
3900 * @param context The object to which the context (`this`) of the function should be set.
3901 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3902 * @since 1.9
3903 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3904 */
3905 proxy<TReturn,
3906 T, U, V, W, X, Y, Z>(funсtion: (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3907 context: null | undefined): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
3908
3909 // #endregion
3910
3911 // #endregion
3912
3913 // region 8+ additional arguments
3914 // #region 8+ additional arguments
3915
3916 /**
3917 * Takes a function and returns a new one that will always have a particular context.
3918 * @param funсtion The function whose context will be changed.
3919 * @param context The object to which the context (`this`) of the function should be set.
3920 * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument.
3921 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3922 * @since 1.9
3923 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3924 */
3925 proxy<TReturn>(funсtion: (...args: any[]) => TReturn,
3926 context: null | undefined,
3927 ...additionalArguments: any[]): (...args: any[]) => TReturn;
3928
3929 // #endregion
3930
3931 // #endregion
3932
3933 // region (funсtion, context)
3934 // #region (funсtion, context)
3935
3936 // region 0 to 7 additional arguments
3937 // #region 0 to 7 additional arguments
3938
3939 // region 0 parameters
3940 // #region 0 parameters
3941
3942 /**
3943 * Takes a function and returns a new one that will always have a particular context.
3944 * @param funсtion The function whose context will be changed.
3945 * @param context The object to which the context (`this`) of the function should be set.
3946 * @param a An argument to be passed to the function referenced in the `function` argument.
3947 * @param b An argument to be passed to the function referenced in the `function` argument.
3948 * @param c An argument to be passed to the function referenced in the `function` argument.
3949 * @param d An argument to be passed to the function referenced in the `function` argument.
3950 * @param e An argument to be passed to the function referenced in the `function` argument.
3951 * @param f An argument to be passed to the function referenced in the `function` argument.
3952 * @param g An argument to be passed to the function referenced in the `function` argument.
3953 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3954 * @since 1.4
3955 * @since 1.6
3956 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3957 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
3958```html
3959<!doctype html>
3960<html lang="en">
3961<head>
3962 <meta charset="utf-8">
3963 <title>jQuery.proxy demo</title>
3964 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
3965</head>
3966<body>
3967
3968<p><button type="button" id="test">Test</button></p>
3969<div id="log"></div>
3970
3971<script>
3972var me = {
3973 type: "zombie",
3974 test: function( event ) {
3975 // Without proxy, `this` would refer to the event target
3976 // use event.target to reference that element.
3977 var element = event.target;
3978 $( element ).css( "background-color", "red" );
3979
3980 // With proxy, `this` refers to the me object encapsulating
3981 // this function.
3982 $( "#log" ).append( "Hello " + this.type + "<br>" );
3983 $( "#test" ).off( "click", this.test );
3984 }
3985};
3986
3987var you = {
3988 type: "person",
3989 test: function( event ) {
3990 $( "#log" ).append( this.type + " " );
3991 }
3992};
3993
3994// Execute you.test() in the context of the `you` object
3995// no matter where it is called
3996// i.e. the `this` keyword will refer to `you`
3997var youClick = $.proxy( you.test, you );
3998
3999// attach click handlers to #test
4000$( "#test" )
4001 // this === "zombie"; handler unbound after first click
4002 .on( "click", $.proxy( me.test, me ) )
4003
4004 // this === "person"
4005 .on( "click", youClick )
4006
4007 // this === "zombie"
4008 .on( "click", $.proxy( you.test, me ) )
4009
4010 // this === "<button> element"
4011 .on( "click", you.test );
4012</script>
4013
4014</body>
4015</html>
4016```
4017 * @example ​ ````Change the context of a function bound to the click handler,
4018```html
4019<!doctype html>
4020<html lang="en">
4021<head>
4022 <meta charset="utf-8">
4023 <title>jQuery.proxy demo</title>
4024 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4025</head>
4026<body>
4027
4028<p><button type="button" id="test">Test</button></p>
4029<div id="log"></div>
4030
4031<script>
4032var me = {
4033 // I'm a dog
4034 type: "dog",
4035
4036 // Note that event comes *after* one and two
4037 test: function( one, two, event ) {
4038 $( "#log" )
4039
4040 // `one` maps to `you`, the 1st additional
4041 // argument in the $.proxy function call
4042 .append( "<h3>Hello " + one.type + ":</h3>" )
4043
4044 // The `this` keyword refers to `me`
4045 // (the 2nd, context, argument of $.proxy)
4046 .append( "I am a " + this.type + ", " )
4047
4048 // `two` maps to `they`, the 2nd additional
4049 // argument in the $.proxy function call
4050 .append( "and they are " + two.type + ".<br>" )
4051
4052 // The event type is "click"
4053 .append( "Thanks for " + event.type + "ing." )
4054
4055 // The clicked element is `event.target`,
4056 // and its type is "button"
4057 .append( "the " + event.target.type + "." );
4058 }
4059};
4060
4061var you = { type: "cat" };
4062var they = { type: "fish" };
4063
4064// Set up handler to execute me.test() in the context
4065// of `me`, with `you` and `they` as additional arguments
4066var proxy = $.proxy( me.test, me, you, they );
4067
4068$( "#test" )
4069 .on( "click", proxy );
4070</script>
4071
4072</body>
4073</html>
4074```
4075 */
4076 proxy<TContext,
4077 TReturn,
4078 A, B, C, D, E, F, G>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G) => TReturn,
4079 context: TContext,
4080 a: A, b: B, c: C, d: D, e: E, f: F, g: G): () => TReturn;
4081 /**
4082 * Takes a function and returns a new one that will always have a particular context.
4083 * @param funсtion The function whose context will be changed.
4084 * @param context The object to which the context (`this`) of the function should be set.
4085 * @param a An argument to be passed to the function referenced in the `function` argument.
4086 * @param b An argument to be passed to the function referenced in the `function` argument.
4087 * @param c An argument to be passed to the function referenced in the `function` argument.
4088 * @param d An argument to be passed to the function referenced in the `function` argument.
4089 * @param e An argument to be passed to the function referenced in the `function` argument.
4090 * @param f An argument to be passed to the function referenced in the `function` argument.
4091 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4092 * @since 1.4
4093 * @since 1.6
4094 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4095 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
4096```html
4097<!doctype html>
4098<html lang="en">
4099<head>
4100 <meta charset="utf-8">
4101 <title>jQuery.proxy demo</title>
4102 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4103</head>
4104<body>
4105
4106<p><button type="button" id="test">Test</button></p>
4107<div id="log"></div>
4108
4109<script>
4110var me = {
4111 type: "zombie",
4112 test: function( event ) {
4113 // Without proxy, `this` would refer to the event target
4114 // use event.target to reference that element.
4115 var element = event.target;
4116 $( element ).css( "background-color", "red" );
4117
4118 // With proxy, `this` refers to the me object encapsulating
4119 // this function.
4120 $( "#log" ).append( "Hello " + this.type + "<br>" );
4121 $( "#test" ).off( "click", this.test );
4122 }
4123};
4124
4125var you = {
4126 type: "person",
4127 test: function( event ) {
4128 $( "#log" ).append( this.type + " " );
4129 }
4130};
4131
4132// Execute you.test() in the context of the `you` object
4133// no matter where it is called
4134// i.e. the `this` keyword will refer to `you`
4135var youClick = $.proxy( you.test, you );
4136
4137// attach click handlers to #test
4138$( "#test" )
4139 // this === "zombie"; handler unbound after first click
4140 .on( "click", $.proxy( me.test, me ) )
4141
4142 // this === "person"
4143 .on( "click", youClick )
4144
4145 // this === "zombie"
4146 .on( "click", $.proxy( you.test, me ) )
4147
4148 // this === "<button> element"
4149 .on( "click", you.test );
4150</script>
4151
4152</body>
4153</html>
4154```
4155 * @example ​ ````Change the context of a function bound to the click handler,
4156```html
4157<!doctype html>
4158<html lang="en">
4159<head>
4160 <meta charset="utf-8">
4161 <title>jQuery.proxy demo</title>
4162 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4163</head>
4164<body>
4165
4166<p><button type="button" id="test">Test</button></p>
4167<div id="log"></div>
4168
4169<script>
4170var me = {
4171 // I'm a dog
4172 type: "dog",
4173
4174 // Note that event comes *after* one and two
4175 test: function( one, two, event ) {
4176 $( "#log" )
4177
4178 // `one` maps to `you`, the 1st additional
4179 // argument in the $.proxy function call
4180 .append( "<h3>Hello " + one.type + ":</h3>" )
4181
4182 // The `this` keyword refers to `me`
4183 // (the 2nd, context, argument of $.proxy)
4184 .append( "I am a " + this.type + ", " )
4185
4186 // `two` maps to `they`, the 2nd additional
4187 // argument in the $.proxy function call
4188 .append( "and they are " + two.type + ".<br>" )
4189
4190 // The event type is "click"
4191 .append( "Thanks for " + event.type + "ing." )
4192
4193 // The clicked element is `event.target`,
4194 // and its type is "button"
4195 .append( "the " + event.target.type + "." );
4196 }
4197};
4198
4199var you = { type: "cat" };
4200var they = { type: "fish" };
4201
4202// Set up handler to execute me.test() in the context
4203// of `me`, with `you` and `they` as additional arguments
4204var proxy = $.proxy( me.test, me, you, they );
4205
4206$( "#test" )
4207 .on( "click", proxy );
4208</script>
4209
4210</body>
4211</html>
4212```
4213 */
4214 proxy<TContext,
4215 TReturn,
4216 A, B, C, D, E, F>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F) => TReturn,
4217 context: TContext,
4218 a: A, b: B, c: C, d: D, e: E, f: F): () => TReturn;
4219 /**
4220 * Takes a function and returns a new one that will always have a particular context.
4221 * @param funсtion The function whose context will be changed.
4222 * @param context The object to which the context (`this`) of the function should be set.
4223 * @param a An argument to be passed to the function referenced in the `function` argument.
4224 * @param b An argument to be passed to the function referenced in the `function` argument.
4225 * @param c An argument to be passed to the function referenced in the `function` argument.
4226 * @param d An argument to be passed to the function referenced in the `function` argument.
4227 * @param e An argument to be passed to the function referenced in the `function` argument.
4228 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4229 * @since 1.4
4230 * @since 1.6
4231 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4232 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
4233```html
4234<!doctype html>
4235<html lang="en">
4236<head>
4237 <meta charset="utf-8">
4238 <title>jQuery.proxy demo</title>
4239 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4240</head>
4241<body>
4242
4243<p><button type="button" id="test">Test</button></p>
4244<div id="log"></div>
4245
4246<script>
4247var me = {
4248 type: "zombie",
4249 test: function( event ) {
4250 // Without proxy, `this` would refer to the event target
4251 // use event.target to reference that element.
4252 var element = event.target;
4253 $( element ).css( "background-color", "red" );
4254
4255 // With proxy, `this` refers to the me object encapsulating
4256 // this function.
4257 $( "#log" ).append( "Hello " + this.type + "<br>" );
4258 $( "#test" ).off( "click", this.test );
4259 }
4260};
4261
4262var you = {
4263 type: "person",
4264 test: function( event ) {
4265 $( "#log" ).append( this.type + " " );
4266 }
4267};
4268
4269// Execute you.test() in the context of the `you` object
4270// no matter where it is called
4271// i.e. the `this` keyword will refer to `you`
4272var youClick = $.proxy( you.test, you );
4273
4274// attach click handlers to #test
4275$( "#test" )
4276 // this === "zombie"; handler unbound after first click
4277 .on( "click", $.proxy( me.test, me ) )
4278
4279 // this === "person"
4280 .on( "click", youClick )
4281
4282 // this === "zombie"
4283 .on( "click", $.proxy( you.test, me ) )
4284
4285 // this === "<button> element"
4286 .on( "click", you.test );
4287</script>
4288
4289</body>
4290</html>
4291```
4292 * @example ​ ````Change the context of a function bound to the click handler,
4293```html
4294<!doctype html>
4295<html lang="en">
4296<head>
4297 <meta charset="utf-8">
4298 <title>jQuery.proxy demo</title>
4299 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4300</head>
4301<body>
4302
4303<p><button type="button" id="test">Test</button></p>
4304<div id="log"></div>
4305
4306<script>
4307var me = {
4308 // I'm a dog
4309 type: "dog",
4310
4311 // Note that event comes *after* one and two
4312 test: function( one, two, event ) {
4313 $( "#log" )
4314
4315 // `one` maps to `you`, the 1st additional
4316 // argument in the $.proxy function call
4317 .append( "<h3>Hello " + one.type + ":</h3>" )
4318
4319 // The `this` keyword refers to `me`
4320 // (the 2nd, context, argument of $.proxy)
4321 .append( "I am a " + this.type + ", " )
4322
4323 // `two` maps to `they`, the 2nd additional
4324 // argument in the $.proxy function call
4325 .append( "and they are " + two.type + ".<br>" )
4326
4327 // The event type is "click"
4328 .append( "Thanks for " + event.type + "ing." )
4329
4330 // The clicked element is `event.target`,
4331 // and its type is "button"
4332 .append( "the " + event.target.type + "." );
4333 }
4334};
4335
4336var you = { type: "cat" };
4337var they = { type: "fish" };
4338
4339// Set up handler to execute me.test() in the context
4340// of `me`, with `you` and `they` as additional arguments
4341var proxy = $.proxy( me.test, me, you, they );
4342
4343$( "#test" )
4344 .on( "click", proxy );
4345</script>
4346
4347</body>
4348</html>
4349```
4350 */
4351 proxy<TContext,
4352 TReturn,
4353 A, B, C, D, E>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E) => TReturn,
4354 context: TContext,
4355 a: A, b: B, c: C, d: D, e: E): () => TReturn;
4356 /**
4357 * Takes a function and returns a new one that will always have a particular context.
4358 * @param funсtion The function whose context will be changed.
4359 * @param context The object to which the context (`this`) of the function should be set.
4360 * @param a An argument to be passed to the function referenced in the `function` argument.
4361 * @param b An argument to be passed to the function referenced in the `function` argument.
4362 * @param c An argument to be passed to the function referenced in the `function` argument.
4363 * @param d An argument to be passed to the function referenced in the `function` argument.
4364 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4365 * @since 1.4
4366 * @since 1.6
4367 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4368 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
4369```html
4370<!doctype html>
4371<html lang="en">
4372<head>
4373 <meta charset="utf-8">
4374 <title>jQuery.proxy demo</title>
4375 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4376</head>
4377<body>
4378
4379<p><button type="button" id="test">Test</button></p>
4380<div id="log"></div>
4381
4382<script>
4383var me = {
4384 type: "zombie",
4385 test: function( event ) {
4386 // Without proxy, `this` would refer to the event target
4387 // use event.target to reference that element.
4388 var element = event.target;
4389 $( element ).css( "background-color", "red" );
4390
4391 // With proxy, `this` refers to the me object encapsulating
4392 // this function.
4393 $( "#log" ).append( "Hello " + this.type + "<br>" );
4394 $( "#test" ).off( "click", this.test );
4395 }
4396};
4397
4398var you = {
4399 type: "person",
4400 test: function( event ) {
4401 $( "#log" ).append( this.type + " " );
4402 }
4403};
4404
4405// Execute you.test() in the context of the `you` object
4406// no matter where it is called
4407// i.e. the `this` keyword will refer to `you`
4408var youClick = $.proxy( you.test, you );
4409
4410// attach click handlers to #test
4411$( "#test" )
4412 // this === "zombie"; handler unbound after first click
4413 .on( "click", $.proxy( me.test, me ) )
4414
4415 // this === "person"
4416 .on( "click", youClick )
4417
4418 // this === "zombie"
4419 .on( "click", $.proxy( you.test, me ) )
4420
4421 // this === "<button> element"
4422 .on( "click", you.test );
4423</script>
4424
4425</body>
4426</html>
4427```
4428 * @example ​ ````Change the context of a function bound to the click handler,
4429```html
4430<!doctype html>
4431<html lang="en">
4432<head>
4433 <meta charset="utf-8">
4434 <title>jQuery.proxy demo</title>
4435 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4436</head>
4437<body>
4438
4439<p><button type="button" id="test">Test</button></p>
4440<div id="log"></div>
4441
4442<script>
4443var me = {
4444 // I'm a dog
4445 type: "dog",
4446
4447 // Note that event comes *after* one and two
4448 test: function( one, two, event ) {
4449 $( "#log" )
4450
4451 // `one` maps to `you`, the 1st additional
4452 // argument in the $.proxy function call
4453 .append( "<h3>Hello " + one.type + ":</h3>" )
4454
4455 // The `this` keyword refers to `me`
4456 // (the 2nd, context, argument of $.proxy)
4457 .append( "I am a " + this.type + ", " )
4458
4459 // `two` maps to `they`, the 2nd additional
4460 // argument in the $.proxy function call
4461 .append( "and they are " + two.type + ".<br>" )
4462
4463 // The event type is "click"
4464 .append( "Thanks for " + event.type + "ing." )
4465
4466 // The clicked element is `event.target`,
4467 // and its type is "button"
4468 .append( "the " + event.target.type + "." );
4469 }
4470};
4471
4472var you = { type: "cat" };
4473var they = { type: "fish" };
4474
4475// Set up handler to execute me.test() in the context
4476// of `me`, with `you` and `they` as additional arguments
4477var proxy = $.proxy( me.test, me, you, they );
4478
4479$( "#test" )
4480 .on( "click", proxy );
4481</script>
4482
4483</body>
4484</html>
4485```
4486 */
4487 proxy<TContext,
4488 TReturn,
4489 A, B, C, D>(funсtion: (this: TContext, a: A, b: B, c: C, d: D) => TReturn,
4490 context: TContext,
4491 a: A, b: B, c: C, d: D): () => TReturn;
4492 /**
4493 * Takes a function and returns a new one that will always have a particular context.
4494 * @param funсtion The function whose context will be changed.
4495 * @param context The object to which the context (`this`) of the function should be set.
4496 * @param a An argument to be passed to the function referenced in the `function` argument.
4497 * @param b An argument to be passed to the function referenced in the `function` argument.
4498 * @param c An argument to be passed to the function referenced in the `function` argument.
4499 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4500 * @since 1.4
4501 * @since 1.6
4502 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4503 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
4504```html
4505<!doctype html>
4506<html lang="en">
4507<head>
4508 <meta charset="utf-8">
4509 <title>jQuery.proxy demo</title>
4510 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4511</head>
4512<body>
4513
4514<p><button type="button" id="test">Test</button></p>
4515<div id="log"></div>
4516
4517<script>
4518var me = {
4519 type: "zombie",
4520 test: function( event ) {
4521 // Without proxy, `this` would refer to the event target
4522 // use event.target to reference that element.
4523 var element = event.target;
4524 $( element ).css( "background-color", "red" );
4525
4526 // With proxy, `this` refers to the me object encapsulating
4527 // this function.
4528 $( "#log" ).append( "Hello " + this.type + "<br>" );
4529 $( "#test" ).off( "click", this.test );
4530 }
4531};
4532
4533var you = {
4534 type: "person",
4535 test: function( event ) {
4536 $( "#log" ).append( this.type + " " );
4537 }
4538};
4539
4540// Execute you.test() in the context of the `you` object
4541// no matter where it is called
4542// i.e. the `this` keyword will refer to `you`
4543var youClick = $.proxy( you.test, you );
4544
4545// attach click handlers to #test
4546$( "#test" )
4547 // this === "zombie"; handler unbound after first click
4548 .on( "click", $.proxy( me.test, me ) )
4549
4550 // this === "person"
4551 .on( "click", youClick )
4552
4553 // this === "zombie"
4554 .on( "click", $.proxy( you.test, me ) )
4555
4556 // this === "<button> element"
4557 .on( "click", you.test );
4558</script>
4559
4560</body>
4561</html>
4562```
4563 * @example ​ ````Change the context of a function bound to the click handler,
4564```html
4565<!doctype html>
4566<html lang="en">
4567<head>
4568 <meta charset="utf-8">
4569 <title>jQuery.proxy demo</title>
4570 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4571</head>
4572<body>
4573
4574<p><button type="button" id="test">Test</button></p>
4575<div id="log"></div>
4576
4577<script>
4578var me = {
4579 // I'm a dog
4580 type: "dog",
4581
4582 // Note that event comes *after* one and two
4583 test: function( one, two, event ) {
4584 $( "#log" )
4585
4586 // `one` maps to `you`, the 1st additional
4587 // argument in the $.proxy function call
4588 .append( "<h3>Hello " + one.type + ":</h3>" )
4589
4590 // The `this` keyword refers to `me`
4591 // (the 2nd, context, argument of $.proxy)
4592 .append( "I am a " + this.type + ", " )
4593
4594 // `two` maps to `they`, the 2nd additional
4595 // argument in the $.proxy function call
4596 .append( "and they are " + two.type + ".<br>" )
4597
4598 // The event type is "click"
4599 .append( "Thanks for " + event.type + "ing." )
4600
4601 // The clicked element is `event.target`,
4602 // and its type is "button"
4603 .append( "the " + event.target.type + "." );
4604 }
4605};
4606
4607var you = { type: "cat" };
4608var they = { type: "fish" };
4609
4610// Set up handler to execute me.test() in the context
4611// of `me`, with `you` and `they` as additional arguments
4612var proxy = $.proxy( me.test, me, you, they );
4613
4614$( "#test" )
4615 .on( "click", proxy );
4616</script>
4617
4618</body>
4619</html>
4620```
4621 */
4622 proxy<TContext,
4623 TReturn,
4624 A, B, C>(funсtion: (this: TContext, a: A, b: B, c: C) => TReturn,
4625 context: TContext,
4626 a: A, b: B, c: C): () => TReturn;
4627 /**
4628 * Takes a function and returns a new one that will always have a particular context.
4629 * @param funсtion The function whose context will be changed.
4630 * @param context The object to which the context (`this`) of the function should be set.
4631 * @param a An argument to be passed to the function referenced in the `function` argument.
4632 * @param b An argument to be passed to the function referenced in the `function` argument.
4633 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4634 * @since 1.4
4635 * @since 1.6
4636 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4637 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
4638```html
4639<!doctype html>
4640<html lang="en">
4641<head>
4642 <meta charset="utf-8">
4643 <title>jQuery.proxy demo</title>
4644 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4645</head>
4646<body>
4647
4648<p><button type="button" id="test">Test</button></p>
4649<div id="log"></div>
4650
4651<script>
4652var me = {
4653 type: "zombie",
4654 test: function( event ) {
4655 // Without proxy, `this` would refer to the event target
4656 // use event.target to reference that element.
4657 var element = event.target;
4658 $( element ).css( "background-color", "red" );
4659
4660 // With proxy, `this` refers to the me object encapsulating
4661 // this function.
4662 $( "#log" ).append( "Hello " + this.type + "<br>" );
4663 $( "#test" ).off( "click", this.test );
4664 }
4665};
4666
4667var you = {
4668 type: "person",
4669 test: function( event ) {
4670 $( "#log" ).append( this.type + " " );
4671 }
4672};
4673
4674// Execute you.test() in the context of the `you` object
4675// no matter where it is called
4676// i.e. the `this` keyword will refer to `you`
4677var youClick = $.proxy( you.test, you );
4678
4679// attach click handlers to #test
4680$( "#test" )
4681 // this === "zombie"; handler unbound after first click
4682 .on( "click", $.proxy( me.test, me ) )
4683
4684 // this === "person"
4685 .on( "click", youClick )
4686
4687 // this === "zombie"
4688 .on( "click", $.proxy( you.test, me ) )
4689
4690 // this === "<button> element"
4691 .on( "click", you.test );
4692</script>
4693
4694</body>
4695</html>
4696```
4697 * @example ​ ````Change the context of a function bound to the click handler,
4698```html
4699<!doctype html>
4700<html lang="en">
4701<head>
4702 <meta charset="utf-8">
4703 <title>jQuery.proxy demo</title>
4704 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4705</head>
4706<body>
4707
4708<p><button type="button" id="test">Test</button></p>
4709<div id="log"></div>
4710
4711<script>
4712var me = {
4713 // I'm a dog
4714 type: "dog",
4715
4716 // Note that event comes *after* one and two
4717 test: function( one, two, event ) {
4718 $( "#log" )
4719
4720 // `one` maps to `you`, the 1st additional
4721 // argument in the $.proxy function call
4722 .append( "<h3>Hello " + one.type + ":</h3>" )
4723
4724 // The `this` keyword refers to `me`
4725 // (the 2nd, context, argument of $.proxy)
4726 .append( "I am a " + this.type + ", " )
4727
4728 // `two` maps to `they`, the 2nd additional
4729 // argument in the $.proxy function call
4730 .append( "and they are " + two.type + ".<br>" )
4731
4732 // The event type is "click"
4733 .append( "Thanks for " + event.type + "ing." )
4734
4735 // The clicked element is `event.target`,
4736 // and its type is "button"
4737 .append( "the " + event.target.type + "." );
4738 }
4739};
4740
4741var you = { type: "cat" };
4742var they = { type: "fish" };
4743
4744// Set up handler to execute me.test() in the context
4745// of `me`, with `you` and `they` as additional arguments
4746var proxy = $.proxy( me.test, me, you, they );
4747
4748$( "#test" )
4749 .on( "click", proxy );
4750</script>
4751
4752</body>
4753</html>
4754```
4755 */
4756 proxy<TContext,
4757 TReturn,
4758 A, B>(funсtion: (this: TContext, a: A, b: B) => TReturn,
4759 context: TContext,
4760 a: A, b: B): () => TReturn;
4761 /**
4762 * Takes a function and returns a new one that will always have a particular context.
4763 * @param funсtion The function whose context will be changed.
4764 * @param context The object to which the context (`this`) of the function should be set.
4765 * @param a An argument to be passed to the function referenced in the `function` argument.
4766 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4767 * @since 1.4`
4768 * @since 1.6
4769 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4770 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
4771```html
4772<!doctype html>
4773<html lang="en">
4774<head>
4775 <meta charset="utf-8">
4776 <title>jQuery.proxy demo</title>
4777 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4778</head>
4779<body>
4780
4781<p><button type="button" id="test">Test</button></p>
4782<div id="log"></div>
4783
4784<script>
4785var me = {
4786 type: "zombie",
4787 test: function( event ) {
4788 // Without proxy, `this` would refer to the event target
4789 // use event.target to reference that element.
4790 var element = event.target;
4791 $( element ).css( "background-color", "red" );
4792
4793 // With proxy, `this` refers to the me object encapsulating
4794 // this function.
4795 $( "#log" ).append( "Hello " + this.type + "<br>" );
4796 $( "#test" ).off( "click", this.test );
4797 }
4798};
4799
4800var you = {
4801 type: "person",
4802 test: function( event ) {
4803 $( "#log" ).append( this.type + " " );
4804 }
4805};
4806
4807// Execute you.test() in the context of the `you` object
4808// no matter where it is called
4809// i.e. the `this` keyword will refer to `you`
4810var youClick = $.proxy( you.test, you );
4811
4812// attach click handlers to #test
4813$( "#test" )
4814 // this === "zombie"; handler unbound after first click
4815 .on( "click", $.proxy( me.test, me ) )
4816
4817 // this === "person"
4818 .on( "click", youClick )
4819
4820 // this === "zombie"
4821 .on( "click", $.proxy( you.test, me ) )
4822
4823 // this === "<button> element"
4824 .on( "click", you.test );
4825</script>
4826
4827</body>
4828</html>
4829```
4830 * @example ​ ````Change the context of a function bound to the click handler,
4831```html
4832<!doctype html>
4833<html lang="en">
4834<head>
4835 <meta charset="utf-8">
4836 <title>jQuery.proxy demo</title>
4837 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4838</head>
4839<body>
4840
4841<p><button type="button" id="test">Test</button></p>
4842<div id="log"></div>
4843
4844<script>
4845var me = {
4846 // I'm a dog
4847 type: "dog",
4848
4849 // Note that event comes *after* one and two
4850 test: function( one, two, event ) {
4851 $( "#log" )
4852
4853 // `one` maps to `you`, the 1st additional
4854 // argument in the $.proxy function call
4855 .append( "<h3>Hello " + one.type + ":</h3>" )
4856
4857 // The `this` keyword refers to `me`
4858 // (the 2nd, context, argument of $.proxy)
4859 .append( "I am a " + this.type + ", " )
4860
4861 // `two` maps to `they`, the 2nd additional
4862 // argument in the $.proxy function call
4863 .append( "and they are " + two.type + ".<br>" )
4864
4865 // The event type is "click"
4866 .append( "Thanks for " + event.type + "ing." )
4867
4868 // The clicked element is `event.target`,
4869 // and its type is "button"
4870 .append( "the " + event.target.type + "." );
4871 }
4872};
4873
4874var you = { type: "cat" };
4875var they = { type: "fish" };
4876
4877// Set up handler to execute me.test() in the context
4878// of `me`, with `you` and `they` as additional arguments
4879var proxy = $.proxy( me.test, me, you, they );
4880
4881$( "#test" )
4882 .on( "click", proxy );
4883</script>
4884
4885</body>
4886</html>
4887```
4888 */
4889 proxy<TContext,
4890 TReturn,
4891 A>(funсtion: (this: TContext, a: A) => TReturn,
4892 context: TContext,
4893 a: A): () => TReturn;
4894 /**
4895 * Takes a function and returns a new one that will always have a particular context.
4896 * @param funсtion The function whose context will be changed.
4897 * @param context The object to which the context (`this`) of the function should be set.
4898 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4899 * @since 1.4
4900 * @since 1.6
4901 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4902 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
4903```html
4904<!doctype html>
4905<html lang="en">
4906<head>
4907 <meta charset="utf-8">
4908 <title>jQuery.proxy demo</title>
4909 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4910</head>
4911<body>
4912
4913<p><button type="button" id="test">Test</button></p>
4914<div id="log"></div>
4915
4916<script>
4917var me = {
4918 type: "zombie",
4919 test: function( event ) {
4920 // Without proxy, `this` would refer to the event target
4921 // use event.target to reference that element.
4922 var element = event.target;
4923 $( element ).css( "background-color", "red" );
4924
4925 // With proxy, `this` refers to the me object encapsulating
4926 // this function.
4927 $( "#log" ).append( "Hello " + this.type + "<br>" );
4928 $( "#test" ).off( "click", this.test );
4929 }
4930};
4931
4932var you = {
4933 type: "person",
4934 test: function( event ) {
4935 $( "#log" ).append( this.type + " " );
4936 }
4937};
4938
4939// Execute you.test() in the context of the `you` object
4940// no matter where it is called
4941// i.e. the `this` keyword will refer to `you`
4942var youClick = $.proxy( you.test, you );
4943
4944// attach click handlers to #test
4945$( "#test" )
4946 // this === "zombie"; handler unbound after first click
4947 .on( "click", $.proxy( me.test, me ) )
4948
4949 // this === "person"
4950 .on( "click", youClick )
4951
4952 // this === "zombie"
4953 .on( "click", $.proxy( you.test, me ) )
4954
4955 // this === "<button> element"
4956 .on( "click", you.test );
4957</script>
4958
4959</body>
4960</html>
4961```
4962 * @example ​ ````Change the context of a function bound to the click handler,
4963```html
4964<!doctype html>
4965<html lang="en">
4966<head>
4967 <meta charset="utf-8">
4968 <title>jQuery.proxy demo</title>
4969 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4970</head>
4971<body>
4972
4973<p><button type="button" id="test">Test</button></p>
4974<div id="log"></div>
4975
4976<script>
4977var me = {
4978 // I'm a dog
4979 type: "dog",
4980
4981 // Note that event comes *after* one and two
4982 test: function( one, two, event ) {
4983 $( "#log" )
4984
4985 // `one` maps to `you`, the 1st additional
4986 // argument in the $.proxy function call
4987 .append( "<h3>Hello " + one.type + ":</h3>" )
4988
4989 // The `this` keyword refers to `me`
4990 // (the 2nd, context, argument of $.proxy)
4991 .append( "I am a " + this.type + ", " )
4992
4993 // `two` maps to `they`, the 2nd additional
4994 // argument in the $.proxy function call
4995 .append( "and they are " + two.type + ".<br>" )
4996
4997 // The event type is "click"
4998 .append( "Thanks for " + event.type + "ing." )
4999
5000 // The clicked element is `event.target`,
5001 // and its type is "button"
5002 .append( "the " + event.target.type + "." );
5003 }
5004};
5005
5006var you = { type: "cat" };
5007var they = { type: "fish" };
5008
5009// Set up handler to execute me.test() in the context
5010// of `me`, with `you` and `they` as additional arguments
5011var proxy = $.proxy( me.test, me, you, they );
5012
5013$( "#test" )
5014 .on( "click", proxy );
5015</script>
5016
5017</body>
5018</html>
5019```
5020 */
5021 proxy<TContext,
5022 TReturn>(funсtion: (this: TContext) => TReturn,
5023 context: TContext): () => TReturn;
5024
5025 // #endregion
5026
5027 // region 1 parameters
5028 // #region 1 parameters
5029
5030 /**
5031 * Takes a function and returns a new one that will always have a particular context.
5032 * @param funсtion The function whose context will be changed.
5033 * @param context The object to which the context (`this`) of the function should be set.
5034 * @param a An argument to be passed to the function referenced in the `function` argument.
5035 * @param b An argument to be passed to the function referenced in the `function` argument.
5036 * @param c An argument to be passed to the function referenced in the `function` argument.
5037 * @param d An argument to be passed to the function referenced in the `function` argument.
5038 * @param e An argument to be passed to the function referenced in the `function` argument.
5039 * @param f An argument to be passed to the function referenced in the `function` argument.
5040 * @param g An argument to be passed to the function referenced in the `function` argument.
5041 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5042 * @since 1.4
5043 * @since 1.6
5044 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5045 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
5046```html
5047<!doctype html>
5048<html lang="en">
5049<head>
5050 <meta charset="utf-8">
5051 <title>jQuery.proxy demo</title>
5052 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5053</head>
5054<body>
5055
5056<p><button type="button" id="test">Test</button></p>
5057<div id="log"></div>
5058
5059<script>
5060var me = {
5061 type: "zombie",
5062 test: function( event ) {
5063 // Without proxy, `this` would refer to the event target
5064 // use event.target to reference that element.
5065 var element = event.target;
5066 $( element ).css( "background-color", "red" );
5067
5068 // With proxy, `this` refers to the me object encapsulating
5069 // this function.
5070 $( "#log" ).append( "Hello " + this.type + "<br>" );
5071 $( "#test" ).off( "click", this.test );
5072 }
5073};
5074
5075var you = {
5076 type: "person",
5077 test: function( event ) {
5078 $( "#log" ).append( this.type + " " );
5079 }
5080};
5081
5082// Execute you.test() in the context of the `you` object
5083// no matter where it is called
5084// i.e. the `this` keyword will refer to `you`
5085var youClick = $.proxy( you.test, you );
5086
5087// attach click handlers to #test
5088$( "#test" )
5089 // this === "zombie"; handler unbound after first click
5090 .on( "click", $.proxy( me.test, me ) )
5091
5092 // this === "person"
5093 .on( "click", youClick )
5094
5095 // this === "zombie"
5096 .on( "click", $.proxy( you.test, me ) )
5097
5098 // this === "<button> element"
5099 .on( "click", you.test );
5100</script>
5101
5102</body>
5103</html>
5104```
5105 * @example ​ ````Change the context of a function bound to the click handler,
5106```html
5107<!doctype html>
5108<html lang="en">
5109<head>
5110 <meta charset="utf-8">
5111 <title>jQuery.proxy demo</title>
5112 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5113</head>
5114<body>
5115
5116<p><button type="button" id="test">Test</button></p>
5117<div id="log"></div>
5118
5119<script>
5120var me = {
5121 // I'm a dog
5122 type: "dog",
5123
5124 // Note that event comes *after* one and two
5125 test: function( one, two, event ) {
5126 $( "#log" )
5127
5128 // `one` maps to `you`, the 1st additional
5129 // argument in the $.proxy function call
5130 .append( "<h3>Hello " + one.type + ":</h3>" )
5131
5132 // The `this` keyword refers to `me`
5133 // (the 2nd, context, argument of $.proxy)
5134 .append( "I am a " + this.type + ", " )
5135
5136 // `two` maps to `they`, the 2nd additional
5137 // argument in the $.proxy function call
5138 .append( "and they are " + two.type + ".<br>" )
5139
5140 // The event type is "click"
5141 .append( "Thanks for " + event.type + "ing." )
5142
5143 // The clicked element is `event.target`,
5144 // and its type is "button"
5145 .append( "the " + event.target.type + "." );
5146 }
5147};
5148
5149var you = { type: "cat" };
5150var they = { type: "fish" };
5151
5152// Set up handler to execute me.test() in the context
5153// of `me`, with `you` and `they` as additional arguments
5154var proxy = $.proxy( me.test, me, you, they );
5155
5156$( "#test" )
5157 .on( "click", proxy );
5158</script>
5159
5160</body>
5161</html>
5162```
5163 */
5164 proxy<TContext,
5165 TReturn,
5166 A, B, C, D, E, F, G,
5167 T>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
5168 t: T) => TReturn,
5169 context: TContext,
5170 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T) => TReturn;
5171 /**
5172 * Takes a function and returns a new one that will always have a particular context.
5173 * @param funсtion The function whose context will be changed.
5174 * @param context The object to which the context (`this`) of the function should be set.
5175 * @param a An argument to be passed to the function referenced in the `function` argument.
5176 * @param b An argument to be passed to the function referenced in the `function` argument.
5177 * @param c An argument to be passed to the function referenced in the `function` argument.
5178 * @param d An argument to be passed to the function referenced in the `function` argument.
5179 * @param e An argument to be passed to the function referenced in the `function` argument.
5180 * @param f An argument to be passed to the function referenced in the `function` argument.
5181 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5182 * @since 1.4
5183 * @since 1.6
5184 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5185 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
5186```html
5187<!doctype html>
5188<html lang="en">
5189<head>
5190 <meta charset="utf-8">
5191 <title>jQuery.proxy demo</title>
5192 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5193</head>
5194<body>
5195
5196<p><button type="button" id="test">Test</button></p>
5197<div id="log"></div>
5198
5199<script>
5200var me = {
5201 type: "zombie",
5202 test: function( event ) {
5203 // Without proxy, `this` would refer to the event target
5204 // use event.target to reference that element.
5205 var element = event.target;
5206 $( element ).css( "background-color", "red" );
5207
5208 // With proxy, `this` refers to the me object encapsulating
5209 // this function.
5210 $( "#log" ).append( "Hello " + this.type + "<br>" );
5211 $( "#test" ).off( "click", this.test );
5212 }
5213};
5214
5215var you = {
5216 type: "person",
5217 test: function( event ) {
5218 $( "#log" ).append( this.type + " " );
5219 }
5220};
5221
5222// Execute you.test() in the context of the `you` object
5223// no matter where it is called
5224// i.e. the `this` keyword will refer to `you`
5225var youClick = $.proxy( you.test, you );
5226
5227// attach click handlers to #test
5228$( "#test" )
5229 // this === "zombie"; handler unbound after first click
5230 .on( "click", $.proxy( me.test, me ) )
5231
5232 // this === "person"
5233 .on( "click", youClick )
5234
5235 // this === "zombie"
5236 .on( "click", $.proxy( you.test, me ) )
5237
5238 // this === "<button> element"
5239 .on( "click", you.test );
5240</script>
5241
5242</body>
5243</html>
5244```
5245 * @example ​ ````Change the context of a function bound to the click handler,
5246```html
5247<!doctype html>
5248<html lang="en">
5249<head>
5250 <meta charset="utf-8">
5251 <title>jQuery.proxy demo</title>
5252 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5253</head>
5254<body>
5255
5256<p><button type="button" id="test">Test</button></p>
5257<div id="log"></div>
5258
5259<script>
5260var me = {
5261 // I'm a dog
5262 type: "dog",
5263
5264 // Note that event comes *after* one and two
5265 test: function( one, two, event ) {
5266 $( "#log" )
5267
5268 // `one` maps to `you`, the 1st additional
5269 // argument in the $.proxy function call
5270 .append( "<h3>Hello " + one.type + ":</h3>" )
5271
5272 // The `this` keyword refers to `me`
5273 // (the 2nd, context, argument of $.proxy)
5274 .append( "I am a " + this.type + ", " )
5275
5276 // `two` maps to `they`, the 2nd additional
5277 // argument in the $.proxy function call
5278 .append( "and they are " + two.type + ".<br>" )
5279
5280 // The event type is "click"
5281 .append( "Thanks for " + event.type + "ing." )
5282
5283 // The clicked element is `event.target`,
5284 // and its type is "button"
5285 .append( "the " + event.target.type + "." );
5286 }
5287};
5288
5289var you = { type: "cat" };
5290var they = { type: "fish" };
5291
5292// Set up handler to execute me.test() in the context
5293// of `me`, with `you` and `they` as additional arguments
5294var proxy = $.proxy( me.test, me, you, they );
5295
5296$( "#test" )
5297 .on( "click", proxy );
5298</script>
5299
5300</body>
5301</html>
5302```
5303 */
5304 proxy<TContext,
5305 TReturn,
5306 A, B, C, D, E, F,
5307 T>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
5308 t: T) => TReturn,
5309 context: TContext,
5310 a: A, b: B, c: C, d: D, e: E, f: F): (t: T) => TReturn;
5311 /**
5312 * Takes a function and returns a new one that will always have a particular context.
5313 * @param funсtion The function whose context will be changed.
5314 * @param context The object to which the context (`this`) of the function should be set.
5315 * @param a An argument to be passed to the function referenced in the `function` argument.
5316 * @param b An argument to be passed to the function referenced in the `function` argument.
5317 * @param c An argument to be passed to the function referenced in the `function` argument.
5318 * @param d An argument to be passed to the function referenced in the `function` argument.
5319 * @param e An argument to be passed to the function referenced in the `function` argument.
5320 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5321 * @since 1.4
5322 * @since 1.6
5323 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5324 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
5325```html
5326<!doctype html>
5327<html lang="en">
5328<head>
5329 <meta charset="utf-8">
5330 <title>jQuery.proxy demo</title>
5331 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5332</head>
5333<body>
5334
5335<p><button type="button" id="test">Test</button></p>
5336<div id="log"></div>
5337
5338<script>
5339var me = {
5340 type: "zombie",
5341 test: function( event ) {
5342 // Without proxy, `this` would refer to the event target
5343 // use event.target to reference that element.
5344 var element = event.target;
5345 $( element ).css( "background-color", "red" );
5346
5347 // With proxy, `this` refers to the me object encapsulating
5348 // this function.
5349 $( "#log" ).append( "Hello " + this.type + "<br>" );
5350 $( "#test" ).off( "click", this.test );
5351 }
5352};
5353
5354var you = {
5355 type: "person",
5356 test: function( event ) {
5357 $( "#log" ).append( this.type + " " );
5358 }
5359};
5360
5361// Execute you.test() in the context of the `you` object
5362// no matter where it is called
5363// i.e. the `this` keyword will refer to `you`
5364var youClick = $.proxy( you.test, you );
5365
5366// attach click handlers to #test
5367$( "#test" )
5368 // this === "zombie"; handler unbound after first click
5369 .on( "click", $.proxy( me.test, me ) )
5370
5371 // this === "person"
5372 .on( "click", youClick )
5373
5374 // this === "zombie"
5375 .on( "click", $.proxy( you.test, me ) )
5376
5377 // this === "<button> element"
5378 .on( "click", you.test );
5379</script>
5380
5381</body>
5382</html>
5383```
5384 * @example ​ ````Change the context of a function bound to the click handler,
5385```html
5386<!doctype html>
5387<html lang="en">
5388<head>
5389 <meta charset="utf-8">
5390 <title>jQuery.proxy demo</title>
5391 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5392</head>
5393<body>
5394
5395<p><button type="button" id="test">Test</button></p>
5396<div id="log"></div>
5397
5398<script>
5399var me = {
5400 // I'm a dog
5401 type: "dog",
5402
5403 // Note that event comes *after* one and two
5404 test: function( one, two, event ) {
5405 $( "#log" )
5406
5407 // `one` maps to `you`, the 1st additional
5408 // argument in the $.proxy function call
5409 .append( "<h3>Hello " + one.type + ":</h3>" )
5410
5411 // The `this` keyword refers to `me`
5412 // (the 2nd, context, argument of $.proxy)
5413 .append( "I am a " + this.type + ", " )
5414
5415 // `two` maps to `they`, the 2nd additional
5416 // argument in the $.proxy function call
5417 .append( "and they are " + two.type + ".<br>" )
5418
5419 // The event type is "click"
5420 .append( "Thanks for " + event.type + "ing." )
5421
5422 // The clicked element is `event.target`,
5423 // and its type is "button"
5424 .append( "the " + event.target.type + "." );
5425 }
5426};
5427
5428var you = { type: "cat" };
5429var they = { type: "fish" };
5430
5431// Set up handler to execute me.test() in the context
5432// of `me`, with `you` and `they` as additional arguments
5433var proxy = $.proxy( me.test, me, you, they );
5434
5435$( "#test" )
5436 .on( "click", proxy );
5437</script>
5438
5439</body>
5440</html>
5441```
5442 */
5443 proxy<TContext,
5444 TReturn,
5445 A, B, C, D, E,
5446 T>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
5447 t: T) => TReturn,
5448 context: TContext,
5449 a: A, b: B, c: C, d: D, e: E): (t: T) => TReturn;
5450 /**
5451 * Takes a function and returns a new one that will always have a particular context.
5452 * @param funсtion The function whose context will be changed.
5453 * @param context The object to which the context (`this`) of the function should be set.
5454 * @param a An argument to be passed to the function referenced in the `function` argument.
5455 * @param b An argument to be passed to the function referenced in the `function` argument.
5456 * @param c An argument to be passed to the function referenced in the `function` argument.
5457 * @param d An argument to be passed to the function referenced in the `function` argument.
5458 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5459 * @since 1.4
5460 * @since 1.6
5461 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5462 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
5463```html
5464<!doctype html>
5465<html lang="en">
5466<head>
5467 <meta charset="utf-8">
5468 <title>jQuery.proxy demo</title>
5469 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5470</head>
5471<body>
5472
5473<p><button type="button" id="test">Test</button></p>
5474<div id="log"></div>
5475
5476<script>
5477var me = {
5478 type: "zombie",
5479 test: function( event ) {
5480 // Without proxy, `this` would refer to the event target
5481 // use event.target to reference that element.
5482 var element = event.target;
5483 $( element ).css( "background-color", "red" );
5484
5485 // With proxy, `this` refers to the me object encapsulating
5486 // this function.
5487 $( "#log" ).append( "Hello " + this.type + "<br>" );
5488 $( "#test" ).off( "click", this.test );
5489 }
5490};
5491
5492var you = {
5493 type: "person",
5494 test: function( event ) {
5495 $( "#log" ).append( this.type + " " );
5496 }
5497};
5498
5499// Execute you.test() in the context of the `you` object
5500// no matter where it is called
5501// i.e. the `this` keyword will refer to `you`
5502var youClick = $.proxy( you.test, you );
5503
5504// attach click handlers to #test
5505$( "#test" )
5506 // this === "zombie"; handler unbound after first click
5507 .on( "click", $.proxy( me.test, me ) )
5508
5509 // this === "person"
5510 .on( "click", youClick )
5511
5512 // this === "zombie"
5513 .on( "click", $.proxy( you.test, me ) )
5514
5515 // this === "<button> element"
5516 .on( "click", you.test );
5517</script>
5518
5519</body>
5520</html>
5521```
5522 * @example ​ ````Change the context of a function bound to the click handler,
5523```html
5524<!doctype html>
5525<html lang="en">
5526<head>
5527 <meta charset="utf-8">
5528 <title>jQuery.proxy demo</title>
5529 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5530</head>
5531<body>
5532
5533<p><button type="button" id="test">Test</button></p>
5534<div id="log"></div>
5535
5536<script>
5537var me = {
5538 // I'm a dog
5539 type: "dog",
5540
5541 // Note that event comes *after* one and two
5542 test: function( one, two, event ) {
5543 $( "#log" )
5544
5545 // `one` maps to `you`, the 1st additional
5546 // argument in the $.proxy function call
5547 .append( "<h3>Hello " + one.type + ":</h3>" )
5548
5549 // The `this` keyword refers to `me`
5550 // (the 2nd, context, argument of $.proxy)
5551 .append( "I am a " + this.type + ", " )
5552
5553 // `two` maps to `they`, the 2nd additional
5554 // argument in the $.proxy function call
5555 .append( "and they are " + two.type + ".<br>" )
5556
5557 // The event type is "click"
5558 .append( "Thanks for " + event.type + "ing." )
5559
5560 // The clicked element is `event.target`,
5561 // and its type is "button"
5562 .append( "the " + event.target.type + "." );
5563 }
5564};
5565
5566var you = { type: "cat" };
5567var they = { type: "fish" };
5568
5569// Set up handler to execute me.test() in the context
5570// of `me`, with `you` and `they` as additional arguments
5571var proxy = $.proxy( me.test, me, you, they );
5572
5573$( "#test" )
5574 .on( "click", proxy );
5575</script>
5576
5577</body>
5578</html>
5579```
5580 */
5581 proxy<TContext,
5582 TReturn,
5583 A, B, C, D,
5584 T>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
5585 t: T) => TReturn,
5586 context: TContext,
5587 a: A, b: B, c: C, d: D): (t: T) => TReturn;
5588 /**
5589 * Takes a function and returns a new one that will always have a particular context.
5590 * @param funсtion The function whose context will be changed.
5591 * @param context The object to which the context (`this`) of the function should be set.
5592 * @param a An argument to be passed to the function referenced in the `function` argument.
5593 * @param b An argument to be passed to the function referenced in the `function` argument.
5594 * @param c An argument to be passed to the function referenced in the `function` argument.
5595 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5596 * @since 1.4
5597 * @since 1.6
5598 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5599 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
5600```html
5601<!doctype html>
5602<html lang="en">
5603<head>
5604 <meta charset="utf-8">
5605 <title>jQuery.proxy demo</title>
5606 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5607</head>
5608<body>
5609
5610<p><button type="button" id="test">Test</button></p>
5611<div id="log"></div>
5612
5613<script>
5614var me = {
5615 type: "zombie",
5616 test: function( event ) {
5617 // Without proxy, `this` would refer to the event target
5618 // use event.target to reference that element.
5619 var element = event.target;
5620 $( element ).css( "background-color", "red" );
5621
5622 // With proxy, `this` refers to the me object encapsulating
5623 // this function.
5624 $( "#log" ).append( "Hello " + this.type + "<br>" );
5625 $( "#test" ).off( "click", this.test );
5626 }
5627};
5628
5629var you = {
5630 type: "person",
5631 test: function( event ) {
5632 $( "#log" ).append( this.type + " " );
5633 }
5634};
5635
5636// Execute you.test() in the context of the `you` object
5637// no matter where it is called
5638// i.e. the `this` keyword will refer to `you`
5639var youClick = $.proxy( you.test, you );
5640
5641// attach click handlers to #test
5642$( "#test" )
5643 // this === "zombie"; handler unbound after first click
5644 .on( "click", $.proxy( me.test, me ) )
5645
5646 // this === "person"
5647 .on( "click", youClick )
5648
5649 // this === "zombie"
5650 .on( "click", $.proxy( you.test, me ) )
5651
5652 // this === "<button> element"
5653 .on( "click", you.test );
5654</script>
5655
5656</body>
5657</html>
5658```
5659 * @example ​ ````Change the context of a function bound to the click handler,
5660```html
5661<!doctype html>
5662<html lang="en">
5663<head>
5664 <meta charset="utf-8">
5665 <title>jQuery.proxy demo</title>
5666 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5667</head>
5668<body>
5669
5670<p><button type="button" id="test">Test</button></p>
5671<div id="log"></div>
5672
5673<script>
5674var me = {
5675 // I'm a dog
5676 type: "dog",
5677
5678 // Note that event comes *after* one and two
5679 test: function( one, two, event ) {
5680 $( "#log" )
5681
5682 // `one` maps to `you`, the 1st additional
5683 // argument in the $.proxy function call
5684 .append( "<h3>Hello " + one.type + ":</h3>" )
5685
5686 // The `this` keyword refers to `me`
5687 // (the 2nd, context, argument of $.proxy)
5688 .append( "I am a " + this.type + ", " )
5689
5690 // `two` maps to `they`, the 2nd additional
5691 // argument in the $.proxy function call
5692 .append( "and they are " + two.type + ".<br>" )
5693
5694 // The event type is "click"
5695 .append( "Thanks for " + event.type + "ing." )
5696
5697 // The clicked element is `event.target`,
5698 // and its type is "button"
5699 .append( "the " + event.target.type + "." );
5700 }
5701};
5702
5703var you = { type: "cat" };
5704var they = { type: "fish" };
5705
5706// Set up handler to execute me.test() in the context
5707// of `me`, with `you` and `they` as additional arguments
5708var proxy = $.proxy( me.test, me, you, they );
5709
5710$( "#test" )
5711 .on( "click", proxy );
5712</script>
5713
5714</body>
5715</html>
5716```
5717 */
5718 proxy<TContext,
5719 TReturn,
5720 A, B, C,
5721 T>(funсtion: (this: TContext, a: A, b: B, c: C,
5722 t: T) => TReturn,
5723 context: TContext,
5724 a: A, b: B, c: C): (t: T) => TReturn;
5725 /**
5726 * Takes a function and returns a new one that will always have a particular context.
5727 * @param funсtion The function whose context will be changed.
5728 * @param context The object to which the context (`this`) of the function should be set.
5729 * @param a An argument to be passed to the function referenced in the `function` argument.
5730 * @param b An argument to be passed to the function referenced in the `function` argument.
5731 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5732 * @since 1.4
5733 * @since 1.6
5734 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5735 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
5736```html
5737<!doctype html>
5738<html lang="en">
5739<head>
5740 <meta charset="utf-8">
5741 <title>jQuery.proxy demo</title>
5742 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5743</head>
5744<body>
5745
5746<p><button type="button" id="test">Test</button></p>
5747<div id="log"></div>
5748
5749<script>
5750var me = {
5751 type: "zombie",
5752 test: function( event ) {
5753 // Without proxy, `this` would refer to the event target
5754 // use event.target to reference that element.
5755 var element = event.target;
5756 $( element ).css( "background-color", "red" );
5757
5758 // With proxy, `this` refers to the me object encapsulating
5759 // this function.
5760 $( "#log" ).append( "Hello " + this.type + "<br>" );
5761 $( "#test" ).off( "click", this.test );
5762 }
5763};
5764
5765var you = {
5766 type: "person",
5767 test: function( event ) {
5768 $( "#log" ).append( this.type + " " );
5769 }
5770};
5771
5772// Execute you.test() in the context of the `you` object
5773// no matter where it is called
5774// i.e. the `this` keyword will refer to `you`
5775var youClick = $.proxy( you.test, you );
5776
5777// attach click handlers to #test
5778$( "#test" )
5779 // this === "zombie"; handler unbound after first click
5780 .on( "click", $.proxy( me.test, me ) )
5781
5782 // this === "person"
5783 .on( "click", youClick )
5784
5785 // this === "zombie"
5786 .on( "click", $.proxy( you.test, me ) )
5787
5788 // this === "<button> element"
5789 .on( "click", you.test );
5790</script>
5791
5792</body>
5793</html>
5794```
5795 * @example ​ ````Change the context of a function bound to the click handler,
5796```html
5797<!doctype html>
5798<html lang="en">
5799<head>
5800 <meta charset="utf-8">
5801 <title>jQuery.proxy demo</title>
5802 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5803</head>
5804<body>
5805
5806<p><button type="button" id="test">Test</button></p>
5807<div id="log"></div>
5808
5809<script>
5810var me = {
5811 // I'm a dog
5812 type: "dog",
5813
5814 // Note that event comes *after* one and two
5815 test: function( one, two, event ) {
5816 $( "#log" )
5817
5818 // `one` maps to `you`, the 1st additional
5819 // argument in the $.proxy function call
5820 .append( "<h3>Hello " + one.type + ":</h3>" )
5821
5822 // The `this` keyword refers to `me`
5823 // (the 2nd, context, argument of $.proxy)
5824 .append( "I am a " + this.type + ", " )
5825
5826 // `two` maps to `they`, the 2nd additional
5827 // argument in the $.proxy function call
5828 .append( "and they are " + two.type + ".<br>" )
5829
5830 // The event type is "click"
5831 .append( "Thanks for " + event.type + "ing." )
5832
5833 // The clicked element is `event.target`,
5834 // and its type is "button"
5835 .append( "the " + event.target.type + "." );
5836 }
5837};
5838
5839var you = { type: "cat" };
5840var they = { type: "fish" };
5841
5842// Set up handler to execute me.test() in the context
5843// of `me`, with `you` and `they` as additional arguments
5844var proxy = $.proxy( me.test, me, you, they );
5845
5846$( "#test" )
5847 .on( "click", proxy );
5848</script>
5849
5850</body>
5851</html>
5852```
5853 */
5854 proxy<TContext,
5855 TReturn,
5856 A, B,
5857 T>(funсtion: (this: TContext, a: A, b: B,
5858 t: T) => TReturn,
5859 context: TContext,
5860 a: A, b: B): (t: T) => TReturn;
5861 /**
5862 * Takes a function and returns a new one that will always have a particular context.
5863 * @param funсtion The function whose context will be changed.
5864 * @param context The object to which the context (`this`) of the function should be set.
5865 * @param a An argument to be passed to the function referenced in the `function` argument.
5866 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5867 * @since 1.4
5868 * @since 1.6
5869 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5870 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
5871```html
5872<!doctype html>
5873<html lang="en">
5874<head>
5875 <meta charset="utf-8">
5876 <title>jQuery.proxy demo</title>
5877 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5878</head>
5879<body>
5880
5881<p><button type="button" id="test">Test</button></p>
5882<div id="log"></div>
5883
5884<script>
5885var me = {
5886 type: "zombie",
5887 test: function( event ) {
5888 // Without proxy, `this` would refer to the event target
5889 // use event.target to reference that element.
5890 var element = event.target;
5891 $( element ).css( "background-color", "red" );
5892
5893 // With proxy, `this` refers to the me object encapsulating
5894 // this function.
5895 $( "#log" ).append( "Hello " + this.type + "<br>" );
5896 $( "#test" ).off( "click", this.test );
5897 }
5898};
5899
5900var you = {
5901 type: "person",
5902 test: function( event ) {
5903 $( "#log" ).append( this.type + " " );
5904 }
5905};
5906
5907// Execute you.test() in the context of the `you` object
5908// no matter where it is called
5909// i.e. the `this` keyword will refer to `you`
5910var youClick = $.proxy( you.test, you );
5911
5912// attach click handlers to #test
5913$( "#test" )
5914 // this === "zombie"; handler unbound after first click
5915 .on( "click", $.proxy( me.test, me ) )
5916
5917 // this === "person"
5918 .on( "click", youClick )
5919
5920 // this === "zombie"
5921 .on( "click", $.proxy( you.test, me ) )
5922
5923 // this === "<button> element"
5924 .on( "click", you.test );
5925</script>
5926
5927</body>
5928</html>
5929```
5930 * @example ​ ````Change the context of a function bound to the click handler,
5931```html
5932<!doctype html>
5933<html lang="en">
5934<head>
5935 <meta charset="utf-8">
5936 <title>jQuery.proxy demo</title>
5937 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5938</head>
5939<body>
5940
5941<p><button type="button" id="test">Test</button></p>
5942<div id="log"></div>
5943
5944<script>
5945var me = {
5946 // I'm a dog
5947 type: "dog",
5948
5949 // Note that event comes *after* one and two
5950 test: function( one, two, event ) {
5951 $( "#log" )
5952
5953 // `one` maps to `you`, the 1st additional
5954 // argument in the $.proxy function call
5955 .append( "<h3>Hello " + one.type + ":</h3>" )
5956
5957 // The `this` keyword refers to `me`
5958 // (the 2nd, context, argument of $.proxy)
5959 .append( "I am a " + this.type + ", " )
5960
5961 // `two` maps to `they`, the 2nd additional
5962 // argument in the $.proxy function call
5963 .append( "and they are " + two.type + ".<br>" )
5964
5965 // The event type is "click"
5966 .append( "Thanks for " + event.type + "ing." )
5967
5968 // The clicked element is `event.target`,
5969 // and its type is "button"
5970 .append( "the " + event.target.type + "." );
5971 }
5972};
5973
5974var you = { type: "cat" };
5975var they = { type: "fish" };
5976
5977// Set up handler to execute me.test() in the context
5978// of `me`, with `you` and `they` as additional arguments
5979var proxy = $.proxy( me.test, me, you, they );
5980
5981$( "#test" )
5982 .on( "click", proxy );
5983</script>
5984
5985</body>
5986</html>
5987```
5988 */
5989 proxy<TContext,
5990 TReturn,
5991 A,
5992 T>(funсtion: (this: TContext, a: A,
5993 t: T) => TReturn,
5994 context: TContext,
5995 a: A): (t: T) => TReturn;
5996 /**
5997 * Takes a function and returns a new one that will always have a particular context.
5998 * @param funсtion The function whose context will be changed.
5999 * @param context The object to which the context (`this`) of the function should be set.
6000 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6001 * @since 1.4
6002 * @since 1.6
6003 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6004 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
6005```html
6006<!doctype html>
6007<html lang="en">
6008<head>
6009 <meta charset="utf-8">
6010 <title>jQuery.proxy demo</title>
6011 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6012</head>
6013<body>
6014
6015<p><button type="button" id="test">Test</button></p>
6016<div id="log"></div>
6017
6018<script>
6019var me = {
6020 type: "zombie",
6021 test: function( event ) {
6022 // Without proxy, `this` would refer to the event target
6023 // use event.target to reference that element.
6024 var element = event.target;
6025 $( element ).css( "background-color", "red" );
6026
6027 // With proxy, `this` refers to the me object encapsulating
6028 // this function.
6029 $( "#log" ).append( "Hello " + this.type + "<br>" );
6030 $( "#test" ).off( "click", this.test );
6031 }
6032};
6033
6034var you = {
6035 type: "person",
6036 test: function( event ) {
6037 $( "#log" ).append( this.type + " " );
6038 }
6039};
6040
6041// Execute you.test() in the context of the `you` object
6042// no matter where it is called
6043// i.e. the `this` keyword will refer to `you`
6044var youClick = $.proxy( you.test, you );
6045
6046// attach click handlers to #test
6047$( "#test" )
6048 // this === "zombie"; handler unbound after first click
6049 .on( "click", $.proxy( me.test, me ) )
6050
6051 // this === "person"
6052 .on( "click", youClick )
6053
6054 // this === "zombie"
6055 .on( "click", $.proxy( you.test, me ) )
6056
6057 // this === "<button> element"
6058 .on( "click", you.test );
6059</script>
6060
6061</body>
6062</html>
6063```
6064 * @example ​ ````Change the context of a function bound to the click handler,
6065```html
6066<!doctype html>
6067<html lang="en">
6068<head>
6069 <meta charset="utf-8">
6070 <title>jQuery.proxy demo</title>
6071 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6072</head>
6073<body>
6074
6075<p><button type="button" id="test">Test</button></p>
6076<div id="log"></div>
6077
6078<script>
6079var me = {
6080 // I'm a dog
6081 type: "dog",
6082
6083 // Note that event comes *after* one and two
6084 test: function( one, two, event ) {
6085 $( "#log" )
6086
6087 // `one` maps to `you`, the 1st additional
6088 // argument in the $.proxy function call
6089 .append( "<h3>Hello " + one.type + ":</h3>" )
6090
6091 // The `this` keyword refers to `me`
6092 // (the 2nd, context, argument of $.proxy)
6093 .append( "I am a " + this.type + ", " )
6094
6095 // `two` maps to `they`, the 2nd additional
6096 // argument in the $.proxy function call
6097 .append( "and they are " + two.type + ".<br>" )
6098
6099 // The event type is "click"
6100 .append( "Thanks for " + event.type + "ing." )
6101
6102 // The clicked element is `event.target`,
6103 // and its type is "button"
6104 .append( "the " + event.target.type + "." );
6105 }
6106};
6107
6108var you = { type: "cat" };
6109var they = { type: "fish" };
6110
6111// Set up handler to execute me.test() in the context
6112// of `me`, with `you` and `they` as additional arguments
6113var proxy = $.proxy( me.test, me, you, they );
6114
6115$( "#test" )
6116 .on( "click", proxy );
6117</script>
6118
6119</body>
6120</html>
6121```
6122 */
6123 proxy<TContext,
6124 TReturn,
6125 T>(funсtion: (this: TContext, t: T) => TReturn,
6126 context: TContext): (t: T) => TReturn;
6127
6128 // #endregion
6129
6130 // region 2 parameters
6131 // #region 2 parameters
6132
6133 /**
6134 * Takes a function and returns a new one that will always have a particular context.
6135 * @param funсtion The function whose context will be changed.
6136 * @param context The object to which the context (`this`) of the function should be set.
6137 * @param a An argument to be passed to the function referenced in the `function` argument.
6138 * @param b An argument to be passed to the function referenced in the `function` argument.
6139 * @param c An argument to be passed to the function referenced in the `function` argument.
6140 * @param d An argument to be passed to the function referenced in the `function` argument.
6141 * @param e An argument to be passed to the function referenced in the `function` argument.
6142 * @param f An argument to be passed to the function referenced in the `function` argument.
6143 * @param g An argument to be passed to the function referenced in the `function` argument.
6144 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6145 * @since 1.4
6146 * @since 1.6
6147 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6148 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
6149```html
6150<!doctype html>
6151<html lang="en">
6152<head>
6153 <meta charset="utf-8">
6154 <title>jQuery.proxy demo</title>
6155 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6156</head>
6157<body>
6158
6159<p><button type="button" id="test">Test</button></p>
6160<div id="log"></div>
6161
6162<script>
6163var me = {
6164 type: "zombie",
6165 test: function( event ) {
6166 // Without proxy, `this` would refer to the event target
6167 // use event.target to reference that element.
6168 var element = event.target;
6169 $( element ).css( "background-color", "red" );
6170
6171 // With proxy, `this` refers to the me object encapsulating
6172 // this function.
6173 $( "#log" ).append( "Hello " + this.type + "<br>" );
6174 $( "#test" ).off( "click", this.test );
6175 }
6176};
6177
6178var you = {
6179 type: "person",
6180 test: function( event ) {
6181 $( "#log" ).append( this.type + " " );
6182 }
6183};
6184
6185// Execute you.test() in the context of the `you` object
6186// no matter where it is called
6187// i.e. the `this` keyword will refer to `you`
6188var youClick = $.proxy( you.test, you );
6189
6190// attach click handlers to #test
6191$( "#test" )
6192 // this === "zombie"; handler unbound after first click
6193 .on( "click", $.proxy( me.test, me ) )
6194
6195 // this === "person"
6196 .on( "click", youClick )
6197
6198 // this === "zombie"
6199 .on( "click", $.proxy( you.test, me ) )
6200
6201 // this === "<button> element"
6202 .on( "click", you.test );
6203</script>
6204
6205</body>
6206</html>
6207```
6208 * @example ​ ````Change the context of a function bound to the click handler,
6209```html
6210<!doctype html>
6211<html lang="en">
6212<head>
6213 <meta charset="utf-8">
6214 <title>jQuery.proxy demo</title>
6215 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6216</head>
6217<body>
6218
6219<p><button type="button" id="test">Test</button></p>
6220<div id="log"></div>
6221
6222<script>
6223var me = {
6224 // I'm a dog
6225 type: "dog",
6226
6227 // Note that event comes *after* one and two
6228 test: function( one, two, event ) {
6229 $( "#log" )
6230
6231 // `one` maps to `you`, the 1st additional
6232 // argument in the $.proxy function call
6233 .append( "<h3>Hello " + one.type + ":</h3>" )
6234
6235 // The `this` keyword refers to `me`
6236 // (the 2nd, context, argument of $.proxy)
6237 .append( "I am a " + this.type + ", " )
6238
6239 // `two` maps to `they`, the 2nd additional
6240 // argument in the $.proxy function call
6241 .append( "and they are " + two.type + ".<br>" )
6242
6243 // The event type is "click"
6244 .append( "Thanks for " + event.type + "ing." )
6245
6246 // The clicked element is `event.target`,
6247 // and its type is "button"
6248 .append( "the " + event.target.type + "." );
6249 }
6250};
6251
6252var you = { type: "cat" };
6253var they = { type: "fish" };
6254
6255// Set up handler to execute me.test() in the context
6256// of `me`, with `you` and `they` as additional arguments
6257var proxy = $.proxy( me.test, me, you, they );
6258
6259$( "#test" )
6260 .on( "click", proxy );
6261</script>
6262
6263</body>
6264</html>
6265```
6266 */
6267 proxy<TContext,
6268 TReturn,
6269 A, B, C, D, E, F, G,
6270 T, U>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
6271 t: T, u: U) => TReturn,
6272 context: TContext,
6273 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U) => TReturn;
6274 /**
6275 * Takes a function and returns a new one that will always have a particular context.
6276 * @param funсtion The function whose context will be changed.
6277 * @param context The object to which the context (`this`) of the function should be set.
6278 * @param a An argument to be passed to the function referenced in the `function` argument.
6279 * @param b An argument to be passed to the function referenced in the `function` argument.
6280 * @param c An argument to be passed to the function referenced in the `function` argument.
6281 * @param d An argument to be passed to the function referenced in the `function` argument.
6282 * @param e An argument to be passed to the function referenced in the `function` argument.
6283 * @param f An argument to be passed to the function referenced in the `function` argument.
6284 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6285 * @since 1.4
6286 * @since 1.6
6287 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6288 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
6289```html
6290<!doctype html>
6291<html lang="en">
6292<head>
6293 <meta charset="utf-8">
6294 <title>jQuery.proxy demo</title>
6295 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6296</head>
6297<body>
6298
6299<p><button type="button" id="test">Test</button></p>
6300<div id="log"></div>
6301
6302<script>
6303var me = {
6304 type: "zombie",
6305 test: function( event ) {
6306 // Without proxy, `this` would refer to the event target
6307 // use event.target to reference that element.
6308 var element = event.target;
6309 $( element ).css( "background-color", "red" );
6310
6311 // With proxy, `this` refers to the me object encapsulating
6312 // this function.
6313 $( "#log" ).append( "Hello " + this.type + "<br>" );
6314 $( "#test" ).off( "click", this.test );
6315 }
6316};
6317
6318var you = {
6319 type: "person",
6320 test: function( event ) {
6321 $( "#log" ).append( this.type + " " );
6322 }
6323};
6324
6325// Execute you.test() in the context of the `you` object
6326// no matter where it is called
6327// i.e. the `this` keyword will refer to `you`
6328var youClick = $.proxy( you.test, you );
6329
6330// attach click handlers to #test
6331$( "#test" )
6332 // this === "zombie"; handler unbound after first click
6333 .on( "click", $.proxy( me.test, me ) )
6334
6335 // this === "person"
6336 .on( "click", youClick )
6337
6338 // this === "zombie"
6339 .on( "click", $.proxy( you.test, me ) )
6340
6341 // this === "<button> element"
6342 .on( "click", you.test );
6343</script>
6344
6345</body>
6346</html>
6347```
6348 * @example ​ ````Change the context of a function bound to the click handler,
6349```html
6350<!doctype html>
6351<html lang="en">
6352<head>
6353 <meta charset="utf-8">
6354 <title>jQuery.proxy demo</title>
6355 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6356</head>
6357<body>
6358
6359<p><button type="button" id="test">Test</button></p>
6360<div id="log"></div>
6361
6362<script>
6363var me = {
6364 // I'm a dog
6365 type: "dog",
6366
6367 // Note that event comes *after* one and two
6368 test: function( one, two, event ) {
6369 $( "#log" )
6370
6371 // `one` maps to `you`, the 1st additional
6372 // argument in the $.proxy function call
6373 .append( "<h3>Hello " + one.type + ":</h3>" )
6374
6375 // The `this` keyword refers to `me`
6376 // (the 2nd, context, argument of $.proxy)
6377 .append( "I am a " + this.type + ", " )
6378
6379 // `two` maps to `they`, the 2nd additional
6380 // argument in the $.proxy function call
6381 .append( "and they are " + two.type + ".<br>" )
6382
6383 // The event type is "click"
6384 .append( "Thanks for " + event.type + "ing." )
6385
6386 // The clicked element is `event.target`,
6387 // and its type is "button"
6388 .append( "the " + event.target.type + "." );
6389 }
6390};
6391
6392var you = { type: "cat" };
6393var they = { type: "fish" };
6394
6395// Set up handler to execute me.test() in the context
6396// of `me`, with `you` and `they` as additional arguments
6397var proxy = $.proxy( me.test, me, you, they );
6398
6399$( "#test" )
6400 .on( "click", proxy );
6401</script>
6402
6403</body>
6404</html>
6405```
6406 */
6407 proxy<TContext,
6408 TReturn,
6409 A, B, C, D, E, F,
6410 T, U>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
6411 t: T, u: U) => TReturn,
6412 context: TContext,
6413 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U) => TReturn;
6414 /**
6415 * Takes a function and returns a new one that will always have a particular context.
6416 * @param funсtion The function whose context will be changed.
6417 * @param context The object to which the context (`this`) of the function should be set.
6418 * @param a An argument to be passed to the function referenced in the `function` argument.
6419 * @param b An argument to be passed to the function referenced in the `function` argument.
6420 * @param c An argument to be passed to the function referenced in the `function` argument.
6421 * @param d An argument to be passed to the function referenced in the `function` argument.
6422 * @param e An argument to be passed to the function referenced in the `function` argument.
6423 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6424 * @since 1.4
6425 * @since 1.6
6426 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6427 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
6428```html
6429<!doctype html>
6430<html lang="en">
6431<head>
6432 <meta charset="utf-8">
6433 <title>jQuery.proxy demo</title>
6434 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6435</head>
6436<body>
6437
6438<p><button type="button" id="test">Test</button></p>
6439<div id="log"></div>
6440
6441<script>
6442var me = {
6443 type: "zombie",
6444 test: function( event ) {
6445 // Without proxy, `this` would refer to the event target
6446 // use event.target to reference that element.
6447 var element = event.target;
6448 $( element ).css( "background-color", "red" );
6449
6450 // With proxy, `this` refers to the me object encapsulating
6451 // this function.
6452 $( "#log" ).append( "Hello " + this.type + "<br>" );
6453 $( "#test" ).off( "click", this.test );
6454 }
6455};
6456
6457var you = {
6458 type: "person",
6459 test: function( event ) {
6460 $( "#log" ).append( this.type + " " );
6461 }
6462};
6463
6464// Execute you.test() in the context of the `you` object
6465// no matter where it is called
6466// i.e. the `this` keyword will refer to `you`
6467var youClick = $.proxy( you.test, you );
6468
6469// attach click handlers to #test
6470$( "#test" )
6471 // this === "zombie"; handler unbound after first click
6472 .on( "click", $.proxy( me.test, me ) )
6473
6474 // this === "person"
6475 .on( "click", youClick )
6476
6477 // this === "zombie"
6478 .on( "click", $.proxy( you.test, me ) )
6479
6480 // this === "<button> element"
6481 .on( "click", you.test );
6482</script>
6483
6484</body>
6485</html>
6486```
6487 * @example ​ ````Change the context of a function bound to the click handler,
6488```html
6489<!doctype html>
6490<html lang="en">
6491<head>
6492 <meta charset="utf-8">
6493 <title>jQuery.proxy demo</title>
6494 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6495</head>
6496<body>
6497
6498<p><button type="button" id="test">Test</button></p>
6499<div id="log"></div>
6500
6501<script>
6502var me = {
6503 // I'm a dog
6504 type: "dog",
6505
6506 // Note that event comes *after* one and two
6507 test: function( one, two, event ) {
6508 $( "#log" )
6509
6510 // `one` maps to `you`, the 1st additional
6511 // argument in the $.proxy function call
6512 .append( "<h3>Hello " + one.type + ":</h3>" )
6513
6514 // The `this` keyword refers to `me`
6515 // (the 2nd, context, argument of $.proxy)
6516 .append( "I am a " + this.type + ", " )
6517
6518 // `two` maps to `they`, the 2nd additional
6519 // argument in the $.proxy function call
6520 .append( "and they are " + two.type + ".<br>" )
6521
6522 // The event type is "click"
6523 .append( "Thanks for " + event.type + "ing." )
6524
6525 // The clicked element is `event.target`,
6526 // and its type is "button"
6527 .append( "the " + event.target.type + "." );
6528 }
6529};
6530
6531var you = { type: "cat" };
6532var they = { type: "fish" };
6533
6534// Set up handler to execute me.test() in the context
6535// of `me`, with `you` and `they` as additional arguments
6536var proxy = $.proxy( me.test, me, you, they );
6537
6538$( "#test" )
6539 .on( "click", proxy );
6540</script>
6541
6542</body>
6543</html>
6544```
6545 */
6546 proxy<TContext,
6547 TReturn,
6548 A, B, C, D, E,
6549 T, U>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
6550 t: T, u: U) => TReturn,
6551 context: TContext,
6552 a: A, b: B, c: C, d: D, e: E): (t: T, u: U) => TReturn;
6553 /**
6554 * Takes a function and returns a new one that will always have a particular context.
6555 * @param funсtion The function whose context will be changed.
6556 * @param context The object to which the context (`this`) of the function should be set.
6557 * @param a An argument to be passed to the function referenced in the `function` argument.
6558 * @param b An argument to be passed to the function referenced in the `function` argument.
6559 * @param c An argument to be passed to the function referenced in the `function` argument.
6560 * @param d An argument to be passed to the function referenced in the `function` argument.
6561 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6562 * @since 1.4
6563 * @since 1.6
6564 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6565 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
6566```html
6567<!doctype html>
6568<html lang="en">
6569<head>
6570 <meta charset="utf-8">
6571 <title>jQuery.proxy demo</title>
6572 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6573</head>
6574<body>
6575
6576<p><button type="button" id="test">Test</button></p>
6577<div id="log"></div>
6578
6579<script>
6580var me = {
6581 type: "zombie",
6582 test: function( event ) {
6583 // Without proxy, `this` would refer to the event target
6584 // use event.target to reference that element.
6585 var element = event.target;
6586 $( element ).css( "background-color", "red" );
6587
6588 // With proxy, `this` refers to the me object encapsulating
6589 // this function.
6590 $( "#log" ).append( "Hello " + this.type + "<br>" );
6591 $( "#test" ).off( "click", this.test );
6592 }
6593};
6594
6595var you = {
6596 type: "person",
6597 test: function( event ) {
6598 $( "#log" ).append( this.type + " " );
6599 }
6600};
6601
6602// Execute you.test() in the context of the `you` object
6603// no matter where it is called
6604// i.e. the `this` keyword will refer to `you`
6605var youClick = $.proxy( you.test, you );
6606
6607// attach click handlers to #test
6608$( "#test" )
6609 // this === "zombie"; handler unbound after first click
6610 .on( "click", $.proxy( me.test, me ) )
6611
6612 // this === "person"
6613 .on( "click", youClick )
6614
6615 // this === "zombie"
6616 .on( "click", $.proxy( you.test, me ) )
6617
6618 // this === "<button> element"
6619 .on( "click", you.test );
6620</script>
6621
6622</body>
6623</html>
6624```
6625 * @example ​ ````Change the context of a function bound to the click handler,
6626```html
6627<!doctype html>
6628<html lang="en">
6629<head>
6630 <meta charset="utf-8">
6631 <title>jQuery.proxy demo</title>
6632 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6633</head>
6634<body>
6635
6636<p><button type="button" id="test">Test</button></p>
6637<div id="log"></div>
6638
6639<script>
6640var me = {
6641 // I'm a dog
6642 type: "dog",
6643
6644 // Note that event comes *after* one and two
6645 test: function( one, two, event ) {
6646 $( "#log" )
6647
6648 // `one` maps to `you`, the 1st additional
6649 // argument in the $.proxy function call
6650 .append( "<h3>Hello " + one.type + ":</h3>" )
6651
6652 // The `this` keyword refers to `me`
6653 // (the 2nd, context, argument of $.proxy)
6654 .append( "I am a " + this.type + ", " )
6655
6656 // `two` maps to `they`, the 2nd additional
6657 // argument in the $.proxy function call
6658 .append( "and they are " + two.type + ".<br>" )
6659
6660 // The event type is "click"
6661 .append( "Thanks for " + event.type + "ing." )
6662
6663 // The clicked element is `event.target`,
6664 // and its type is "button"
6665 .append( "the " + event.target.type + "." );
6666 }
6667};
6668
6669var you = { type: "cat" };
6670var they = { type: "fish" };
6671
6672// Set up handler to execute me.test() in the context
6673// of `me`, with `you` and `they` as additional arguments
6674var proxy = $.proxy( me.test, me, you, they );
6675
6676$( "#test" )
6677 .on( "click", proxy );
6678</script>
6679
6680</body>
6681</html>
6682```
6683 */
6684 proxy<TContext,
6685 TReturn,
6686 A, B, C, D,
6687 T, U>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
6688 t: T, u: U) => TReturn,
6689 context: TContext,
6690 a: A, b: B, c: C, d: D): (t: T, u: U) => TReturn;
6691 /**
6692 * Takes a function and returns a new one that will always have a particular context.
6693 * @param funсtion The function whose context will be changed.
6694 * @param context The object to which the context (`this`) of the function should be set.
6695 * @param a An argument to be passed to the function referenced in the `function` argument.
6696 * @param b An argument to be passed to the function referenced in the `function` argument.
6697 * @param c An argument to be passed to the function referenced in the `function` argument.
6698 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6699 * @since 1.4
6700 * @since 1.6
6701 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6702 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
6703```html
6704<!doctype html>
6705<html lang="en">
6706<head>
6707 <meta charset="utf-8">
6708 <title>jQuery.proxy demo</title>
6709 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6710</head>
6711<body>
6712
6713<p><button type="button" id="test">Test</button></p>
6714<div id="log"></div>
6715
6716<script>
6717var me = {
6718 type: "zombie",
6719 test: function( event ) {
6720 // Without proxy, `this` would refer to the event target
6721 // use event.target to reference that element.
6722 var element = event.target;
6723 $( element ).css( "background-color", "red" );
6724
6725 // With proxy, `this` refers to the me object encapsulating
6726 // this function.
6727 $( "#log" ).append( "Hello " + this.type + "<br>" );
6728 $( "#test" ).off( "click", this.test );
6729 }
6730};
6731
6732var you = {
6733 type: "person",
6734 test: function( event ) {
6735 $( "#log" ).append( this.type + " " );
6736 }
6737};
6738
6739// Execute you.test() in the context of the `you` object
6740// no matter where it is called
6741// i.e. the `this` keyword will refer to `you`
6742var youClick = $.proxy( you.test, you );
6743
6744// attach click handlers to #test
6745$( "#test" )
6746 // this === "zombie"; handler unbound after first click
6747 .on( "click", $.proxy( me.test, me ) )
6748
6749 // this === "person"
6750 .on( "click", youClick )
6751
6752 // this === "zombie"
6753 .on( "click", $.proxy( you.test, me ) )
6754
6755 // this === "<button> element"
6756 .on( "click", you.test );
6757</script>
6758
6759</body>
6760</html>
6761```
6762 * @example ​ ````Change the context of a function bound to the click handler,
6763```html
6764<!doctype html>
6765<html lang="en">
6766<head>
6767 <meta charset="utf-8">
6768 <title>jQuery.proxy demo</title>
6769 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6770</head>
6771<body>
6772
6773<p><button type="button" id="test">Test</button></p>
6774<div id="log"></div>
6775
6776<script>
6777var me = {
6778 // I'm a dog
6779 type: "dog",
6780
6781 // Note that event comes *after* one and two
6782 test: function( one, two, event ) {
6783 $( "#log" )
6784
6785 // `one` maps to `you`, the 1st additional
6786 // argument in the $.proxy function call
6787 .append( "<h3>Hello " + one.type + ":</h3>" )
6788
6789 // The `this` keyword refers to `me`
6790 // (the 2nd, context, argument of $.proxy)
6791 .append( "I am a " + this.type + ", " )
6792
6793 // `two` maps to `they`, the 2nd additional
6794 // argument in the $.proxy function call
6795 .append( "and they are " + two.type + ".<br>" )
6796
6797 // The event type is "click"
6798 .append( "Thanks for " + event.type + "ing." )
6799
6800 // The clicked element is `event.target`,
6801 // and its type is "button"
6802 .append( "the " + event.target.type + "." );
6803 }
6804};
6805
6806var you = { type: "cat" };
6807var they = { type: "fish" };
6808
6809// Set up handler to execute me.test() in the context
6810// of `me`, with `you` and `they` as additional arguments
6811var proxy = $.proxy( me.test, me, you, they );
6812
6813$( "#test" )
6814 .on( "click", proxy );
6815</script>
6816
6817</body>
6818</html>
6819```
6820 */
6821 proxy<TContext,
6822 TReturn,
6823 A, B, C,
6824 T, U>(funсtion: (this: TContext, a: A, b: B, c: C,
6825 t: T, u: U) => TReturn,
6826 context: TContext,
6827 a: A, b: B, c: C): (t: T, u: U) => TReturn;
6828 /**
6829 * Takes a function and returns a new one that will always have a particular context.
6830 * @param funсtion The function whose context will be changed.
6831 * @param context The object to which the context (`this`) of the function should be set.
6832 * @param a An argument to be passed to the function referenced in the `function` argument.
6833 * @param b An argument to be passed to the function referenced in the `function` argument.
6834 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6835 * @since 1.4
6836 * @since 1.6
6837 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6838 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
6839```html
6840<!doctype html>
6841<html lang="en">
6842<head>
6843 <meta charset="utf-8">
6844 <title>jQuery.proxy demo</title>
6845 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6846</head>
6847<body>
6848
6849<p><button type="button" id="test">Test</button></p>
6850<div id="log"></div>
6851
6852<script>
6853var me = {
6854 type: "zombie",
6855 test: function( event ) {
6856 // Without proxy, `this` would refer to the event target
6857 // use event.target to reference that element.
6858 var element = event.target;
6859 $( element ).css( "background-color", "red" );
6860
6861 // With proxy, `this` refers to the me object encapsulating
6862 // this function.
6863 $( "#log" ).append( "Hello " + this.type + "<br>" );
6864 $( "#test" ).off( "click", this.test );
6865 }
6866};
6867
6868var you = {
6869 type: "person",
6870 test: function( event ) {
6871 $( "#log" ).append( this.type + " " );
6872 }
6873};
6874
6875// Execute you.test() in the context of the `you` object
6876// no matter where it is called
6877// i.e. the `this` keyword will refer to `you`
6878var youClick = $.proxy( you.test, you );
6879
6880// attach click handlers to #test
6881$( "#test" )
6882 // this === "zombie"; handler unbound after first click
6883 .on( "click", $.proxy( me.test, me ) )
6884
6885 // this === "person"
6886 .on( "click", youClick )
6887
6888 // this === "zombie"
6889 .on( "click", $.proxy( you.test, me ) )
6890
6891 // this === "<button> element"
6892 .on( "click", you.test );
6893</script>
6894
6895</body>
6896</html>
6897```
6898 * @example ​ ````Change the context of a function bound to the click handler,
6899```html
6900<!doctype html>
6901<html lang="en">
6902<head>
6903 <meta charset="utf-8">
6904 <title>jQuery.proxy demo</title>
6905 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6906</head>
6907<body>
6908
6909<p><button type="button" id="test">Test</button></p>
6910<div id="log"></div>
6911
6912<script>
6913var me = {
6914 // I'm a dog
6915 type: "dog",
6916
6917 // Note that event comes *after* one and two
6918 test: function( one, two, event ) {
6919 $( "#log" )
6920
6921 // `one` maps to `you`, the 1st additional
6922 // argument in the $.proxy function call
6923 .append( "<h3>Hello " + one.type + ":</h3>" )
6924
6925 // The `this` keyword refers to `me`
6926 // (the 2nd, context, argument of $.proxy)
6927 .append( "I am a " + this.type + ", " )
6928
6929 // `two` maps to `they`, the 2nd additional
6930 // argument in the $.proxy function call
6931 .append( "and they are " + two.type + ".<br>" )
6932
6933 // The event type is "click"
6934 .append( "Thanks for " + event.type + "ing." )
6935
6936 // The clicked element is `event.target`,
6937 // and its type is "button"
6938 .append( "the " + event.target.type + "." );
6939 }
6940};
6941
6942var you = { type: "cat" };
6943var they = { type: "fish" };
6944
6945// Set up handler to execute me.test() in the context
6946// of `me`, with `you` and `they` as additional arguments
6947var proxy = $.proxy( me.test, me, you, they );
6948
6949$( "#test" )
6950 .on( "click", proxy );
6951</script>
6952
6953</body>
6954</html>
6955```
6956 */
6957 proxy<TContext,
6958 TReturn,
6959 A, B,
6960 T, U>(funсtion: (this: TContext, a: A, b: B,
6961 t: T, u: U) => TReturn,
6962 context: TContext,
6963 a: A, b: B): (t: T, u: U) => TReturn;
6964 /**
6965 * Takes a function and returns a new one that will always have a particular context.
6966 * @param funсtion The function whose context will be changed.
6967 * @param context The object to which the context (`this`) of the function should be set.
6968 * @param a An argument to be passed to the function referenced in the `function` argument.
6969 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6970 * @since 1.4
6971 * @since 1.6
6972 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6973 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
6974```html
6975<!doctype html>
6976<html lang="en">
6977<head>
6978 <meta charset="utf-8">
6979 <title>jQuery.proxy demo</title>
6980 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6981</head>
6982<body>
6983
6984<p><button type="button" id="test">Test</button></p>
6985<div id="log"></div>
6986
6987<script>
6988var me = {
6989 type: "zombie",
6990 test: function( event ) {
6991 // Without proxy, `this` would refer to the event target
6992 // use event.target to reference that element.
6993 var element = event.target;
6994 $( element ).css( "background-color", "red" );
6995
6996 // With proxy, `this` refers to the me object encapsulating
6997 // this function.
6998 $( "#log" ).append( "Hello " + this.type + "<br>" );
6999 $( "#test" ).off( "click", this.test );
7000 }
7001};
7002
7003var you = {
7004 type: "person",
7005 test: function( event ) {
7006 $( "#log" ).append( this.type + " " );
7007 }
7008};
7009
7010// Execute you.test() in the context of the `you` object
7011// no matter where it is called
7012// i.e. the `this` keyword will refer to `you`
7013var youClick = $.proxy( you.test, you );
7014
7015// attach click handlers to #test
7016$( "#test" )
7017 // this === "zombie"; handler unbound after first click
7018 .on( "click", $.proxy( me.test, me ) )
7019
7020 // this === "person"
7021 .on( "click", youClick )
7022
7023 // this === "zombie"
7024 .on( "click", $.proxy( you.test, me ) )
7025
7026 // this === "<button> element"
7027 .on( "click", you.test );
7028</script>
7029
7030</body>
7031</html>
7032```
7033 * @example ​ ````Change the context of a function bound to the click handler,
7034```html
7035<!doctype html>
7036<html lang="en">
7037<head>
7038 <meta charset="utf-8">
7039 <title>jQuery.proxy demo</title>
7040 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7041</head>
7042<body>
7043
7044<p><button type="button" id="test">Test</button></p>
7045<div id="log"></div>
7046
7047<script>
7048var me = {
7049 // I'm a dog
7050 type: "dog",
7051
7052 // Note that event comes *after* one and two
7053 test: function( one, two, event ) {
7054 $( "#log" )
7055
7056 // `one` maps to `you`, the 1st additional
7057 // argument in the $.proxy function call
7058 .append( "<h3>Hello " + one.type + ":</h3>" )
7059
7060 // The `this` keyword refers to `me`
7061 // (the 2nd, context, argument of $.proxy)
7062 .append( "I am a " + this.type + ", " )
7063
7064 // `two` maps to `they`, the 2nd additional
7065 // argument in the $.proxy function call
7066 .append( "and they are " + two.type + ".<br>" )
7067
7068 // The event type is "click"
7069 .append( "Thanks for " + event.type + "ing." )
7070
7071 // The clicked element is `event.target`,
7072 // and its type is "button"
7073 .append( "the " + event.target.type + "." );
7074 }
7075};
7076
7077var you = { type: "cat" };
7078var they = { type: "fish" };
7079
7080// Set up handler to execute me.test() in the context
7081// of `me`, with `you` and `they` as additional arguments
7082var proxy = $.proxy( me.test, me, you, they );
7083
7084$( "#test" )
7085 .on( "click", proxy );
7086</script>
7087
7088</body>
7089</html>
7090```
7091 */
7092 proxy<TContext,
7093 TReturn,
7094 A,
7095 T, U>(funсtion: (this: TContext, a: A,
7096 t: T, u: U) => TReturn,
7097 context: TContext,
7098 a: A): (t: T, u: U) => TReturn;
7099 /**
7100 * Takes a function and returns a new one that will always have a particular context.
7101 * @param funсtion The function whose context will be changed.
7102 * @param context The object to which the context (`this`) of the function should be set.
7103 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7104 * @since 1.4
7105 * @since 1.6
7106 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7107 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
7108```html
7109<!doctype html>
7110<html lang="en">
7111<head>
7112 <meta charset="utf-8">
7113 <title>jQuery.proxy demo</title>
7114 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7115</head>
7116<body>
7117
7118<p><button type="button" id="test">Test</button></p>
7119<div id="log"></div>
7120
7121<script>
7122var me = {
7123 type: "zombie",
7124 test: function( event ) {
7125 // Without proxy, `this` would refer to the event target
7126 // use event.target to reference that element.
7127 var element = event.target;
7128 $( element ).css( "background-color", "red" );
7129
7130 // With proxy, `this` refers to the me object encapsulating
7131 // this function.
7132 $( "#log" ).append( "Hello " + this.type + "<br>" );
7133 $( "#test" ).off( "click", this.test );
7134 }
7135};
7136
7137var you = {
7138 type: "person",
7139 test: function( event ) {
7140 $( "#log" ).append( this.type + " " );
7141 }
7142};
7143
7144// Execute you.test() in the context of the `you` object
7145// no matter where it is called
7146// i.e. the `this` keyword will refer to `you`
7147var youClick = $.proxy( you.test, you );
7148
7149// attach click handlers to #test
7150$( "#test" )
7151 // this === "zombie"; handler unbound after first click
7152 .on( "click", $.proxy( me.test, me ) )
7153
7154 // this === "person"
7155 .on( "click", youClick )
7156
7157 // this === "zombie"
7158 .on( "click", $.proxy( you.test, me ) )
7159
7160 // this === "<button> element"
7161 .on( "click", you.test );
7162</script>
7163
7164</body>
7165</html>
7166```
7167 * @example ​ ````Change the context of a function bound to the click handler,
7168```html
7169<!doctype html>
7170<html lang="en">
7171<head>
7172 <meta charset="utf-8">
7173 <title>jQuery.proxy demo</title>
7174 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7175</head>
7176<body>
7177
7178<p><button type="button" id="test">Test</button></p>
7179<div id="log"></div>
7180
7181<script>
7182var me = {
7183 // I'm a dog
7184 type: "dog",
7185
7186 // Note that event comes *after* one and two
7187 test: function( one, two, event ) {
7188 $( "#log" )
7189
7190 // `one` maps to `you`, the 1st additional
7191 // argument in the $.proxy function call
7192 .append( "<h3>Hello " + one.type + ":</h3>" )
7193
7194 // The `this` keyword refers to `me`
7195 // (the 2nd, context, argument of $.proxy)
7196 .append( "I am a " + this.type + ", " )
7197
7198 // `two` maps to `they`, the 2nd additional
7199 // argument in the $.proxy function call
7200 .append( "and they are " + two.type + ".<br>" )
7201
7202 // The event type is "click"
7203 .append( "Thanks for " + event.type + "ing." )
7204
7205 // The clicked element is `event.target`,
7206 // and its type is "button"
7207 .append( "the " + event.target.type + "." );
7208 }
7209};
7210
7211var you = { type: "cat" };
7212var they = { type: "fish" };
7213
7214// Set up handler to execute me.test() in the context
7215// of `me`, with `you` and `they` as additional arguments
7216var proxy = $.proxy( me.test, me, you, they );
7217
7218$( "#test" )
7219 .on( "click", proxy );
7220</script>
7221
7222</body>
7223</html>
7224```
7225 */
7226 proxy<TContext,
7227 TReturn,
7228 T, U>(funсtion: (this: TContext, t: T, u: U) => TReturn,
7229 context: TContext): (t: T, u: U) => TReturn;
7230
7231 // #endregion
7232
7233 // region 3 parameters
7234 // #region 3 parameters
7235
7236 /**
7237 * Takes a function and returns a new one that will always have a particular context.
7238 * @param funсtion The function whose context will be changed.
7239 * @param context The object to which the context (`this`) of the function should be set.
7240 * @param a An argument to be passed to the function referenced in the `function` argument.
7241 * @param b An argument to be passed to the function referenced in the `function` argument.
7242 * @param c An argument to be passed to the function referenced in the `function` argument.
7243 * @param d An argument to be passed to the function referenced in the `function` argument.
7244 * @param e An argument to be passed to the function referenced in the `function` argument.
7245 * @param f An argument to be passed to the function referenced in the `function` argument.
7246 * @param g An argument to be passed to the function referenced in the `function` argument.
7247 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7248 * @since 1.4
7249 * @since 1.6
7250 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7251 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
7252```html
7253<!doctype html>
7254<html lang="en">
7255<head>
7256 <meta charset="utf-8">
7257 <title>jQuery.proxy demo</title>
7258 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7259</head>
7260<body>
7261
7262<p><button type="button" id="test">Test</button></p>
7263<div id="log"></div>
7264
7265<script>
7266var me = {
7267 type: "zombie",
7268 test: function( event ) {
7269 // Without proxy, `this` would refer to the event target
7270 // use event.target to reference that element.
7271 var element = event.target;
7272 $( element ).css( "background-color", "red" );
7273
7274 // With proxy, `this` refers to the me object encapsulating
7275 // this function.
7276 $( "#log" ).append( "Hello " + this.type + "<br>" );
7277 $( "#test" ).off( "click", this.test );
7278 }
7279};
7280
7281var you = {
7282 type: "person",
7283 test: function( event ) {
7284 $( "#log" ).append( this.type + " " );
7285 }
7286};
7287
7288// Execute you.test() in the context of the `you` object
7289// no matter where it is called
7290// i.e. the `this` keyword will refer to `you`
7291var youClick = $.proxy( you.test, you );
7292
7293// attach click handlers to #test
7294$( "#test" )
7295 // this === "zombie"; handler unbound after first click
7296 .on( "click", $.proxy( me.test, me ) )
7297
7298 // this === "person"
7299 .on( "click", youClick )
7300
7301 // this === "zombie"
7302 .on( "click", $.proxy( you.test, me ) )
7303
7304 // this === "<button> element"
7305 .on( "click", you.test );
7306</script>
7307
7308</body>
7309</html>
7310```
7311 * @example ​ ````Change the context of a function bound to the click handler,
7312```html
7313<!doctype html>
7314<html lang="en">
7315<head>
7316 <meta charset="utf-8">
7317 <title>jQuery.proxy demo</title>
7318 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7319</head>
7320<body>
7321
7322<p><button type="button" id="test">Test</button></p>
7323<div id="log"></div>
7324
7325<script>
7326var me = {
7327 // I'm a dog
7328 type: "dog",
7329
7330 // Note that event comes *after* one and two
7331 test: function( one, two, event ) {
7332 $( "#log" )
7333
7334 // `one` maps to `you`, the 1st additional
7335 // argument in the $.proxy function call
7336 .append( "<h3>Hello " + one.type + ":</h3>" )
7337
7338 // The `this` keyword refers to `me`
7339 // (the 2nd, context, argument of $.proxy)
7340 .append( "I am a " + this.type + ", " )
7341
7342 // `two` maps to `they`, the 2nd additional
7343 // argument in the $.proxy function call
7344 .append( "and they are " + two.type + ".<br>" )
7345
7346 // The event type is "click"
7347 .append( "Thanks for " + event.type + "ing." )
7348
7349 // The clicked element is `event.target`,
7350 // and its type is "button"
7351 .append( "the " + event.target.type + "." );
7352 }
7353};
7354
7355var you = { type: "cat" };
7356var they = { type: "fish" };
7357
7358// Set up handler to execute me.test() in the context
7359// of `me`, with `you` and `they` as additional arguments
7360var proxy = $.proxy( me.test, me, you, they );
7361
7362$( "#test" )
7363 .on( "click", proxy );
7364</script>
7365
7366</body>
7367</html>
7368```
7369 */
7370 proxy<TContext,
7371 TReturn,
7372 A, B, C, D, E, F, G,
7373 T, U, V>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
7374 t: T, u: U, v: V) => TReturn,
7375 context: TContext,
7376 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V) => TReturn;
7377 /**
7378 * Takes a function and returns a new one that will always have a particular context.
7379 * @param funсtion The function whose context will be changed.
7380 * @param context The object to which the context (`this`) of the function should be set.
7381 * @param a An argument to be passed to the function referenced in the `function` argument.
7382 * @param b An argument to be passed to the function referenced in the `function` argument.
7383 * @param c An argument to be passed to the function referenced in the `function` argument.
7384 * @param d An argument to be passed to the function referenced in the `function` argument.
7385 * @param e An argument to be passed to the function referenced in the `function` argument.
7386 * @param f An argument to be passed to the function referenced in the `function` argument.
7387 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7388 * @since 1.4
7389 * @since 1.6
7390 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7391 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
7392```html
7393<!doctype html>
7394<html lang="en">
7395<head>
7396 <meta charset="utf-8">
7397 <title>jQuery.proxy demo</title>
7398 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7399</head>
7400<body>
7401
7402<p><button type="button" id="test">Test</button></p>
7403<div id="log"></div>
7404
7405<script>
7406var me = {
7407 type: "zombie",
7408 test: function( event ) {
7409 // Without proxy, `this` would refer to the event target
7410 // use event.target to reference that element.
7411 var element = event.target;
7412 $( element ).css( "background-color", "red" );
7413
7414 // With proxy, `this` refers to the me object encapsulating
7415 // this function.
7416 $( "#log" ).append( "Hello " + this.type + "<br>" );
7417 $( "#test" ).off( "click", this.test );
7418 }
7419};
7420
7421var you = {
7422 type: "person",
7423 test: function( event ) {
7424 $( "#log" ).append( this.type + " " );
7425 }
7426};
7427
7428// Execute you.test() in the context of the `you` object
7429// no matter where it is called
7430// i.e. the `this` keyword will refer to `you`
7431var youClick = $.proxy( you.test, you );
7432
7433// attach click handlers to #test
7434$( "#test" )
7435 // this === "zombie"; handler unbound after first click
7436 .on( "click", $.proxy( me.test, me ) )
7437
7438 // this === "person"
7439 .on( "click", youClick )
7440
7441 // this === "zombie"
7442 .on( "click", $.proxy( you.test, me ) )
7443
7444 // this === "<button> element"
7445 .on( "click", you.test );
7446</script>
7447
7448</body>
7449</html>
7450```
7451 * @example ​ ````Change the context of a function bound to the click handler,
7452```html
7453<!doctype html>
7454<html lang="en">
7455<head>
7456 <meta charset="utf-8">
7457 <title>jQuery.proxy demo</title>
7458 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7459</head>
7460<body>
7461
7462<p><button type="button" id="test">Test</button></p>
7463<div id="log"></div>
7464
7465<script>
7466var me = {
7467 // I'm a dog
7468 type: "dog",
7469
7470 // Note that event comes *after* one and two
7471 test: function( one, two, event ) {
7472 $( "#log" )
7473
7474 // `one` maps to `you`, the 1st additional
7475 // argument in the $.proxy function call
7476 .append( "<h3>Hello " + one.type + ":</h3>" )
7477
7478 // The `this` keyword refers to `me`
7479 // (the 2nd, context, argument of $.proxy)
7480 .append( "I am a " + this.type + ", " )
7481
7482 // `two` maps to `they`, the 2nd additional
7483 // argument in the $.proxy function call
7484 .append( "and they are " + two.type + ".<br>" )
7485
7486 // The event type is "click"
7487 .append( "Thanks for " + event.type + "ing." )
7488
7489 // The clicked element is `event.target`,
7490 // and its type is "button"
7491 .append( "the " + event.target.type + "." );
7492 }
7493};
7494
7495var you = { type: "cat" };
7496var they = { type: "fish" };
7497
7498// Set up handler to execute me.test() in the context
7499// of `me`, with `you` and `they` as additional arguments
7500var proxy = $.proxy( me.test, me, you, they );
7501
7502$( "#test" )
7503 .on( "click", proxy );
7504</script>
7505
7506</body>
7507</html>
7508```
7509 */
7510 proxy<TContext,
7511 TReturn,
7512 A, B, C, D, E, F,
7513 T, U, V>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
7514 t: T, u: U, v: V) => TReturn,
7515 context: TContext,
7516 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V) => TReturn;
7517 /**
7518 * Takes a function and returns a new one that will always have a particular context.
7519 * @param funсtion The function whose context will be changed.
7520 * @param context The object to which the context (`this`) of the function should be set.
7521 * @param a An argument to be passed to the function referenced in the `function` argument.
7522 * @param b An argument to be passed to the function referenced in the `function` argument.
7523 * @param c An argument to be passed to the function referenced in the `function` argument.
7524 * @param d An argument to be passed to the function referenced in the `function` argument.
7525 * @param e An argument to be passed to the function referenced in the `function` argument.
7526 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7527 * @since 1.4
7528 * @since 1.6
7529 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7530 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
7531```html
7532<!doctype html>
7533<html lang="en">
7534<head>
7535 <meta charset="utf-8">
7536 <title>jQuery.proxy demo</title>
7537 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7538</head>
7539<body>
7540
7541<p><button type="button" id="test">Test</button></p>
7542<div id="log"></div>
7543
7544<script>
7545var me = {
7546 type: "zombie",
7547 test: function( event ) {
7548 // Without proxy, `this` would refer to the event target
7549 // use event.target to reference that element.
7550 var element = event.target;
7551 $( element ).css( "background-color", "red" );
7552
7553 // With proxy, `this` refers to the me object encapsulating
7554 // this function.
7555 $( "#log" ).append( "Hello " + this.type + "<br>" );
7556 $( "#test" ).off( "click", this.test );
7557 }
7558};
7559
7560var you = {
7561 type: "person",
7562 test: function( event ) {
7563 $( "#log" ).append( this.type + " " );
7564 }
7565};
7566
7567// Execute you.test() in the context of the `you` object
7568// no matter where it is called
7569// i.e. the `this` keyword will refer to `you`
7570var youClick = $.proxy( you.test, you );
7571
7572// attach click handlers to #test
7573$( "#test" )
7574 // this === "zombie"; handler unbound after first click
7575 .on( "click", $.proxy( me.test, me ) )
7576
7577 // this === "person"
7578 .on( "click", youClick )
7579
7580 // this === "zombie"
7581 .on( "click", $.proxy( you.test, me ) )
7582
7583 // this === "<button> element"
7584 .on( "click", you.test );
7585</script>
7586
7587</body>
7588</html>
7589```
7590 * @example ​ ````Change the context of a function bound to the click handler,
7591```html
7592<!doctype html>
7593<html lang="en">
7594<head>
7595 <meta charset="utf-8">
7596 <title>jQuery.proxy demo</title>
7597 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7598</head>
7599<body>
7600
7601<p><button type="button" id="test">Test</button></p>
7602<div id="log"></div>
7603
7604<script>
7605var me = {
7606 // I'm a dog
7607 type: "dog",
7608
7609 // Note that event comes *after* one and two
7610 test: function( one, two, event ) {
7611 $( "#log" )
7612
7613 // `one` maps to `you`, the 1st additional
7614 // argument in the $.proxy function call
7615 .append( "<h3>Hello " + one.type + ":</h3>" )
7616
7617 // The `this` keyword refers to `me`
7618 // (the 2nd, context, argument of $.proxy)
7619 .append( "I am a " + this.type + ", " )
7620
7621 // `two` maps to `they`, the 2nd additional
7622 // argument in the $.proxy function call
7623 .append( "and they are " + two.type + ".<br>" )
7624
7625 // The event type is "click"
7626 .append( "Thanks for " + event.type + "ing." )
7627
7628 // The clicked element is `event.target`,
7629 // and its type is "button"
7630 .append( "the " + event.target.type + "." );
7631 }
7632};
7633
7634var you = { type: "cat" };
7635var they = { type: "fish" };
7636
7637// Set up handler to execute me.test() in the context
7638// of `me`, with `you` and `they` as additional arguments
7639var proxy = $.proxy( me.test, me, you, they );
7640
7641$( "#test" )
7642 .on( "click", proxy );
7643</script>
7644
7645</body>
7646</html>
7647```
7648 */
7649 proxy<TContext,
7650 TReturn,
7651 A, B, C, D, E,
7652 T, U, V>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
7653 t: T, u: U, v: V) => TReturn,
7654 context: TContext,
7655 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V) => TReturn;
7656 /**
7657 * Takes a function and returns a new one that will always have a particular context.
7658 * @param funсtion The function whose context will be changed.
7659 * @param context The object to which the context (`this`) of the function should be set.
7660 * @param a An argument to be passed to the function referenced in the `function` argument.
7661 * @param b An argument to be passed to the function referenced in the `function` argument.
7662 * @param c An argument to be passed to the function referenced in the `function` argument.
7663 * @param d An argument to be passed to the function referenced in the `function` argument.
7664 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7665 * @since 1.4
7666 * @since 1.6
7667 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7668 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
7669```html
7670<!doctype html>
7671<html lang="en">
7672<head>
7673 <meta charset="utf-8">
7674 <title>jQuery.proxy demo</title>
7675 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7676</head>
7677<body>
7678
7679<p><button type="button" id="test">Test</button></p>
7680<div id="log"></div>
7681
7682<script>
7683var me = {
7684 type: "zombie",
7685 test: function( event ) {
7686 // Without proxy, `this` would refer to the event target
7687 // use event.target to reference that element.
7688 var element = event.target;
7689 $( element ).css( "background-color", "red" );
7690
7691 // With proxy, `this` refers to the me object encapsulating
7692 // this function.
7693 $( "#log" ).append( "Hello " + this.type + "<br>" );
7694 $( "#test" ).off( "click", this.test );
7695 }
7696};
7697
7698var you = {
7699 type: "person",
7700 test: function( event ) {
7701 $( "#log" ).append( this.type + " " );
7702 }
7703};
7704
7705// Execute you.test() in the context of the `you` object
7706// no matter where it is called
7707// i.e. the `this` keyword will refer to `you`
7708var youClick = $.proxy( you.test, you );
7709
7710// attach click handlers to #test
7711$( "#test" )
7712 // this === "zombie"; handler unbound after first click
7713 .on( "click", $.proxy( me.test, me ) )
7714
7715 // this === "person"
7716 .on( "click", youClick )
7717
7718 // this === "zombie"
7719 .on( "click", $.proxy( you.test, me ) )
7720
7721 // this === "<button> element"
7722 .on( "click", you.test );
7723</script>
7724
7725</body>
7726</html>
7727```
7728 * @example ​ ````Change the context of a function bound to the click handler,
7729```html
7730<!doctype html>
7731<html lang="en">
7732<head>
7733 <meta charset="utf-8">
7734 <title>jQuery.proxy demo</title>
7735 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7736</head>
7737<body>
7738
7739<p><button type="button" id="test">Test</button></p>
7740<div id="log"></div>
7741
7742<script>
7743var me = {
7744 // I'm a dog
7745 type: "dog",
7746
7747 // Note that event comes *after* one and two
7748 test: function( one, two, event ) {
7749 $( "#log" )
7750
7751 // `one` maps to `you`, the 1st additional
7752 // argument in the $.proxy function call
7753 .append( "<h3>Hello " + one.type + ":</h3>" )
7754
7755 // The `this` keyword refers to `me`
7756 // (the 2nd, context, argument of $.proxy)
7757 .append( "I am a " + this.type + ", " )
7758
7759 // `two` maps to `they`, the 2nd additional
7760 // argument in the $.proxy function call
7761 .append( "and they are " + two.type + ".<br>" )
7762
7763 // The event type is "click"
7764 .append( "Thanks for " + event.type + "ing." )
7765
7766 // The clicked element is `event.target`,
7767 // and its type is "button"
7768 .append( "the " + event.target.type + "." );
7769 }
7770};
7771
7772var you = { type: "cat" };
7773var they = { type: "fish" };
7774
7775// Set up handler to execute me.test() in the context
7776// of `me`, with `you` and `they` as additional arguments
7777var proxy = $.proxy( me.test, me, you, they );
7778
7779$( "#test" )
7780 .on( "click", proxy );
7781</script>
7782
7783</body>
7784</html>
7785```
7786 */
7787 proxy<TContext,
7788 TReturn,
7789 A, B, C, D,
7790 T, U, V>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
7791 t: T, u: U, v: V) => TReturn,
7792 context: TContext,
7793 a: A, b: B, c: C, d: D): (t: T, u: U, v: V) => TReturn;
7794 /**
7795 * Takes a function and returns a new one that will always have a particular context.
7796 * @param funсtion The function whose context will be changed.
7797 * @param context The object to which the context (`this`) of the function should be set.
7798 * @param a An argument to be passed to the function referenced in the `function` argument.
7799 * @param b An argument to be passed to the function referenced in the `function` argument.
7800 * @param c An argument to be passed to the function referenced in the `function` argument.
7801 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7802 * @since 1.4
7803 * @since 1.6
7804 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7805 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
7806```html
7807<!doctype html>
7808<html lang="en">
7809<head>
7810 <meta charset="utf-8">
7811 <title>jQuery.proxy demo</title>
7812 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7813</head>
7814<body>
7815
7816<p><button type="button" id="test">Test</button></p>
7817<div id="log"></div>
7818
7819<script>
7820var me = {
7821 type: "zombie",
7822 test: function( event ) {
7823 // Without proxy, `this` would refer to the event target
7824 // use event.target to reference that element.
7825 var element = event.target;
7826 $( element ).css( "background-color", "red" );
7827
7828 // With proxy, `this` refers to the me object encapsulating
7829 // this function.
7830 $( "#log" ).append( "Hello " + this.type + "<br>" );
7831 $( "#test" ).off( "click", this.test );
7832 }
7833};
7834
7835var you = {
7836 type: "person",
7837 test: function( event ) {
7838 $( "#log" ).append( this.type + " " );
7839 }
7840};
7841
7842// Execute you.test() in the context of the `you` object
7843// no matter where it is called
7844// i.e. the `this` keyword will refer to `you`
7845var youClick = $.proxy( you.test, you );
7846
7847// attach click handlers to #test
7848$( "#test" )
7849 // this === "zombie"; handler unbound after first click
7850 .on( "click", $.proxy( me.test, me ) )
7851
7852 // this === "person"
7853 .on( "click", youClick )
7854
7855 // this === "zombie"
7856 .on( "click", $.proxy( you.test, me ) )
7857
7858 // this === "<button> element"
7859 .on( "click", you.test );
7860</script>
7861
7862</body>
7863</html>
7864```
7865 * @example ​ ````Change the context of a function bound to the click handler,
7866```html
7867<!doctype html>
7868<html lang="en">
7869<head>
7870 <meta charset="utf-8">
7871 <title>jQuery.proxy demo</title>
7872 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7873</head>
7874<body>
7875
7876<p><button type="button" id="test">Test</button></p>
7877<div id="log"></div>
7878
7879<script>
7880var me = {
7881 // I'm a dog
7882 type: "dog",
7883
7884 // Note that event comes *after* one and two
7885 test: function( one, two, event ) {
7886 $( "#log" )
7887
7888 // `one` maps to `you`, the 1st additional
7889 // argument in the $.proxy function call
7890 .append( "<h3>Hello " + one.type + ":</h3>" )
7891
7892 // The `this` keyword refers to `me`
7893 // (the 2nd, context, argument of $.proxy)
7894 .append( "I am a " + this.type + ", " )
7895
7896 // `two` maps to `they`, the 2nd additional
7897 // argument in the $.proxy function call
7898 .append( "and they are " + two.type + ".<br>" )
7899
7900 // The event type is "click"
7901 .append( "Thanks for " + event.type + "ing." )
7902
7903 // The clicked element is `event.target`,
7904 // and its type is "button"
7905 .append( "the " + event.target.type + "." );
7906 }
7907};
7908
7909var you = { type: "cat" };
7910var they = { type: "fish" };
7911
7912// Set up handler to execute me.test() in the context
7913// of `me`, with `you` and `they` as additional arguments
7914var proxy = $.proxy( me.test, me, you, they );
7915
7916$( "#test" )
7917 .on( "click", proxy );
7918</script>
7919
7920</body>
7921</html>
7922```
7923 */
7924 proxy<TContext,
7925 TReturn,
7926 A, B, C,
7927 T, U, V>(funсtion: (this: TContext, a: A, b: B, c: C,
7928 t: T, u: U, v: V) => TReturn,
7929 context: TContext,
7930 a: A, b: B, c: C): (t: T, u: U, v: V) => TReturn;
7931 /**
7932 * Takes a function and returns a new one that will always have a particular context.
7933 * @param funсtion The function whose context will be changed.
7934 * @param context The object to which the context (`this`) of the function should be set.
7935 * @param a An argument to be passed to the function referenced in the `function` argument.
7936 * @param b An argument to be passed to the function referenced in the `function` argument.
7937 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7938 * @since 1.4
7939 * @since 1.6
7940 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7941 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
7942```html
7943<!doctype html>
7944<html lang="en">
7945<head>
7946 <meta charset="utf-8">
7947 <title>jQuery.proxy demo</title>
7948 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7949</head>
7950<body>
7951
7952<p><button type="button" id="test">Test</button></p>
7953<div id="log"></div>
7954
7955<script>
7956var me = {
7957 type: "zombie",
7958 test: function( event ) {
7959 // Without proxy, `this` would refer to the event target
7960 // use event.target to reference that element.
7961 var element = event.target;
7962 $( element ).css( "background-color", "red" );
7963
7964 // With proxy, `this` refers to the me object encapsulating
7965 // this function.
7966 $( "#log" ).append( "Hello " + this.type + "<br>" );
7967 $( "#test" ).off( "click", this.test );
7968 }
7969};
7970
7971var you = {
7972 type: "person",
7973 test: function( event ) {
7974 $( "#log" ).append( this.type + " " );
7975 }
7976};
7977
7978// Execute you.test() in the context of the `you` object
7979// no matter where it is called
7980// i.e. the `this` keyword will refer to `you`
7981var youClick = $.proxy( you.test, you );
7982
7983// attach click handlers to #test
7984$( "#test" )
7985 // this === "zombie"; handler unbound after first click
7986 .on( "click", $.proxy( me.test, me ) )
7987
7988 // this === "person"
7989 .on( "click", youClick )
7990
7991 // this === "zombie"
7992 .on( "click", $.proxy( you.test, me ) )
7993
7994 // this === "<button> element"
7995 .on( "click", you.test );
7996</script>
7997
7998</body>
7999</html>
8000```
8001 * @example ​ ````Change the context of a function bound to the click handler,
8002```html
8003<!doctype html>
8004<html lang="en">
8005<head>
8006 <meta charset="utf-8">
8007 <title>jQuery.proxy demo</title>
8008 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8009</head>
8010<body>
8011
8012<p><button type="button" id="test">Test</button></p>
8013<div id="log"></div>
8014
8015<script>
8016var me = {
8017 // I'm a dog
8018 type: "dog",
8019
8020 // Note that event comes *after* one and two
8021 test: function( one, two, event ) {
8022 $( "#log" )
8023
8024 // `one` maps to `you`, the 1st additional
8025 // argument in the $.proxy function call
8026 .append( "<h3>Hello " + one.type + ":</h3>" )
8027
8028 // The `this` keyword refers to `me`
8029 // (the 2nd, context, argument of $.proxy)
8030 .append( "I am a " + this.type + ", " )
8031
8032 // `two` maps to `they`, the 2nd additional
8033 // argument in the $.proxy function call
8034 .append( "and they are " + two.type + ".<br>" )
8035
8036 // The event type is "click"
8037 .append( "Thanks for " + event.type + "ing." )
8038
8039 // The clicked element is `event.target`,
8040 // and its type is "button"
8041 .append( "the " + event.target.type + "." );
8042 }
8043};
8044
8045var you = { type: "cat" };
8046var they = { type: "fish" };
8047
8048// Set up handler to execute me.test() in the context
8049// of `me`, with `you` and `they` as additional arguments
8050var proxy = $.proxy( me.test, me, you, they );
8051
8052$( "#test" )
8053 .on( "click", proxy );
8054</script>
8055
8056</body>
8057</html>
8058```
8059 */
8060 proxy<TContext,
8061 TReturn,
8062 A, B,
8063 T, U, V>(funсtion: (this: TContext, a: A, b: B,
8064 t: T, u: U, v: V) => TReturn,
8065 context: TContext,
8066 a: A, b: B): (t: T, u: U, v: V) => TReturn;
8067 /**
8068 * Takes a function and returns a new one that will always have a particular context.
8069 * @param funсtion The function whose context will be changed.
8070 * @param context The object to which the context (`this`) of the function should be set.
8071 * @param a An argument to be passed to the function referenced in the `function` argument.
8072 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8073 * @since 1.4
8074 * @since 1.6
8075 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8076 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
8077```html
8078<!doctype html>
8079<html lang="en">
8080<head>
8081 <meta charset="utf-8">
8082 <title>jQuery.proxy demo</title>
8083 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8084</head>
8085<body>
8086
8087<p><button type="button" id="test">Test</button></p>
8088<div id="log"></div>
8089
8090<script>
8091var me = {
8092 type: "zombie",
8093 test: function( event ) {
8094 // Without proxy, `this` would refer to the event target
8095 // use event.target to reference that element.
8096 var element = event.target;
8097 $( element ).css( "background-color", "red" );
8098
8099 // With proxy, `this` refers to the me object encapsulating
8100 // this function.
8101 $( "#log" ).append( "Hello " + this.type + "<br>" );
8102 $( "#test" ).off( "click", this.test );
8103 }
8104};
8105
8106var you = {
8107 type: "person",
8108 test: function( event ) {
8109 $( "#log" ).append( this.type + " " );
8110 }
8111};
8112
8113// Execute you.test() in the context of the `you` object
8114// no matter where it is called
8115// i.e. the `this` keyword will refer to `you`
8116var youClick = $.proxy( you.test, you );
8117
8118// attach click handlers to #test
8119$( "#test" )
8120 // this === "zombie"; handler unbound after first click
8121 .on( "click", $.proxy( me.test, me ) )
8122
8123 // this === "person"
8124 .on( "click", youClick )
8125
8126 // this === "zombie"
8127 .on( "click", $.proxy( you.test, me ) )
8128
8129 // this === "<button> element"
8130 .on( "click", you.test );
8131</script>
8132
8133</body>
8134</html>
8135```
8136 * @example ​ ````Change the context of a function bound to the click handler,
8137```html
8138<!doctype html>
8139<html lang="en">
8140<head>
8141 <meta charset="utf-8">
8142 <title>jQuery.proxy demo</title>
8143 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8144</head>
8145<body>
8146
8147<p><button type="button" id="test">Test</button></p>
8148<div id="log"></div>
8149
8150<script>
8151var me = {
8152 // I'm a dog
8153 type: "dog",
8154
8155 // Note that event comes *after* one and two
8156 test: function( one, two, event ) {
8157 $( "#log" )
8158
8159 // `one` maps to `you`, the 1st additional
8160 // argument in the $.proxy function call
8161 .append( "<h3>Hello " + one.type + ":</h3>" )
8162
8163 // The `this` keyword refers to `me`
8164 // (the 2nd, context, argument of $.proxy)
8165 .append( "I am a " + this.type + ", " )
8166
8167 // `two` maps to `they`, the 2nd additional
8168 // argument in the $.proxy function call
8169 .append( "and they are " + two.type + ".<br>" )
8170
8171 // The event type is "click"
8172 .append( "Thanks for " + event.type + "ing." )
8173
8174 // The clicked element is `event.target`,
8175 // and its type is "button"
8176 .append( "the " + event.target.type + "." );
8177 }
8178};
8179
8180var you = { type: "cat" };
8181var they = { type: "fish" };
8182
8183// Set up handler to execute me.test() in the context
8184// of `me`, with `you` and `they` as additional arguments
8185var proxy = $.proxy( me.test, me, you, they );
8186
8187$( "#test" )
8188 .on( "click", proxy );
8189</script>
8190
8191</body>
8192</html>
8193```
8194 */
8195 proxy<TContext,
8196 TReturn,
8197 A,
8198 T, U, V>(funсtion: (this: TContext, a: A,
8199 t: T, u: U, v: V) => TReturn,
8200 context: TContext,
8201 a: A): (t: T, u: U, v: V) => TReturn;
8202 /**
8203 * Takes a function and returns a new one that will always have a particular context.
8204 * @param funсtion The function whose context will be changed.
8205 * @param context The object to which the context (`this`) of the function should be set.
8206 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8207 * @since 1.4
8208 * @since 1.6
8209 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8210 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
8211```html
8212<!doctype html>
8213<html lang="en">
8214<head>
8215 <meta charset="utf-8">
8216 <title>jQuery.proxy demo</title>
8217 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8218</head>
8219<body>
8220
8221<p><button type="button" id="test">Test</button></p>
8222<div id="log"></div>
8223
8224<script>
8225var me = {
8226 type: "zombie",
8227 test: function( event ) {
8228 // Without proxy, `this` would refer to the event target
8229 // use event.target to reference that element.
8230 var element = event.target;
8231 $( element ).css( "background-color", "red" );
8232
8233 // With proxy, `this` refers to the me object encapsulating
8234 // this function.
8235 $( "#log" ).append( "Hello " + this.type + "<br>" );
8236 $( "#test" ).off( "click", this.test );
8237 }
8238};
8239
8240var you = {
8241 type: "person",
8242 test: function( event ) {
8243 $( "#log" ).append( this.type + " " );
8244 }
8245};
8246
8247// Execute you.test() in the context of the `you` object
8248// no matter where it is called
8249// i.e. the `this` keyword will refer to `you`
8250var youClick = $.proxy( you.test, you );
8251
8252// attach click handlers to #test
8253$( "#test" )
8254 // this === "zombie"; handler unbound after first click
8255 .on( "click", $.proxy( me.test, me ) )
8256
8257 // this === "person"
8258 .on( "click", youClick )
8259
8260 // this === "zombie"
8261 .on( "click", $.proxy( you.test, me ) )
8262
8263 // this === "<button> element"
8264 .on( "click", you.test );
8265</script>
8266
8267</body>
8268</html>
8269```
8270 * @example ​ ````Change the context of a function bound to the click handler,
8271```html
8272<!doctype html>
8273<html lang="en">
8274<head>
8275 <meta charset="utf-8">
8276 <title>jQuery.proxy demo</title>
8277 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8278</head>
8279<body>
8280
8281<p><button type="button" id="test">Test</button></p>
8282<div id="log"></div>
8283
8284<script>
8285var me = {
8286 // I'm a dog
8287 type: "dog",
8288
8289 // Note that event comes *after* one and two
8290 test: function( one, two, event ) {
8291 $( "#log" )
8292
8293 // `one` maps to `you`, the 1st additional
8294 // argument in the $.proxy function call
8295 .append( "<h3>Hello " + one.type + ":</h3>" )
8296
8297 // The `this` keyword refers to `me`
8298 // (the 2nd, context, argument of $.proxy)
8299 .append( "I am a " + this.type + ", " )
8300
8301 // `two` maps to `they`, the 2nd additional
8302 // argument in the $.proxy function call
8303 .append( "and they are " + two.type + ".<br>" )
8304
8305 // The event type is "click"
8306 .append( "Thanks for " + event.type + "ing." )
8307
8308 // The clicked element is `event.target`,
8309 // and its type is "button"
8310 .append( "the " + event.target.type + "." );
8311 }
8312};
8313
8314var you = { type: "cat" };
8315var they = { type: "fish" };
8316
8317// Set up handler to execute me.test() in the context
8318// of `me`, with `you` and `they` as additional arguments
8319var proxy = $.proxy( me.test, me, you, they );
8320
8321$( "#test" )
8322 .on( "click", proxy );
8323</script>
8324
8325</body>
8326</html>
8327```
8328 */
8329 proxy<TContext,
8330 TReturn,
8331 T, U, V>(funсtion: (this: TContext, t: T, u: U, v: V) => TReturn,
8332 context: TContext): (t: T, u: U, v: V) => TReturn;
8333
8334 // #endregion
8335
8336 // region 4 parameters
8337 // #region 4 parameters
8338
8339 /**
8340 * Takes a function and returns a new one that will always have a particular context.
8341 * @param funсtion The function whose context will be changed.
8342 * @param context The object to which the context (`this`) of the function should be set.
8343 * @param a An argument to be passed to the function referenced in the `function` argument.
8344 * @param b An argument to be passed to the function referenced in the `function` argument.
8345 * @param c An argument to be passed to the function referenced in the `function` argument.
8346 * @param d An argument to be passed to the function referenced in the `function` argument.
8347 * @param e An argument to be passed to the function referenced in the `function` argument.
8348 * @param f An argument to be passed to the function referenced in the `function` argument.
8349 * @param g An argument to be passed to the function referenced in the `function` argument.
8350 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8351 * @since 1.4
8352 * @since 1.6
8353 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8354 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
8355```html
8356<!doctype html>
8357<html lang="en">
8358<head>
8359 <meta charset="utf-8">
8360 <title>jQuery.proxy demo</title>
8361 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8362</head>
8363<body>
8364
8365<p><button type="button" id="test">Test</button></p>
8366<div id="log"></div>
8367
8368<script>
8369var me = {
8370 type: "zombie",
8371 test: function( event ) {
8372 // Without proxy, `this` would refer to the event target
8373 // use event.target to reference that element.
8374 var element = event.target;
8375 $( element ).css( "background-color", "red" );
8376
8377 // With proxy, `this` refers to the me object encapsulating
8378 // this function.
8379 $( "#log" ).append( "Hello " + this.type + "<br>" );
8380 $( "#test" ).off( "click", this.test );
8381 }
8382};
8383
8384var you = {
8385 type: "person",
8386 test: function( event ) {
8387 $( "#log" ).append( this.type + " " );
8388 }
8389};
8390
8391// Execute you.test() in the context of the `you` object
8392// no matter where it is called
8393// i.e. the `this` keyword will refer to `you`
8394var youClick = $.proxy( you.test, you );
8395
8396// attach click handlers to #test
8397$( "#test" )
8398 // this === "zombie"; handler unbound after first click
8399 .on( "click", $.proxy( me.test, me ) )
8400
8401 // this === "person"
8402 .on( "click", youClick )
8403
8404 // this === "zombie"
8405 .on( "click", $.proxy( you.test, me ) )
8406
8407 // this === "<button> element"
8408 .on( "click", you.test );
8409</script>
8410
8411</body>
8412</html>
8413```
8414 * @example ​ ````Change the context of a function bound to the click handler,
8415```html
8416<!doctype html>
8417<html lang="en">
8418<head>
8419 <meta charset="utf-8">
8420 <title>jQuery.proxy demo</title>
8421 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8422</head>
8423<body>
8424
8425<p><button type="button" id="test">Test</button></p>
8426<div id="log"></div>
8427
8428<script>
8429var me = {
8430 // I'm a dog
8431 type: "dog",
8432
8433 // Note that event comes *after* one and two
8434 test: function( one, two, event ) {
8435 $( "#log" )
8436
8437 // `one` maps to `you`, the 1st additional
8438 // argument in the $.proxy function call
8439 .append( "<h3>Hello " + one.type + ":</h3>" )
8440
8441 // The `this` keyword refers to `me`
8442 // (the 2nd, context, argument of $.proxy)
8443 .append( "I am a " + this.type + ", " )
8444
8445 // `two` maps to `they`, the 2nd additional
8446 // argument in the $.proxy function call
8447 .append( "and they are " + two.type + ".<br>" )
8448
8449 // The event type is "click"
8450 .append( "Thanks for " + event.type + "ing." )
8451
8452 // The clicked element is `event.target`,
8453 // and its type is "button"
8454 .append( "the " + event.target.type + "." );
8455 }
8456};
8457
8458var you = { type: "cat" };
8459var they = { type: "fish" };
8460
8461// Set up handler to execute me.test() in the context
8462// of `me`, with `you` and `they` as additional arguments
8463var proxy = $.proxy( me.test, me, you, they );
8464
8465$( "#test" )
8466 .on( "click", proxy );
8467</script>
8468
8469</body>
8470</html>
8471```
8472 */
8473 proxy<TContext,
8474 TReturn,
8475 A, B, C, D, E, F, G,
8476 T, U, V, W>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
8477 t: T, u: U, v: V, w: W) => TReturn,
8478 context: TContext,
8479 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W) => TReturn;
8480 /**
8481 * Takes a function and returns a new one that will always have a particular context.
8482 * @param funсtion The function whose context will be changed.
8483 * @param context The object to which the context (`this`) of the function should be set.
8484 * @param a An argument to be passed to the function referenced in the `function` argument.
8485 * @param b An argument to be passed to the function referenced in the `function` argument.
8486 * @param c An argument to be passed to the function referenced in the `function` argument.
8487 * @param d An argument to be passed to the function referenced in the `function` argument.
8488 * @param e An argument to be passed to the function referenced in the `function` argument.
8489 * @param f An argument to be passed to the function referenced in the `function` argument.
8490 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8491 * @since 1.4
8492 * @since 1.6
8493 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8494 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
8495```html
8496<!doctype html>
8497<html lang="en">
8498<head>
8499 <meta charset="utf-8">
8500 <title>jQuery.proxy demo</title>
8501 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8502</head>
8503<body>
8504
8505<p><button type="button" id="test">Test</button></p>
8506<div id="log"></div>
8507
8508<script>
8509var me = {
8510 type: "zombie",
8511 test: function( event ) {
8512 // Without proxy, `this` would refer to the event target
8513 // use event.target to reference that element.
8514 var element = event.target;
8515 $( element ).css( "background-color", "red" );
8516
8517 // With proxy, `this` refers to the me object encapsulating
8518 // this function.
8519 $( "#log" ).append( "Hello " + this.type + "<br>" );
8520 $( "#test" ).off( "click", this.test );
8521 }
8522};
8523
8524var you = {
8525 type: "person",
8526 test: function( event ) {
8527 $( "#log" ).append( this.type + " " );
8528 }
8529};
8530
8531// Execute you.test() in the context of the `you` object
8532// no matter where it is called
8533// i.e. the `this` keyword will refer to `you`
8534var youClick = $.proxy( you.test, you );
8535
8536// attach click handlers to #test
8537$( "#test" )
8538 // this === "zombie"; handler unbound after first click
8539 .on( "click", $.proxy( me.test, me ) )
8540
8541 // this === "person"
8542 .on( "click", youClick )
8543
8544 // this === "zombie"
8545 .on( "click", $.proxy( you.test, me ) )
8546
8547 // this === "<button> element"
8548 .on( "click", you.test );
8549</script>
8550
8551</body>
8552</html>
8553```
8554 * @example ​ ````Change the context of a function bound to the click handler,
8555```html
8556<!doctype html>
8557<html lang="en">
8558<head>
8559 <meta charset="utf-8">
8560 <title>jQuery.proxy demo</title>
8561 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8562</head>
8563<body>
8564
8565<p><button type="button" id="test">Test</button></p>
8566<div id="log"></div>
8567
8568<script>
8569var me = {
8570 // I'm a dog
8571 type: "dog",
8572
8573 // Note that event comes *after* one and two
8574 test: function( one, two, event ) {
8575 $( "#log" )
8576
8577 // `one` maps to `you`, the 1st additional
8578 // argument in the $.proxy function call
8579 .append( "<h3>Hello " + one.type + ":</h3>" )
8580
8581 // The `this` keyword refers to `me`
8582 // (the 2nd, context, argument of $.proxy)
8583 .append( "I am a " + this.type + ", " )
8584
8585 // `two` maps to `they`, the 2nd additional
8586 // argument in the $.proxy function call
8587 .append( "and they are " + two.type + ".<br>" )
8588
8589 // The event type is "click"
8590 .append( "Thanks for " + event.type + "ing." )
8591
8592 // The clicked element is `event.target`,
8593 // and its type is "button"
8594 .append( "the " + event.target.type + "." );
8595 }
8596};
8597
8598var you = { type: "cat" };
8599var they = { type: "fish" };
8600
8601// Set up handler to execute me.test() in the context
8602// of `me`, with `you` and `they` as additional arguments
8603var proxy = $.proxy( me.test, me, you, they );
8604
8605$( "#test" )
8606 .on( "click", proxy );
8607</script>
8608
8609</body>
8610</html>
8611```
8612 */
8613 proxy<TContext,
8614 TReturn,
8615 A, B, C, D, E, F,
8616 T, U, V, W>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
8617 t: T, u: U, v: V, w: W) => TReturn,
8618 context: TContext,
8619 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W) => TReturn;
8620 /**
8621 * Takes a function and returns a new one that will always have a particular context.
8622 * @param funсtion The function whose context will be changed.
8623 * @param context The object to which the context (`this`) of the function should be set.
8624 * @param a An argument to be passed to the function referenced in the `function` argument.
8625 * @param b An argument to be passed to the function referenced in the `function` argument.
8626 * @param c An argument to be passed to the function referenced in the `function` argument.
8627 * @param d An argument to be passed to the function referenced in the `function` argument.
8628 * @param e An argument to be passed to the function referenced in the `function` argument.
8629 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8630 * @since 1.4
8631 * @since 1.6
8632 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8633 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
8634```html
8635<!doctype html>
8636<html lang="en">
8637<head>
8638 <meta charset="utf-8">
8639 <title>jQuery.proxy demo</title>
8640 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8641</head>
8642<body>
8643
8644<p><button type="button" id="test">Test</button></p>
8645<div id="log"></div>
8646
8647<script>
8648var me = {
8649 type: "zombie",
8650 test: function( event ) {
8651 // Without proxy, `this` would refer to the event target
8652 // use event.target to reference that element.
8653 var element = event.target;
8654 $( element ).css( "background-color", "red" );
8655
8656 // With proxy, `this` refers to the me object encapsulating
8657 // this function.
8658 $( "#log" ).append( "Hello " + this.type + "<br>" );
8659 $( "#test" ).off( "click", this.test );
8660 }
8661};
8662
8663var you = {
8664 type: "person",
8665 test: function( event ) {
8666 $( "#log" ).append( this.type + " " );
8667 }
8668};
8669
8670// Execute you.test() in the context of the `you` object
8671// no matter where it is called
8672// i.e. the `this` keyword will refer to `you`
8673var youClick = $.proxy( you.test, you );
8674
8675// attach click handlers to #test
8676$( "#test" )
8677 // this === "zombie"; handler unbound after first click
8678 .on( "click", $.proxy( me.test, me ) )
8679
8680 // this === "person"
8681 .on( "click", youClick )
8682
8683 // this === "zombie"
8684 .on( "click", $.proxy( you.test, me ) )
8685
8686 // this === "<button> element"
8687 .on( "click", you.test );
8688</script>
8689
8690</body>
8691</html>
8692```
8693 * @example ​ ````Change the context of a function bound to the click handler,
8694```html
8695<!doctype html>
8696<html lang="en">
8697<head>
8698 <meta charset="utf-8">
8699 <title>jQuery.proxy demo</title>
8700 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8701</head>
8702<body>
8703
8704<p><button type="button" id="test">Test</button></p>
8705<div id="log"></div>
8706
8707<script>
8708var me = {
8709 // I'm a dog
8710 type: "dog",
8711
8712 // Note that event comes *after* one and two
8713 test: function( one, two, event ) {
8714 $( "#log" )
8715
8716 // `one` maps to `you`, the 1st additional
8717 // argument in the $.proxy function call
8718 .append( "<h3>Hello " + one.type + ":</h3>" )
8719
8720 // The `this` keyword refers to `me`
8721 // (the 2nd, context, argument of $.proxy)
8722 .append( "I am a " + this.type + ", " )
8723
8724 // `two` maps to `they`, the 2nd additional
8725 // argument in the $.proxy function call
8726 .append( "and they are " + two.type + ".<br>" )
8727
8728 // The event type is "click"
8729 .append( "Thanks for " + event.type + "ing." )
8730
8731 // The clicked element is `event.target`,
8732 // and its type is "button"
8733 .append( "the " + event.target.type + "." );
8734 }
8735};
8736
8737var you = { type: "cat" };
8738var they = { type: "fish" };
8739
8740// Set up handler to execute me.test() in the context
8741// of `me`, with `you` and `they` as additional arguments
8742var proxy = $.proxy( me.test, me, you, they );
8743
8744$( "#test" )
8745 .on( "click", proxy );
8746</script>
8747
8748</body>
8749</html>
8750```
8751 */
8752 proxy<TContext,
8753 TReturn,
8754 A, B, C, D, E,
8755 T, U, V, W>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
8756 t: T, u: U, v: V, w: W) => TReturn,
8757 context: TContext,
8758 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W) => TReturn;
8759 /**
8760 * Takes a function and returns a new one that will always have a particular context.
8761 * @param funсtion The function whose context will be changed.
8762 * @param context The object to which the context (`this`) of the function should be set.
8763 * @param a An argument to be passed to the function referenced in the `function` argument.
8764 * @param b An argument to be passed to the function referenced in the `function` argument.
8765 * @param c An argument to be passed to the function referenced in the `function` argument.
8766 * @param d An argument to be passed to the function referenced in the `function` argument.
8767 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8768 * @since 1.4
8769 * @since 1.6
8770 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8771 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
8772```html
8773<!doctype html>
8774<html lang="en">
8775<head>
8776 <meta charset="utf-8">
8777 <title>jQuery.proxy demo</title>
8778 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8779</head>
8780<body>
8781
8782<p><button type="button" id="test">Test</button></p>
8783<div id="log"></div>
8784
8785<script>
8786var me = {
8787 type: "zombie",
8788 test: function( event ) {
8789 // Without proxy, `this` would refer to the event target
8790 // use event.target to reference that element.
8791 var element = event.target;
8792 $( element ).css( "background-color", "red" );
8793
8794 // With proxy, `this` refers to the me object encapsulating
8795 // this function.
8796 $( "#log" ).append( "Hello " + this.type + "<br>" );
8797 $( "#test" ).off( "click", this.test );
8798 }
8799};
8800
8801var you = {
8802 type: "person",
8803 test: function( event ) {
8804 $( "#log" ).append( this.type + " " );
8805 }
8806};
8807
8808// Execute you.test() in the context of the `you` object
8809// no matter where it is called
8810// i.e. the `this` keyword will refer to `you`
8811var youClick = $.proxy( you.test, you );
8812
8813// attach click handlers to #test
8814$( "#test" )
8815 // this === "zombie"; handler unbound after first click
8816 .on( "click", $.proxy( me.test, me ) )
8817
8818 // this === "person"
8819 .on( "click", youClick )
8820
8821 // this === "zombie"
8822 .on( "click", $.proxy( you.test, me ) )
8823
8824 // this === "<button> element"
8825 .on( "click", you.test );
8826</script>
8827
8828</body>
8829</html>
8830```
8831 * @example ​ ````Change the context of a function bound to the click handler,
8832```html
8833<!doctype html>
8834<html lang="en">
8835<head>
8836 <meta charset="utf-8">
8837 <title>jQuery.proxy demo</title>
8838 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8839</head>
8840<body>
8841
8842<p><button type="button" id="test">Test</button></p>
8843<div id="log"></div>
8844
8845<script>
8846var me = {
8847 // I'm a dog
8848 type: "dog",
8849
8850 // Note that event comes *after* one and two
8851 test: function( one, two, event ) {
8852 $( "#log" )
8853
8854 // `one` maps to `you`, the 1st additional
8855 // argument in the $.proxy function call
8856 .append( "<h3>Hello " + one.type + ":</h3>" )
8857
8858 // The `this` keyword refers to `me`
8859 // (the 2nd, context, argument of $.proxy)
8860 .append( "I am a " + this.type + ", " )
8861
8862 // `two` maps to `they`, the 2nd additional
8863 // argument in the $.proxy function call
8864 .append( "and they are " + two.type + ".<br>" )
8865
8866 // The event type is "click"
8867 .append( "Thanks for " + event.type + "ing." )
8868
8869 // The clicked element is `event.target`,
8870 // and its type is "button"
8871 .append( "the " + event.target.type + "." );
8872 }
8873};
8874
8875var you = { type: "cat" };
8876var they = { type: "fish" };
8877
8878// Set up handler to execute me.test() in the context
8879// of `me`, with `you` and `they` as additional arguments
8880var proxy = $.proxy( me.test, me, you, they );
8881
8882$( "#test" )
8883 .on( "click", proxy );
8884</script>
8885
8886</body>
8887</html>
8888```
8889 */
8890 proxy<TContext,
8891 TReturn,
8892 A, B, C, D,
8893 T, U, V, W>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
8894 t: T, u: U, v: V, w: W) => TReturn,
8895 context: TContext,
8896 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W) => TReturn;
8897 /**
8898 * Takes a function and returns a new one that will always have a particular context.
8899 * @param funсtion The function whose context will be changed.
8900 * @param context The object to which the context (`this`) of the function should be set.
8901 * @param a An argument to be passed to the function referenced in the `function` argument.
8902 * @param b An argument to be passed to the function referenced in the `function` argument.
8903 * @param c An argument to be passed to the function referenced in the `function` argument.
8904 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8905 * @since 1.4
8906 * @since 1.6
8907 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8908 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
8909```html
8910<!doctype html>
8911<html lang="en">
8912<head>
8913 <meta charset="utf-8">
8914 <title>jQuery.proxy demo</title>
8915 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8916</head>
8917<body>
8918
8919<p><button type="button" id="test">Test</button></p>
8920<div id="log"></div>
8921
8922<script>
8923var me = {
8924 type: "zombie",
8925 test: function( event ) {
8926 // Without proxy, `this` would refer to the event target
8927 // use event.target to reference that element.
8928 var element = event.target;
8929 $( element ).css( "background-color", "red" );
8930
8931 // With proxy, `this` refers to the me object encapsulating
8932 // this function.
8933 $( "#log" ).append( "Hello " + this.type + "<br>" );
8934 $( "#test" ).off( "click", this.test );
8935 }
8936};
8937
8938var you = {
8939 type: "person",
8940 test: function( event ) {
8941 $( "#log" ).append( this.type + " " );
8942 }
8943};
8944
8945// Execute you.test() in the context of the `you` object
8946// no matter where it is called
8947// i.e. the `this` keyword will refer to `you`
8948var youClick = $.proxy( you.test, you );
8949
8950// attach click handlers to #test
8951$( "#test" )
8952 // this === "zombie"; handler unbound after first click
8953 .on( "click", $.proxy( me.test, me ) )
8954
8955 // this === "person"
8956 .on( "click", youClick )
8957
8958 // this === "zombie"
8959 .on( "click", $.proxy( you.test, me ) )
8960
8961 // this === "<button> element"
8962 .on( "click", you.test );
8963</script>
8964
8965</body>
8966</html>
8967```
8968 * @example ​ ````Change the context of a function bound to the click handler,
8969```html
8970<!doctype html>
8971<html lang="en">
8972<head>
8973 <meta charset="utf-8">
8974 <title>jQuery.proxy demo</title>
8975 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8976</head>
8977<body>
8978
8979<p><button type="button" id="test">Test</button></p>
8980<div id="log"></div>
8981
8982<script>
8983var me = {
8984 // I'm a dog
8985 type: "dog",
8986
8987 // Note that event comes *after* one and two
8988 test: function( one, two, event ) {
8989 $( "#log" )
8990
8991 // `one` maps to `you`, the 1st additional
8992 // argument in the $.proxy function call
8993 .append( "<h3>Hello " + one.type + ":</h3>" )
8994
8995 // The `this` keyword refers to `me`
8996 // (the 2nd, context, argument of $.proxy)
8997 .append( "I am a " + this.type + ", " )
8998
8999 // `two` maps to `they`, the 2nd additional
9000 // argument in the $.proxy function call
9001 .append( "and they are " + two.type + ".<br>" )
9002
9003 // The event type is "click"
9004 .append( "Thanks for " + event.type + "ing." )
9005
9006 // The clicked element is `event.target`,
9007 // and its type is "button"
9008 .append( "the " + event.target.type + "." );
9009 }
9010};
9011
9012var you = { type: "cat" };
9013var they = { type: "fish" };
9014
9015// Set up handler to execute me.test() in the context
9016// of `me`, with `you` and `they` as additional arguments
9017var proxy = $.proxy( me.test, me, you, they );
9018
9019$( "#test" )
9020 .on( "click", proxy );
9021</script>
9022
9023</body>
9024</html>
9025```
9026 */
9027 proxy<TContext,
9028 TReturn,
9029 A, B, C,
9030 T, U, V, W>(funсtion: (this: TContext, a: A, b: B, c: C,
9031 t: T, u: U, v: V, w: W) => TReturn,
9032 context: TContext,
9033 a: A, b: B, c: C): (t: T, u: U, v: V, w: W) => TReturn;
9034 /**
9035 * Takes a function and returns a new one that will always have a particular context.
9036 * @param funсtion The function whose context will be changed.
9037 * @param context The object to which the context (`this`) of the function should be set.
9038 * @param a An argument to be passed to the function referenced in the `function` argument.
9039 * @param b An argument to be passed to the function referenced in the `function` argument.
9040 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9041 * @since 1.4
9042 * @since 1.6
9043 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9044 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
9045```html
9046<!doctype html>
9047<html lang="en">
9048<head>
9049 <meta charset="utf-8">
9050 <title>jQuery.proxy demo</title>
9051 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9052</head>
9053<body>
9054
9055<p><button type="button" id="test">Test</button></p>
9056<div id="log"></div>
9057
9058<script>
9059var me = {
9060 type: "zombie",
9061 test: function( event ) {
9062 // Without proxy, `this` would refer to the event target
9063 // use event.target to reference that element.
9064 var element = event.target;
9065 $( element ).css( "background-color", "red" );
9066
9067 // With proxy, `this` refers to the me object encapsulating
9068 // this function.
9069 $( "#log" ).append( "Hello " + this.type + "<br>" );
9070 $( "#test" ).off( "click", this.test );
9071 }
9072};
9073
9074var you = {
9075 type: "person",
9076 test: function( event ) {
9077 $( "#log" ).append( this.type + " " );
9078 }
9079};
9080
9081// Execute you.test() in the context of the `you` object
9082// no matter where it is called
9083// i.e. the `this` keyword will refer to `you`
9084var youClick = $.proxy( you.test, you );
9085
9086// attach click handlers to #test
9087$( "#test" )
9088 // this === "zombie"; handler unbound after first click
9089 .on( "click", $.proxy( me.test, me ) )
9090
9091 // this === "person"
9092 .on( "click", youClick )
9093
9094 // this === "zombie"
9095 .on( "click", $.proxy( you.test, me ) )
9096
9097 // this === "<button> element"
9098 .on( "click", you.test );
9099</script>
9100
9101</body>
9102</html>
9103```
9104 * @example ​ ````Change the context of a function bound to the click handler,
9105```html
9106<!doctype html>
9107<html lang="en">
9108<head>
9109 <meta charset="utf-8">
9110 <title>jQuery.proxy demo</title>
9111 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9112</head>
9113<body>
9114
9115<p><button type="button" id="test">Test</button></p>
9116<div id="log"></div>
9117
9118<script>
9119var me = {
9120 // I'm a dog
9121 type: "dog",
9122
9123 // Note that event comes *after* one and two
9124 test: function( one, two, event ) {
9125 $( "#log" )
9126
9127 // `one` maps to `you`, the 1st additional
9128 // argument in the $.proxy function call
9129 .append( "<h3>Hello " + one.type + ":</h3>" )
9130
9131 // The `this` keyword refers to `me`
9132 // (the 2nd, context, argument of $.proxy)
9133 .append( "I am a " + this.type + ", " )
9134
9135 // `two` maps to `they`, the 2nd additional
9136 // argument in the $.proxy function call
9137 .append( "and they are " + two.type + ".<br>" )
9138
9139 // The event type is "click"
9140 .append( "Thanks for " + event.type + "ing." )
9141
9142 // The clicked element is `event.target`,
9143 // and its type is "button"
9144 .append( "the " + event.target.type + "." );
9145 }
9146};
9147
9148var you = { type: "cat" };
9149var they = { type: "fish" };
9150
9151// Set up handler to execute me.test() in the context
9152// of `me`, with `you` and `they` as additional arguments
9153var proxy = $.proxy( me.test, me, you, they );
9154
9155$( "#test" )
9156 .on( "click", proxy );
9157</script>
9158
9159</body>
9160</html>
9161```
9162 */
9163 proxy<TContext,
9164 TReturn,
9165 A, B,
9166 T, U, V, W>(funсtion: (this: TContext, a: A, b: B,
9167 t: T, u: U, v: V, w: W) => TReturn,
9168 context: TContext,
9169 a: A, b: B): (t: T, u: U, v: V, w: W) => TReturn;
9170 /**
9171 * Takes a function and returns a new one that will always have a particular context.
9172 * @param funсtion The function whose context will be changed.
9173 * @param context The object to which the context (`this`) of the function should be set.
9174 * @param a An argument to be passed to the function referenced in the `function` argument.
9175 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9176 * @since 1.4
9177 * @since 1.6
9178 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9179 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
9180```html
9181<!doctype html>
9182<html lang="en">
9183<head>
9184 <meta charset="utf-8">
9185 <title>jQuery.proxy demo</title>
9186 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9187</head>
9188<body>
9189
9190<p><button type="button" id="test">Test</button></p>
9191<div id="log"></div>
9192
9193<script>
9194var me = {
9195 type: "zombie",
9196 test: function( event ) {
9197 // Without proxy, `this` would refer to the event target
9198 // use event.target to reference that element.
9199 var element = event.target;
9200 $( element ).css( "background-color", "red" );
9201
9202 // With proxy, `this` refers to the me object encapsulating
9203 // this function.
9204 $( "#log" ).append( "Hello " + this.type + "<br>" );
9205 $( "#test" ).off( "click", this.test );
9206 }
9207};
9208
9209var you = {
9210 type: "person",
9211 test: function( event ) {
9212 $( "#log" ).append( this.type + " " );
9213 }
9214};
9215
9216// Execute you.test() in the context of the `you` object
9217// no matter where it is called
9218// i.e. the `this` keyword will refer to `you`
9219var youClick = $.proxy( you.test, you );
9220
9221// attach click handlers to #test
9222$( "#test" )
9223 // this === "zombie"; handler unbound after first click
9224 .on( "click", $.proxy( me.test, me ) )
9225
9226 // this === "person"
9227 .on( "click", youClick )
9228
9229 // this === "zombie"
9230 .on( "click", $.proxy( you.test, me ) )
9231
9232 // this === "<button> element"
9233 .on( "click", you.test );
9234</script>
9235
9236</body>
9237</html>
9238```
9239 * @example ​ ````Change the context of a function bound to the click handler,
9240```html
9241<!doctype html>
9242<html lang="en">
9243<head>
9244 <meta charset="utf-8">
9245 <title>jQuery.proxy demo</title>
9246 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9247</head>
9248<body>
9249
9250<p><button type="button" id="test">Test</button></p>
9251<div id="log"></div>
9252
9253<script>
9254var me = {
9255 // I'm a dog
9256 type: "dog",
9257
9258 // Note that event comes *after* one and two
9259 test: function( one, two, event ) {
9260 $( "#log" )
9261
9262 // `one` maps to `you`, the 1st additional
9263 // argument in the $.proxy function call
9264 .append( "<h3>Hello " + one.type + ":</h3>" )
9265
9266 // The `this` keyword refers to `me`
9267 // (the 2nd, context, argument of $.proxy)
9268 .append( "I am a " + this.type + ", " )
9269
9270 // `two` maps to `they`, the 2nd additional
9271 // argument in the $.proxy function call
9272 .append( "and they are " + two.type + ".<br>" )
9273
9274 // The event type is "click"
9275 .append( "Thanks for " + event.type + "ing." )
9276
9277 // The clicked element is `event.target`,
9278 // and its type is "button"
9279 .append( "the " + event.target.type + "." );
9280 }
9281};
9282
9283var you = { type: "cat" };
9284var they = { type: "fish" };
9285
9286// Set up handler to execute me.test() in the context
9287// of `me`, with `you` and `they` as additional arguments
9288var proxy = $.proxy( me.test, me, you, they );
9289
9290$( "#test" )
9291 .on( "click", proxy );
9292</script>
9293
9294</body>
9295</html>
9296```
9297 */
9298 proxy<TContext,
9299 TReturn,
9300 A,
9301 T, U, V, W>(funсtion: (this: TContext, a: A,
9302 t: T, u: U, v: V, w: W) => TReturn,
9303 context: TContext,
9304 a: A): (t: T, u: U, v: V, w: W) => TReturn;
9305 /**
9306 * Takes a function and returns a new one that will always have a particular context.
9307 * @param funсtion The function whose context will be changed.
9308 * @param context The object to which the context (`this`) of the function should be set.
9309 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9310 * @since 1.4
9311 * @since 1.6
9312 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9313 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
9314```html
9315<!doctype html>
9316<html lang="en">
9317<head>
9318 <meta charset="utf-8">
9319 <title>jQuery.proxy demo</title>
9320 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9321</head>
9322<body>
9323
9324<p><button type="button" id="test">Test</button></p>
9325<div id="log"></div>
9326
9327<script>
9328var me = {
9329 type: "zombie",
9330 test: function( event ) {
9331 // Without proxy, `this` would refer to the event target
9332 // use event.target to reference that element.
9333 var element = event.target;
9334 $( element ).css( "background-color", "red" );
9335
9336 // With proxy, `this` refers to the me object encapsulating
9337 // this function.
9338 $( "#log" ).append( "Hello " + this.type + "<br>" );
9339 $( "#test" ).off( "click", this.test );
9340 }
9341};
9342
9343var you = {
9344 type: "person",
9345 test: function( event ) {
9346 $( "#log" ).append( this.type + " " );
9347 }
9348};
9349
9350// Execute you.test() in the context of the `you` object
9351// no matter where it is called
9352// i.e. the `this` keyword will refer to `you`
9353var youClick = $.proxy( you.test, you );
9354
9355// attach click handlers to #test
9356$( "#test" )
9357 // this === "zombie"; handler unbound after first click
9358 .on( "click", $.proxy( me.test, me ) )
9359
9360 // this === "person"
9361 .on( "click", youClick )
9362
9363 // this === "zombie"
9364 .on( "click", $.proxy( you.test, me ) )
9365
9366 // this === "<button> element"
9367 .on( "click", you.test );
9368</script>
9369
9370</body>
9371</html>
9372```
9373 * @example ​ ````Change the context of a function bound to the click handler,
9374```html
9375<!doctype html>
9376<html lang="en">
9377<head>
9378 <meta charset="utf-8">
9379 <title>jQuery.proxy demo</title>
9380 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9381</head>
9382<body>
9383
9384<p><button type="button" id="test">Test</button></p>
9385<div id="log"></div>
9386
9387<script>
9388var me = {
9389 // I'm a dog
9390 type: "dog",
9391
9392 // Note that event comes *after* one and two
9393 test: function( one, two, event ) {
9394 $( "#log" )
9395
9396 // `one` maps to `you`, the 1st additional
9397 // argument in the $.proxy function call
9398 .append( "<h3>Hello " + one.type + ":</h3>" )
9399
9400 // The `this` keyword refers to `me`
9401 // (the 2nd, context, argument of $.proxy)
9402 .append( "I am a " + this.type + ", " )
9403
9404 // `two` maps to `they`, the 2nd additional
9405 // argument in the $.proxy function call
9406 .append( "and they are " + two.type + ".<br>" )
9407
9408 // The event type is "click"
9409 .append( "Thanks for " + event.type + "ing." )
9410
9411 // The clicked element is `event.target`,
9412 // and its type is "button"
9413 .append( "the " + event.target.type + "." );
9414 }
9415};
9416
9417var you = { type: "cat" };
9418var they = { type: "fish" };
9419
9420// Set up handler to execute me.test() in the context
9421// of `me`, with `you` and `they` as additional arguments
9422var proxy = $.proxy( me.test, me, you, they );
9423
9424$( "#test" )
9425 .on( "click", proxy );
9426</script>
9427
9428</body>
9429</html>
9430```
9431 */
9432 proxy<TContext,
9433 TReturn,
9434 T, U, V, W>(funсtion: (this: TContext, t: T, u: U, v: V, w: W) => TReturn,
9435 context: TContext): (t: T, u: U, v: V, w: W) => TReturn;
9436
9437 // #endregion
9438
9439 // region 5 parameters
9440 // #region 5 parameters
9441
9442 /**
9443 * Takes a function and returns a new one that will always have a particular context.
9444 * @param funсtion The function whose context will be changed.
9445 * @param context The object to which the context (`this`) of the function should be set.
9446 * @param a An argument to be passed to the function referenced in the `function` argument.
9447 * @param b An argument to be passed to the function referenced in the `function` argument.
9448 * @param c An argument to be passed to the function referenced in the `function` argument.
9449 * @param d An argument to be passed to the function referenced in the `function` argument.
9450 * @param e An argument to be passed to the function referenced in the `function` argument.
9451 * @param f An argument to be passed to the function referenced in the `function` argument.
9452 * @param g An argument to be passed to the function referenced in the `function` argument.
9453 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9454 * @since 1.4
9455 * @since 1.6
9456 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9457 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
9458```html
9459<!doctype html>
9460<html lang="en">
9461<head>
9462 <meta charset="utf-8">
9463 <title>jQuery.proxy demo</title>
9464 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9465</head>
9466<body>
9467
9468<p><button type="button" id="test">Test</button></p>
9469<div id="log"></div>
9470
9471<script>
9472var me = {
9473 type: "zombie",
9474 test: function( event ) {
9475 // Without proxy, `this` would refer to the event target
9476 // use event.target to reference that element.
9477 var element = event.target;
9478 $( element ).css( "background-color", "red" );
9479
9480 // With proxy, `this` refers to the me object encapsulating
9481 // this function.
9482 $( "#log" ).append( "Hello " + this.type + "<br>" );
9483 $( "#test" ).off( "click", this.test );
9484 }
9485};
9486
9487var you = {
9488 type: "person",
9489 test: function( event ) {
9490 $( "#log" ).append( this.type + " " );
9491 }
9492};
9493
9494// Execute you.test() in the context of the `you` object
9495// no matter where it is called
9496// i.e. the `this` keyword will refer to `you`
9497var youClick = $.proxy( you.test, you );
9498
9499// attach click handlers to #test
9500$( "#test" )
9501 // this === "zombie"; handler unbound after first click
9502 .on( "click", $.proxy( me.test, me ) )
9503
9504 // this === "person"
9505 .on( "click", youClick )
9506
9507 // this === "zombie"
9508 .on( "click", $.proxy( you.test, me ) )
9509
9510 // this === "<button> element"
9511 .on( "click", you.test );
9512</script>
9513
9514</body>
9515</html>
9516```
9517 * @example ​ ````Change the context of a function bound to the click handler,
9518```html
9519<!doctype html>
9520<html lang="en">
9521<head>
9522 <meta charset="utf-8">
9523 <title>jQuery.proxy demo</title>
9524 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9525</head>
9526<body>
9527
9528<p><button type="button" id="test">Test</button></p>
9529<div id="log"></div>
9530
9531<script>
9532var me = {
9533 // I'm a dog
9534 type: "dog",
9535
9536 // Note that event comes *after* one and two
9537 test: function( one, two, event ) {
9538 $( "#log" )
9539
9540 // `one` maps to `you`, the 1st additional
9541 // argument in the $.proxy function call
9542 .append( "<h3>Hello " + one.type + ":</h3>" )
9543
9544 // The `this` keyword refers to `me`
9545 // (the 2nd, context, argument of $.proxy)
9546 .append( "I am a " + this.type + ", " )
9547
9548 // `two` maps to `they`, the 2nd additional
9549 // argument in the $.proxy function call
9550 .append( "and they are " + two.type + ".<br>" )
9551
9552 // The event type is "click"
9553 .append( "Thanks for " + event.type + "ing." )
9554
9555 // The clicked element is `event.target`,
9556 // and its type is "button"
9557 .append( "the " + event.target.type + "." );
9558 }
9559};
9560
9561var you = { type: "cat" };
9562var they = { type: "fish" };
9563
9564// Set up handler to execute me.test() in the context
9565// of `me`, with `you` and `they` as additional arguments
9566var proxy = $.proxy( me.test, me, you, they );
9567
9568$( "#test" )
9569 .on( "click", proxy );
9570</script>
9571
9572</body>
9573</html>
9574```
9575 */
9576 proxy<TContext,
9577 TReturn,
9578 A, B, C, D, E, F, G,
9579 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
9580 t: T, u: U, v: V, w: W, x: X) => TReturn,
9581 context: TContext,
9582 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X) => TReturn;
9583 /**
9584 * Takes a function and returns a new one that will always have a particular context.
9585 * @param funсtion The function whose context will be changed.
9586 * @param context The object to which the context (`this`) of the function should be set.
9587 * @param a An argument to be passed to the function referenced in the `function` argument.
9588 * @param b An argument to be passed to the function referenced in the `function` argument.
9589 * @param c An argument to be passed to the function referenced in the `function` argument.
9590 * @param d An argument to be passed to the function referenced in the `function` argument.
9591 * @param e An argument to be passed to the function referenced in the `function` argument.
9592 * @param f An argument to be passed to the function referenced in the `function` argument.
9593 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9594 * @since 1.4
9595 * @since 1.6
9596 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9597 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
9598```html
9599<!doctype html>
9600<html lang="en">
9601<head>
9602 <meta charset="utf-8">
9603 <title>jQuery.proxy demo</title>
9604 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9605</head>
9606<body>
9607
9608<p><button type="button" id="test">Test</button></p>
9609<div id="log"></div>
9610
9611<script>
9612var me = {
9613 type: "zombie",
9614 test: function( event ) {
9615 // Without proxy, `this` would refer to the event target
9616 // use event.target to reference that element.
9617 var element = event.target;
9618 $( element ).css( "background-color", "red" );
9619
9620 // With proxy, `this` refers to the me object encapsulating
9621 // this function.
9622 $( "#log" ).append( "Hello " + this.type + "<br>" );
9623 $( "#test" ).off( "click", this.test );
9624 }
9625};
9626
9627var you = {
9628 type: "person",
9629 test: function( event ) {
9630 $( "#log" ).append( this.type + " " );
9631 }
9632};
9633
9634// Execute you.test() in the context of the `you` object
9635// no matter where it is called
9636// i.e. the `this` keyword will refer to `you`
9637var youClick = $.proxy( you.test, you );
9638
9639// attach click handlers to #test
9640$( "#test" )
9641 // this === "zombie"; handler unbound after first click
9642 .on( "click", $.proxy( me.test, me ) )
9643
9644 // this === "person"
9645 .on( "click", youClick )
9646
9647 // this === "zombie"
9648 .on( "click", $.proxy( you.test, me ) )
9649
9650 // this === "<button> element"
9651 .on( "click", you.test );
9652</script>
9653
9654</body>
9655</html>
9656```
9657 * @example ​ ````Change the context of a function bound to the click handler,
9658```html
9659<!doctype html>
9660<html lang="en">
9661<head>
9662 <meta charset="utf-8">
9663 <title>jQuery.proxy demo</title>
9664 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9665</head>
9666<body>
9667
9668<p><button type="button" id="test">Test</button></p>
9669<div id="log"></div>
9670
9671<script>
9672var me = {
9673 // I'm a dog
9674 type: "dog",
9675
9676 // Note that event comes *after* one and two
9677 test: function( one, two, event ) {
9678 $( "#log" )
9679
9680 // `one` maps to `you`, the 1st additional
9681 // argument in the $.proxy function call
9682 .append( "<h3>Hello " + one.type + ":</h3>" )
9683
9684 // The `this` keyword refers to `me`
9685 // (the 2nd, context, argument of $.proxy)
9686 .append( "I am a " + this.type + ", " )
9687
9688 // `two` maps to `they`, the 2nd additional
9689 // argument in the $.proxy function call
9690 .append( "and they are " + two.type + ".<br>" )
9691
9692 // The event type is "click"
9693 .append( "Thanks for " + event.type + "ing." )
9694
9695 // The clicked element is `event.target`,
9696 // and its type is "button"
9697 .append( "the " + event.target.type + "." );
9698 }
9699};
9700
9701var you = { type: "cat" };
9702var they = { type: "fish" };
9703
9704// Set up handler to execute me.test() in the context
9705// of `me`, with `you` and `they` as additional arguments
9706var proxy = $.proxy( me.test, me, you, they );
9707
9708$( "#test" )
9709 .on( "click", proxy );
9710</script>
9711
9712</body>
9713</html>
9714```
9715 */
9716 proxy<TContext,
9717 TReturn,
9718 A, B, C, D, E, F,
9719 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
9720 t: T, u: U, v: V, w: W, x: X) => TReturn,
9721 context: TContext,
9722 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X) => TReturn;
9723 /**
9724 * Takes a function and returns a new one that will always have a particular context.
9725 * @param funсtion The function whose context will be changed.
9726 * @param context The object to which the context (`this`) of the function should be set.
9727 * @param a An argument to be passed to the function referenced in the `function` argument.
9728 * @param b An argument to be passed to the function referenced in the `function` argument.
9729 * @param c An argument to be passed to the function referenced in the `function` argument.
9730 * @param d An argument to be passed to the function referenced in the `function` argument.
9731 * @param e An argument to be passed to the function referenced in the `function` argument.
9732 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9733 * @since 1.4
9734 * @since 1.6
9735 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9736 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
9737```html
9738<!doctype html>
9739<html lang="en">
9740<head>
9741 <meta charset="utf-8">
9742 <title>jQuery.proxy demo</title>
9743 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9744</head>
9745<body>
9746
9747<p><button type="button" id="test">Test</button></p>
9748<div id="log"></div>
9749
9750<script>
9751var me = {
9752 type: "zombie",
9753 test: function( event ) {
9754 // Without proxy, `this` would refer to the event target
9755 // use event.target to reference that element.
9756 var element = event.target;
9757 $( element ).css( "background-color", "red" );
9758
9759 // With proxy, `this` refers to the me object encapsulating
9760 // this function.
9761 $( "#log" ).append( "Hello " + this.type + "<br>" );
9762 $( "#test" ).off( "click", this.test );
9763 }
9764};
9765
9766var you = {
9767 type: "person",
9768 test: function( event ) {
9769 $( "#log" ).append( this.type + " " );
9770 }
9771};
9772
9773// Execute you.test() in the context of the `you` object
9774// no matter where it is called
9775// i.e. the `this` keyword will refer to `you`
9776var youClick = $.proxy( you.test, you );
9777
9778// attach click handlers to #test
9779$( "#test" )
9780 // this === "zombie"; handler unbound after first click
9781 .on( "click", $.proxy( me.test, me ) )
9782
9783 // this === "person"
9784 .on( "click", youClick )
9785
9786 // this === "zombie"
9787 .on( "click", $.proxy( you.test, me ) )
9788
9789 // this === "<button> element"
9790 .on( "click", you.test );
9791</script>
9792
9793</body>
9794</html>
9795```
9796 * @example ​ ````Change the context of a function bound to the click handler,
9797```html
9798<!doctype html>
9799<html lang="en">
9800<head>
9801 <meta charset="utf-8">
9802 <title>jQuery.proxy demo</title>
9803 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9804</head>
9805<body>
9806
9807<p><button type="button" id="test">Test</button></p>
9808<div id="log"></div>
9809
9810<script>
9811var me = {
9812 // I'm a dog
9813 type: "dog",
9814
9815 // Note that event comes *after* one and two
9816 test: function( one, two, event ) {
9817 $( "#log" )
9818
9819 // `one` maps to `you`, the 1st additional
9820 // argument in the $.proxy function call
9821 .append( "<h3>Hello " + one.type + ":</h3>" )
9822
9823 // The `this` keyword refers to `me`
9824 // (the 2nd, context, argument of $.proxy)
9825 .append( "I am a " + this.type + ", " )
9826
9827 // `two` maps to `they`, the 2nd additional
9828 // argument in the $.proxy function call
9829 .append( "and they are " + two.type + ".<br>" )
9830
9831 // The event type is "click"
9832 .append( "Thanks for " + event.type + "ing." )
9833
9834 // The clicked element is `event.target`,
9835 // and its type is "button"
9836 .append( "the " + event.target.type + "." );
9837 }
9838};
9839
9840var you = { type: "cat" };
9841var they = { type: "fish" };
9842
9843// Set up handler to execute me.test() in the context
9844// of `me`, with `you` and `they` as additional arguments
9845var proxy = $.proxy( me.test, me, you, they );
9846
9847$( "#test" )
9848 .on( "click", proxy );
9849</script>
9850
9851</body>
9852</html>
9853```
9854 */
9855 proxy<TContext,
9856 TReturn,
9857 A, B, C, D, E,
9858 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
9859 t: T, u: U, v: V, w: W, x: X) => TReturn,
9860 context: TContext,
9861 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X) => TReturn;
9862 /**
9863 * Takes a function and returns a new one that will always have a particular context.
9864 * @param funсtion The function whose context will be changed.
9865 * @param context The object to which the context (`this`) of the function should be set.
9866 * @param a An argument to be passed to the function referenced in the `function` argument.
9867 * @param b An argument to be passed to the function referenced in the `function` argument.
9868 * @param c An argument to be passed to the function referenced in the `function` argument.
9869 * @param d An argument to be passed to the function referenced in the `function` argument.
9870 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9871 * @since 1.4
9872 * @since 1.6
9873 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9874 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
9875```html
9876<!doctype html>
9877<html lang="en">
9878<head>
9879 <meta charset="utf-8">
9880 <title>jQuery.proxy demo</title>
9881 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9882</head>
9883<body>
9884
9885<p><button type="button" id="test">Test</button></p>
9886<div id="log"></div>
9887
9888<script>
9889var me = {
9890 type: "zombie",
9891 test: function( event ) {
9892 // Without proxy, `this` would refer to the event target
9893 // use event.target to reference that element.
9894 var element = event.target;
9895 $( element ).css( "background-color", "red" );
9896
9897 // With proxy, `this` refers to the me object encapsulating
9898 // this function.
9899 $( "#log" ).append( "Hello " + this.type + "<br>" );
9900 $( "#test" ).off( "click", this.test );
9901 }
9902};
9903
9904var you = {
9905 type: "person",
9906 test: function( event ) {
9907 $( "#log" ).append( this.type + " " );
9908 }
9909};
9910
9911// Execute you.test() in the context of the `you` object
9912// no matter where it is called
9913// i.e. the `this` keyword will refer to `you`
9914var youClick = $.proxy( you.test, you );
9915
9916// attach click handlers to #test
9917$( "#test" )
9918 // this === "zombie"; handler unbound after first click
9919 .on( "click", $.proxy( me.test, me ) )
9920
9921 // this === "person"
9922 .on( "click", youClick )
9923
9924 // this === "zombie"
9925 .on( "click", $.proxy( you.test, me ) )
9926
9927 // this === "<button> element"
9928 .on( "click", you.test );
9929</script>
9930
9931</body>
9932</html>
9933```
9934 * @example ​ ````Change the context of a function bound to the click handler,
9935```html
9936<!doctype html>
9937<html lang="en">
9938<head>
9939 <meta charset="utf-8">
9940 <title>jQuery.proxy demo</title>
9941 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9942</head>
9943<body>
9944
9945<p><button type="button" id="test">Test</button></p>
9946<div id="log"></div>
9947
9948<script>
9949var me = {
9950 // I'm a dog
9951 type: "dog",
9952
9953 // Note that event comes *after* one and two
9954 test: function( one, two, event ) {
9955 $( "#log" )
9956
9957 // `one` maps to `you`, the 1st additional
9958 // argument in the $.proxy function call
9959 .append( "<h3>Hello " + one.type + ":</h3>" )
9960
9961 // The `this` keyword refers to `me`
9962 // (the 2nd, context, argument of $.proxy)
9963 .append( "I am a " + this.type + ", " )
9964
9965 // `two` maps to `they`, the 2nd additional
9966 // argument in the $.proxy function call
9967 .append( "and they are " + two.type + ".<br>" )
9968
9969 // The event type is "click"
9970 .append( "Thanks for " + event.type + "ing." )
9971
9972 // The clicked element is `event.target`,
9973 // and its type is "button"
9974 .append( "the " + event.target.type + "." );
9975 }
9976};
9977
9978var you = { type: "cat" };
9979var they = { type: "fish" };
9980
9981// Set up handler to execute me.test() in the context
9982// of `me`, with `you` and `they` as additional arguments
9983var proxy = $.proxy( me.test, me, you, they );
9984
9985$( "#test" )
9986 .on( "click", proxy );
9987</script>
9988
9989</body>
9990</html>
9991```
9992 */
9993 proxy<TContext,
9994 TReturn,
9995 A, B, C, D,
9996 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
9997 t: T, u: U, v: V, w: W, x: X) => TReturn,
9998 context: TContext,
9999 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X) => TReturn;
10000 /**
10001 * Takes a function and returns a new one that will always have a particular context.
10002 * @param funсtion The function whose context will be changed.
10003 * @param context The object to which the context (`this`) of the function should be set.
10004 * @param a An argument to be passed to the function referenced in the `function` argument.
10005 * @param b An argument to be passed to the function referenced in the `function` argument.
10006 * @param c An argument to be passed to the function referenced in the `function` argument.
10007 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10008 * @since 1.4
10009 * @since 1.6
10010 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10011 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
10012```html
10013<!doctype html>
10014<html lang="en">
10015<head>
10016 <meta charset="utf-8">
10017 <title>jQuery.proxy demo</title>
10018 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10019</head>
10020<body>
10021
10022<p><button type="button" id="test">Test</button></p>
10023<div id="log"></div>
10024
10025<script>
10026var me = {
10027 type: "zombie",
10028 test: function( event ) {
10029 // Without proxy, `this` would refer to the event target
10030 // use event.target to reference that element.
10031 var element = event.target;
10032 $( element ).css( "background-color", "red" );
10033
10034 // With proxy, `this` refers to the me object encapsulating
10035 // this function.
10036 $( "#log" ).append( "Hello " + this.type + "<br>" );
10037 $( "#test" ).off( "click", this.test );
10038 }
10039};
10040
10041var you = {
10042 type: "person",
10043 test: function( event ) {
10044 $( "#log" ).append( this.type + " " );
10045 }
10046};
10047
10048// Execute you.test() in the context of the `you` object
10049// no matter where it is called
10050// i.e. the `this` keyword will refer to `you`
10051var youClick = $.proxy( you.test, you );
10052
10053// attach click handlers to #test
10054$( "#test" )
10055 // this === "zombie"; handler unbound after first click
10056 .on( "click", $.proxy( me.test, me ) )
10057
10058 // this === "person"
10059 .on( "click", youClick )
10060
10061 // this === "zombie"
10062 .on( "click", $.proxy( you.test, me ) )
10063
10064 // this === "<button> element"
10065 .on( "click", you.test );
10066</script>
10067
10068</body>
10069</html>
10070```
10071 * @example ​ ````Change the context of a function bound to the click handler,
10072```html
10073<!doctype html>
10074<html lang="en">
10075<head>
10076 <meta charset="utf-8">
10077 <title>jQuery.proxy demo</title>
10078 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10079</head>
10080<body>
10081
10082<p><button type="button" id="test">Test</button></p>
10083<div id="log"></div>
10084
10085<script>
10086var me = {
10087 // I'm a dog
10088 type: "dog",
10089
10090 // Note that event comes *after* one and two
10091 test: function( one, two, event ) {
10092 $( "#log" )
10093
10094 // `one` maps to `you`, the 1st additional
10095 // argument in the $.proxy function call
10096 .append( "<h3>Hello " + one.type + ":</h3>" )
10097
10098 // The `this` keyword refers to `me`
10099 // (the 2nd, context, argument of $.proxy)
10100 .append( "I am a " + this.type + ", " )
10101
10102 // `two` maps to `they`, the 2nd additional
10103 // argument in the $.proxy function call
10104 .append( "and they are " + two.type + ".<br>" )
10105
10106 // The event type is "click"
10107 .append( "Thanks for " + event.type + "ing." )
10108
10109 // The clicked element is `event.target`,
10110 // and its type is "button"
10111 .append( "the " + event.target.type + "." );
10112 }
10113};
10114
10115var you = { type: "cat" };
10116var they = { type: "fish" };
10117
10118// Set up handler to execute me.test() in the context
10119// of `me`, with `you` and `they` as additional arguments
10120var proxy = $.proxy( me.test, me, you, they );
10121
10122$( "#test" )
10123 .on( "click", proxy );
10124</script>
10125
10126</body>
10127</html>
10128```
10129 */
10130 proxy<TContext,
10131 TReturn,
10132 A, B, C,
10133 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B, c: C,
10134 t: T, u: U, v: V, w: W, x: X) => TReturn,
10135 context: TContext,
10136 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X) => TReturn;
10137 /**
10138 * Takes a function and returns a new one that will always have a particular context.
10139 * @param funсtion The function whose context will be changed.
10140 * @param context The object to which the context (`this`) of the function should be set.
10141 * @param a An argument to be passed to the function referenced in the `function` argument.
10142 * @param b An argument to be passed to the function referenced in the `function` argument.
10143 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10144 * @since 1.4
10145 * @since 1.6
10146 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10147 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
10148```html
10149<!doctype html>
10150<html lang="en">
10151<head>
10152 <meta charset="utf-8">
10153 <title>jQuery.proxy demo</title>
10154 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10155</head>
10156<body>
10157
10158<p><button type="button" id="test">Test</button></p>
10159<div id="log"></div>
10160
10161<script>
10162var me = {
10163 type: "zombie",
10164 test: function( event ) {
10165 // Without proxy, `this` would refer to the event target
10166 // use event.target to reference that element.
10167 var element = event.target;
10168 $( element ).css( "background-color", "red" );
10169
10170 // With proxy, `this` refers to the me object encapsulating
10171 // this function.
10172 $( "#log" ).append( "Hello " + this.type + "<br>" );
10173 $( "#test" ).off( "click", this.test );
10174 }
10175};
10176
10177var you = {
10178 type: "person",
10179 test: function( event ) {
10180 $( "#log" ).append( this.type + " " );
10181 }
10182};
10183
10184// Execute you.test() in the context of the `you` object
10185// no matter where it is called
10186// i.e. the `this` keyword will refer to `you`
10187var youClick = $.proxy( you.test, you );
10188
10189// attach click handlers to #test
10190$( "#test" )
10191 // this === "zombie"; handler unbound after first click
10192 .on( "click", $.proxy( me.test, me ) )
10193
10194 // this === "person"
10195 .on( "click", youClick )
10196
10197 // this === "zombie"
10198 .on( "click", $.proxy( you.test, me ) )
10199
10200 // this === "<button> element"
10201 .on( "click", you.test );
10202</script>
10203
10204</body>
10205</html>
10206```
10207 * @example ​ ````Change the context of a function bound to the click handler,
10208```html
10209<!doctype html>
10210<html lang="en">
10211<head>
10212 <meta charset="utf-8">
10213 <title>jQuery.proxy demo</title>
10214 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10215</head>
10216<body>
10217
10218<p><button type="button" id="test">Test</button></p>
10219<div id="log"></div>
10220
10221<script>
10222var me = {
10223 // I'm a dog
10224 type: "dog",
10225
10226 // Note that event comes *after* one and two
10227 test: function( one, two, event ) {
10228 $( "#log" )
10229
10230 // `one` maps to `you`, the 1st additional
10231 // argument in the $.proxy function call
10232 .append( "<h3>Hello " + one.type + ":</h3>" )
10233
10234 // The `this` keyword refers to `me`
10235 // (the 2nd, context, argument of $.proxy)
10236 .append( "I am a " + this.type + ", " )
10237
10238 // `two` maps to `they`, the 2nd additional
10239 // argument in the $.proxy function call
10240 .append( "and they are " + two.type + ".<br>" )
10241
10242 // The event type is "click"
10243 .append( "Thanks for " + event.type + "ing." )
10244
10245 // The clicked element is `event.target`,
10246 // and its type is "button"
10247 .append( "the " + event.target.type + "." );
10248 }
10249};
10250
10251var you = { type: "cat" };
10252var they = { type: "fish" };
10253
10254// Set up handler to execute me.test() in the context
10255// of `me`, with `you` and `they` as additional arguments
10256var proxy = $.proxy( me.test, me, you, they );
10257
10258$( "#test" )
10259 .on( "click", proxy );
10260</script>
10261
10262</body>
10263</html>
10264```
10265 */
10266 proxy<TContext,
10267 TReturn,
10268 A, B,
10269 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B,
10270 t: T, u: U, v: V, w: W, x: X) => TReturn,
10271 context: TContext,
10272 a: A, b: B): (t: T, u: U, v: V, w: W, x: X) => TReturn;
10273 /**
10274 * Takes a function and returns a new one that will always have a particular context.
10275 * @param funсtion The function whose context will be changed.
10276 * @param context The object to which the context (`this`) of the function should be set.
10277 * @param a An argument to be passed to the function referenced in the `function` argument.
10278 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10279 * @since 1.4
10280 * @since 1.6
10281 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10282 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
10283```html
10284<!doctype html>
10285<html lang="en">
10286<head>
10287 <meta charset="utf-8">
10288 <title>jQuery.proxy demo</title>
10289 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10290</head>
10291<body>
10292
10293<p><button type="button" id="test">Test</button></p>
10294<div id="log"></div>
10295
10296<script>
10297var me = {
10298 type: "zombie",
10299 test: function( event ) {
10300 // Without proxy, `this` would refer to the event target
10301 // use event.target to reference that element.
10302 var element = event.target;
10303 $( element ).css( "background-color", "red" );
10304
10305 // With proxy, `this` refers to the me object encapsulating
10306 // this function.
10307 $( "#log" ).append( "Hello " + this.type + "<br>" );
10308 $( "#test" ).off( "click", this.test );
10309 }
10310};
10311
10312var you = {
10313 type: "person",
10314 test: function( event ) {
10315 $( "#log" ).append( this.type + " " );
10316 }
10317};
10318
10319// Execute you.test() in the context of the `you` object
10320// no matter where it is called
10321// i.e. the `this` keyword will refer to `you`
10322var youClick = $.proxy( you.test, you );
10323
10324// attach click handlers to #test
10325$( "#test" )
10326 // this === "zombie"; handler unbound after first click
10327 .on( "click", $.proxy( me.test, me ) )
10328
10329 // this === "person"
10330 .on( "click", youClick )
10331
10332 // this === "zombie"
10333 .on( "click", $.proxy( you.test, me ) )
10334
10335 // this === "<button> element"
10336 .on( "click", you.test );
10337</script>
10338
10339</body>
10340</html>
10341```
10342 * @example ​ ````Change the context of a function bound to the click handler,
10343```html
10344<!doctype html>
10345<html lang="en">
10346<head>
10347 <meta charset="utf-8">
10348 <title>jQuery.proxy demo</title>
10349 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10350</head>
10351<body>
10352
10353<p><button type="button" id="test">Test</button></p>
10354<div id="log"></div>
10355
10356<script>
10357var me = {
10358 // I'm a dog
10359 type: "dog",
10360
10361 // Note that event comes *after* one and two
10362 test: function( one, two, event ) {
10363 $( "#log" )
10364
10365 // `one` maps to `you`, the 1st additional
10366 // argument in the $.proxy function call
10367 .append( "<h3>Hello " + one.type + ":</h3>" )
10368
10369 // The `this` keyword refers to `me`
10370 // (the 2nd, context, argument of $.proxy)
10371 .append( "I am a " + this.type + ", " )
10372
10373 // `two` maps to `they`, the 2nd additional
10374 // argument in the $.proxy function call
10375 .append( "and they are " + two.type + ".<br>" )
10376
10377 // The event type is "click"
10378 .append( "Thanks for " + event.type + "ing." )
10379
10380 // The clicked element is `event.target`,
10381 // and its type is "button"
10382 .append( "the " + event.target.type + "." );
10383 }
10384};
10385
10386var you = { type: "cat" };
10387var they = { type: "fish" };
10388
10389// Set up handler to execute me.test() in the context
10390// of `me`, with `you` and `they` as additional arguments
10391var proxy = $.proxy( me.test, me, you, they );
10392
10393$( "#test" )
10394 .on( "click", proxy );
10395</script>
10396
10397</body>
10398</html>
10399```
10400 */
10401 proxy<TContext,
10402 TReturn,
10403 A,
10404 T, U, V, W, X>(funсtion: (this: TContext, a: A,
10405 t: T, u: U, v: V, w: W, x: X) => TReturn,
10406 context: TContext,
10407 a: A): (t: T, u: U, v: V, w: W, x: X) => TReturn;
10408 /**
10409 * Takes a function and returns a new one that will always have a particular context.
10410 * @param funсtion The function whose context will be changed.
10411 * @param context The object to which the context (`this`) of the function should be set.
10412 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10413 * @since 1.4
10414 * @since 1.6
10415 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10416 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
10417```html
10418<!doctype html>
10419<html lang="en">
10420<head>
10421 <meta charset="utf-8">
10422 <title>jQuery.proxy demo</title>
10423 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10424</head>
10425<body>
10426
10427<p><button type="button" id="test">Test</button></p>
10428<div id="log"></div>
10429
10430<script>
10431var me = {
10432 type: "zombie",
10433 test: function( event ) {
10434 // Without proxy, `this` would refer to the event target
10435 // use event.target to reference that element.
10436 var element = event.target;
10437 $( element ).css( "background-color", "red" );
10438
10439 // With proxy, `this` refers to the me object encapsulating
10440 // this function.
10441 $( "#log" ).append( "Hello " + this.type + "<br>" );
10442 $( "#test" ).off( "click", this.test );
10443 }
10444};
10445
10446var you = {
10447 type: "person",
10448 test: function( event ) {
10449 $( "#log" ).append( this.type + " " );
10450 }
10451};
10452
10453// Execute you.test() in the context of the `you` object
10454// no matter where it is called
10455// i.e. the `this` keyword will refer to `you`
10456var youClick = $.proxy( you.test, you );
10457
10458// attach click handlers to #test
10459$( "#test" )
10460 // this === "zombie"; handler unbound after first click
10461 .on( "click", $.proxy( me.test, me ) )
10462
10463 // this === "person"
10464 .on( "click", youClick )
10465
10466 // this === "zombie"
10467 .on( "click", $.proxy( you.test, me ) )
10468
10469 // this === "<button> element"
10470 .on( "click", you.test );
10471</script>
10472
10473</body>
10474</html>
10475```
10476 * @example ​ ````Change the context of a function bound to the click handler,
10477```html
10478<!doctype html>
10479<html lang="en">
10480<head>
10481 <meta charset="utf-8">
10482 <title>jQuery.proxy demo</title>
10483 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10484</head>
10485<body>
10486
10487<p><button type="button" id="test">Test</button></p>
10488<div id="log"></div>
10489
10490<script>
10491var me = {
10492 // I'm a dog
10493 type: "dog",
10494
10495 // Note that event comes *after* one and two
10496 test: function( one, two, event ) {
10497 $( "#log" )
10498
10499 // `one` maps to `you`, the 1st additional
10500 // argument in the $.proxy function call
10501 .append( "<h3>Hello " + one.type + ":</h3>" )
10502
10503 // The `this` keyword refers to `me`
10504 // (the 2nd, context, argument of $.proxy)
10505 .append( "I am a " + this.type + ", " )
10506
10507 // `two` maps to `they`, the 2nd additional
10508 // argument in the $.proxy function call
10509 .append( "and they are " + two.type + ".<br>" )
10510
10511 // The event type is "click"
10512 .append( "Thanks for " + event.type + "ing." )
10513
10514 // The clicked element is `event.target`,
10515 // and its type is "button"
10516 .append( "the " + event.target.type + "." );
10517 }
10518};
10519
10520var you = { type: "cat" };
10521var they = { type: "fish" };
10522
10523// Set up handler to execute me.test() in the context
10524// of `me`, with `you` and `they` as additional arguments
10525var proxy = $.proxy( me.test, me, you, they );
10526
10527$( "#test" )
10528 .on( "click", proxy );
10529</script>
10530
10531</body>
10532</html>
10533```
10534 */
10535 proxy<TContext,
10536 TReturn,
10537 T, U, V, W, X>(funсtion: (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn,
10538 context: TContext): (t: T, u: U, v: V, w: W, x: X) => TReturn;
10539
10540 // #endregion
10541
10542 // region 6 parameters
10543 // #region 6 parameters
10544
10545 /**
10546 * Takes a function and returns a new one that will always have a particular context.
10547 * @param funсtion The function whose context will be changed.
10548 * @param context The object to which the context (`this`) of the function should be set.
10549 * @param a An argument to be passed to the function referenced in the `function` argument.
10550 * @param b An argument to be passed to the function referenced in the `function` argument.
10551 * @param c An argument to be passed to the function referenced in the `function` argument.
10552 * @param d An argument to be passed to the function referenced in the `function` argument.
10553 * @param e An argument to be passed to the function referenced in the `function` argument.
10554 * @param f An argument to be passed to the function referenced in the `function` argument.
10555 * @param g An argument to be passed to the function referenced in the `function` argument.
10556 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10557 * @since 1.4
10558 * @since 1.6
10559 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10560 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
10561```html
10562<!doctype html>
10563<html lang="en">
10564<head>
10565 <meta charset="utf-8">
10566 <title>jQuery.proxy demo</title>
10567 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10568</head>
10569<body>
10570
10571<p><button type="button" id="test">Test</button></p>
10572<div id="log"></div>
10573
10574<script>
10575var me = {
10576 type: "zombie",
10577 test: function( event ) {
10578 // Without proxy, `this` would refer to the event target
10579 // use event.target to reference that element.
10580 var element = event.target;
10581 $( element ).css( "background-color", "red" );
10582
10583 // With proxy, `this` refers to the me object encapsulating
10584 // this function.
10585 $( "#log" ).append( "Hello " + this.type + "<br>" );
10586 $( "#test" ).off( "click", this.test );
10587 }
10588};
10589
10590var you = {
10591 type: "person",
10592 test: function( event ) {
10593 $( "#log" ).append( this.type + " " );
10594 }
10595};
10596
10597// Execute you.test() in the context of the `you` object
10598// no matter where it is called
10599// i.e. the `this` keyword will refer to `you`
10600var youClick = $.proxy( you.test, you );
10601
10602// attach click handlers to #test
10603$( "#test" )
10604 // this === "zombie"; handler unbound after first click
10605 .on( "click", $.proxy( me.test, me ) )
10606
10607 // this === "person"
10608 .on( "click", youClick )
10609
10610 // this === "zombie"
10611 .on( "click", $.proxy( you.test, me ) )
10612
10613 // this === "<button> element"
10614 .on( "click", you.test );
10615</script>
10616
10617</body>
10618</html>
10619```
10620 * @example ​ ````Change the context of a function bound to the click handler,
10621```html
10622<!doctype html>
10623<html lang="en">
10624<head>
10625 <meta charset="utf-8">
10626 <title>jQuery.proxy demo</title>
10627 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10628</head>
10629<body>
10630
10631<p><button type="button" id="test">Test</button></p>
10632<div id="log"></div>
10633
10634<script>
10635var me = {
10636 // I'm a dog
10637 type: "dog",
10638
10639 // Note that event comes *after* one and two
10640 test: function( one, two, event ) {
10641 $( "#log" )
10642
10643 // `one` maps to `you`, the 1st additional
10644 // argument in the $.proxy function call
10645 .append( "<h3>Hello " + one.type + ":</h3>" )
10646
10647 // The `this` keyword refers to `me`
10648 // (the 2nd, context, argument of $.proxy)
10649 .append( "I am a " + this.type + ", " )
10650
10651 // `two` maps to `they`, the 2nd additional
10652 // argument in the $.proxy function call
10653 .append( "and they are " + two.type + ".<br>" )
10654
10655 // The event type is "click"
10656 .append( "Thanks for " + event.type + "ing." )
10657
10658 // The clicked element is `event.target`,
10659 // and its type is "button"
10660 .append( "the " + event.target.type + "." );
10661 }
10662};
10663
10664var you = { type: "cat" };
10665var they = { type: "fish" };
10666
10667// Set up handler to execute me.test() in the context
10668// of `me`, with `you` and `they` as additional arguments
10669var proxy = $.proxy( me.test, me, you, they );
10670
10671$( "#test" )
10672 .on( "click", proxy );
10673</script>
10674
10675</body>
10676</html>
10677```
10678 */
10679 proxy<TContext,
10680 TReturn,
10681 A, B, C, D, E, F, G,
10682 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
10683 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
10684 context: TContext,
10685 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
10686 /**
10687 * Takes a function and returns a new one that will always have a particular context.
10688 * @param funсtion The function whose context will be changed.
10689 * @param context The object to which the context (`this`) of the function should be set.
10690 * @param a An argument to be passed to the function referenced in the `function` argument.
10691 * @param b An argument to be passed to the function referenced in the `function` argument.
10692 * @param c An argument to be passed to the function referenced in the `function` argument.
10693 * @param d An argument to be passed to the function referenced in the `function` argument.
10694 * @param e An argument to be passed to the function referenced in the `function` argument.
10695 * @param f An argument to be passed to the function referenced in the `function` argument.
10696 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10697 * @since 1.4
10698 * @since 1.6
10699 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10700 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
10701```html
10702<!doctype html>
10703<html lang="en">
10704<head>
10705 <meta charset="utf-8">
10706 <title>jQuery.proxy demo</title>
10707 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10708</head>
10709<body>
10710
10711<p><button type="button" id="test">Test</button></p>
10712<div id="log"></div>
10713
10714<script>
10715var me = {
10716 type: "zombie",
10717 test: function( event ) {
10718 // Without proxy, `this` would refer to the event target
10719 // use event.target to reference that element.
10720 var element = event.target;
10721 $( element ).css( "background-color", "red" );
10722
10723 // With proxy, `this` refers to the me object encapsulating
10724 // this function.
10725 $( "#log" ).append( "Hello " + this.type + "<br>" );
10726 $( "#test" ).off( "click", this.test );
10727 }
10728};
10729
10730var you = {
10731 type: "person",
10732 test: function( event ) {
10733 $( "#log" ).append( this.type + " " );
10734 }
10735};
10736
10737// Execute you.test() in the context of the `you` object
10738// no matter where it is called
10739// i.e. the `this` keyword will refer to `you`
10740var youClick = $.proxy( you.test, you );
10741
10742// attach click handlers to #test
10743$( "#test" )
10744 // this === "zombie"; handler unbound after first click
10745 .on( "click", $.proxy( me.test, me ) )
10746
10747 // this === "person"
10748 .on( "click", youClick )
10749
10750 // this === "zombie"
10751 .on( "click", $.proxy( you.test, me ) )
10752
10753 // this === "<button> element"
10754 .on( "click", you.test );
10755</script>
10756
10757</body>
10758</html>
10759```
10760 * @example ​ ````Change the context of a function bound to the click handler,
10761```html
10762<!doctype html>
10763<html lang="en">
10764<head>
10765 <meta charset="utf-8">
10766 <title>jQuery.proxy demo</title>
10767 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10768</head>
10769<body>
10770
10771<p><button type="button" id="test">Test</button></p>
10772<div id="log"></div>
10773
10774<script>
10775var me = {
10776 // I'm a dog
10777 type: "dog",
10778
10779 // Note that event comes *after* one and two
10780 test: function( one, two, event ) {
10781 $( "#log" )
10782
10783 // `one` maps to `you`, the 1st additional
10784 // argument in the $.proxy function call
10785 .append( "<h3>Hello " + one.type + ":</h3>" )
10786
10787 // The `this` keyword refers to `me`
10788 // (the 2nd, context, argument of $.proxy)
10789 .append( "I am a " + this.type + ", " )
10790
10791 // `two` maps to `they`, the 2nd additional
10792 // argument in the $.proxy function call
10793 .append( "and they are " + two.type + ".<br>" )
10794
10795 // The event type is "click"
10796 .append( "Thanks for " + event.type + "ing." )
10797
10798 // The clicked element is `event.target`,
10799 // and its type is "button"
10800 .append( "the " + event.target.type + "." );
10801 }
10802};
10803
10804var you = { type: "cat" };
10805var they = { type: "fish" };
10806
10807// Set up handler to execute me.test() in the context
10808// of `me`, with `you` and `they` as additional arguments
10809var proxy = $.proxy( me.test, me, you, they );
10810
10811$( "#test" )
10812 .on( "click", proxy );
10813</script>
10814
10815</body>
10816</html>
10817```
10818 */
10819 proxy<TContext,
10820 TReturn,
10821 A, B, C, D, E, F,
10822 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
10823 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
10824 context: TContext,
10825 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
10826 /**
10827 * Takes a function and returns a new one that will always have a particular context.
10828 * @param funсtion The function whose context will be changed.
10829 * @param context The object to which the context (`this`) of the function should be set.
10830 * @param a An argument to be passed to the function referenced in the `function` argument.
10831 * @param b An argument to be passed to the function referenced in the `function` argument.
10832 * @param c An argument to be passed to the function referenced in the `function` argument.
10833 * @param d An argument to be passed to the function referenced in the `function` argument.
10834 * @param e An argument to be passed to the function referenced in the `function` argument.
10835 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10836 * @since 1.4
10837 * @since 1.6
10838 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10839 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
10840```html
10841<!doctype html>
10842<html lang="en">
10843<head>
10844 <meta charset="utf-8">
10845 <title>jQuery.proxy demo</title>
10846 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10847</head>
10848<body>
10849
10850<p><button type="button" id="test">Test</button></p>
10851<div id="log"></div>
10852
10853<script>
10854var me = {
10855 type: "zombie",
10856 test: function( event ) {
10857 // Without proxy, `this` would refer to the event target
10858 // use event.target to reference that element.
10859 var element = event.target;
10860 $( element ).css( "background-color", "red" );
10861
10862 // With proxy, `this` refers to the me object encapsulating
10863 // this function.
10864 $( "#log" ).append( "Hello " + this.type + "<br>" );
10865 $( "#test" ).off( "click", this.test );
10866 }
10867};
10868
10869var you = {
10870 type: "person",
10871 test: function( event ) {
10872 $( "#log" ).append( this.type + " " );
10873 }
10874};
10875
10876// Execute you.test() in the context of the `you` object
10877// no matter where it is called
10878// i.e. the `this` keyword will refer to `you`
10879var youClick = $.proxy( you.test, you );
10880
10881// attach click handlers to #test
10882$( "#test" )
10883 // this === "zombie"; handler unbound after first click
10884 .on( "click", $.proxy( me.test, me ) )
10885
10886 // this === "person"
10887 .on( "click", youClick )
10888
10889 // this === "zombie"
10890 .on( "click", $.proxy( you.test, me ) )
10891
10892 // this === "<button> element"
10893 .on( "click", you.test );
10894</script>
10895
10896</body>
10897</html>
10898```
10899 * @example ​ ````Change the context of a function bound to the click handler,
10900```html
10901<!doctype html>
10902<html lang="en">
10903<head>
10904 <meta charset="utf-8">
10905 <title>jQuery.proxy demo</title>
10906 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10907</head>
10908<body>
10909
10910<p><button type="button" id="test">Test</button></p>
10911<div id="log"></div>
10912
10913<script>
10914var me = {
10915 // I'm a dog
10916 type: "dog",
10917
10918 // Note that event comes *after* one and two
10919 test: function( one, two, event ) {
10920 $( "#log" )
10921
10922 // `one` maps to `you`, the 1st additional
10923 // argument in the $.proxy function call
10924 .append( "<h3>Hello " + one.type + ":</h3>" )
10925
10926 // The `this` keyword refers to `me`
10927 // (the 2nd, context, argument of $.proxy)
10928 .append( "I am a " + this.type + ", " )
10929
10930 // `two` maps to `they`, the 2nd additional
10931 // argument in the $.proxy function call
10932 .append( "and they are " + two.type + ".<br>" )
10933
10934 // The event type is "click"
10935 .append( "Thanks for " + event.type + "ing." )
10936
10937 // The clicked element is `event.target`,
10938 // and its type is "button"
10939 .append( "the " + event.target.type + "." );
10940 }
10941};
10942
10943var you = { type: "cat" };
10944var they = { type: "fish" };
10945
10946// Set up handler to execute me.test() in the context
10947// of `me`, with `you` and `they` as additional arguments
10948var proxy = $.proxy( me.test, me, you, they );
10949
10950$( "#test" )
10951 .on( "click", proxy );
10952</script>
10953
10954</body>
10955</html>
10956```
10957 */
10958 proxy<TContext,
10959 TReturn,
10960 A, B, C, D, E,
10961 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
10962 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
10963 context: TContext,
10964 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
10965 /**
10966 * Takes a function and returns a new one that will always have a particular context.
10967 * @param funсtion The function whose context will be changed.
10968 * @param context The object to which the context (`this`) of the function should be set.
10969 * @param a An argument to be passed to the function referenced in the `function` argument.
10970 * @param b An argument to be passed to the function referenced in the `function` argument.
10971 * @param c An argument to be passed to the function referenced in the `function` argument.
10972 * @param d An argument to be passed to the function referenced in the `function` argument.
10973 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10974 * @since 1.4
10975 * @since 1.6
10976 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10977 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
10978```html
10979<!doctype html>
10980<html lang="en">
10981<head>
10982 <meta charset="utf-8">
10983 <title>jQuery.proxy demo</title>
10984 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10985</head>
10986<body>
10987
10988<p><button type="button" id="test">Test</button></p>
10989<div id="log"></div>
10990
10991<script>
10992var me = {
10993 type: "zombie",
10994 test: function( event ) {
10995 // Without proxy, `this` would refer to the event target
10996 // use event.target to reference that element.
10997 var element = event.target;
10998 $( element ).css( "background-color", "red" );
10999
11000 // With proxy, `this` refers to the me object encapsulating
11001 // this function.
11002 $( "#log" ).append( "Hello " + this.type + "<br>" );
11003 $( "#test" ).off( "click", this.test );
11004 }
11005};
11006
11007var you = {
11008 type: "person",
11009 test: function( event ) {
11010 $( "#log" ).append( this.type + " " );
11011 }
11012};
11013
11014// Execute you.test() in the context of the `you` object
11015// no matter where it is called
11016// i.e. the `this` keyword will refer to `you`
11017var youClick = $.proxy( you.test, you );
11018
11019// attach click handlers to #test
11020$( "#test" )
11021 // this === "zombie"; handler unbound after first click
11022 .on( "click", $.proxy( me.test, me ) )
11023
11024 // this === "person"
11025 .on( "click", youClick )
11026
11027 // this === "zombie"
11028 .on( "click", $.proxy( you.test, me ) )
11029
11030 // this === "<button> element"
11031 .on( "click", you.test );
11032</script>
11033
11034</body>
11035</html>
11036```
11037 * @example ​ ````Change the context of a function bound to the click handler,
11038```html
11039<!doctype html>
11040<html lang="en">
11041<head>
11042 <meta charset="utf-8">
11043 <title>jQuery.proxy demo</title>
11044 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11045</head>
11046<body>
11047
11048<p><button type="button" id="test">Test</button></p>
11049<div id="log"></div>
11050
11051<script>
11052var me = {
11053 // I'm a dog
11054 type: "dog",
11055
11056 // Note that event comes *after* one and two
11057 test: function( one, two, event ) {
11058 $( "#log" )
11059
11060 // `one` maps to `you`, the 1st additional
11061 // argument in the $.proxy function call
11062 .append( "<h3>Hello " + one.type + ":</h3>" )
11063
11064 // The `this` keyword refers to `me`
11065 // (the 2nd, context, argument of $.proxy)
11066 .append( "I am a " + this.type + ", " )
11067
11068 // `two` maps to `they`, the 2nd additional
11069 // argument in the $.proxy function call
11070 .append( "and they are " + two.type + ".<br>" )
11071
11072 // The event type is "click"
11073 .append( "Thanks for " + event.type + "ing." )
11074
11075 // The clicked element is `event.target`,
11076 // and its type is "button"
11077 .append( "the " + event.target.type + "." );
11078 }
11079};
11080
11081var you = { type: "cat" };
11082var they = { type: "fish" };
11083
11084// Set up handler to execute me.test() in the context
11085// of `me`, with `you` and `they` as additional arguments
11086var proxy = $.proxy( me.test, me, you, they );
11087
11088$( "#test" )
11089 .on( "click", proxy );
11090</script>
11091
11092</body>
11093</html>
11094```
11095 */
11096 proxy<TContext,
11097 TReturn,
11098 A, B, C, D,
11099 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
11100 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
11101 context: TContext,
11102 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
11103 /**
11104 * Takes a function and returns a new one that will always have a particular context.
11105 * @param funсtion The function whose context will be changed.
11106 * @param context The object to which the context (`this`) of the function should be set.
11107 * @param a An argument to be passed to the function referenced in the `function` argument.
11108 * @param b An argument to be passed to the function referenced in the `function` argument.
11109 * @param c An argument to be passed to the function referenced in the `function` argument.
11110 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11111 * @since 1.4
11112 * @since 1.6
11113 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11114 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
11115```html
11116<!doctype html>
11117<html lang="en">
11118<head>
11119 <meta charset="utf-8">
11120 <title>jQuery.proxy demo</title>
11121 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11122</head>
11123<body>
11124
11125<p><button type="button" id="test">Test</button></p>
11126<div id="log"></div>
11127
11128<script>
11129var me = {
11130 type: "zombie",
11131 test: function( event ) {
11132 // Without proxy, `this` would refer to the event target
11133 // use event.target to reference that element.
11134 var element = event.target;
11135 $( element ).css( "background-color", "red" );
11136
11137 // With proxy, `this` refers to the me object encapsulating
11138 // this function.
11139 $( "#log" ).append( "Hello " + this.type + "<br>" );
11140 $( "#test" ).off( "click", this.test );
11141 }
11142};
11143
11144var you = {
11145 type: "person",
11146 test: function( event ) {
11147 $( "#log" ).append( this.type + " " );
11148 }
11149};
11150
11151// Execute you.test() in the context of the `you` object
11152// no matter where it is called
11153// i.e. the `this` keyword will refer to `you`
11154var youClick = $.proxy( you.test, you );
11155
11156// attach click handlers to #test
11157$( "#test" )
11158 // this === "zombie"; handler unbound after first click
11159 .on( "click", $.proxy( me.test, me ) )
11160
11161 // this === "person"
11162 .on( "click", youClick )
11163
11164 // this === "zombie"
11165 .on( "click", $.proxy( you.test, me ) )
11166
11167 // this === "<button> element"
11168 .on( "click", you.test );
11169</script>
11170
11171</body>
11172</html>
11173```
11174 * @example ​ ````Change the context of a function bound to the click handler,
11175```html
11176<!doctype html>
11177<html lang="en">
11178<head>
11179 <meta charset="utf-8">
11180 <title>jQuery.proxy demo</title>
11181 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11182</head>
11183<body>
11184
11185<p><button type="button" id="test">Test</button></p>
11186<div id="log"></div>
11187
11188<script>
11189var me = {
11190 // I'm a dog
11191 type: "dog",
11192
11193 // Note that event comes *after* one and two
11194 test: function( one, two, event ) {
11195 $( "#log" )
11196
11197 // `one` maps to `you`, the 1st additional
11198 // argument in the $.proxy function call
11199 .append( "<h3>Hello " + one.type + ":</h3>" )
11200
11201 // The `this` keyword refers to `me`
11202 // (the 2nd, context, argument of $.proxy)
11203 .append( "I am a " + this.type + ", " )
11204
11205 // `two` maps to `they`, the 2nd additional
11206 // argument in the $.proxy function call
11207 .append( "and they are " + two.type + ".<br>" )
11208
11209 // The event type is "click"
11210 .append( "Thanks for " + event.type + "ing." )
11211
11212 // The clicked element is `event.target`,
11213 // and its type is "button"
11214 .append( "the " + event.target.type + "." );
11215 }
11216};
11217
11218var you = { type: "cat" };
11219var they = { type: "fish" };
11220
11221// Set up handler to execute me.test() in the context
11222// of `me`, with `you` and `they` as additional arguments
11223var proxy = $.proxy( me.test, me, you, they );
11224
11225$( "#test" )
11226 .on( "click", proxy );
11227</script>
11228
11229</body>
11230</html>
11231```
11232 */
11233 proxy<TContext,
11234 TReturn,
11235 A, B, C,
11236 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B, c: C,
11237 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
11238 context: TContext,
11239 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
11240 /**
11241 * Takes a function and returns a new one that will always have a particular context.
11242 * @param funсtion The function whose context will be changed.
11243 * @param context The object to which the context (`this`) of the function should be set.
11244 * @param a An argument to be passed to the function referenced in the `function` argument.
11245 * @param b An argument to be passed to the function referenced in the `function` argument.
11246 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11247 * @since 1.4
11248 * @since 1.6
11249 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11250 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
11251```html
11252<!doctype html>
11253<html lang="en">
11254<head>
11255 <meta charset="utf-8">
11256 <title>jQuery.proxy demo</title>
11257 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11258</head>
11259<body>
11260
11261<p><button type="button" id="test">Test</button></p>
11262<div id="log"></div>
11263
11264<script>
11265var me = {
11266 type: "zombie",
11267 test: function( event ) {
11268 // Without proxy, `this` would refer to the event target
11269 // use event.target to reference that element.
11270 var element = event.target;
11271 $( element ).css( "background-color", "red" );
11272
11273 // With proxy, `this` refers to the me object encapsulating
11274 // this function.
11275 $( "#log" ).append( "Hello " + this.type + "<br>" );
11276 $( "#test" ).off( "click", this.test );
11277 }
11278};
11279
11280var you = {
11281 type: "person",
11282 test: function( event ) {
11283 $( "#log" ).append( this.type + " " );
11284 }
11285};
11286
11287// Execute you.test() in the context of the `you` object
11288// no matter where it is called
11289// i.e. the `this` keyword will refer to `you`
11290var youClick = $.proxy( you.test, you );
11291
11292// attach click handlers to #test
11293$( "#test" )
11294 // this === "zombie"; handler unbound after first click
11295 .on( "click", $.proxy( me.test, me ) )
11296
11297 // this === "person"
11298 .on( "click", youClick )
11299
11300 // this === "zombie"
11301 .on( "click", $.proxy( you.test, me ) )
11302
11303 // this === "<button> element"
11304 .on( "click", you.test );
11305</script>
11306
11307</body>
11308</html>
11309```
11310 * @example ​ ````Change the context of a function bound to the click handler,
11311```html
11312<!doctype html>
11313<html lang="en">
11314<head>
11315 <meta charset="utf-8">
11316 <title>jQuery.proxy demo</title>
11317 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11318</head>
11319<body>
11320
11321<p><button type="button" id="test">Test</button></p>
11322<div id="log"></div>
11323
11324<script>
11325var me = {
11326 // I'm a dog
11327 type: "dog",
11328
11329 // Note that event comes *after* one and two
11330 test: function( one, two, event ) {
11331 $( "#log" )
11332
11333 // `one` maps to `you`, the 1st additional
11334 // argument in the $.proxy function call
11335 .append( "<h3>Hello " + one.type + ":</h3>" )
11336
11337 // The `this` keyword refers to `me`
11338 // (the 2nd, context, argument of $.proxy)
11339 .append( "I am a " + this.type + ", " )
11340
11341 // `two` maps to `they`, the 2nd additional
11342 // argument in the $.proxy function call
11343 .append( "and they are " + two.type + ".<br>" )
11344
11345 // The event type is "click"
11346 .append( "Thanks for " + event.type + "ing." )
11347
11348 // The clicked element is `event.target`,
11349 // and its type is "button"
11350 .append( "the " + event.target.type + "." );
11351 }
11352};
11353
11354var you = { type: "cat" };
11355var they = { type: "fish" };
11356
11357// Set up handler to execute me.test() in the context
11358// of `me`, with `you` and `they` as additional arguments
11359var proxy = $.proxy( me.test, me, you, they );
11360
11361$( "#test" )
11362 .on( "click", proxy );
11363</script>
11364
11365</body>
11366</html>
11367```
11368 */
11369 proxy<TContext,
11370 TReturn,
11371 A, B,
11372 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B,
11373 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
11374 context: TContext,
11375 a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
11376 /**
11377 * Takes a function and returns a new one that will always have a particular context.
11378 * @param funсtion The function whose context will be changed.
11379 * @param context The object to which the context (`this`) of the function should be set.
11380 * @param a An argument to be passed to the function referenced in the `function` argument.
11381 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11382 * @since 1.4
11383 * @since 1.6
11384 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11385 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
11386```html
11387<!doctype html>
11388<html lang="en">
11389<head>
11390 <meta charset="utf-8">
11391 <title>jQuery.proxy demo</title>
11392 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11393</head>
11394<body>
11395
11396<p><button type="button" id="test">Test</button></p>
11397<div id="log"></div>
11398
11399<script>
11400var me = {
11401 type: "zombie",
11402 test: function( event ) {
11403 // Without proxy, `this` would refer to the event target
11404 // use event.target to reference that element.
11405 var element = event.target;
11406 $( element ).css( "background-color", "red" );
11407
11408 // With proxy, `this` refers to the me object encapsulating
11409 // this function.
11410 $( "#log" ).append( "Hello " + this.type + "<br>" );
11411 $( "#test" ).off( "click", this.test );
11412 }
11413};
11414
11415var you = {
11416 type: "person",
11417 test: function( event ) {
11418 $( "#log" ).append( this.type + " " );
11419 }
11420};
11421
11422// Execute you.test() in the context of the `you` object
11423// no matter where it is called
11424// i.e. the `this` keyword will refer to `you`
11425var youClick = $.proxy( you.test, you );
11426
11427// attach click handlers to #test
11428$( "#test" )
11429 // this === "zombie"; handler unbound after first click
11430 .on( "click", $.proxy( me.test, me ) )
11431
11432 // this === "person"
11433 .on( "click", youClick )
11434
11435 // this === "zombie"
11436 .on( "click", $.proxy( you.test, me ) )
11437
11438 // this === "<button> element"
11439 .on( "click", you.test );
11440</script>
11441
11442</body>
11443</html>
11444```
11445 * @example ​ ````Change the context of a function bound to the click handler,
11446```html
11447<!doctype html>
11448<html lang="en">
11449<head>
11450 <meta charset="utf-8">
11451 <title>jQuery.proxy demo</title>
11452 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11453</head>
11454<body>
11455
11456<p><button type="button" id="test">Test</button></p>
11457<div id="log"></div>
11458
11459<script>
11460var me = {
11461 // I'm a dog
11462 type: "dog",
11463
11464 // Note that event comes *after* one and two
11465 test: function( one, two, event ) {
11466 $( "#log" )
11467
11468 // `one` maps to `you`, the 1st additional
11469 // argument in the $.proxy function call
11470 .append( "<h3>Hello " + one.type + ":</h3>" )
11471
11472 // The `this` keyword refers to `me`
11473 // (the 2nd, context, argument of $.proxy)
11474 .append( "I am a " + this.type + ", " )
11475
11476 // `two` maps to `they`, the 2nd additional
11477 // argument in the $.proxy function call
11478 .append( "and they are " + two.type + ".<br>" )
11479
11480 // The event type is "click"
11481 .append( "Thanks for " + event.type + "ing." )
11482
11483 // The clicked element is `event.target`,
11484 // and its type is "button"
11485 .append( "the " + event.target.type + "." );
11486 }
11487};
11488
11489var you = { type: "cat" };
11490var they = { type: "fish" };
11491
11492// Set up handler to execute me.test() in the context
11493// of `me`, with `you` and `they` as additional arguments
11494var proxy = $.proxy( me.test, me, you, they );
11495
11496$( "#test" )
11497 .on( "click", proxy );
11498</script>
11499
11500</body>
11501</html>
11502```
11503 */
11504 proxy<TContext,
11505 TReturn,
11506 A,
11507 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A,
11508 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
11509 context: TContext,
11510 a: A): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
11511 /**
11512 * Takes a function and returns a new one that will always have a particular context.
11513 * @param funсtion The function whose context will be changed.
11514 * @param context The object to which the context (`this`) of the function should be set.
11515 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11516 * @since 1.4
11517 * @since 1.6
11518 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11519 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
11520```html
11521<!doctype html>
11522<html lang="en">
11523<head>
11524 <meta charset="utf-8">
11525 <title>jQuery.proxy demo</title>
11526 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11527</head>
11528<body>
11529
11530<p><button type="button" id="test">Test</button></p>
11531<div id="log"></div>
11532
11533<script>
11534var me = {
11535 type: "zombie",
11536 test: function( event ) {
11537 // Without proxy, `this` would refer to the event target
11538 // use event.target to reference that element.
11539 var element = event.target;
11540 $( element ).css( "background-color", "red" );
11541
11542 // With proxy, `this` refers to the me object encapsulating
11543 // this function.
11544 $( "#log" ).append( "Hello " + this.type + "<br>" );
11545 $( "#test" ).off( "click", this.test );
11546 }
11547};
11548
11549var you = {
11550 type: "person",
11551 test: function( event ) {
11552 $( "#log" ).append( this.type + " " );
11553 }
11554};
11555
11556// Execute you.test() in the context of the `you` object
11557// no matter where it is called
11558// i.e. the `this` keyword will refer to `you`
11559var youClick = $.proxy( you.test, you );
11560
11561// attach click handlers to #test
11562$( "#test" )
11563 // this === "zombie"; handler unbound after first click
11564 .on( "click", $.proxy( me.test, me ) )
11565
11566 // this === "person"
11567 .on( "click", youClick )
11568
11569 // this === "zombie"
11570 .on( "click", $.proxy( you.test, me ) )
11571
11572 // this === "<button> element"
11573 .on( "click", you.test );
11574</script>
11575
11576</body>
11577</html>
11578```
11579 * @example ​ ````Change the context of a function bound to the click handler,
11580```html
11581<!doctype html>
11582<html lang="en">
11583<head>
11584 <meta charset="utf-8">
11585 <title>jQuery.proxy demo</title>
11586 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11587</head>
11588<body>
11589
11590<p><button type="button" id="test">Test</button></p>
11591<div id="log"></div>
11592
11593<script>
11594var me = {
11595 // I'm a dog
11596 type: "dog",
11597
11598 // Note that event comes *after* one and two
11599 test: function( one, two, event ) {
11600 $( "#log" )
11601
11602 // `one` maps to `you`, the 1st additional
11603 // argument in the $.proxy function call
11604 .append( "<h3>Hello " + one.type + ":</h3>" )
11605
11606 // The `this` keyword refers to `me`
11607 // (the 2nd, context, argument of $.proxy)
11608 .append( "I am a " + this.type + ", " )
11609
11610 // `two` maps to `they`, the 2nd additional
11611 // argument in the $.proxy function call
11612 .append( "and they are " + two.type + ".<br>" )
11613
11614 // The event type is "click"
11615 .append( "Thanks for " + event.type + "ing." )
11616
11617 // The clicked element is `event.target`,
11618 // and its type is "button"
11619 .append( "the " + event.target.type + "." );
11620 }
11621};
11622
11623var you = { type: "cat" };
11624var they = { type: "fish" };
11625
11626// Set up handler to execute me.test() in the context
11627// of `me`, with `you` and `they` as additional arguments
11628var proxy = $.proxy( me.test, me, you, they );
11629
11630$( "#test" )
11631 .on( "click", proxy );
11632</script>
11633
11634</body>
11635</html>
11636```
11637 */
11638 proxy<TContext,
11639 TReturn,
11640 T, U, V, W, X, Y>(funсtion: (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
11641 context: TContext): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
11642
11643 // #endregion
11644
11645 // region 7+ parameters
11646 // #region 7+ parameters
11647
11648 /**
11649 * Takes a function and returns a new one that will always have a particular context.
11650 * @param funсtion The function whose context will be changed.
11651 * @param context The object to which the context (`this`) of the function should be set.
11652 * @param a An argument to be passed to the function referenced in the `function` argument.
11653 * @param b An argument to be passed to the function referenced in the `function` argument.
11654 * @param c An argument to be passed to the function referenced in the `function` argument.
11655 * @param d An argument to be passed to the function referenced in the `function` argument.
11656 * @param e An argument to be passed to the function referenced in the `function` argument.
11657 * @param f An argument to be passed to the function referenced in the `function` argument.
11658 * @param g An argument to be passed to the function referenced in the `function` argument.
11659 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11660 * @since 1.4
11661 * @since 1.6
11662 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11663 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
11664```html
11665<!doctype html>
11666<html lang="en">
11667<head>
11668 <meta charset="utf-8">
11669 <title>jQuery.proxy demo</title>
11670 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11671</head>
11672<body>
11673
11674<p><button type="button" id="test">Test</button></p>
11675<div id="log"></div>
11676
11677<script>
11678var me = {
11679 type: "zombie",
11680 test: function( event ) {
11681 // Without proxy, `this` would refer to the event target
11682 // use event.target to reference that element.
11683 var element = event.target;
11684 $( element ).css( "background-color", "red" );
11685
11686 // With proxy, `this` refers to the me object encapsulating
11687 // this function.
11688 $( "#log" ).append( "Hello " + this.type + "<br>" );
11689 $( "#test" ).off( "click", this.test );
11690 }
11691};
11692
11693var you = {
11694 type: "person",
11695 test: function( event ) {
11696 $( "#log" ).append( this.type + " " );
11697 }
11698};
11699
11700// Execute you.test() in the context of the `you` object
11701// no matter where it is called
11702// i.e. the `this` keyword will refer to `you`
11703var youClick = $.proxy( you.test, you );
11704
11705// attach click handlers to #test
11706$( "#test" )
11707 // this === "zombie"; handler unbound after first click
11708 .on( "click", $.proxy( me.test, me ) )
11709
11710 // this === "person"
11711 .on( "click", youClick )
11712
11713 // this === "zombie"
11714 .on( "click", $.proxy( you.test, me ) )
11715
11716 // this === "<button> element"
11717 .on( "click", you.test );
11718</script>
11719
11720</body>
11721</html>
11722```
11723 * @example ​ ````Change the context of a function bound to the click handler,
11724```html
11725<!doctype html>
11726<html lang="en">
11727<head>
11728 <meta charset="utf-8">
11729 <title>jQuery.proxy demo</title>
11730 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11731</head>
11732<body>
11733
11734<p><button type="button" id="test">Test</button></p>
11735<div id="log"></div>
11736
11737<script>
11738var me = {
11739 // I'm a dog
11740 type: "dog",
11741
11742 // Note that event comes *after* one and two
11743 test: function( one, two, event ) {
11744 $( "#log" )
11745
11746 // `one` maps to `you`, the 1st additional
11747 // argument in the $.proxy function call
11748 .append( "<h3>Hello " + one.type + ":</h3>" )
11749
11750 // The `this` keyword refers to `me`
11751 // (the 2nd, context, argument of $.proxy)
11752 .append( "I am a " + this.type + ", " )
11753
11754 // `two` maps to `they`, the 2nd additional
11755 // argument in the $.proxy function call
11756 .append( "and they are " + two.type + ".<br>" )
11757
11758 // The event type is "click"
11759 .append( "Thanks for " + event.type + "ing." )
11760
11761 // The clicked element is `event.target`,
11762 // and its type is "button"
11763 .append( "the " + event.target.type + "." );
11764 }
11765};
11766
11767var you = { type: "cat" };
11768var they = { type: "fish" };
11769
11770// Set up handler to execute me.test() in the context
11771// of `me`, with `you` and `they` as additional arguments
11772var proxy = $.proxy( me.test, me, you, they );
11773
11774$( "#test" )
11775 .on( "click", proxy );
11776</script>
11777
11778</body>
11779</html>
11780```
11781 */
11782 proxy<TContext,
11783 TReturn,
11784 A, B, C, D, E, F, G,
11785 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
11786 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
11787 context: TContext,
11788 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
11789 /**
11790 * Takes a function and returns a new one that will always have a particular context.
11791 * @param funсtion The function whose context will be changed.
11792 * @param context The object to which the context (`this`) of the function should be set.
11793 * @param a An argument to be passed to the function referenced in the `function` argument.
11794 * @param b An argument to be passed to the function referenced in the `function` argument.
11795 * @param c An argument to be passed to the function referenced in the `function` argument.
11796 * @param d An argument to be passed to the function referenced in the `function` argument.
11797 * @param e An argument to be passed to the function referenced in the `function` argument.
11798 * @param f An argument to be passed to the function referenced in the `function` argument.
11799 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11800 * @since 1.4
11801 * @since 1.6
11802 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11803 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
11804```html
11805<!doctype html>
11806<html lang="en">
11807<head>
11808 <meta charset="utf-8">
11809 <title>jQuery.proxy demo</title>
11810 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11811</head>
11812<body>
11813
11814<p><button type="button" id="test">Test</button></p>
11815<div id="log"></div>
11816
11817<script>
11818var me = {
11819 type: "zombie",
11820 test: function( event ) {
11821 // Without proxy, `this` would refer to the event target
11822 // use event.target to reference that element.
11823 var element = event.target;
11824 $( element ).css( "background-color", "red" );
11825
11826 // With proxy, `this` refers to the me object encapsulating
11827 // this function.
11828 $( "#log" ).append( "Hello " + this.type + "<br>" );
11829 $( "#test" ).off( "click", this.test );
11830 }
11831};
11832
11833var you = {
11834 type: "person",
11835 test: function( event ) {
11836 $( "#log" ).append( this.type + " " );
11837 }
11838};
11839
11840// Execute you.test() in the context of the `you` object
11841// no matter where it is called
11842// i.e. the `this` keyword will refer to `you`
11843var youClick = $.proxy( you.test, you );
11844
11845// attach click handlers to #test
11846$( "#test" )
11847 // this === "zombie"; handler unbound after first click
11848 .on( "click", $.proxy( me.test, me ) )
11849
11850 // this === "person"
11851 .on( "click", youClick )
11852
11853 // this === "zombie"
11854 .on( "click", $.proxy( you.test, me ) )
11855
11856 // this === "<button> element"
11857 .on( "click", you.test );
11858</script>
11859
11860</body>
11861</html>
11862```
11863 * @example ​ ````Change the context of a function bound to the click handler,
11864```html
11865<!doctype html>
11866<html lang="en">
11867<head>
11868 <meta charset="utf-8">
11869 <title>jQuery.proxy demo</title>
11870 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11871</head>
11872<body>
11873
11874<p><button type="button" id="test">Test</button></p>
11875<div id="log"></div>
11876
11877<script>
11878var me = {
11879 // I'm a dog
11880 type: "dog",
11881
11882 // Note that event comes *after* one and two
11883 test: function( one, two, event ) {
11884 $( "#log" )
11885
11886 // `one` maps to `you`, the 1st additional
11887 // argument in the $.proxy function call
11888 .append( "<h3>Hello " + one.type + ":</h3>" )
11889
11890 // The `this` keyword refers to `me`
11891 // (the 2nd, context, argument of $.proxy)
11892 .append( "I am a " + this.type + ", " )
11893
11894 // `two` maps to `they`, the 2nd additional
11895 // argument in the $.proxy function call
11896 .append( "and they are " + two.type + ".<br>" )
11897
11898 // The event type is "click"
11899 .append( "Thanks for " + event.type + "ing." )
11900
11901 // The clicked element is `event.target`,
11902 // and its type is "button"
11903 .append( "the " + event.target.type + "." );
11904 }
11905};
11906
11907var you = { type: "cat" };
11908var they = { type: "fish" };
11909
11910// Set up handler to execute me.test() in the context
11911// of `me`, with `you` and `they` as additional arguments
11912var proxy = $.proxy( me.test, me, you, they );
11913
11914$( "#test" )
11915 .on( "click", proxy );
11916</script>
11917
11918</body>
11919</html>
11920```
11921 */
11922 proxy<TContext,
11923 TReturn,
11924 A, B, C, D, E, F,
11925 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
11926 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
11927 context: TContext,
11928 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
11929 /**
11930 * Takes a function and returns a new one that will always have a particular context.
11931 * @param funсtion The function whose context will be changed.
11932 * @param context The object to which the context (`this`) of the function should be set.
11933 * @param a An argument to be passed to the function referenced in the `function` argument.
11934 * @param b An argument to be passed to the function referenced in the `function` argument.
11935 * @param c An argument to be passed to the function referenced in the `function` argument.
11936 * @param d An argument to be passed to the function referenced in the `function` argument.
11937 * @param e An argument to be passed to the function referenced in the `function` argument.
11938 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11939 * @since 1.4
11940 * @since 1.6
11941 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11942 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
11943```html
11944<!doctype html>
11945<html lang="en">
11946<head>
11947 <meta charset="utf-8">
11948 <title>jQuery.proxy demo</title>
11949 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11950</head>
11951<body>
11952
11953<p><button type="button" id="test">Test</button></p>
11954<div id="log"></div>
11955
11956<script>
11957var me = {
11958 type: "zombie",
11959 test: function( event ) {
11960 // Without proxy, `this` would refer to the event target
11961 // use event.target to reference that element.
11962 var element = event.target;
11963 $( element ).css( "background-color", "red" );
11964
11965 // With proxy, `this` refers to the me object encapsulating
11966 // this function.
11967 $( "#log" ).append( "Hello " + this.type + "<br>" );
11968 $( "#test" ).off( "click", this.test );
11969 }
11970};
11971
11972var you = {
11973 type: "person",
11974 test: function( event ) {
11975 $( "#log" ).append( this.type + " " );
11976 }
11977};
11978
11979// Execute you.test() in the context of the `you` object
11980// no matter where it is called
11981// i.e. the `this` keyword will refer to `you`
11982var youClick = $.proxy( you.test, you );
11983
11984// attach click handlers to #test
11985$( "#test" )
11986 // this === "zombie"; handler unbound after first click
11987 .on( "click", $.proxy( me.test, me ) )
11988
11989 // this === "person"
11990 .on( "click", youClick )
11991
11992 // this === "zombie"
11993 .on( "click", $.proxy( you.test, me ) )
11994
11995 // this === "<button> element"
11996 .on( "click", you.test );
11997</script>
11998
11999</body>
12000</html>
12001```
12002 * @example ​ ````Change the context of a function bound to the click handler,
12003```html
12004<!doctype html>
12005<html lang="en">
12006<head>
12007 <meta charset="utf-8">
12008 <title>jQuery.proxy demo</title>
12009 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12010</head>
12011<body>
12012
12013<p><button type="button" id="test">Test</button></p>
12014<div id="log"></div>
12015
12016<script>
12017var me = {
12018 // I'm a dog
12019 type: "dog",
12020
12021 // Note that event comes *after* one and two
12022 test: function( one, two, event ) {
12023 $( "#log" )
12024
12025 // `one` maps to `you`, the 1st additional
12026 // argument in the $.proxy function call
12027 .append( "<h3>Hello " + one.type + ":</h3>" )
12028
12029 // The `this` keyword refers to `me`
12030 // (the 2nd, context, argument of $.proxy)
12031 .append( "I am a " + this.type + ", " )
12032
12033 // `two` maps to `they`, the 2nd additional
12034 // argument in the $.proxy function call
12035 .append( "and they are " + two.type + ".<br>" )
12036
12037 // The event type is "click"
12038 .append( "Thanks for " + event.type + "ing." )
12039
12040 // The clicked element is `event.target`,
12041 // and its type is "button"
12042 .append( "the " + event.target.type + "." );
12043 }
12044};
12045
12046var you = { type: "cat" };
12047var they = { type: "fish" };
12048
12049// Set up handler to execute me.test() in the context
12050// of `me`, with `you` and `they` as additional arguments
12051var proxy = $.proxy( me.test, me, you, they );
12052
12053$( "#test" )
12054 .on( "click", proxy );
12055</script>
12056
12057</body>
12058</html>
12059```
12060 */
12061 proxy<TContext,
12062 TReturn,
12063 A, B, C, D, E,
12064 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
12065 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
12066 context: TContext,
12067 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
12068 /**
12069 * Takes a function and returns a new one that will always have a particular context.
12070 * @param funсtion The function whose context will be changed.
12071 * @param context The object to which the context (`this`) of the function should be set.
12072 * @param a An argument to be passed to the function referenced in the `function` argument.
12073 * @param b An argument to be passed to the function referenced in the `function` argument.
12074 * @param c An argument to be passed to the function referenced in the `function` argument.
12075 * @param d An argument to be passed to the function referenced in the `function` argument.
12076 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12077 * @since 1.4
12078 * @since 1.6
12079 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12080 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
12081```html
12082<!doctype html>
12083<html lang="en">
12084<head>
12085 <meta charset="utf-8">
12086 <title>jQuery.proxy demo</title>
12087 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12088</head>
12089<body>
12090
12091<p><button type="button" id="test">Test</button></p>
12092<div id="log"></div>
12093
12094<script>
12095var me = {
12096 type: "zombie",
12097 test: function( event ) {
12098 // Without proxy, `this` would refer to the event target
12099 // use event.target to reference that element.
12100 var element = event.target;
12101 $( element ).css( "background-color", "red" );
12102
12103 // With proxy, `this` refers to the me object encapsulating
12104 // this function.
12105 $( "#log" ).append( "Hello " + this.type + "<br>" );
12106 $( "#test" ).off( "click", this.test );
12107 }
12108};
12109
12110var you = {
12111 type: "person",
12112 test: function( event ) {
12113 $( "#log" ).append( this.type + " " );
12114 }
12115};
12116
12117// Execute you.test() in the context of the `you` object
12118// no matter where it is called
12119// i.e. the `this` keyword will refer to `you`
12120var youClick = $.proxy( you.test, you );
12121
12122// attach click handlers to #test
12123$( "#test" )
12124 // this === "zombie"; handler unbound after first click
12125 .on( "click", $.proxy( me.test, me ) )
12126
12127 // this === "person"
12128 .on( "click", youClick )
12129
12130 // this === "zombie"
12131 .on( "click", $.proxy( you.test, me ) )
12132
12133 // this === "<button> element"
12134 .on( "click", you.test );
12135</script>
12136
12137</body>
12138</html>
12139```
12140 * @example ​ ````Change the context of a function bound to the click handler,
12141```html
12142<!doctype html>
12143<html lang="en">
12144<head>
12145 <meta charset="utf-8">
12146 <title>jQuery.proxy demo</title>
12147 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12148</head>
12149<body>
12150
12151<p><button type="button" id="test">Test</button></p>
12152<div id="log"></div>
12153
12154<script>
12155var me = {
12156 // I'm a dog
12157 type: "dog",
12158
12159 // Note that event comes *after* one and two
12160 test: function( one, two, event ) {
12161 $( "#log" )
12162
12163 // `one` maps to `you`, the 1st additional
12164 // argument in the $.proxy function call
12165 .append( "<h3>Hello " + one.type + ":</h3>" )
12166
12167 // The `this` keyword refers to `me`
12168 // (the 2nd, context, argument of $.proxy)
12169 .append( "I am a " + this.type + ", " )
12170
12171 // `two` maps to `they`, the 2nd additional
12172 // argument in the $.proxy function call
12173 .append( "and they are " + two.type + ".<br>" )
12174
12175 // The event type is "click"
12176 .append( "Thanks for " + event.type + "ing." )
12177
12178 // The clicked element is `event.target`,
12179 // and its type is "button"
12180 .append( "the " + event.target.type + "." );
12181 }
12182};
12183
12184var you = { type: "cat" };
12185var they = { type: "fish" };
12186
12187// Set up handler to execute me.test() in the context
12188// of `me`, with `you` and `they` as additional arguments
12189var proxy = $.proxy( me.test, me, you, they );
12190
12191$( "#test" )
12192 .on( "click", proxy );
12193</script>
12194
12195</body>
12196</html>
12197```
12198 */
12199 proxy<TContext,
12200 TReturn,
12201 A, B, C, D,
12202 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
12203 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
12204 context: TContext,
12205 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
12206 /**
12207 * Takes a function and returns a new one that will always have a particular context.
12208 * @param funсtion The function whose context will be changed.
12209 * @param context The object to which the context (`this`) of the function should be set.
12210 * @param a An argument to be passed to the function referenced in the `function` argument.
12211 * @param b An argument to be passed to the function referenced in the `function` argument.
12212 * @param c An argument to be passed to the function referenced in the `function` argument.
12213 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12214 * @since 1.4
12215 * @since 1.6
12216 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12217 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
12218```html
12219<!doctype html>
12220<html lang="en">
12221<head>
12222 <meta charset="utf-8">
12223 <title>jQuery.proxy demo</title>
12224 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12225</head>
12226<body>
12227
12228<p><button type="button" id="test">Test</button></p>
12229<div id="log"></div>
12230
12231<script>
12232var me = {
12233 type: "zombie",
12234 test: function( event ) {
12235 // Without proxy, `this` would refer to the event target
12236 // use event.target to reference that element.
12237 var element = event.target;
12238 $( element ).css( "background-color", "red" );
12239
12240 // With proxy, `this` refers to the me object encapsulating
12241 // this function.
12242 $( "#log" ).append( "Hello " + this.type + "<br>" );
12243 $( "#test" ).off( "click", this.test );
12244 }
12245};
12246
12247var you = {
12248 type: "person",
12249 test: function( event ) {
12250 $( "#log" ).append( this.type + " " );
12251 }
12252};
12253
12254// Execute you.test() in the context of the `you` object
12255// no matter where it is called
12256// i.e. the `this` keyword will refer to `you`
12257var youClick = $.proxy( you.test, you );
12258
12259// attach click handlers to #test
12260$( "#test" )
12261 // this === "zombie"; handler unbound after first click
12262 .on( "click", $.proxy( me.test, me ) )
12263
12264 // this === "person"
12265 .on( "click", youClick )
12266
12267 // this === "zombie"
12268 .on( "click", $.proxy( you.test, me ) )
12269
12270 // this === "<button> element"
12271 .on( "click", you.test );
12272</script>
12273
12274</body>
12275</html>
12276```
12277 * @example ​ ````Change the context of a function bound to the click handler,
12278```html
12279<!doctype html>
12280<html lang="en">
12281<head>
12282 <meta charset="utf-8">
12283 <title>jQuery.proxy demo</title>
12284 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12285</head>
12286<body>
12287
12288<p><button type="button" id="test">Test</button></p>
12289<div id="log"></div>
12290
12291<script>
12292var me = {
12293 // I'm a dog
12294 type: "dog",
12295
12296 // Note that event comes *after* one and two
12297 test: function( one, two, event ) {
12298 $( "#log" )
12299
12300 // `one` maps to `you`, the 1st additional
12301 // argument in the $.proxy function call
12302 .append( "<h3>Hello " + one.type + ":</h3>" )
12303
12304 // The `this` keyword refers to `me`
12305 // (the 2nd, context, argument of $.proxy)
12306 .append( "I am a " + this.type + ", " )
12307
12308 // `two` maps to `they`, the 2nd additional
12309 // argument in the $.proxy function call
12310 .append( "and they are " + two.type + ".<br>" )
12311
12312 // The event type is "click"
12313 .append( "Thanks for " + event.type + "ing." )
12314
12315 // The clicked element is `event.target`,
12316 // and its type is "button"
12317 .append( "the " + event.target.type + "." );
12318 }
12319};
12320
12321var you = { type: "cat" };
12322var they = { type: "fish" };
12323
12324// Set up handler to execute me.test() in the context
12325// of `me`, with `you` and `they` as additional arguments
12326var proxy = $.proxy( me.test, me, you, they );
12327
12328$( "#test" )
12329 .on( "click", proxy );
12330</script>
12331
12332</body>
12333</html>
12334```
12335 */
12336 proxy<TContext,
12337 TReturn,
12338 A, B, C,
12339 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A, b: B, c: C,
12340 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
12341 context: TContext,
12342 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
12343 /**
12344 * Takes a function and returns a new one that will always have a particular context.
12345 * @param funсtion The function whose context will be changed.
12346 * @param context The object to which the context (`this`) of the function should be set.
12347 * @param a An argument to be passed to the function referenced in the `function` argument.
12348 * @param b An argument to be passed to the function referenced in the `function` argument.
12349 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12350 * @since 1.4
12351 * @since 1.6
12352 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12353 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
12354```html
12355<!doctype html>
12356<html lang="en">
12357<head>
12358 <meta charset="utf-8">
12359 <title>jQuery.proxy demo</title>
12360 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12361</head>
12362<body>
12363
12364<p><button type="button" id="test">Test</button></p>
12365<div id="log"></div>
12366
12367<script>
12368var me = {
12369 type: "zombie",
12370 test: function( event ) {
12371 // Without proxy, `this` would refer to the event target
12372 // use event.target to reference that element.
12373 var element = event.target;
12374 $( element ).css( "background-color", "red" );
12375
12376 // With proxy, `this` refers to the me object encapsulating
12377 // this function.
12378 $( "#log" ).append( "Hello " + this.type + "<br>" );
12379 $( "#test" ).off( "click", this.test );
12380 }
12381};
12382
12383var you = {
12384 type: "person",
12385 test: function( event ) {
12386 $( "#log" ).append( this.type + " " );
12387 }
12388};
12389
12390// Execute you.test() in the context of the `you` object
12391// no matter where it is called
12392// i.e. the `this` keyword will refer to `you`
12393var youClick = $.proxy( you.test, you );
12394
12395// attach click handlers to #test
12396$( "#test" )
12397 // this === "zombie"; handler unbound after first click
12398 .on( "click", $.proxy( me.test, me ) )
12399
12400 // this === "person"
12401 .on( "click", youClick )
12402
12403 // this === "zombie"
12404 .on( "click", $.proxy( you.test, me ) )
12405
12406 // this === "<button> element"
12407 .on( "click", you.test );
12408</script>
12409
12410</body>
12411</html>
12412```
12413 * @example ​ ````Change the context of a function bound to the click handler,
12414```html
12415<!doctype html>
12416<html lang="en">
12417<head>
12418 <meta charset="utf-8">
12419 <title>jQuery.proxy demo</title>
12420 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12421</head>
12422<body>
12423
12424<p><button type="button" id="test">Test</button></p>
12425<div id="log"></div>
12426
12427<script>
12428var me = {
12429 // I'm a dog
12430 type: "dog",
12431
12432 // Note that event comes *after* one and two
12433 test: function( one, two, event ) {
12434 $( "#log" )
12435
12436 // `one` maps to `you`, the 1st additional
12437 // argument in the $.proxy function call
12438 .append( "<h3>Hello " + one.type + ":</h3>" )
12439
12440 // The `this` keyword refers to `me`
12441 // (the 2nd, context, argument of $.proxy)
12442 .append( "I am a " + this.type + ", " )
12443
12444 // `two` maps to `they`, the 2nd additional
12445 // argument in the $.proxy function call
12446 .append( "and they are " + two.type + ".<br>" )
12447
12448 // The event type is "click"
12449 .append( "Thanks for " + event.type + "ing." )
12450
12451 // The clicked element is `event.target`,
12452 // and its type is "button"
12453 .append( "the " + event.target.type + "." );
12454 }
12455};
12456
12457var you = { type: "cat" };
12458var they = { type: "fish" };
12459
12460// Set up handler to execute me.test() in the context
12461// of `me`, with `you` and `they` as additional arguments
12462var proxy = $.proxy( me.test, me, you, they );
12463
12464$( "#test" )
12465 .on( "click", proxy );
12466</script>
12467
12468</body>
12469</html>
12470```
12471 */
12472 proxy<TContext,
12473 TReturn,
12474 A, B,
12475 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A, b: B,
12476 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
12477 context: TContext,
12478 a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
12479 /**
12480 * Takes a function and returns a new one that will always have a particular context.
12481 * @param funсtion The function whose context will be changed.
12482 * @param context The object to which the context (`this`) of the function should be set.
12483 * @param a An argument to be passed to the function referenced in the `function` argument.
12484 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12485 * @since 1.4
12486 * @since 1.6
12487 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12488 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
12489```html
12490<!doctype html>
12491<html lang="en">
12492<head>
12493 <meta charset="utf-8">
12494 <title>jQuery.proxy demo</title>
12495 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12496</head>
12497<body>
12498
12499<p><button type="button" id="test">Test</button></p>
12500<div id="log"></div>
12501
12502<script>
12503var me = {
12504 type: "zombie",
12505 test: function( event ) {
12506 // Without proxy, `this` would refer to the event target
12507 // use event.target to reference that element.
12508 var element = event.target;
12509 $( element ).css( "background-color", "red" );
12510
12511 // With proxy, `this` refers to the me object encapsulating
12512 // this function.
12513 $( "#log" ).append( "Hello " + this.type + "<br>" );
12514 $( "#test" ).off( "click", this.test );
12515 }
12516};
12517
12518var you = {
12519 type: "person",
12520 test: function( event ) {
12521 $( "#log" ).append( this.type + " " );
12522 }
12523};
12524
12525// Execute you.test() in the context of the `you` object
12526// no matter where it is called
12527// i.e. the `this` keyword will refer to `you`
12528var youClick = $.proxy( you.test, you );
12529
12530// attach click handlers to #test
12531$( "#test" )
12532 // this === "zombie"; handler unbound after first click
12533 .on( "click", $.proxy( me.test, me ) )
12534
12535 // this === "person"
12536 .on( "click", youClick )
12537
12538 // this === "zombie"
12539 .on( "click", $.proxy( you.test, me ) )
12540
12541 // this === "<button> element"
12542 .on( "click", you.test );
12543</script>
12544
12545</body>
12546</html>
12547```
12548 * @example ​ ````Change the context of a function bound to the click handler,
12549```html
12550<!doctype html>
12551<html lang="en">
12552<head>
12553 <meta charset="utf-8">
12554 <title>jQuery.proxy demo</title>
12555 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12556</head>
12557<body>
12558
12559<p><button type="button" id="test">Test</button></p>
12560<div id="log"></div>
12561
12562<script>
12563var me = {
12564 // I'm a dog
12565 type: "dog",
12566
12567 // Note that event comes *after* one and two
12568 test: function( one, two, event ) {
12569 $( "#log" )
12570
12571 // `one` maps to `you`, the 1st additional
12572 // argument in the $.proxy function call
12573 .append( "<h3>Hello " + one.type + ":</h3>" )
12574
12575 // The `this` keyword refers to `me`
12576 // (the 2nd, context, argument of $.proxy)
12577 .append( "I am a " + this.type + ", " )
12578
12579 // `two` maps to `they`, the 2nd additional
12580 // argument in the $.proxy function call
12581 .append( "and they are " + two.type + ".<br>" )
12582
12583 // The event type is "click"
12584 .append( "Thanks for " + event.type + "ing." )
12585
12586 // The clicked element is `event.target`,
12587 // and its type is "button"
12588 .append( "the " + event.target.type + "." );
12589 }
12590};
12591
12592var you = { type: "cat" };
12593var they = { type: "fish" };
12594
12595// Set up handler to execute me.test() in the context
12596// of `me`, with `you` and `they` as additional arguments
12597var proxy = $.proxy( me.test, me, you, they );
12598
12599$( "#test" )
12600 .on( "click", proxy );
12601</script>
12602
12603</body>
12604</html>
12605```
12606 */
12607 proxy<TContext,
12608 TReturn,
12609 A,
12610 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A,
12611 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
12612 context: TContext,
12613 a: A): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
12614 /**
12615 * Takes a function and returns a new one that will always have a particular context.
12616 * @param funсtion The function whose context will be changed.
12617 * @param context The object to which the context (`this`) of the function should be set.
12618 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12619 * @since 1.4
12620 * @since 1.6
12621 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12622 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
12623```html
12624<!doctype html>
12625<html lang="en">
12626<head>
12627 <meta charset="utf-8">
12628 <title>jQuery.proxy demo</title>
12629 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12630</head>
12631<body>
12632
12633<p><button type="button" id="test">Test</button></p>
12634<div id="log"></div>
12635
12636<script>
12637var me = {
12638 type: "zombie",
12639 test: function( event ) {
12640 // Without proxy, `this` would refer to the event target
12641 // use event.target to reference that element.
12642 var element = event.target;
12643 $( element ).css( "background-color", "red" );
12644
12645 // With proxy, `this` refers to the me object encapsulating
12646 // this function.
12647 $( "#log" ).append( "Hello " + this.type + "<br>" );
12648 $( "#test" ).off( "click", this.test );
12649 }
12650};
12651
12652var you = {
12653 type: "person",
12654 test: function( event ) {
12655 $( "#log" ).append( this.type + " " );
12656 }
12657};
12658
12659// Execute you.test() in the context of the `you` object
12660// no matter where it is called
12661// i.e. the `this` keyword will refer to `you`
12662var youClick = $.proxy( you.test, you );
12663
12664// attach click handlers to #test
12665$( "#test" )
12666 // this === "zombie"; handler unbound after first click
12667 .on( "click", $.proxy( me.test, me ) )
12668
12669 // this === "person"
12670 .on( "click", youClick )
12671
12672 // this === "zombie"
12673 .on( "click", $.proxy( you.test, me ) )
12674
12675 // this === "<button> element"
12676 .on( "click", you.test );
12677</script>
12678
12679</body>
12680</html>
12681```
12682 * @example ​ ````Change the context of a function bound to the click handler,
12683```html
12684<!doctype html>
12685<html lang="en">
12686<head>
12687 <meta charset="utf-8">
12688 <title>jQuery.proxy demo</title>
12689 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12690</head>
12691<body>
12692
12693<p><button type="button" id="test">Test</button></p>
12694<div id="log"></div>
12695
12696<script>
12697var me = {
12698 // I'm a dog
12699 type: "dog",
12700
12701 // Note that event comes *after* one and two
12702 test: function( one, two, event ) {
12703 $( "#log" )
12704
12705 // `one` maps to `you`, the 1st additional
12706 // argument in the $.proxy function call
12707 .append( "<h3>Hello " + one.type + ":</h3>" )
12708
12709 // The `this` keyword refers to `me`
12710 // (the 2nd, context, argument of $.proxy)
12711 .append( "I am a " + this.type + ", " )
12712
12713 // `two` maps to `they`, the 2nd additional
12714 // argument in the $.proxy function call
12715 .append( "and they are " + two.type + ".<br>" )
12716
12717 // The event type is "click"
12718 .append( "Thanks for " + event.type + "ing." )
12719
12720 // The clicked element is `event.target`,
12721 // and its type is "button"
12722 .append( "the " + event.target.type + "." );
12723 }
12724};
12725
12726var you = { type: "cat" };
12727var they = { type: "fish" };
12728
12729// Set up handler to execute me.test() in the context
12730// of `me`, with `you` and `they` as additional arguments
12731var proxy = $.proxy( me.test, me, you, they );
12732
12733$( "#test" )
12734 .on( "click", proxy );
12735</script>
12736
12737</body>
12738</html>
12739```
12740 */
12741 proxy<TContext,
12742 TReturn,
12743 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
12744 context: TContext): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
12745
12746 // #endregion
12747
12748 // #endregion
12749
12750 // region 8+ additional arguments
12751 // #region 8+ additional arguments
12752
12753 /**
12754 * Takes a function and returns a new one that will always have a particular context.
12755 * @param funсtion The function whose context will be changed.
12756 * @param context The object to which the context (`this`) of the function should be set.
12757 * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument.
12758 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12759 * @since 1.4
12760 * @since 1.6
12761 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12762 * @example ​ ````Change the context of functions bound to a click handler using the &quot;function, context&quot; signature. Unbind the first handler after first click.
12763```html
12764<!doctype html>
12765<html lang="en">
12766<head>
12767 <meta charset="utf-8">
12768 <title>jQuery.proxy demo</title>
12769 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12770</head>
12771<body>
12772
12773<p><button type="button" id="test">Test</button></p>
12774<div id="log"></div>
12775
12776<script>
12777var me = {
12778 type: "zombie",
12779 test: function( event ) {
12780 // Without proxy, `this` would refer to the event target
12781 // use event.target to reference that element.
12782 var element = event.target;
12783 $( element ).css( "background-color", "red" );
12784
12785 // With proxy, `this` refers to the me object encapsulating
12786 // this function.
12787 $( "#log" ).append( "Hello " + this.type + "<br>" );
12788 $( "#test" ).off( "click", this.test );
12789 }
12790};
12791
12792var you = {
12793 type: "person",
12794 test: function( event ) {
12795 $( "#log" ).append( this.type + " " );
12796 }
12797};
12798
12799// Execute you.test() in the context of the `you` object
12800// no matter where it is called
12801// i.e. the `this` keyword will refer to `you`
12802var youClick = $.proxy( you.test, you );
12803
12804// attach click handlers to #test
12805$( "#test" )
12806 // this === "zombie"; handler unbound after first click
12807 .on( "click", $.proxy( me.test, me ) )
12808
12809 // this === "person"
12810 .on( "click", youClick )
12811
12812 // this === "zombie"
12813 .on( "click", $.proxy( you.test, me ) )
12814
12815 // this === "<button> element"
12816 .on( "click", you.test );
12817</script>
12818
12819</body>
12820</html>
12821```
12822 * @example ​ ````Change the context of a function bound to the click handler,
12823```html
12824<!doctype html>
12825<html lang="en">
12826<head>
12827 <meta charset="utf-8">
12828 <title>jQuery.proxy demo</title>
12829 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12830</head>
12831<body>
12832
12833<p><button type="button" id="test">Test</button></p>
12834<div id="log"></div>
12835
12836<script>
12837var me = {
12838 // I'm a dog
12839 type: "dog",
12840
12841 // Note that event comes *after* one and two
12842 test: function( one, two, event ) {
12843 $( "#log" )
12844
12845 // `one` maps to `you`, the 1st additional
12846 // argument in the $.proxy function call
12847 .append( "<h3>Hello " + one.type + ":</h3>" )
12848
12849 // The `this` keyword refers to `me`
12850 // (the 2nd, context, argument of $.proxy)
12851 .append( "I am a " + this.type + ", " )
12852
12853 // `two` maps to `they`, the 2nd additional
12854 // argument in the $.proxy function call
12855 .append( "and they are " + two.type + ".<br>" )
12856
12857 // The event type is "click"
12858 .append( "Thanks for " + event.type + "ing." )
12859
12860 // The clicked element is `event.target`,
12861 // and its type is "button"
12862 .append( "the " + event.target.type + "." );
12863 }
12864};
12865
12866var you = { type: "cat" };
12867var they = { type: "fish" };
12868
12869// Set up handler to execute me.test() in the context
12870// of `me`, with `you` and `they` as additional arguments
12871var proxy = $.proxy( me.test, me, you, they );
12872
12873$( "#test" )
12874 .on( "click", proxy );
12875</script>
12876
12877</body>
12878</html>
12879```
12880 */
12881 proxy<TContext,
12882 TReturn>(funсtion: (this: TContext, ...args: any[]) => TReturn,
12883 context: TContext,
12884 ...additionalArguments: any[]): (...args: any[]) => TReturn;
12885
12886 // #endregion
12887
12888 // #endregion
12889
12890 // region (context, name)
12891 // #region (context, name)
12892
12893 /**
12894 * Takes a function and returns a new one that will always have a particular context.
12895 * @param context The object to which the context of the function should be set.
12896 * @param name The name of the function whose context will be changed (should be a property of the context object).
12897 * @param additionalArguments Any number of arguments to be passed to the function named in the name argument.
12898 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12899 * @since 1.4
12900 * @since 1.6
12901 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12902 * @example ​ ````Enforce the context of the function using the &quot;context, function name&quot; signature. Unbind the handler after first click.
12903```html
12904<!doctype html>
12905<html lang="en">
12906<head>
12907 <meta charset="utf-8">
12908 <title>jQuery.proxy demo</title>
12909 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12910</head>
12911<body>
12912
12913 <p><button id="test">Test</button></p>
12914 <p id="log"></p>
12915
12916<script>
12917var obj = {
12918 name: "John",
12919 test: function() {
12920 $( "#log" ).append( this.name );
12921 $( "#test" ).off( "click", obj.test );
12922 }
12923};
12924$( "#test" ).on( "click", jQuery.proxy( obj, "test" ) );
12925</script>
12926
12927</body>
12928</html>
12929```
12930 */
12931 proxy<TContext>(context: TContext,
12932 name: keyof TContext,
12933 ...additionalArguments: any[]): (...args: any[]) => any;
12934
12935 // #endregion
12936
12937 // #endregion
12938
12939 /**
12940 * Manipulate the queue of functions to be executed on the matched element.
12941 * @param element A DOM element where the array of queued functions is attached.
12942 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
12943 * @param newQueue The new function to add to the queue.
12944 * An array of functions to replace the current queue contents.
12945 * @see \`{@link https://api.jquery.com/jQuery.queue/ }\`
12946 * @since 1.3
12947 * @example ​ ````Show the length of the queue.
12948```html
12949<!doctype html>
12950<html lang="en">
12951<head>
12952 <meta charset="utf-8">
12953 <title>jQuery.queue demo</title>
12954 <style>
12955 div {
12956 margin: 3px;
12957 width: 40px;
12958 height: 40px;
12959 position: absolute;
12960 left: 0px;
12961 top: 30px;
12962 background: green;
12963 display: none;
12964 }
12965 div.newcolor {
12966 background: blue;
12967 }
12968 span {
12969 color: red;
12970 }
12971 </style>
12972 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12973</head>
12974<body>
12975
12976<button id="show">Show Length of Queue</button>
12977<span></span>
12978<div></div>
12979
12980<script>
12981$( "#show" ).click(function() {
12982 var n = jQuery.queue( $( "div" )[ 0 ], "fx" );
12983 $( "span" ).text( "Queue length is: " + n.length );
12984});
12985
12986function runIt() {
12987 $( "div" )
12988 .show( "slow" )
12989 .animate({
12990 left: "+=200"
12991 }, 2000 )
12992 .slideToggle( 1000 )
12993 .slideToggle( "fast" )
12994 .animate({
12995 left: "-=200"
12996 }, 1500 )
12997 .hide( "slow" )
12998 .show( 1200 )
12999 .slideUp( "normal", runIt );
13000}
13001
13002runIt();
13003</script>
13004
13005</body>
13006</html>
13007```
13008 * @example ​ ````Queue a custom function.
13009```html
13010<!doctype html>
13011<html lang="en">
13012<head>
13013 <meta charset="utf-8">
13014 <title>jQuery.queue demo</title>
13015 <style>
13016 div {
13017 margin: 3px;
13018 width: 40px;
13019 height: 40px;
13020 position: absolute;
13021 left: 0px;
13022 top: 30px;
13023 background: green;
13024 display: none;
13025 }
13026 div.newcolor {
13027 background: blue;
13028 }
13029 </style>
13030 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13031</head>
13032<body>
13033
13034Click here...
13035<div></div>
13036
13037<script>
13038$( document.body ).click(function() {
13039 var divs = $( "div" )
13040 .show( "slow" )
13041 .animate({ left: "+=200" }, 2000 );
13042 jQuery.queue( divs[ 0 ], "fx", function() {
13043 $( this ).addClass( "newcolor" );
13044 jQuery.dequeue( this );
13045 });
13046 divs.animate({ left: "-=200" }, 500 );
13047 jQuery.queue( divs[ 0 ], "fx", function() {
13048 $( this ).removeClass( "newcolor" );
13049 jQuery.dequeue( this );
13050 });
13051 divs.slideUp();
13052});
13053</script>
13054
13055</body>
13056</html>
13057```
13058 * @example ​ ````Set a queue array to delete the queue.
13059```html
13060<!doctype html>
13061<html lang="en">
13062<head>
13063 <meta charset="utf-8">
13064 <title>jQuery.queue demo</title>
13065 <style>
13066 div {
13067 margin: 3px;
13068 width: 40px;
13069 height: 40px;
13070 position: absolute;
13071 left: 0px;
13072 top: 30px;
13073 background: green;
13074 display: none;
13075 }
13076 div.newcolor {
13077 background: blue;
13078 }
13079 </style>
13080 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13081</head>
13082<body>
13083
13084<button id="start">Start</button>
13085<button id="stop">Stop</button>
13086<div></div>
13087
13088<script>
13089$( "#start" ).click(function() {
13090 var divs = $( "div" )
13091 .show( "slow" )
13092 .animate({ left: "+=200" }, 5000 );
13093 jQuery.queue( divs[ 0 ], "fx", function() {
13094 $( this ).addClass( "newcolor" );
13095 jQuery.dequeue( this );
13096 });
13097 divs.animate({ left: "-=200" }, 1500 );
13098 jQuery.queue( divs[ 0 ], "fx", function() {
13099 $( this ).removeClass( "newcolor" );
13100 jQuery.dequeue( this );
13101 });
13102 divs.slideUp();
13103});
13104$( "#stop" ).click(function() {
13105 jQuery.queue( $( "div" )[ 0 ], "fx", [] );
13106 $( "div" ).stop();
13107});
13108</script>
13109
13110</body>
13111</html>
13112```
13113 */
13114 queue<T extends Element>(element: T, queueName?: string, newQueue?: JQuery.TypeOrArray<JQuery.QueueFunction<T>>): JQuery.Queue<T>;
13115 /**
13116 * Handles errors thrown synchronously in functions wrapped in jQuery().
13117 * @param error An error thrown in the function wrapped in jQuery().
13118 * @see \`{@link https://api.jquery.com/jQuery.readyException/ }\`
13119 * @since 3.1
13120 * @example ​ ````Pass the received error to console.error.
13121```javascript
13122jQuery.readyException = function( error ) {
13123 console.error( error );
13124};
13125```
13126 */
13127 readyException(error: Error): any;
13128 /**
13129 * Remove a previously-stored piece of data.
13130 * @param element A DOM element from which to remove data.
13131 * @param name A string naming the piece of data to remove.
13132 * @see \`{@link https://api.jquery.com/jQuery.removeData/ }\`
13133 * @since 1.2.3
13134 * @example ​ ````Set a data store for 2 names then remove one of them.
13135```html
13136<!doctype html>
13137<html lang="en">
13138<head>
13139 <meta charset="utf-8">
13140 <title>jQuery.removeData demo</title>
13141 <style>
13142 div {
13143 margin: 2px;
13144 color: blue;
13145 }
13146 span {
13147 color: red;
13148 }
13149 </style>
13150 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13151</head>
13152<body>
13153
13154<div>value1 before creation: <span></span></div>
13155<div>value1 after creation: <span></span></div>
13156<div>value1 after removal: <span></span></div>
13157<div>value2 after removal: <span></span></div>
13158
13159<script>
13160var div = $( "div" )[ 0 ];
13161$( "span:eq(0)" ).text( "" + $( "div" ).data( "test1" ) );
13162jQuery.data( div, "test1", "VALUE-1" );
13163jQuery.data( div, "test2", "VALUE-2" );
13164$( "span:eq(1)" ).text( "" + jQuery.data( div, "test1" ) );
13165jQuery.removeData( div, "test1" );
13166$( "span:eq(2)" ).text( "" + jQuery.data( div, "test1" ) );
13167$( "span:eq(3)" ).text( "" + jQuery.data( div, "test2" ) );
13168</script>
13169
13170</body>
13171</html>
13172```
13173 */
13174 removeData(element: Element | Document | Window | JQuery.PlainObject, name?: string): void;
13175 /**
13176 * Creates an object containing a set of properties ready to be used in the definition of custom animations.
13177 * @param duration A string or number determining how long the animation will run.
13178 * @param easing A string indicating which easing function to use for the transition.
13179 * @param complete A function to call once the animation is complete, called once per matched element.
13180 * @see \`{@link https://api.jquery.com/jQuery.speed/ }\`
13181 * @since 1.1
13182 */
13183 speed<TElement extends Element = HTMLElement>(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): JQuery.EffectsOptions<TElement>;
13184 /**
13185 * Creates an object containing a set of properties ready to be used in the definition of custom animations.
13186 * @param duration A string or number determining how long the animation will run.
13187 * @param easing_complete _&#x40;param_ `easing_complete`
13188 * <br>
13189 * * `easing` — A string indicating which easing function to use for the transition. <br>
13190 * * `complete` — A function to call once the animation is complete, called once per matched element.
13191 * @see \`{@link https://api.jquery.com/jQuery.speed/ }\`
13192 * @since 1.0
13193 * @since 1.1
13194 */
13195 speed<TElement extends Element = HTMLElement>(duration: JQuery.Duration,
13196 easing_complete: string | ((this: TElement) => void)): JQuery.EffectsOptions<TElement>;
13197 /**
13198 * Creates an object containing a set of properties ready to be used in the definition of custom animations.
13199 * @param duration_complete_settings _&#x40;param_ `duration_complete_settings`
13200 * <br>
13201 * * `duration` — A string or number determining how long the animation will run. <br>
13202 * * `complete` — A function to call once the animation is complete, called once per matched element. <br>
13203 * * `settings` —
13204 * @see \`{@link https://api.jquery.com/jQuery.speed/ }\`
13205 * @since 1.0
13206 * @since 1.1
13207 */
13208 speed<TElement extends Element = HTMLElement>(duration_complete_settings?: JQuery.Duration | ((this: TElement) => void) | JQuery.SpeedSettings<TElement>): JQuery.EffectsOptions<TElement>;
13209 /**
13210 * Remove the whitespace from the beginning and end of a string.
13211 * @param str The string to trim.
13212 * @see \`{@link https://api.jquery.com/jQuery.trim/ }\`
13213 * @since 1.0
13214 * @deprecatedDeprecated since 3.5. Use \`{@link String.prototype.trim String.prototype.trim}\`.
13215 * @example ​ ````Remove the white spaces at the start and at the end of the string.
13216```html
13217<!doctype html>
13218<html lang="en">
13219<head>
13220 <meta charset="utf-8">
13221 <title>jQuery.trim demo</title>
13222 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13223</head>
13224<body>
13225
13226<pre id="original"></pre>
13227<pre id="trimmed"></pre>
13228
13229<script>
13230var str = " lots of spaces before and after ";
13231$( "#original" ).html( "Original String: '" + str + "'" );
13232$( "#trimmed" ).html( "$.trim()'ed: '" + $.trim(str) + "'" );
13233</script>
13234
13235</body>
13236</html>
13237```
13238 * @example ​ ````Remove the white spaces at the start and at the end of the string.
13239```javascript
13240$.trim(" hello, how are you? ");
13241```
13242 * @example ​ ````Remove the white spaces at the start and at the end of the string.
13243```javascript
13244$.trim(" hello, how are you? ");
13245```
13246 */
13247 trim(str: string): string;
13248 /**
13249 * Determine the internal JavaScript [[Class]] of an object.
13250 * @param obj Object to get the internal JavaScript [[Class]] of.
13251 * @see \`{@link https://api.jquery.com/jQuery.type/ }\`
13252 * @since 1.4.3
13253 * @deprecatedDeprecated since 3.3. See \`{@link https://github.com/jquery/jquery/issues/3605 }\`.
13254 * @example ​ ````Find out if the parameter is a RegExp.
13255```html
13256<!doctype html>
13257<html lang="en">
13258<head>
13259 <meta charset="utf-8">
13260 <title>jQuery.type demo</title>
13261 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13262</head>
13263<body>
13264
13265Is it a RegExp? <b></b>
13266
13267<script>
13268$( "b" ).append( "" + jQuery.type( /test/ ) );
13269</script>
13270
13271</body>
13272</html>
13273```
13274 */
13275 type(obj: any): 'array' | 'boolean' | 'date' | 'error' | 'function' | 'null' | 'number' | 'object' | 'regexp' | 'string' | 'symbol' | 'undefined';
13276 /**
13277 * 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.
13278 * @param array The Array of DOM elements.
13279 * @see \`{@link https://api.jquery.com/jQuery.unique/ }\`
13280 * @since 1.1.3
13281 * @deprecatedDeprecated since 3.0. Use \`{@link uniqueSort }\`.
13282 *
13283 * **Cause**: The fact that `jQuery.unique` sorted its results in DOM order was surprising to many who did not read the documentation carefully. As of jQuery 3.0 this function is being renamed to make it clear.
13284 *
13285 * **Solution**: Replace all uses of `jQuery.unique` with `jQuery.uniqueSort` which is the same function with a better name.
13286 * @example ​ ````Removes any duplicate elements from the array of divs.
13287```html
13288<!doctype html>
13289<html lang="en">
13290<head>
13291 <meta charset="utf-8">
13292 <title>jQuery.unique demo</title>
13293 <style>
13294 div {
13295 color: blue;
13296 }
13297 </style>
13298 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13299</head>
13300<body>
13301
13302<div>There are 6 divs in this document.</div>
13303<div></div>
13304<div class="dup"></div>
13305<div class="dup"></div>
13306<div class="dup"></div>
13307<div></div>
13308
13309<script>
13310// unique() must take a native array
13311var divs = $( "div" ).get();
13312
13313// Add 3 elements of class dup too (they are divs)
13314divs = divs.concat( $( ".dup" ).get() );
13315$( "div:eq(1)" ).text( "Pre-unique there are " + divs.length + " elements." );
13316
13317divs = jQuery.unique( divs );
13318$( "div:eq(2)" ).text( "Post-unique there are " + divs.length + " elements." )
13319 .css( "color", "red" );
13320</script>
13321
13322</body>
13323</html>
13324```
13325 */
13326 unique<T extends Element>(array: T[]): T[];
13327 /**
13328 * 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.
13329 * @param array The Array of DOM elements.
13330 * @see \`{@link https://api.jquery.com/jQuery.uniqueSort/ }\`
13331 * @since 1.12
13332 * @since 2.2
13333 * @example ​ ````Removes any duplicate elements from the array of divs.
13334```html
13335<!doctype html>
13336<html lang="en">
13337<head>
13338 <meta charset="utf-8">
13339 <title>jQuery.uniqueSort demo</title>
13340 <style>
13341 div {
13342 color: blue;
13343 }
13344 </style>
13345 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13346</head>
13347<body>
13348
13349<div>There are 6 divs in this document.</div>
13350<div></div>
13351<div class="dup"></div>
13352<div class="dup"></div>
13353<div class="dup"></div>
13354<div></div>
13355
13356<script>
13357// unique() must take a native array
13358var divs = $( "div" ).get();
13359
13360// Add 3 elements of class dup too (they are divs)
13361divs = divs.concat( $( ".dup" ).get() );
13362$( "div:eq(1)" ).text( "Pre-unique there are " + divs.length + " elements." );
13363
13364divs = jQuery.uniqueSort( divs );
13365$( "div:eq(2)" ).text( "Post-unique there are " + divs.length + " elements." )
13366 .css( "color", "red" );
13367</script>
13368
13369</body>
13370</html>
13371```
13372 */
13373 uniqueSort<T extends Element>(array: T[]): T[];
13374 /**
13375 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13376 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13377 * @since 1.5
13378 * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request).
13379```javascript
13380$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13381 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13382 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13383 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13384 if ( /Whip It/.test( data ) ) {
13385 alert( "We got what we came for!" );
13386 }
13387});
13388```
13389 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13390```javascript
13391$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13392 .then( myFunc, myFailure );
13393```
13394 */
13395 when<TR1, UR1, VR1,
13396 TJ1 = any, UJ1 = any, VJ1 = any>(
13397 deferredT: JQuery.Promise<TR1, TJ1> | JQuery.Thenable<TR1> | TR1,
13398 deferredU: JQuery.Promise<UR1, UJ1> | JQuery.Thenable<UR1> | UR1,
13399 deferredV: JQuery.Promise<VR1, VJ1> | JQuery.Thenable<VR1> | VR1,
13400 ): JQuery.Promise3<
13401 TR1, TJ1, never,
13402 UR1, UJ1, never,
13403 VR1, VJ1, never>;
13404 /**
13405 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13406 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13407 * @since 1.5
13408 * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request).
13409```javascript
13410$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13411 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13412 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13413 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13414 if ( /Whip It/.test( data ) ) {
13415 alert( "We got what we came for!" );
13416 }
13417});
13418```
13419 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13420```javascript
13421$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13422 .then( myFunc, myFailure );
13423```
13424 */
13425 when<TR1, UR1,
13426 TJ1 = any, UJ1 = any>(
13427 deferredT: JQuery.Promise<TR1, TJ1> | JQuery.Thenable<TR1> | TR1,
13428 deferredU: JQuery.Promise<UR1, UJ1> | JQuery.Thenable<UR1> | UR1,
13429 ): JQuery.Promise2<
13430 TR1, TJ1, never,
13431 UR1, UJ1, never>;
13432 /**
13433 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13434 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13435 * @since 1.5
13436 * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request).
13437```javascript
13438$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13439 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13440 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13441 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13442 if ( /Whip It/.test( data ) ) {
13443 alert( "We got what we came for!" );
13444 }
13445});
13446```
13447 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13448```javascript
13449$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13450 .then( myFunc, myFailure );
13451```
13452 */
13453 when<TR1, TJ1,
13454 TR2, TJ2,
13455 TR3 = never, TJ3 = never>(
13456 deferredT: JQuery.Promise3<TR1, TJ1, any, TR2, TJ2, any, TR3, TJ3, any> |
13457 JQuery.Promise2<TR1, TJ1, any, TR2, TJ2, any>
13458 ): JQuery.Promise3<
13459 TR1, TJ1, never,
13460 TR2, TJ2, never,
13461 TR3, TJ3, never>;
13462 /**
13463 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13464 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13465 * @since 1.5
13466 * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request).
13467```javascript
13468$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13469 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13470 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13471 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13472 if ( /Whip It/.test( data ) ) {
13473 alert( "We got what we came for!" );
13474 }
13475});
13476```
13477 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13478```javascript
13479$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13480 .then( myFunc, myFailure );
13481```
13482 */
13483 when<TR1, TJ1 = any>(deferred: JQuery.Promise<TR1, TJ1> | JQuery.Thenable<TR1> | TR1): JQuery.Promise<TR1, TJ1, never>;
13484 /**
13485 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13486 * @param deferreds Zero or more Thenable objects.
13487 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13488 * @since 1.5
13489 * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request).
13490```javascript
13491$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13492 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13493 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13494 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13495 if ( /Whip It/.test( data ) ) {
13496 alert( "We got what we came for!" );
13497 }
13498});
13499```
13500 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13501```javascript
13502$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13503 .then( myFunc, myFailure );
13504```
13505 */
13506 when<TR1 = never, TJ1 = never>(...deferreds: Array<JQuery.Promise<TR1, TJ1> | JQuery.Thenable<TR1> | TR1>): JQuery.Promise<TR1, TJ1, never>;
13507 /**
13508 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13509 * @param deferreds Zero or more Thenable objects.
13510 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13511 * @since 1.5
13512 * @example ​ ````Execute a function after two Ajax requests are successful. (See the jQuery.ajax() documentation for a complete description of success and error cases for an ajax request).
13513```javascript
13514$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13515 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13516 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13517 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13518 if ( /Whip It/.test( data ) ) {
13519 alert( "We got what we came for!" );
13520 }
13521});
13522```
13523 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13524```javascript
13525$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13526 .then( myFunc, myFailure );
13527```
13528 */
13529 when(...deferreds: any[]): JQuery.Promise<any, any, never>;
13530}
13531
\No newline at end of file