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 // tslint: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 // tslint: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 // tslint:disable-next-line:no-unnecessary-generics unified-signatures
197 <TElement = HTMLElement>(callback: ((this: Document, $: JQueryStatic) => void)): JQuery<TElement>;
198 /**
199 * Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string.
200 * @param object A plain object to wrap in a jQuery object.
201 * @see \`{@link https://api.jquery.com/jQuery/ }\`
202 * @since 1.0
203 */
204 <T extends JQuery.PlainObject>(object: T): JQuery<T>;
205 /**
206 * Returns an empty jQuery set.
207 * @see \`{@link https://api.jquery.com/jQuery/ }\`
208 * @since 1.4
209 */
210 // tslint:disable-next-line:no-unnecessary-generics
211 <TElement = HTMLElement>(): JQuery<TElement>;
212 /**
213 * Perform an asynchronous HTTP (Ajax) request.
214 * @param url A string containing the URL to which the request is sent.
215 * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can
216 * be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings.
217 * @see \`{@link https://api.jquery.com/jQuery.ajax/ }\`
218 * @since 1.5
219 */
220 ajax(url: string, settings?: JQuery.AjaxSettings): JQuery.jqXHR;
221 /**
222 * Perform an asynchronous HTTP (Ajax) request.
223 * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can
224 * be set for any option with $.ajaxSetup().
225 * @see \`{@link https://api.jquery.com/jQuery.ajax/ }\`
226 * @since 1.0
227 * @example ​ ````Save some data to the server and notify the user once it&#39;s complete.
228```javascript
229$.ajax({
230 method: "POST",
231 url: "some.php",
232 data: { name: "John", location: "Boston" }
233})
234 .done(function( msg ) {
235 alert( "Data Saved: " + msg );
236 });
237```
238 * @example ​ ````Retrieve the latest version of an HTML page.
239```javascript
240$.ajax({
241 url: "test.html",
242 cache: false
243})
244 .done(function( html ) {
245 $( "#results" ).append( html );
246 });
247```
248 * @example ​ ````Send an xml document as data to the server. By setting the processData
249 option to false, the automatic conversion of data to strings is prevented.
250```javascript
251var xmlDocument = [create xml document];
252var xmlRequest = $.ajax({
253 url: "page.php",
254 processData: false,
255 data: xmlDocument
256});
257
258xmlRequest.done( handleResponse );
259```
260 * @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.
261```javascript
262var menuId = $( "ul.nav" ).first().attr( "id" );
263var request = $.ajax({
264 url: "script.php",
265 method: "POST",
266 data: { id : menuId },
267 dataType: "html"
268});
269
270request.done(function( msg ) {
271 $( "#log" ).html( msg );
272});
273
274request.fail(function( jqXHR, textStatus ) {
275 alert( "Request failed: " + textStatus );
276});
277```
278 * @example ​ ````Load and execute a JavaScript file.
279```javascript
280$.ajax({
281 method: "GET",
282 url: "test.js",
283 dataType: "script"
284});
285```
286 */
287 ajax(settings?: JQuery.AjaxSettings): JQuery.jqXHR;
288 /**
289 * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
290 * @param dataTypes An optional string containing one or more space-separated dataTypes
291 * @param handler A handler to set default values for future Ajax requests.
292 * @see \`{@link https://api.jquery.com/jQuery.ajaxPrefilter/ }\`
293 * @since 1.5
294 */
295 ajaxPrefilter(dataTypes: string,
296 handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void;
297 /**
298 * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
299 * @param handler A handler to set default values for future Ajax requests.
300 * @see \`{@link https://api.jquery.com/jQuery.ajaxPrefilter/ }\`
301 * @since 1.5
302 */
303 ajaxPrefilter(handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void;
304 /**
305 * Set default values for future Ajax requests. Its use is not recommended.
306 * @param options A set of key/value pairs that configure the default Ajax request. All options are optional.
307 * @see \`{@link https://api.jquery.com/jQuery.ajaxSetup/ }\`
308 * @since 1.1
309 * @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.
310```javascript
311$.ajaxSetup({
312 url: "/xmlhttp/",
313 global: false,
314 type: "POST"
315});
316$.ajax({ data: myData });
317```
318 */
319 ajaxSetup(options: JQuery.AjaxSettings): JQuery.AjaxSettings;
320 /**
321 * Creates an object that handles the actual transmission of Ajax data.
322 * @param dataType A string identifying the data type to use
323 * @param handler A handler to return the new transport object to use with the data type provided in the first argument.
324 * @see \`{@link https://api.jquery.com/jQuery.ajaxTransport/ }\`
325 * @since 1.5
326 */
327 ajaxTransport(dataType: string,
328 handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => JQuery.Transport | void): void;
329 /**
330 * @deprecatedDeprecated since 3.3. Internal. See \`{@link https://github.com/jquery/jquery/issues/3384 }\`.
331 */
332 camelCase(value: string): string;
333 cleanData(elems: ArrayLike<Element | Document | Window | JQuery.PlainObject>): void;
334 /**
335 * Check to see if a DOM element is a descendant of another DOM element.
336 * @param container The DOM element that may contain the other element.
337 * @param contained The DOM element that may be contained by (a descendant of) the other element.
338 * @see \`{@link https://api.jquery.com/jQuery.contains/ }\`
339 * @since 1.4
340 * @example ​ ````Check if an element is a descendant of another.
341```javascript
342$.contains( document.documentElement, document.body ); // true
343$.contains( document.body, document.documentElement ); // false
344```
345 */
346 contains(container: Element, contained: Element): boolean;
347 css(elem: Element, name: string): any;
348 /**
349 * Store arbitrary data associated with the specified element. Returns the value that was set.
350 * @param element The DOM element to associate with the data.
351 * @param key A string naming the piece of data to set.
352 * @param value The new data value; this can be any Javascript type except `undefined`.
353 * @see \`{@link https://api.jquery.com/jQuery.data/ }\`
354 * @since 1.2.3
355 * @example ​ ````Get the data named &quot;blah&quot; stored at for an element.
356```html
357<!doctype html>
358<html lang="en">
359<head>
360 <meta charset="utf-8">
361 <title>jQuery.data demo</title>
362 <style>
363 div {
364 margin: 5px;
365 background: yellow;
366 }
367 button {
368 margin: 5px;
369 font-size: 14px;
370 }
371 p {
372 margin: 5px;
373 color: blue;
374 }
375 span {
376 color: red;
377 }
378 </style>
379 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
380</head>
381<body>
382
383<div>A div</div>
384<button>Get "blah" from the div</button>
385<button>Set "blah" to "hello"</button>
386<button>Set "blah" to 86</button>
387<button>Remove "blah" from the div</button>
388<p>The "blah" value of this div is <span>?</span></p>
389
390<script>
391$( "button" ).click( function() {
392 var value,
393 div = $( "div" )[ 0 ];
394 switch ( $( "button" ).index( this ) ) {
395 case 0 :
396 value = jQuery.data( div, "blah" );
397 break;
398 case 1 :
399 jQuery.data( div, "blah", "hello" );
400 value = "Stored!";
401 break;
402 case 2 :
403 jQuery.data( div, "blah", 86 );
404 value = "Stored!";
405 break;
406 case 3 :
407 jQuery.removeData( div, "blah" );
408 value = "Removed!";
409 break;
410 }
411 $( "span" ).text( "" + value );
412});
413</script>
414
415</body>
416</html>
417```
418 */
419 data<T extends string | number | boolean | symbol | object | null>(element: Element | Document | Window | JQuery.PlainObject, key: string, value: T): T;
420 /**
421 * 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.
422 * @param element The DOM element to query for the data.
423 * @param key Name of the data stored.
424 * @param value `undefined` is not recognized as a data value. Calls such as `jQuery.data( el, "name", undefined )`
425 * will return the corresponding data for "name", and is therefore the same as `jQuery.data( el, "name" )`
426 * @see \`{@link https://api.jquery.com/jQuery.data/ }\`
427 * @since 1.2.3
428 */
429 // `unified-signatures` is disabled so that behavior when passing `undefined` to `value` can be documented. Unifying the signatures
430 // results in potential confusion for users from an unexpected parameter.
431 // tslint:disable-next-line:unified-signatures
432 data(element: Element | Document | Window | JQuery.PlainObject, key: string, value: undefined): any;
433 /**
434 * 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.
435 * @param element The DOM element to query for the data.
436 * @param key Name of the data stored.
437 * @see \`{@link https://api.jquery.com/jQuery.data/ }\`
438 * @since 1.2.3
439 * @since 1.4
440 * @example ​ ````Store then retrieve a value from the div element.
441```html
442<!doctype html>
443<html lang="en">
444<head>
445 <meta charset="utf-8">
446 <title>jQuery.data demo</title>
447 <style>
448 div {
449 color: blue;
450 }
451 span {
452 color: red;
453 }
454 </style>
455 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
456</head>
457<body>
458
459<div>
460 The values stored were
461 <span></span>
462 and
463 <span></span>
464</div>
465
466<script>
467var div = $( "div" )[ 0 ];
468jQuery.data( div, "test", {
469 first: 16,
470 last: "pizza!"
471});
472$( "span:first" ).text( jQuery.data( div, "test" ).first );
473$( "span:last" ).text( jQuery.data( div, "test" ).last );
474</script>
475
476</body>
477</html>
478```
479 */
480 data(element: Element | Document | Window | JQuery.PlainObject, key?: string): any;
481 /**
482 * Execute the next function on the queue for the matched element.
483 * @param element A DOM element from which to remove and execute a queued function.
484 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
485 * @see \`{@link https://api.jquery.com/jQuery.dequeue/ }\`
486 * @since 1.3
487 * @example ​ ````Use jQuery.dequeue() to end a custom queue function which allows the queue to keep going.
488```html
489<!doctype html>
490<html lang="en">
491<head>
492 <meta charset="utf-8">
493 <title>jQuery.dequeue demo</title>
494 <style>
495 div {
496 margin: 3px;
497 width: 50px;
498 position: absolute;
499 height: 50px;
500 left: 10px;
501 top: 30px;
502 background-color: yellow;
503 }
504 div.red {
505 background-color: red;
506 }
507 </style>
508 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
509</head>
510<body>
511
512<button>Start</button>
513<div></div>
514
515<script>
516$( "button" ).click(function() {
517 $( "div" )
518 .animate({ left: '+=200px' }, 2000 )
519 .animate({ top: '0px' }, 600 )
520 .queue(function() {
521 $( this ).toggleClass( "red" );
522 $.dequeue( this );
523 })
524 .animate({ left:'10px', top:'30px' }, 700 );
525});
526</script>
527
528</body>
529</html>
530```
531 */
532 dequeue(element: Element, queueName?: string): void;
533 /**
534 * 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.
535 * @param array The array to iterate over.
536 * @param callback The function that will be executed on every object.
537 * @see \`{@link https://api.jquery.com/jQuery.each/ }\`
538 * @since 1.0
539 * @example ​ ````Iterates through the array displaying each number as both a word and numeral
540```html
541<!doctype html>
542<html lang="en">
543<head>
544 <meta charset="utf-8">
545 <title>jQuery.each demo</title>
546 <style>
547 div {
548 color: blue;
549 }
550 div#five {
551 color: red;
552 }
553 </style>
554 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
555</head>
556<body>
557
558<div id="one"></div>
559<div id="two"></div>
560<div id="three"></div>
561<div id="four"></div>
562<div id="five"></div>
563
564<script>
565var arr = [ "one", "two", "three", "four", "five" ];
566var obj = { one: 1, two: 2, three: 3, four: 4, five: 5 };
567
568jQuery.each( arr, function( i, val ) {
569 $( "#" + val ).text( "Mine is " + val + "." );
570
571 // Will stop running after "three"
572 return ( val !== "three" );
573});
574
575jQuery.each( obj, function( i, val ) {
576 $( "#" + i ).append( document.createTextNode( " - " + val ) );
577});
578</script>
579
580</body>
581</html>
582```
583 * @example ​ ````Iterates over items in an array, accessing both the current item and its index.
584```javascript
585$.each( [ "a", "b", "c" ], function( i, l ){
586 alert( "Index #" + i + ": " + l );
587});
588```
589 */
590 each<T>(array: ArrayLike<T>, callback: (this: T, indexInArray: number, value: T) => any): ArrayLike<T>;
591 /**
592 * 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.
593 * @param obj The object to iterate over.
594 * @param callback The function that will be executed on every object.
595 * @see \`{@link https://api.jquery.com/jQuery.each/ }\`
596 * @since 1.0
597 * @example ​ ````Iterates through the array displaying each number as both a word and numeral
598```html
599<!doctype html>
600<html lang="en">
601<head>
602 <meta charset="utf-8">
603 <title>jQuery.each demo</title>
604 <style>
605 div {
606 color: blue;
607 }
608 div#five {
609 color: red;
610 }
611 </style>
612 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
613</head>
614<body>
615
616<div id="one"></div>
617<div id="two"></div>
618<div id="three"></div>
619<div id="four"></div>
620<div id="five"></div>
621
622<script>
623var arr = [ "one", "two", "three", "four", "five" ];
624var obj = { one: 1, two: 2, three: 3, four: 4, five: 5 };
625
626jQuery.each( arr, function( i, val ) {
627 $( "#" + val ).text( "Mine is " + val + "." );
628
629 // Will stop running after "three"
630 return ( val !== "three" );
631});
632
633jQuery.each( obj, function( i, val ) {
634 $( "#" + i ).append( document.createTextNode( " - " + val ) );
635});
636</script>
637
638</body>
639</html>
640```
641 * @example ​ ````Iterates over the properties in an object, accessing both the current item and its key.
642```javascript
643$.each({ name: "John", lang: "JS" }, function( k, v ) {
644 alert( "Key: " + k + ", Value: " + v );
645});
646```
647 */
648 each<T, K extends keyof T>(obj: T, callback: (this: T[K], propertyName: K, valueOfProperty: T[K]) => any): T;
649 /**
650 * Takes a string and throws an exception containing it.
651 * @param message The message to send out.
652 * @see \`{@link https://api.jquery.com/jQuery.error/ }\`
653 * @since 1.4.1
654 * @example ​ ````Override jQuery.error for display in Firebug.
655```javascript
656jQuery.error = console.error;
657```
658 */
659 error(message: string): any;
660 /**
661 * Escapes any character that has a special meaning in a CSS selector.
662 * @param selector A string containing a selector expression to escape.
663 * @see \`{@link https://api.jquery.com/jQuery.escapeSelector/ }\`
664 * @since 3.0
665 * @example ​ ````Escape an ID containing a hash.
666```javascript
667$.escapeSelector( "#target" ); // "\#target"
668```
669 * @example ​ ````Select all the elements having a class name of .box inside a div.
670```javascript
671$( "div" ).find( "." + $.escapeSelector( ".box" ) );
672```
673 */
674 escapeSelector(selector: JQuery.Selector): JQuery.Selector;
675 /**
676 * Merge the contents of two or more objects together into the first object.
677 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
678 * @param target The object to extend. It will receive the new properties.
679 * @param object1 An object containing additional properties to merge in.
680 * @param object2 An object containing additional properties to merge in.
681 * @param object3 An object containing additional properties to merge in.
682 * @param object4 An object containing additional properties to merge in.
683 * @param object5 An object containing additional properties to merge in.
684 * @param object6 An object containing additional properties to merge in.
685 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
686 * @since 1.1.4
687 * @example ​ ````Merge two objects recursively, modifying the first.
688```html
689<!doctype html>
690<html lang="en">
691<head>
692 <meta charset="utf-8">
693 <title>jQuery.extend demo</title>
694 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
695</head>
696<body>
697
698<div id="log"></div>
699
700<script>
701var object1 = {
702 apple: 0,
703 banana: { weight: 52, price: 100 },
704 cherry: 97
705};
706var object2 = {
707 banana: { price: 200 },
708 durian: 100
709};
710
711// Merge object2 into object1, recursively
712$.extend( true, object1, object2 );
713
714// Assuming JSON.stringify - not available in IE<8
715$( "#log" ).append( JSON.stringify( object1 ) );
716</script>
717
718</body>
719</html>
720```
721 */
722 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;
723 /**
724 * Merge the contents of two or more objects together into the first object.
725 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
726 * @param target The object to extend. It will receive the new properties.
727 * @param object1 An object containing additional properties to merge in.
728 * @param object2 An object containing additional properties to merge in.
729 * @param object3 An object containing additional properties to merge in.
730 * @param object4 An object containing additional properties to merge in.
731 * @param object5 An object containing additional properties to merge in.
732 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
733 * @since 1.1.4
734 * @example ​ ````Merge two objects recursively, modifying the first.
735```html
736<!doctype html>
737<html lang="en">
738<head>
739 <meta charset="utf-8">
740 <title>jQuery.extend demo</title>
741 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
742</head>
743<body>
744
745<div id="log"></div>
746
747<script>
748var object1 = {
749 apple: 0,
750 banana: { weight: 52, price: 100 },
751 cherry: 97
752};
753var object2 = {
754 banana: { price: 200 },
755 durian: 100
756};
757
758// Merge object2 into object1, recursively
759$.extend( true, object1, object2 );
760
761// Assuming JSON.stringify - not available in IE<8
762$( "#log" ).append( JSON.stringify( object1 ) );
763</script>
764
765</body>
766</html>
767```
768 */
769 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;
770 /**
771 * Merge the contents of two or more objects together into the first object.
772 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
773 * @param target The object to extend. It will receive the new properties.
774 * @param object1 An object containing additional properties to merge in.
775 * @param object2 An object containing additional properties to merge in.
776 * @param object3 An object containing additional properties to merge in.
777 * @param object4 An object containing additional properties to merge in.
778 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
779 * @since 1.1.4
780 * @example ​ ````Merge two objects recursively, modifying the first.
781```html
782<!doctype html>
783<html lang="en">
784<head>
785 <meta charset="utf-8">
786 <title>jQuery.extend demo</title>
787 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
788</head>
789<body>
790
791<div id="log"></div>
792
793<script>
794var object1 = {
795 apple: 0,
796 banana: { weight: 52, price: 100 },
797 cherry: 97
798};
799var object2 = {
800 banana: { price: 200 },
801 durian: 100
802};
803
804// Merge object2 into object1, recursively
805$.extend( true, object1, object2 );
806
807// Assuming JSON.stringify - not available in IE<8
808$( "#log" ).append( JSON.stringify( object1 ) );
809</script>
810
811</body>
812</html>
813```
814 */
815 extend<T, U, V, W, X>(deep: true, target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X;
816 /**
817 * Merge the contents of two or more objects together into the first object.
818 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
819 * @param target The object to extend. It will receive the new properties.
820 * @param object1 An object containing additional properties to merge in.
821 * @param object2 An object containing additional properties to merge in.
822 * @param object3 An object containing additional properties to merge in.
823 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
824 * @since 1.1.4
825 * @example ​ ````Merge two objects recursively, modifying the first.
826```html
827<!doctype html>
828<html lang="en">
829<head>
830 <meta charset="utf-8">
831 <title>jQuery.extend demo</title>
832 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
833</head>
834<body>
835
836<div id="log"></div>
837
838<script>
839var object1 = {
840 apple: 0,
841 banana: { weight: 52, price: 100 },
842 cherry: 97
843};
844var object2 = {
845 banana: { price: 200 },
846 durian: 100
847};
848
849// Merge object2 into object1, recursively
850$.extend( true, object1, object2 );
851
852// Assuming JSON.stringify - not available in IE<8
853$( "#log" ).append( JSON.stringify( object1 ) );
854</script>
855
856</body>
857</html>
858```
859 */
860 extend<T, U, V, W>(deep: true, target: T, object1: U, object2: V, object3: W): T & U & V & W;
861 /**
862 * Merge the contents of two or more objects together into the first object.
863 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
864 * @param target The object to extend. It will receive the new properties.
865 * @param object1 An object containing additional properties to merge in.
866 * @param object2 An object containing additional properties to merge in.
867 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
868 * @since 1.1.4
869 * @example ​ ````Merge two objects recursively, modifying the first.
870```html
871<!doctype html>
872<html lang="en">
873<head>
874 <meta charset="utf-8">
875 <title>jQuery.extend demo</title>
876 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
877</head>
878<body>
879
880<div id="log"></div>
881
882<script>
883var object1 = {
884 apple: 0,
885 banana: { weight: 52, price: 100 },
886 cherry: 97
887};
888var object2 = {
889 banana: { price: 200 },
890 durian: 100
891};
892
893// Merge object2 into object1, recursively
894$.extend( true, object1, object2 );
895
896// Assuming JSON.stringify - not available in IE<8
897$( "#log" ).append( JSON.stringify( object1 ) );
898</script>
899
900</body>
901</html>
902```
903 */
904 extend<T, U, V>(deep: true, target: T, object1: U, object2: V): T & U & V;
905 /**
906 * Merge the contents of two or more objects together into the first object.
907 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
908 * @param target The object to extend. It will receive the new properties.
909 * @param object1 An object containing additional properties to merge in.
910 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
911 * @since 1.1.4
912 * @example ​ ````Merge two objects recursively, modifying the first.
913```html
914<!doctype html>
915<html lang="en">
916<head>
917 <meta charset="utf-8">
918 <title>jQuery.extend demo</title>
919 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
920</head>
921<body>
922
923<div id="log"></div>
924
925<script>
926var object1 = {
927 apple: 0,
928 banana: { weight: 52, price: 100 },
929 cherry: 97
930};
931var object2 = {
932 banana: { price: 200 },
933 durian: 100
934};
935
936// Merge object2 into object1, recursively
937$.extend( true, object1, object2 );
938
939// Assuming JSON.stringify - not available in IE<8
940$( "#log" ).append( JSON.stringify( object1 ) );
941</script>
942
943</body>
944</html>
945```
946 */
947 extend<T, U>(deep: true, target: T, object1: U): T & U;
948 /**
949 * Merge the contents of two or more objects together into the first object.
950 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
951 * @param target The object to extend. It will receive the new properties.
952 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
953 * @since 1.1.4
954 */
955 extend<T>(deep: true, target: T): this & T;
956 /**
957 * Merge the contents of two or more objects together into the first object.
958 * @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
959 * @param target The object to extend. It will receive the new properties.
960 * @param object1 An object containing additional properties to merge in.
961 * @param objectN Additional objects containing properties to merge in.
962 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
963 * @since 1.1.4
964 * @example ​ ````Merge two objects recursively, modifying the first.
965```html
966<!doctype html>
967<html lang="en">
968<head>
969 <meta charset="utf-8">
970 <title>jQuery.extend demo</title>
971 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
972</head>
973<body>
974
975<div id="log"></div>
976
977<script>
978var object1 = {
979 apple: 0,
980 banana: { weight: 52, price: 100 },
981 cherry: 97
982};
983var object2 = {
984 banana: { price: 200 },
985 durian: 100
986};
987
988// Merge object2 into object1, recursively
989$.extend( true, object1, object2 );
990
991// Assuming JSON.stringify - not available in IE<8
992$( "#log" ).append( JSON.stringify( object1 ) );
993</script>
994
995</body>
996</html>
997```
998 */
999 extend(deep: true, target: any, object1: any, ...objectN: any[]): any;
1000 /**
1001 * Merge the contents of two or more objects together into the first object.
1002 * @param target An object that will receive the new properties if additional objects are passed in or that will
1003 * extend the jQuery namespace if it is the sole argument.
1004 * @param object1 An object containing additional properties to merge in.
1005 * @param object2 An object containing additional properties to merge in.
1006 * @param object3 An object containing additional properties to merge in.
1007 * @param object4 An object containing additional properties to merge in.
1008 * @param object5 An object containing additional properties to merge in.
1009 * @param object6 An object containing additional properties to merge in.
1010 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
1011 * @since 1.0
1012 * @example ​ ````Merge two objects, modifying the first.
1013```html
1014<!doctype html>
1015<html lang="en">
1016<head>
1017 <meta charset="utf-8">
1018 <title>jQuery.extend demo</title>
1019 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1020</head>
1021<body>
1022
1023<div id="log"></div>
1024
1025<script>
1026var object1 = {
1027 apple: 0,
1028 banana: { weight: 52, price: 100 },
1029 cherry: 97
1030};
1031var object2 = {
1032 banana: { price: 200 },
1033 durian: 100
1034};
1035
1036// Merge object2 into object1
1037$.extend( object1, object2 );
1038
1039// Assuming JSON.stringify - not available in IE<8
1040$( "#log" ).append( JSON.stringify( object1 ) );
1041</script>
1042
1043</body>
1044</html>
1045```
1046 * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern.
1047```html
1048<!doctype html>
1049<html lang="en">
1050<head>
1051 <meta charset="utf-8">
1052 <title>jQuery.extend demo</title>
1053 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1054</head>
1055<body>
1056
1057<div id="log"></div>
1058
1059<script>
1060var defaults = { validate: false, limit: 5, name: "foo" };
1061var options = { validate: true, name: "bar" };
1062
1063// Merge defaults and options, without modifying defaults
1064var settings = $.extend( {}, defaults, options );
1065
1066// Assuming JSON.stringify - not available in IE<8
1067$( "#log" ).append( "<div><b>defaults -- </b>" + JSON.stringify( defaults ) + "</div>" );
1068$( "#log" ).append( "<div><b>options -- </b>" + JSON.stringify( options ) + "</div>" );
1069$( "#log" ).append( "<div><b>settings -- </b>" + JSON.stringify( settings ) + "</div>" );
1070</script>
1071
1072</body>
1073</html>
1074```
1075 */
1076 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;
1077 /**
1078 * Merge the contents of two or more objects together into the first object.
1079 * @param target An object that will receive the new properties if additional objects are passed in or that will
1080 * extend the jQuery namespace if it is the sole argument.
1081 * @param object1 An object containing additional properties to merge in.
1082 * @param object2 An object containing additional properties to merge in.
1083 * @param object3 An object containing additional properties to merge in.
1084 * @param object4 An object containing additional properties to merge in.
1085 * @param object5 An object containing additional properties to merge in.
1086 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
1087 * @since 1.0
1088 * @example ​ ````Merge two objects, modifying the first.
1089```html
1090<!doctype html>
1091<html lang="en">
1092<head>
1093 <meta charset="utf-8">
1094 <title>jQuery.extend demo</title>
1095 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1096</head>
1097<body>
1098
1099<div id="log"></div>
1100
1101<script>
1102var object1 = {
1103 apple: 0,
1104 banana: { weight: 52, price: 100 },
1105 cherry: 97
1106};
1107var object2 = {
1108 banana: { price: 200 },
1109 durian: 100
1110};
1111
1112// Merge object2 into object1
1113$.extend( object1, object2 );
1114
1115// Assuming JSON.stringify - not available in IE<8
1116$( "#log" ).append( JSON.stringify( object1 ) );
1117</script>
1118
1119</body>
1120</html>
1121```
1122 * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern.
1123```html
1124<!doctype html>
1125<html lang="en">
1126<head>
1127 <meta charset="utf-8">
1128 <title>jQuery.extend demo</title>
1129 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1130</head>
1131<body>
1132
1133<div id="log"></div>
1134
1135<script>
1136var defaults = { validate: false, limit: 5, name: "foo" };
1137var options = { validate: true, name: "bar" };
1138
1139// Merge defaults and options, without modifying defaults
1140var settings = $.extend( {}, defaults, options );
1141
1142// Assuming JSON.stringify - not available in IE<8
1143$( "#log" ).append( "<div><b>defaults -- </b>" + JSON.stringify( defaults ) + "</div>" );
1144$( "#log" ).append( "<div><b>options -- </b>" + JSON.stringify( options ) + "</div>" );
1145$( "#log" ).append( "<div><b>settings -- </b>" + JSON.stringify( settings ) + "</div>" );
1146</script>
1147
1148</body>
1149</html>
1150```
1151 */
1152 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;
1153 /**
1154 * Merge the contents of two or more objects together into the first object.
1155 * @param target An object that will receive the new properties if additional objects are passed in or that will
1156 * extend the jQuery namespace if it is the sole argument.
1157 * @param object1 An object containing additional properties to merge in.
1158 * @param object2 An object containing additional properties to merge in.
1159 * @param object3 An object containing additional properties to merge in.
1160 * @param object4 An object containing additional properties to merge in.
1161 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
1162 * @since 1.0
1163 * @example ​ ````Merge two objects, modifying the first.
1164```html
1165<!doctype html>
1166<html lang="en">
1167<head>
1168 <meta charset="utf-8">
1169 <title>jQuery.extend demo</title>
1170 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1171</head>
1172<body>
1173
1174<div id="log"></div>
1175
1176<script>
1177var object1 = {
1178 apple: 0,
1179 banana: { weight: 52, price: 100 },
1180 cherry: 97
1181};
1182var object2 = {
1183 banana: { price: 200 },
1184 durian: 100
1185};
1186
1187// Merge object2 into object1
1188$.extend( object1, object2 );
1189
1190// Assuming JSON.stringify - not available in IE<8
1191$( "#log" ).append( JSON.stringify( object1 ) );
1192</script>
1193
1194</body>
1195</html>
1196```
1197 * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern.
1198```html
1199<!doctype html>
1200<html lang="en">
1201<head>
1202 <meta charset="utf-8">
1203 <title>jQuery.extend demo</title>
1204 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1205</head>
1206<body>
1207
1208<div id="log"></div>
1209
1210<script>
1211var defaults = { validate: false, limit: 5, name: "foo" };
1212var options = { validate: true, name: "bar" };
1213
1214// Merge defaults and options, without modifying defaults
1215var settings = $.extend( {}, defaults, options );
1216
1217// Assuming JSON.stringify - not available in IE<8
1218$( "#log" ).append( "<div><b>defaults -- </b>" + JSON.stringify( defaults ) + "</div>" );
1219$( "#log" ).append( "<div><b>options -- </b>" + JSON.stringify( options ) + "</div>" );
1220$( "#log" ).append( "<div><b>settings -- </b>" + JSON.stringify( settings ) + "</div>" );
1221</script>
1222
1223</body>
1224</html>
1225```
1226 */
1227 extend<T, U, V, W, X>(target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X;
1228 /**
1229 * Merge the contents of two or more objects together into the first object.
1230 * @param target An object that will receive the new properties if additional objects are passed in or that will
1231 * extend the jQuery namespace if it is the sole argument.
1232 * @param object1 An object containing additional properties to merge in.
1233 * @param object2 An object containing additional properties to merge in.
1234 * @param object3 An object containing additional properties to merge in.
1235 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
1236 * @since 1.0
1237 * @example ​ ````Merge two objects, modifying the first.
1238```html
1239<!doctype html>
1240<html lang="en">
1241<head>
1242 <meta charset="utf-8">
1243 <title>jQuery.extend demo</title>
1244 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1245</head>
1246<body>
1247
1248<div id="log"></div>
1249
1250<script>
1251var object1 = {
1252 apple: 0,
1253 banana: { weight: 52, price: 100 },
1254 cherry: 97
1255};
1256var object2 = {
1257 banana: { price: 200 },
1258 durian: 100
1259};
1260
1261// Merge object2 into object1
1262$.extend( object1, object2 );
1263
1264// Assuming JSON.stringify - not available in IE<8
1265$( "#log" ).append( JSON.stringify( object1 ) );
1266</script>
1267
1268</body>
1269</html>
1270```
1271 * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern.
1272```html
1273<!doctype html>
1274<html lang="en">
1275<head>
1276 <meta charset="utf-8">
1277 <title>jQuery.extend demo</title>
1278 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1279</head>
1280<body>
1281
1282<div id="log"></div>
1283
1284<script>
1285var defaults = { validate: false, limit: 5, name: "foo" };
1286var options = { validate: true, name: "bar" };
1287
1288// Merge defaults and options, without modifying defaults
1289var settings = $.extend( {}, defaults, options );
1290
1291// Assuming JSON.stringify - not available in IE<8
1292$( "#log" ).append( "<div><b>defaults -- </b>" + JSON.stringify( defaults ) + "</div>" );
1293$( "#log" ).append( "<div><b>options -- </b>" + JSON.stringify( options ) + "</div>" );
1294$( "#log" ).append( "<div><b>settings -- </b>" + JSON.stringify( settings ) + "</div>" );
1295</script>
1296
1297</body>
1298</html>
1299```
1300 */
1301 extend<T, U, V, W>(target: T, object1: U, object2: V, object3: W): T & U & V & W;
1302 /**
1303 * Merge the contents of two or more objects together into the first object.
1304 * @param target An object that will receive the new properties if additional objects are passed in or that will
1305 * extend the jQuery namespace if it is the sole argument.
1306 * @param object1 An object containing additional properties to merge in.
1307 * @param object2 An object containing additional properties to merge in.
1308 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
1309 * @since 1.0
1310 * @example ​ ````Merge two objects, modifying the first.
1311```html
1312<!doctype html>
1313<html lang="en">
1314<head>
1315 <meta charset="utf-8">
1316 <title>jQuery.extend demo</title>
1317 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1318</head>
1319<body>
1320
1321<div id="log"></div>
1322
1323<script>
1324var object1 = {
1325 apple: 0,
1326 banana: { weight: 52, price: 100 },
1327 cherry: 97
1328};
1329var object2 = {
1330 banana: { price: 200 },
1331 durian: 100
1332};
1333
1334// Merge object2 into object1
1335$.extend( object1, object2 );
1336
1337// Assuming JSON.stringify - not available in IE<8
1338$( "#log" ).append( JSON.stringify( object1 ) );
1339</script>
1340
1341</body>
1342</html>
1343```
1344 * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern.
1345```html
1346<!doctype html>
1347<html lang="en">
1348<head>
1349 <meta charset="utf-8">
1350 <title>jQuery.extend demo</title>
1351 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1352</head>
1353<body>
1354
1355<div id="log"></div>
1356
1357<script>
1358var defaults = { validate: false, limit: 5, name: "foo" };
1359var options = { validate: true, name: "bar" };
1360
1361// Merge defaults and options, without modifying defaults
1362var settings = $.extend( {}, defaults, options );
1363
1364// Assuming JSON.stringify - not available in IE<8
1365$( "#log" ).append( "<div><b>defaults -- </b>" + JSON.stringify( defaults ) + "</div>" );
1366$( "#log" ).append( "<div><b>options -- </b>" + JSON.stringify( options ) + "</div>" );
1367$( "#log" ).append( "<div><b>settings -- </b>" + JSON.stringify( settings ) + "</div>" );
1368</script>
1369
1370</body>
1371</html>
1372```
1373 */
1374 extend<T, U, V>(target: T, object1: U, object2: V): T & U & V;
1375 /**
1376 * Merge the contents of two or more objects together into the first object.
1377 * @param target An object that will receive the new properties if additional objects are passed in or that will
1378 * extend the jQuery namespace if it is the sole argument.
1379 * @param object1 An object containing additional properties to merge in.
1380 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
1381 * @since 1.0
1382 * @example ​ ````Merge two objects, modifying the first.
1383```html
1384<!doctype html>
1385<html lang="en">
1386<head>
1387 <meta charset="utf-8">
1388 <title>jQuery.extend demo</title>
1389 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1390</head>
1391<body>
1392
1393<div id="log"></div>
1394
1395<script>
1396var object1 = {
1397 apple: 0,
1398 banana: { weight: 52, price: 100 },
1399 cherry: 97
1400};
1401var object2 = {
1402 banana: { price: 200 },
1403 durian: 100
1404};
1405
1406// Merge object2 into object1
1407$.extend( object1, object2 );
1408
1409// Assuming JSON.stringify - not available in IE<8
1410$( "#log" ).append( JSON.stringify( object1 ) );
1411</script>
1412
1413</body>
1414</html>
1415```
1416 * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern.
1417```html
1418<!doctype html>
1419<html lang="en">
1420<head>
1421 <meta charset="utf-8">
1422 <title>jQuery.extend demo</title>
1423 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1424</head>
1425<body>
1426
1427<div id="log"></div>
1428
1429<script>
1430var defaults = { validate: false, limit: 5, name: "foo" };
1431var options = { validate: true, name: "bar" };
1432
1433// Merge defaults and options, without modifying defaults
1434var settings = $.extend( {}, defaults, options );
1435
1436// Assuming JSON.stringify - not available in IE<8
1437$( "#log" ).append( "<div><b>defaults -- </b>" + JSON.stringify( defaults ) + "</div>" );
1438$( "#log" ).append( "<div><b>options -- </b>" + JSON.stringify( options ) + "</div>" );
1439$( "#log" ).append( "<div><b>settings -- </b>" + JSON.stringify( settings ) + "</div>" );
1440</script>
1441
1442</body>
1443</html>
1444```
1445 */
1446 extend<T, U>(target: T, object1: U): T & U;
1447 /**
1448 * Merge the contents of two or more objects together into the first object.
1449 * @param target An object that will receive the new properties if additional objects are passed in or that will
1450 * extend the jQuery namespace if it is the sole argument.
1451 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
1452 * @since 1.0
1453 */
1454 extend<T>(target: T): this & T;
1455 /**
1456 * Merge the contents of two or more objects together into the first object.
1457 * @param target An object that will receive the new properties if additional objects are passed in or that will
1458 * extend the jQuery namespace if it is the sole argument.
1459 * @param object1 An object containing additional properties to merge in.
1460 * @param objectN Additional objects containing properties to merge in.
1461 * @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
1462 * @since 1.0
1463 * @example ​ ````Merge two objects, modifying the first.
1464```html
1465<!doctype html>
1466<html lang="en">
1467<head>
1468 <meta charset="utf-8">
1469 <title>jQuery.extend demo</title>
1470 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1471</head>
1472<body>
1473
1474<div id="log"></div>
1475
1476<script>
1477var object1 = {
1478 apple: 0,
1479 banana: { weight: 52, price: 100 },
1480 cherry: 97
1481};
1482var object2 = {
1483 banana: { price: 200 },
1484 durian: 100
1485};
1486
1487// Merge object2 into object1
1488$.extend( object1, object2 );
1489
1490// Assuming JSON.stringify - not available in IE<8
1491$( "#log" ).append( JSON.stringify( object1 ) );
1492</script>
1493
1494</body>
1495</html>
1496```
1497 * @example ​ ````Merge defaults and options, without modifying the defaults. This is a common plugin development pattern.
1498```html
1499<!doctype html>
1500<html lang="en">
1501<head>
1502 <meta charset="utf-8">
1503 <title>jQuery.extend demo</title>
1504 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1505</head>
1506<body>
1507
1508<div id="log"></div>
1509
1510<script>
1511var defaults = { validate: false, limit: 5, name: "foo" };
1512var options = { validate: true, name: "bar" };
1513
1514// Merge defaults and options, without modifying defaults
1515var settings = $.extend( {}, defaults, options );
1516
1517// Assuming JSON.stringify - not available in IE<8
1518$( "#log" ).append( "<div><b>defaults -- </b>" + JSON.stringify( defaults ) + "</div>" );
1519$( "#log" ).append( "<div><b>options -- </b>" + JSON.stringify( options ) + "</div>" );
1520$( "#log" ).append( "<div><b>settings -- </b>" + JSON.stringify( settings ) + "</div>" );
1521</script>
1522
1523</body>
1524</html>
1525```
1526 */
1527 extend(target: any, object1: any, ...objectN: any[]): any;
1528 /**
1529 * Load data from the server using a HTTP GET request.
1530 * @param url A string containing the URL to which the request is sent.
1531 * @param data A plain object or string that is sent to the server with the request.
1532 * @param success A callback function that is executed if the request succeeds. Required if `dataType` is provided,
1533 * but you can use `null` or \`{@link noop jQuery.noop}\` as a placeholder.
1534 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
1535 * @see \`{@link https://api.jquery.com/jQuery.get/ }\`
1536 * @since 1.0
1537 */
1538 get(url: string,
1539 data: JQuery.PlainObject | string,
1540 success: JQuery.jqXHR.DoneCallback | null,
1541 dataType?: string): JQuery.jqXHR;
1542 /**
1543 * Load data from the server using a HTTP GET request.
1544 * @param url A string containing the URL to which the request is sent.
1545 * @param success A callback function that is executed if the request succeeds. Required if `dataType` is provided,
1546 * but you can use `null` or \`{@link noop jQuery.noop}\` as a placeholder.
1547 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
1548 * @see \`{@link https://api.jquery.com/jQuery.get/ }\`
1549 * @since 1.0
1550 * @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.
1551```javascript
1552$.get( "test.php", function( data ) {
1553 $( "body" )
1554 .append( "Name: " + data.name ) // John
1555 .append( "Time: " + data.time ); // 2pm
1556}, "json" );
1557```
1558 */
1559 get(url: string,
1560 success: JQuery.jqXHR.DoneCallback | null,
1561 dataType: string): JQuery.jqXHR;
1562 /**
1563 * Load data from the server using a HTTP GET request.
1564 * @param url A string containing the URL to which the request is sent.
1565 * @param success_data _&#x40;param_ `success_data`
1566 * <br>
1567 * * `success` — A callback function that is executed if the request succeeds. Required if `dataType` is provided,
1568 * but you can use `null` or \`{@link noop jQuery.noop}\` as a placeholder. <br>
1569 * * `data` — A plain object or string that is sent to the server with the request.
1570 * @see \`{@link https://api.jquery.com/jQuery.get/ }\`
1571 * @since 1.0
1572 * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results).
1573```javascript
1574$.get( "test.php", { name: "John", time: "2pm" } );
1575```
1576 * @example ​ ````Pass arrays of data to the server (while still ignoring the return results).
1577```javascript
1578$.get( "test.php", { "choices[]": ["Jon", "Susan"] } );
1579```
1580 * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned).
1581```javascript
1582$.get( "test.php", function( data ) {
1583 alert( "Data Loaded: " + data );
1584});
1585```
1586 * @example ​ ````Alert the results from requesting test.cgi with an additional payload of data (HTML or XML, depending on what was returned).
1587```javascript
1588$.get( "test.cgi", { name: "John", time: "2pm" } )
1589 .done(function( data ) {
1590 alert( "Data Loaded: " + data );
1591 });
1592```
1593 */
1594 get(url: string,
1595 success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR;
1596 /**
1597 * Load data from the server using a HTTP GET request.
1598 * @param url_settings _&#x40;param_ `url_settings`
1599 * <br>
1600 * * `url` — A string containing the URL to which the request is sent. <br>
1601 * * `settings` — A set of key/value pairs that configure the Ajax request. All properties except for `url` are
1602 * 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 )}\`
1603 * for a complete list of all settings. The type option will automatically be set to `GET`.
1604 * @see \`{@link https://api.jquery.com/jQuery.get/ }\`
1605 * @since 1.0
1606 * @since 1.12
1607 * @since 2.2
1608 * @example ​ ````Request the test.php page, but ignore the return results.
1609```javascript
1610$.get( "test.php" );
1611```
1612 */
1613 get(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR;
1614 /**
1615 * Load JSON-encoded data from the server using a GET HTTP request.
1616 * @param url A string containing the URL to which the request is sent.
1617 * @param data A plain object or string that is sent to the server with the request.
1618 * @param success A callback function that is executed if the request succeeds.
1619 * @see \`{@link https://api.jquery.com/jQuery.getJSON/ }\`
1620 * @since 1.0
1621 */
1622 getJSON(url: string,
1623 data: JQuery.PlainObject | string,
1624 success: JQuery.jqXHR.DoneCallback): JQuery.jqXHR;
1625 /**
1626 * Load JSON-encoded data from the server using a GET HTTP request.
1627 * @param url A string containing the URL to which the request is sent.
1628 * @param success_data _&#x40;param_ `url_settings`
1629 * <br>
1630 * * `success` — A callback function that is executed if the request succeeds. <br>
1631 * * `data` — A plain object or string that is sent to the server with the request.
1632 * @see \`{@link https://api.jquery.com/jQuery.getJSON/ }\`
1633 * @since 1.0
1634 * @example ​ ````Loads the four most recent pictures of Mount Rainier from the Flickr JSONP API.
1635```html
1636<!doctype html>
1637<html lang="en">
1638<head>
1639 <meta charset="utf-8">
1640 <title>jQuery.getJSON demo</title>
1641 <style>
1642 img {
1643 height: 100px;
1644 float: left;
1645 }
1646 </style>
1647 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1648</head>
1649<body>
1650
1651<div id="images"></div>
1652
1653<script>
1654(function() {
1655 var flickerAPI = "https://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?";
1656 $.getJSON( flickerAPI, {
1657 tags: "mount rainier",
1658 tagmode: "any",
1659 format: "json"
1660 })
1661 .done(function( data ) {
1662 $.each( data.items, function( i, item ) {
1663 $( "<img>" ).attr( "src", item.media.m ).appendTo( "#images" );
1664 if ( i === 3 ) {
1665 return false;
1666 }
1667 });
1668 });
1669})();
1670</script>
1671
1672</body>
1673</html>
1674```
1675 * @example ​ ````Load the JSON data from test.js and access a name from the returned JSON data.
1676```javascript
1677$.getJSON( "test.js", function( json ) {
1678 console.log( "JSON Data: " + json.users[ 3 ].name );
1679 });
1680 ```
1681 * @example ​ ````Load the JSON data from test.js, passing along additional data, and access a name from the returned JSON data.
1682 If an error occurs, log an error message instead.
1683```javascript
1684$.getJSON( "test.js", { name: "John", time: "2pm" } )
1685 .done(function( json ) {
1686 console.log( "JSON Data: " + json.users[ 3 ].name );
1687 })
1688 .fail(function( jqxhr, textStatus, error ) {
1689 var err = textStatus + ", " + error;
1690 console.log( "Request Failed: " + err );
1691});
1692```
1693 */
1694 getJSON(url: string,
1695 success_data?: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR;
1696 /**
1697 * Load a JavaScript file from the server using a GET HTTP request, then execute it.
1698 * @param url A string containing the URL to which the request is sent.
1699 * @param success A callback function that is executed if the request succeeds.
1700 * @see \`{@link https://api.jquery.com/jQuery.getScript/ }\`
1701 * @since 1.0
1702 * @example ​ ````Define a $.cachedScript() method that allows fetching a cached script:
1703```javascript
1704jQuery.cachedScript = function( url, options ) {
1705
1706 // Allow user to set any option except for dataType, cache, and url
1707 options = $.extend( options || {}, {
1708 dataType: "script",
1709 cache: true,
1710 url: url
1711 });
1712
1713 // Use $.ajax() since it is more flexible than $.getScript
1714 // Return the jqXHR object so we can chain callbacks
1715 return jQuery.ajax( options );
1716};
1717
1718// Usage
1719$.cachedScript( "ajax/test.js" ).done(function( script, textStatus ) {
1720 console.log( textStatus );
1721});
1722```
1723 * @example ​ ````Load the official jQuery Color Animation plugin dynamically and bind some color animations to occur once the new functionality is loaded.
1724```html
1725<!doctype html>
1726<html lang="en">
1727<head>
1728 <meta charset="utf-8">
1729 <title>jQuery.getScript demo</title>
1730 <style>
1731 .block {
1732 background-color: blue;
1733 width: 150px;
1734 height: 70px;
1735 margin: 10px;
1736 }
1737 </style>
1738 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1739</head>
1740<body>
1741
1742<button id="go">&raquo; Run</button>
1743<div class="block"></div>
1744
1745<script>
1746var url = "https://code.jquery.com/color/jquery.color.js";
1747$.getScript( url, function() {
1748 $( "#go" ).click(function() {
1749 $( ".block" )
1750 .animate({
1751 backgroundColor: "rgb(255, 180, 180)"
1752 }, 1000 )
1753 .delay( 500 )
1754 .animate({
1755 backgroundColor: "olive"
1756 }, 1000 )
1757 .delay( 500 )
1758 .animate({
1759 backgroundColor: "#00f"
1760 }, 1000 );
1761 });
1762});
1763</script>
1764
1765</body>
1766</html>
1767```
1768 */
1769 getScript(url: string,
1770 success?: JQuery.jqXHR.DoneCallback<string | undefined>): JQuery.jqXHR<string | undefined>;
1771 /**
1772 * Load a JavaScript file from the server using a GET HTTP request, then execute it.
1773 * @see \`{@link https://api.jquery.com/jQuery.getScript/ }\`
1774 * @since 1.12
1775 * @since 2.2
1776 */
1777 getScript(options: JQuery.UrlAjaxSettings): JQuery.jqXHR<string | undefined>;
1778 /**
1779 * Execute some JavaScript code globally.
1780 * @param code The JavaScript code to execute.
1781 * @see \`{@link https://api.jquery.com/jQuery.globalEval/ }\`
1782 * @since 1.0.4
1783 * @example ​ ````Execute a script in the global context.
1784```javascript
1785function test() {
1786 jQuery.globalEval( "var newVar = true;" )
1787}
1788test();
1789// newVar === true
1790```
1791 */
1792 globalEval(code: string): void;
1793 /**
1794 * Finds the elements of an array which satisfy a filter function. The original array is not affected.
1795 * @param array The array-like object to search through.
1796 * @param funсtion The function to process each item against. The first argument to the function is the item, and the
1797 * second argument is the index. The function should return a Boolean value. `this` will be the global
1798 * window object.
1799 * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements
1800 * for which "callback" returns true. If "invert" is true, then the function returns an array
1801 * consisting of all elements for which "callback" returns false.
1802 * @see \`{@link https://api.jquery.com/jQuery.grep/ }\`
1803 * @since 1.0
1804 * @example ​ ````Filters the original array of numbers leaving that are not 5 and have an index greater than 4. Then it removes all 9s.
1805```html
1806<!doctype html>
1807<html lang="en">
1808<head>
1809 <meta charset="utf-8">
1810 <title>jQuery.grep demo</title>
1811 <style>
1812 div {
1813 color: blue;
1814 }
1815 p {
1816 color: green;
1817 margin: 0;
1818 }
1819 span {
1820 color: red;
1821 }
1822 </style>
1823 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1824</head>
1825<body>
1826
1827<div></div>
1828<p></p>
1829<span></span>
1830
1831<script>
1832var arr = [ 1, 9, 3, 8, 6, 1, 5, 9, 4, 7, 3, 8, 6, 9, 1 ];
1833$( "div" ).text( arr.join( ", " ) );
1834
1835arr = jQuery.grep(arr, function( n, i ) {
1836 return ( n !== 5 && i > 4 );
1837});
1838$( "p" ).text( arr.join( ", " ) );
1839
1840arr = jQuery.grep(arr, function( a ) {
1841 return a !== 9;
1842});
1843
1844$( "span" ).text( arr.join( ", " ) );
1845</script>
1846
1847</body>
1848</html>
1849```
1850 * @example ​ ````Filter an array of numbers to include only numbers bigger then zero.
1851```javascript
1852$.grep( [ 0, 1, 2 ], function( n, i ) {
1853 return n > 0;
1854});
1855```
1856 * @example ​ ````Filter an array of numbers to include numbers that are not bigger than zero.
1857```javascript
1858$.grep( [ 0, 1, 2 ], function( n, i ) {
1859 return n > 0;
1860}, true );
1861```
1862 */
1863 grep<T>(array: ArrayLike<T>,
1864 funсtion: (elementOfArray: T, indexInArray: number) => boolean,
1865 invert?: boolean): T[];
1866 /**
1867 * Determine whether an element has any jQuery data associated with it.
1868 * @param element A DOM element to be checked for data.
1869 * @see \`{@link https://api.jquery.com/jQuery.hasData/ }\`
1870 * @since 1.5
1871 * @example ​ ````Set data on an element and see the results of hasData.
1872```html
1873<!doctype html>
1874<html lang="en">
1875<head>
1876 <meta charset="utf-8">
1877 <title>jQuery.hasData demo</title>
1878 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1879</head>
1880<body>
1881
1882<p>Results: </p>
1883
1884<script>
1885var $p = jQuery( "p" ), p = $p[ 0 ];
1886$p.append( jQuery.hasData( p ) + " " ); // false
1887
1888$.data( p, "testing", 123 );
1889$p.append( jQuery.hasData( p ) + " " ); // true
1890
1891$.removeData( p, "testing" );
1892$p.append( jQuery.hasData( p ) + " " ); // false
1893
1894$p.on( "click", function() {} );
1895$p.append( jQuery.hasData( p ) + " " ); // true
1896
1897$p.off( "click" );
1898$p.append( jQuery.hasData( p ) + " " ); // false
1899</script>
1900
1901</body>
1902</html>
1903```
1904 */
1905 hasData(element: Element | Document | Window | JQuery.PlainObject): boolean;
1906 /**
1907 * Holds or releases the execution of jQuery's ready event.
1908 * @param hold Indicates whether the ready hold is being requested or released
1909 * @see \`{@link https://api.jquery.com/jQuery.holdReady/ }\`
1910 * @since 1.6
1911 * @deprecatedDeprecated since 3.2. See \`{@link https://github.com/jquery/jquery/issues/3288 }\`.
1912 *
1913 * **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.
1914 *
1915 * **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.
1916 * @example ​ ````Delay the ready event until a custom plugin has loaded.
1917```javascript
1918$.holdReady( true );
1919$.getScript( "myplugin.js", function() {
1920 $.holdReady( false );
1921});
1922```
1923 */
1924 holdReady(hold: boolean): void;
1925 /**
1926 * Modify and filter HTML strings passed through jQuery manipulation methods.
1927 * @param html The HTML string on which to operate.
1928 * @see \`{@link https://api.jquery.com/jQuery.htmlPrefilter/ }\`
1929 * @since 1.12
1930 * @since 2.2
1931 */
1932 htmlPrefilter(html: JQuery.htmlString): JQuery.htmlString;
1933 /**
1934 * Search for a specified value within an array and return its index (or -1 if not found).
1935 * @param value The value to search for.
1936 * @param array An array through which to search.
1937 * @param fromIndex The index of the array at which to begin the search. The default is 0, which will search the whole array.
1938 * @see \`{@link https://api.jquery.com/jQuery.inArray/ }\`
1939 * @since 1.2
1940 * @example ​ ````Report the index of some elements in the array.
1941```html
1942<!doctype html>
1943<html lang="en">
1944<head>
1945 <meta charset="utf-8">
1946 <title>jQuery.inArray demo</title>
1947 <style>
1948 div {
1949 color: blue;
1950 }
1951 span {
1952 color: red;
1953 }
1954 </style>
1955 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1956</head>
1957<body>
1958
1959<div>"John" found at <span></span></div>
1960<div>4 found at <span></span></div>
1961<div>"Karl" not found, so <span></span></div>
1962<div>"Pete" is in the array, but not at or after index 2, so <span></span></div>
1963
1964<script>
1965var arr = [ 4, "Pete", 8, "John" ];
1966var $spans = $( "span" );
1967$spans.eq( 0 ).text( jQuery.inArray( "John", arr ) );
1968$spans.eq( 1 ).text( jQuery.inArray( 4, arr ) );
1969$spans.eq( 2 ).text( jQuery.inArray( "Karl", arr ) );
1970$spans.eq( 3 ).text( jQuery.inArray( "Pete", arr, 2 ) );
1971</script>
1972
1973</body>
1974</html>
1975```
1976 */
1977 inArray<T>(value: T, array: T[], fromIndex?: number): number;
1978 /**
1979 * Determine whether the argument is an array.
1980 * @param obj Object to test whether or not it is an array.
1981 * @see \`{@link https://api.jquery.com/jQuery.isArray/ }\`
1982 * @since 1.3
1983 * @deprecatedDeprecated since 3.2. Use \`{@link ArrayConstructor.isArray Array.isArray}\`.
1984 * @example ​ ````Finds out if the parameter is an array.
1985```html
1986<!doctype html>
1987<html lang="en">
1988<head>
1989 <meta charset="utf-8">
1990 <title>jQuery.isArray demo</title>
1991 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1992</head>
1993<body>
1994
1995Is [] an Array? <b></b>
1996
1997<script>
1998$( "b" ).append( "" + $.isArray([]) );
1999</script>
2000
2001</body>
2002</html>
2003```
2004 */
2005 isArray(obj: any): obj is any[];
2006 /**
2007 * Check to see if an object is empty (contains no enumerable properties).
2008 * @param obj The object that will be checked to see if it's empty.
2009 * @see \`{@link https://api.jquery.com/jQuery.isEmptyObject/ }\`
2010 * @since 1.4
2011 * @example ​ ````Check an object to see if it&#39;s empty.
2012```javascript
2013jQuery.isEmptyObject({}); // true
2014jQuery.isEmptyObject({ foo: "bar" }); // false
2015```
2016 */
2017 isEmptyObject(obj: any): boolean;
2018 /**
2019 * Determine if the argument passed is a JavaScript function object.
2020 * @param obj Object to test whether or not it is a function.
2021 * @see \`{@link https://api.jquery.com/jQuery.isFunction/ }\`
2022 * @since 1.2
2023 * @deprecatedDeprecated since 3.3. Use `typeof x === "function"`.
2024 * @example ​ ````Test a few parameter examples.
2025```html
2026<!doctype html>
2027<html lang="en">
2028<head>
2029 <meta charset="utf-8">
2030 <title>jQuery.isFunction demo</title>
2031 <style>
2032 div {
2033 color: blue;
2034 margin: 2px;
2035 font-size: 14px;
2036 }
2037 span {
2038 color: red;
2039 }
2040 </style>
2041 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2042</head>
2043<body>
2044
2045<div>jQuery.isFunction( objs[ 0 ] ) = <span></span></div>
2046<div>jQuery.isFunction( objs[ 1 ] ) = <span></span></div>
2047<div>jQuery.isFunction( objs[ 2 ] ) = <span></span></div>
2048<div>jQuery.isFunction( objs[ 3 ] ) = <span></span></div>
2049<div>jQuery.isFunction( objs[ 4 ] ) = <span></span></div>
2050
2051<script>
2052function stub() {}
2053var objs = [
2054 function() {},
2055 { x:15, y:20 },
2056 null,
2057 stub,
2058 "function"
2059];
2060
2061jQuery.each( objs, function( i ) {
2062 var isFunc = jQuery.isFunction( objs[ i ]);
2063 $( "span" ).eq( i ).text( isFunc );
2064});
2065</script>
2066
2067</body>
2068</html>
2069```
2070 * @example ​ ````Finds out if the parameter is a function.
2071```javascript
2072$.isFunction(function() {});
2073```
2074 */
2075 // tslint:disable-next-line:ban-types
2076 isFunction(obj: any): obj is Function;
2077 /**
2078 * Determines whether its argument represents a JavaScript number.
2079 * @param value The value to be tested.
2080 * @see \`{@link https://api.jquery.com/jQuery.isNumeric/ }\`
2081 * @since 1.7
2082 * @deprecatedDeprecated since 3.3. Internal. See \`{@link https://github.com/jquery/jquery/issues/2960 }\`.
2083 * @example ​ ````Sample return values of $.isNumeric with various inputs.
2084```javascript
2085// true (numeric)
2086$.isNumeric( "-10" )
2087$.isNumeric( "0" )
2088$.isNumeric( 0xFF )
2089$.isNumeric( "0xFF" )
2090$.isNumeric( "8e5" )
2091$.isNumeric( "3.1415" )
2092$.isNumeric( +10 )
2093$.isNumeric( 0144 )
2094
2095// false (non-numeric)
2096$.isNumeric( "-0x42" )
2097$.isNumeric( "7.2acdgs" )
2098$.isNumeric( "" )
2099$.isNumeric( {} )
2100$.isNumeric( NaN )
2101$.isNumeric( null )
2102$.isNumeric( true )
2103$.isNumeric( Infinity )
2104$.isNumeric( undefined )
2105```
2106 */
2107 isNumeric(value: any): boolean;
2108 /**
2109 * Check to see if an object is a plain object (created using "{}" or "new Object").
2110 * @param obj The object that will be checked to see if it's a plain object.
2111 * @see \`{@link https://api.jquery.com/jQuery.isPlainObject/ }\`
2112 * @since 1.4
2113 * @example ​ ````Check an object to see if it&#39;s a plain object.
2114```javascript
2115jQuery.isPlainObject({}) // true
2116jQuery.isPlainObject( "test" ) // false
2117```
2118 */
2119 isPlainObject(obj: any): boolean;
2120 /**
2121 * Determine whether the argument is a window.
2122 * @param obj Object to test whether or not it is a window.
2123 * @see \`{@link https://api.jquery.com/jQuery.isWindow/ }\`
2124 * @since 1.4.3
2125 * @deprecatedDeprecated since 3.3. Internal. See \`{@link https://github.com/jquery/jquery/issues/3629 }\`.
2126 *
2127 * **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.
2128 *
2129 * **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.
2130 * @example ​ ````Finds out if the parameter is a window.
2131```html
2132<!doctype html>
2133<html lang="en">
2134<head>
2135 <meta charset="utf-8">
2136 <title>jQuery.isWindow demo</title>
2137 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2138</head>
2139<body>
2140
2141Is 'window' a window? <b></b>
2142
2143<script>
2144$( "b" ).append( "" + $.isWindow( window ) );
2145</script>
2146
2147</body>
2148</html>
2149```
2150 */
2151 isWindow(obj: any): obj is Window;
2152 /**
2153 * Check to see if a DOM node is within an XML document (or is an XML document).
2154 * @param node The DOM node that will be checked to see if it's in an XML document.
2155 * @see \`{@link https://api.jquery.com/jQuery.isXMLDoc/ }\`
2156 * @since 1.1.4
2157 * @example ​ ````Check an object to see if it&#39;s in an XML document.
2158```javascript
2159jQuery.isXMLDoc( document ) // false
2160jQuery.isXMLDoc( document.body ) // false
2161```
2162 */
2163 isXMLDoc(node: Node): boolean;
2164 /**
2165 * Convert an array-like object into a true JavaScript array.
2166 * @param obj Any object to turn into a native Array.
2167 * @see \`{@link https://api.jquery.com/jQuery.makeArray/ }\`
2168 * @since 1.2
2169 * @example ​ ````Turn a collection of HTMLElements into an Array of them.
2170```html
2171<!doctype html>
2172<html lang="en">
2173<head>
2174 <meta charset="utf-8">
2175 <title>jQuery.makeArray demo</title>
2176 <style>
2177 div {
2178 color: red;
2179 }
2180 </style>
2181 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2182</head>
2183<body>
2184
2185<div>First</div>
2186<div>Second</div>
2187<div>Third</div>
2188<div>Fourth</div>
2189
2190<script>
2191// Returns a NodeList
2192var elems = document.getElementsByTagName( "div" );
2193// Convert the NodeList to an Array
2194var arr = jQuery.makeArray( elems );
2195// Use an Array method on list of dom elements
2196arr.reverse();
2197$( arr ).appendTo( document.body );
2198</script>
2199
2200</body>
2201</html>
2202```
2203 * @example ​ ````Turn a jQuery object into an array
2204```javascript
2205var obj = $( "li" );
2206var arr = $.makeArray( obj );
2207```
2208 */
2209 makeArray<T>(obj: ArrayLike<T>): T[];
2210 /**
2211 * Translate all items in an array or object to new array of items.
2212 * @param array The Array to translate.
2213 * @param callback The function to process each item against. The first argument to the function is the array item, the
2214 * second argument is the index in array The function can return any value. A returned array will be
2215 * flattened into the resulting array. Within the function, this refers to the global (window) object.
2216 * @see \`{@link https://api.jquery.com/jQuery.map/ }\`
2217 * @since 1.0
2218 * @example ​ ````Use $.map() to change the values of an array.
2219```html
2220<!doctype html>
2221<html lang="en">
2222<head>
2223 <meta charset="utf-8">
2224 <title>jQuery.map demo</title>
2225 <style>
2226 div {
2227 color: blue;
2228 }
2229 p {
2230 color: green;
2231 margin: 0;
2232 }
2233 span {
2234 color: red;
2235 }
2236 </style>
2237 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2238</head>
2239<body>
2240
2241<div></div>
2242<p></p>
2243<span></span>
2244
2245<script>
2246var arr = [ "a", "b", "c", "d", "e" ];
2247$( "div" ).text( arr.join( ", " ) );
2248
2249arr = jQuery.map( arr, function( n, i ) {
2250 return ( n.toUpperCase() + i );
2251});
2252$( "p" ).text( arr.join( ", " ) );
2253
2254arr = jQuery.map( arr, function( a ) {
2255 return a + a;
2256});
2257$( "span" ).text( arr.join( ", " ) );
2258</script>
2259
2260</body>
2261</html>
2262```
2263 * @example ​ ````Map the original array to a new one and add 4 to each value.
2264```javascript
2265$.map( [ 0, 1, 2 ], function( n ) {
2266 return n + 4;
2267});
2268```
2269 * @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.
2270```javascript
2271$.map( [ 0, 1, 2 ], function( n ) {
2272 return n > 0 ? n + 1 : null;
2273});
2274```
2275 * @example ​ ````Map the original array to a new one; each element is added with its original value and the value plus one.
2276```javascript
2277$.map( [ 0, 1, 2 ], function( n ) {
2278 return [ n, n + 1 ];
2279});
2280```
2281 * @example ​ ````Map the original array to a new one; each element is squared.
2282```javascript
2283$.map( [ 0, 1, 2, 3 ], function( a ) {
2284 return a * a;
2285});
2286```
2287 * @example ​ ````Map the original array to a new one, removing numbers less than 50 by returning null and subtracting 45 from the rest.
2288```javascript
2289$.map( [ 0, 1, 52, 97 ], function( a ) {
2290 return (a > 50 ? a - 45 : null);
2291});
2292```
2293 * @example ​ ````Augment the resulting array by returning an array inside the function.
2294```javascript
2295var array = [ 0, 1, 52, 97 ];
2296array = $.map( array, function( a, index ) {
2297 return [ a - 45, index ];
2298});
2299```
2300 */
2301 map<T, TReturn>(array: T[], callback: (this: Window, elementOfArray: T, indexInArray: number) => JQuery.TypeOrArray<TReturn> | null | undefined): TReturn[];
2302 /**
2303 * Translate all items in an array or object to new array of items.
2304 * @param obj The Object to translate.
2305 * @param callback The function to process each item against. The first argument to the function is the value; the
2306 * second argument is the key of the object property. The function can return any value to add to the
2307 * array. A returned array will be flattened into the resulting array. Within the function, this refers
2308 * to the global (window) object.
2309 * @see \`{@link https://api.jquery.com/jQuery.map/ }\`
2310 * @since 1.6
2311 * @example ​ ````Map the original object to a new array and double each value.
2312```javascript
2313var dimensions = { width: 10, height: 15, length: 20 };
2314dimensions = $.map( dimensions, function( value, index ) {
2315 return value * 2;
2316});
2317```
2318 * @example ​ ````Map an object&#39;s keys to an array.
2319```javascript
2320var dimensions = { width: 10, height: 15, length: 20 };
2321var keys = $.map( dimensions, function( value, key ) {
2322 return key;
2323});
2324```
2325 */
2326 map<T, K extends keyof T, TReturn>(obj: T, callback: (this: Window, propertyOfObject: T[K], key: K) => JQuery.TypeOrArray<TReturn> | null | undefined): TReturn[];
2327 /**
2328 * Merge the contents of two arrays together into the first array.
2329 * @param first The first array-like object to merge, the elements of second added.
2330 * @param second The second array-like object to merge into the first, unaltered.
2331 * @see \`{@link https://api.jquery.com/jQuery.merge/ }\`
2332 * @since 1.0
2333 * @example ​ ````Merges two arrays, altering the first argument.
2334```javascript
2335$.merge( [ 0, 1, 2 ], [ 2, 3, 4 ] )
2336```
2337 * @example ​ ````Merges two arrays, altering the first argument.
2338```javascript
2339$.merge( [ 3, 2, 1 ], [ 4, 3, 2 ] )
2340```
2341 * @example ​ ````Merges two arrays, but uses a copy, so the original isn&#39;t altered.
2342```javascript
2343var first = [ "a", "b", "c" ];
2344var second = [ "d", "e", "f" ];
2345$.merge( $.merge( [], first ), second );
2346```
2347 */
2348 merge<T, U>(first: ArrayLike<T>, second: ArrayLike<U>): Array<T | U>;
2349 /**
2350 * Relinquish jQuery's control of the $ variable.
2351 * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).
2352 * @see \`{@link https://api.jquery.com/jQuery.noConflict/ }\`
2353 * @since 1.0
2354 * @example ​ ````Map the original object that was referenced by $ back to $.
2355```javascript
2356jQuery.noConflict();
2357// Do something with jQuery
2358jQuery( "div p" ).hide();
2359// Do something with another library's $()
2360$( "content" ).style.display = "none";
2361```
2362 * @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.
2363```javascript
2364jQuery.noConflict();
2365(function( $ ) {
2366 $(function() {
2367 // More code using $ as alias to jQuery
2368 });
2369})(jQuery);
2370
2371// Other code using $ as an alias to the other library
2372```
2373 * @example ​ ````Create a different alias instead of jQuery to use in the rest of the script.
2374```javascript
2375var j = jQuery.noConflict();
2376
2377// Do something with jQuery
2378j( "div p" ).hide();
2379
2380// Do something with another library's $()
2381$( "content" ).style.display = "none";
2382```
2383 * @example ​ ````Completely move jQuery to a new namespace in another object.
2384```javascript
2385var dom = {};
2386dom.query = jQuery.noConflict( true );
2387```
2388 * @example ​ ````Load two versions of jQuery (not recommended). Then, restore jQuery&#39;s globally scoped variables to the first loaded jQuery.
2389```html
2390<!doctype html>
2391<html lang="en">
2392<head>
2393 <meta charset="utf-8">
2394 <title>jQuery.noConflict demo</title>
2395 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2396</head>
2397<body>
2398
2399<div id="log">
2400 <h3>Before $.noConflict(true)</h3>
2401</div>
2402<script src="https://code.jquery.com/jquery-1.6.2.js"></script>
2403
2404<script>
2405var $log = $( "#log" );
2406
2407$log.append( "2nd loaded jQuery version ($): " + $.fn.jquery + "<br>" );
2408
2409// Restore globally scoped jQuery variables to the first version loaded
2410// (the newer version)
2411
2412jq162 = jQuery.noConflict( true );
2413
2414$log.append( "<h3>After $.noConflict(true)</h3>" );
2415$log.append( "1st loaded jQuery version ($): " + $.fn.jquery + "<br>" );
2416$log.append( "2nd loaded jQuery version (jq162): " + jq162.fn.jquery + "<br>" );
2417</script>
2418
2419</body>
2420</html>
2421```
2422 */
2423 noConflict(removeAll?: boolean): this;
2424 /**
2425 * @deprecatedDeprecated since 3.2.
2426 *
2427 * **Cause**: This public but never-documented method has been deprecated as of jQuery 3.2.0.
2428 *
2429 * **Solution**: Replace calls such as `jQuery.nodeName( elem, "div" )` with a test such as `elem.nodeName.toLowerCase() === "div"`.
2430 */
2431 nodeName(elem: Node, name: string): boolean;
2432 /**
2433 * An empty function.
2434 * @see \`{@link https://api.jquery.com/jQuery.noop/ }\`
2435 * @since 1.4
2436 */
2437 noop(): undefined;
2438 /**
2439 * Return a number representing the current time.
2440 * @see \`{@link https://api.jquery.com/jQuery.now/ }\`
2441 * @since 1.4.3
2442 * @deprecatedDeprecated since 3.3. Use \`{@link DateConstructor.now Date.now}\`.
2443 */
2444 now(): number;
2445 /**
2446 * 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.
2447 * @param obj An array, a plain object, or a jQuery object to serialize.
2448 * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization.
2449 * @see \`{@link https://api.jquery.com/jQuery.param/ }\`
2450 * @since 1.2
2451 * @since 1.4
2452 * @example ​ ````Serialize a key/value object.
2453```html
2454<!doctype html>
2455<html lang="en">
2456<head>
2457 <meta charset="utf-8">
2458 <title>jQuery.param demo</title>
2459 <style>
2460 div {
2461 color: red;
2462 }
2463 </style>
2464 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2465</head>
2466<body>
2467
2468<div id="results"></div>
2469
2470<script>
2471var params = { width:1680, height:1050 };
2472var str = jQuery.param( params );
2473$( "#results" ).text( str );
2474</script>
2475
2476</body>
2477</html>
2478```
2479 * @example ​ ````Serialize a few complex objects
2480```html
2481<!doctype html>
2482<html lang="en">
2483<head>
2484 <meta charset="utf-8">
2485 <title>jQuery.param demo</title>
2486 <style>
2487 div {
2488 color: red;
2489 }
2490 </style>
2491 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2492</head>
2493<body>
2494​​
2495<script>
2496// <=1.3.2:
2497$.param({ a: [ 2, 3, 4 ] }); // "a=2&a=3&a=4"
2498// >=1.4:
2499$.param({ a: [ 2, 3, 4 ] }); // "a[]=2&a[]=3&a[]=4"
2500
2501// <=1.3.2:
2502$.param({ a: { b: 1, c: 2 }, d: [ 3, 4, { e: 5 } ] });
2503// "a=[object+Object]&d=3&d=4&d=[object+Object]"
2504
2505// >=1.4:
2506$.param({ a: { b: 1, c: 2 }, d: [ 3, 4, { e: 5 } ] });
2507// "a[b]=1&a[c]=2&d[]=3&d[]=4&d[2][e]=5"
2508</script>
2509
2510</body>
2511</html>
2512```
2513 */
2514 param(obj: any[] | JQuery.PlainObject | JQuery, traditional?: boolean): string;
2515 /**
2516 * Parses a string into an array of DOM nodes.
2517 * @param data HTML string to be parsed
2518 * @param context Document element to serve as the context in which the HTML fragment will be created
2519 * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
2520 * @see \`{@link https://api.jquery.com/jQuery.parseHTML/ }\`
2521 * @since 1.8
2522 */
2523 parseHTML(data: string, context: Document | null | undefined, keepScripts: boolean): JQuery.Node[];
2524 /**
2525 * Parses a string into an array of DOM nodes.
2526 * @param data HTML string to be parsed
2527 * @param context_keepScripts _&#x40;param_ `context_keepScripts`
2528 * <br>
2529 * * `context` — Document element to serve as the context in which the HTML fragment will be created <br>
2530 * * `keepScripts` — A Boolean indicating whether to include scripts passed in the HTML string
2531 * @see \`{@link https://api.jquery.com/jQuery.parseHTML/ }\`
2532 * @since 1.8
2533 * @example ​ ````Create an array of DOM nodes using an HTML string and insert it into a div.
2534```html
2535<!doctype html>
2536<html lang="en">
2537<head>
2538 <meta charset="utf-8">
2539 <title>jQuery.parseHTML demo</title>
2540 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2541</head>
2542<body>
2543
2544<div id="log">
2545 <h3>Content:</h3>
2546</div>
2547
2548<script>
2549var $log = $( "#log" ),
2550 str = "hello, <b>my name is</b> jQuery.",
2551 html = $.parseHTML( str ),
2552 nodeNames = [];
2553
2554// Append the parsed HTML
2555$log.append( html );
2556
2557// Gather the parsed HTML's node names
2558$.each( html, function( i, el ) {
2559 nodeNames[ i ] = "<li>" + el.nodeName + "</li>";
2560});
2561
2562// Insert the node names
2563$log.append( "<h3>Node Names:</h3>" );
2564$( "<ol></ol>" )
2565 .append( nodeNames.join( "" ) )
2566 .appendTo( $log );
2567</script>
2568
2569</body>
2570</html>
2571```
2572 */
2573 parseHTML(data: string, context_keepScripts?: Document | null | boolean): JQuery.Node[];
2574 /**
2575 * Takes a well-formed JSON string and returns the resulting JavaScript value.
2576 * @param json The JSON string to parse.
2577 * @see \`{@link https://api.jquery.com/jQuery.parseJSON/ }\`
2578 * @since 1.4.1
2579 * @deprecatedDeprecated since 3.0. Use \`{@link JSON.parse }\`.
2580 *
2581 * **Cause**: The `jQuery.parseJSON` method in recent jQuery is identical to the native `JSON.parse`. As of jQuery 3.0 `jQuery.parseJSON` is deprecated.
2582 *
2583 * **Solution**: Replace any use of `jQuery.parseJSON` with `JSON.parse`.
2584 * @example ​ ````Parse a JSON string.
2585```javascript
2586var obj = jQuery.parseJSON( '{ "name": "John" }' );
2587alert( obj.name === "John" );
2588```
2589 */
2590 parseJSON(json: string): any;
2591 /**
2592 * Parses a string into an XML document.
2593 * @param data a well-formed XML string to be parsed
2594 * @see \`{@link https://api.jquery.com/jQuery.parseXML/ }\`
2595 * @since 1.5
2596 * @example ​ ````Create a jQuery object using an XML string and obtain the value of the title node.
2597```html
2598<!doctype html>
2599<html lang="en">
2600<head>
2601 <meta charset="utf-8">
2602 <title>jQuery.parseXML demo</title>
2603 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2604</head>
2605<body>
2606
2607<p id="someElement"></p>
2608<p id="anotherElement"></p>
2609
2610<script>
2611var xml = "<rss version='2.0'><channel><title>RSS Title</title></channel></rss>",
2612 xmlDoc = $.parseXML( xml ),
2613 $xml = $( xmlDoc ),
2614 $title = $xml.find( "title" );
2615
2616// Append "RSS Title" to #someElement
2617$( "#someElement" ).append( $title.text() );
2618
2619// Change the title to "XML Title"
2620$title.text( "XML Title" );
2621
2622// Append "XML Title" to #anotherElement
2623$( "#anotherElement" ).append( $title.text() );
2624</script>
2625
2626</body>
2627</html>
2628```
2629 */
2630 parseXML(data: string): XMLDocument;
2631 /**
2632 * Load data from the server using a HTTP POST request.
2633 * @param url A string containing the URL to which the request is sent.
2634 * @param data A plain object or string that is sent to the server with the request.
2635 * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but
2636 * can be null in that case.
2637 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
2638 * @see \`{@link https://api.jquery.com/jQuery.post/ }\`
2639 * @since 1.0
2640 * @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;).
2641```javascript
2642$.post( "test.php", { func: "getNameAndTime" }, function( data ) {
2643 console.log( data.name ); // John
2644 console.log( data.time ); // 2pm
2645}, "json");
2646```
2647 */
2648 post(url: string,
2649 data: JQuery.PlainObject | string,
2650 success: JQuery.jqXHR.DoneCallback | null,
2651 dataType?: string): JQuery.jqXHR;
2652 /**
2653 * Load data from the server using a HTTP POST request.
2654 * @param url A string containing the URL to which the request is sent.
2655 * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but
2656 * can be null in that case.
2657 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
2658 * @see \`{@link https://api.jquery.com/jQuery.post/ }\`
2659 * @since 1.0
2660 */
2661 post(url: string,
2662 success: JQuery.jqXHR.DoneCallback | null,
2663 dataType: string): JQuery.jqXHR;
2664 /**
2665 * Load data from the server using a HTTP POST request.
2666 * @param url A string containing the URL to which the request is sent.
2667 * @param success_data _&#x40;param_ `success_data`
2668 * <br>
2669 * * `success` — A callback function that is executed if the request succeeds. Required if `dataType` is provided,
2670 * but can be `null` in that case. <br>
2671 * * `data` — A plain object or string that is sent to the server with the request.
2672 * @see \`{@link https://api.jquery.com/jQuery.post/ }\`
2673 * @since 1.0
2674 * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results).
2675```javascript
2676$.post( "test.php", { name: "John", time: "2pm" } );
2677```
2678 * @example ​ ````Pass arrays of data to the server (while still ignoring the return results).
2679```javascript
2680$.post( "test.php", { 'choices[]': [ "Jon", "Susan" ] } );
2681```
2682 * @example ​ ````Send form data using Ajax requests
2683```javascript
2684$.post( "test.php", $( "#testform" ).serialize() );
2685```
2686 * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned).
2687```javascript
2688$.post( "test.php", function( data ) {
2689 alert( "Data Loaded: " + data );
2690});
2691```
2692 * @example ​ ````Alert the results from requesting test.php with an additional payload of data (HTML or XML, depending on what was returned).
2693```javascript
2694$.post( "test.php", { name: "John", time: "2pm" })
2695 .done(function( data ) {
2696 alert( "Data Loaded: " + data );
2697 });
2698```
2699 * @example ​ ````Post a form using Ajax and put results in a div
2700```html
2701<!doctype html>
2702<html lang="en">
2703<head>
2704 <meta charset="utf-8">
2705 <title>jQuery.post demo</title>
2706 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2707</head>
2708<body>
2709
2710<form action="/" id="searchForm">
2711 <input type="text" name="s" placeholder="Search...">
2712 <input type="submit" value="Search">
2713</form>
2714<!-- the result of the search will be rendered inside this div -->
2715<div id="result"></div>
2716
2717<script>
2718// Attach a submit handler to the form
2719$( "#searchForm" ).submit(function( event ) {
2720
2721 // Stop form from submitting normally
2722 event.preventDefault();
2723
2724 // Get some values from elements on the page:
2725 var $form = $( this ),
2726 term = $form.find( "input[name='s']" ).val(),
2727 url = $form.attr( "action" );
2728
2729 // Send the data using post
2730 var posting = $.post( url, { s: term } );
2731
2732 // Put the results in a div
2733 posting.done(function( data ) {
2734 var content = $( data ).find( "#content" );
2735 $( "#result" ).empty().append( content );
2736 });
2737});
2738</script>
2739
2740</body>
2741</html>
2742```
2743 */
2744 post(url: string,
2745 success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR;
2746 /**
2747 * Load data from the server using a HTTP POST request.
2748 * @param url_settings _&#x40;param_ `url_settings`
2749 * <br>
2750 * * `url` — A string containing the URL to which the request is sent. <br>
2751 * * `settings` — A set of key/value pairs that configure the Ajax request. All properties except for `url` are optional.
2752 * 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 )}\`
2753 * for a complete list of all settings. Type will automatically be set to `POST`.
2754 * @see \`{@link https://api.jquery.com/jQuery.post/ }\`
2755 * @since 1.0
2756 * @since 1.12
2757 * @since 2.2
2758 * @example ​ ````Request the test.php page, but ignore the return results.
2759```javascript
2760$.post( "test.php" );
2761```
2762 */
2763 post(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR;
2764
2765 // region proxy
2766 // #region proxy
2767
2768 // region (funсtion, null | undefined)
2769 // #region (funсtion, null | undefined)
2770
2771 // region 0 to 7 additional arguments
2772 // #region 0 to 7 additional arguments
2773
2774 // region 0 parameters
2775 // #region 0 parameters
2776
2777 /**
2778 * Takes a function and returns a new one that will always have a particular context.
2779 * @param funсtion The function whose context will be changed.
2780 * @param context The object to which the context (`this`) of the function should be set.
2781 * @param a An argument to be passed to the function referenced in the `function` argument.
2782 * @param b An argument to be passed to the function referenced in the `function` argument.
2783 * @param c An argument to be passed to the function referenced in the `function` argument.
2784 * @param d An argument to be passed to the function referenced in the `function` argument.
2785 * @param e An argument to be passed to the function referenced in the `function` argument.
2786 * @param f An argument to be passed to the function referenced in the `function` argument.
2787 * @param g An argument to be passed to the function referenced in the `function` argument.
2788 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2789 * @since 1.9
2790 * @deprecatedDeprecated since 3.3. Use \`{@link Function#bind }\`.
2791 */
2792 proxy<TReturn,
2793 A, B, C, D, E, F, G>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => TReturn,
2794 context: null | undefined,
2795 a: A, b: B, c: C, d: D, e: E, f: F, g: G): () => TReturn;
2796 /**
2797 * Takes a function and returns a new one that will always have a particular context.
2798 * @param funсtion The function whose context will be changed.
2799 * @param context The object to which the context (`this`) of the function should be set.
2800 * @param a An argument to be passed to the function referenced in the `function` argument.
2801 * @param b An argument to be passed to the function referenced in the `function` argument.
2802 * @param c An argument to be passed to the function referenced in the `function` argument.
2803 * @param d An argument to be passed to the function referenced in the `function` argument.
2804 * @param e An argument to be passed to the function referenced in the `function` argument.
2805 * @param f An argument to be passed to the function referenced in the `function` argument.
2806 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2807 * @since 1.9
2808 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2809 */
2810 proxy<TReturn,
2811 A, B, C, D, E, F>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F) => TReturn,
2812 context: null | undefined,
2813 a: A, b: B, c: C, d: D, e: E, f: F): () => TReturn;
2814 /**
2815 * Takes a function and returns a new one that will always have a particular context.
2816 * @param funсtion The function whose context will be changed.
2817 * @param context The object to which the context (`this`) of the function should be set.
2818 * @param a An argument to be passed to the function referenced in the `function` argument.
2819 * @param b An argument to be passed to the function referenced in the `function` argument.
2820 * @param c An argument to be passed to the function referenced in the `function` argument.
2821 * @param d An argument to be passed to the function referenced in the `function` argument.
2822 * @param e An argument to be passed to the function referenced in the `function` argument.
2823 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2824 * @since 1.9
2825 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2826 */
2827 proxy<TReturn,
2828 A, B, C, D, E>(funсtion: (a: A, b: B, c: C, d: D, e: E) => TReturn,
2829 context: null | undefined,
2830 a: A, b: B, c: C, d: D, e: E): () => TReturn;
2831 /**
2832 * Takes a function and returns a new one that will always have a particular context.
2833 * @param funсtion The function whose context will be changed.
2834 * @param context The object to which the context (`this`) of the function should be set.
2835 * @param a An argument to be passed to the function referenced in the `function` argument.
2836 * @param b An argument to be passed to the function referenced in the `function` argument.
2837 * @param c An argument to be passed to the function referenced in the `function` argument.
2838 * @param d An argument to be passed to the function referenced in the `function` argument.
2839 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2840 * @since 1.9
2841 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2842 */
2843 proxy<TReturn,
2844 A, B, C, D>(funсtion: (a: A, b: B, c: C, d: D) => TReturn,
2845 context: null | undefined,
2846 a: A, b: B, c: C, d: D): () => TReturn;
2847 /**
2848 * Takes a function and returns a new one that will always have a particular context.
2849 * @param funсtion The function whose context will be changed.
2850 * @param context The object to which the context (`this`) of the function should be set.
2851 * @param a An argument to be passed to the function referenced in the `function` argument.
2852 * @param b An argument to be passed to the function referenced in the `function` argument.
2853 * @param c An argument to be passed to the function referenced in the `function` argument.
2854 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2855 * @since 1.9
2856 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2857 */
2858 proxy<TReturn,
2859 A, B, C>(funсtion: (a: A, b: B, c: C) => TReturn,
2860 context: null | undefined,
2861 a: A, b: B, c: C): () => TReturn;
2862 /**
2863 * Takes a function and returns a new one that will always have a particular context.
2864 * @param funсtion The function whose context will be changed.
2865 * @param context The object to which the context (`this`) of the function should be set.
2866 * @param a An argument to be passed to the function referenced in the `function` argument.
2867 * @param b An argument to be passed to the function referenced in the `function` argument.
2868 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2869 * @since 1.9
2870 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2871 */
2872 proxy<TReturn,
2873 A, B>(funсtion: (a: A, b: B) => TReturn,
2874 context: null | undefined,
2875 a: A, b: B): () => TReturn;
2876 /**
2877 * Takes a function and returns a new one that will always have a particular context.
2878 * @param funсtion The function whose context will be changed.
2879 * @param context The object to which the context (`this`) of the function should be set.
2880 * @param a An argument to be passed to the function referenced in the `function` argument.
2881 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2882 * @since 1.9
2883 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2884 */
2885 proxy<TReturn,
2886 A>(funсtion: (a: A) => TReturn,
2887 context: null | undefined,
2888 a: A): () => TReturn;
2889 /**
2890 * Takes a function and returns a new one that will always have a particular context.
2891 * @param funсtion The function whose context will be changed.
2892 * @param context The object to which the context (`this`) of the function should be set.
2893 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2894 * @since 1.9
2895 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2896 */
2897 proxy<TReturn>(funсtion: () => TReturn,
2898 context: null | undefined): () => TReturn;
2899
2900 // #endregion
2901
2902 // region 1 parameters
2903 // #region 1 parameters
2904
2905 /**
2906 * Takes a function and returns a new one that will always have a particular context.
2907 * @param funсtion The function whose context will be changed.
2908 * @param context The object to which the context (`this`) of the function should be set.
2909 * @param a An argument to be passed to the function referenced in the `function` argument.
2910 * @param b An argument to be passed to the function referenced in the `function` argument.
2911 * @param c An argument to be passed to the function referenced in the `function` argument.
2912 * @param d An argument to be passed to the function referenced in the `function` argument.
2913 * @param e An argument to be passed to the function referenced in the `function` argument.
2914 * @param f An argument to be passed to the function referenced in the `function` argument.
2915 * @param g An argument to be passed to the function referenced in the `function` argument.
2916 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2917 * @since 1.9
2918 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2919 */
2920 proxy<TReturn,
2921 A, B, C, D, E, F, G,
2922 T>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
2923 t: T) => TReturn,
2924 context: null | undefined,
2925 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T) => TReturn;
2926 /**
2927 * Takes a function and returns a new one that will always have a particular context.
2928 * @param funсtion The function whose context will be changed.
2929 * @param context The object to which the context (`this`) of the function should be set.
2930 * @param a An argument to be passed to the function referenced in the `function` argument.
2931 * @param b An argument to be passed to the function referenced in the `function` argument.
2932 * @param c An argument to be passed to the function referenced in the `function` argument.
2933 * @param d An argument to be passed to the function referenced in the `function` argument.
2934 * @param e An argument to be passed to the function referenced in the `function` argument.
2935 * @param f An argument to be passed to the function referenced in the `function` argument.
2936 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2937 * @since 1.9
2938 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2939 */
2940 proxy<TReturn,
2941 A, B, C, D, E, F,
2942 T>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
2943 t: T) => TReturn,
2944 context: null | undefined,
2945 a: A, b: B, c: C, d: D, e: E, f: F): (t: T) => TReturn;
2946 /**
2947 * Takes a function and returns a new one that will always have a particular context.
2948 * @param funсtion The function whose context will be changed.
2949 * @param context The object to which the context (`this`) of the function should be set.
2950 * @param a An argument to be passed to the function referenced in the `function` argument.
2951 * @param b An argument to be passed to the function referenced in the `function` argument.
2952 * @param c An argument to be passed to the function referenced in the `function` argument.
2953 * @param d An argument to be passed to the function referenced in the `function` argument.
2954 * @param e An argument to be passed to the function referenced in the `function` argument.
2955 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2956 * @since 1.9
2957 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2958 */
2959 proxy<TReturn,
2960 A, B, C, D, E,
2961 T>(funсtion: (a: A, b: B, c: C, d: D, e: E,
2962 t: T) => TReturn,
2963 context: null | undefined,
2964 a: A, b: B, c: C, d: D, e: E): (t: T) => TReturn;
2965 /**
2966 * Takes a function and returns a new one that will always have a particular context.
2967 * @param funсtion The function whose context will be changed.
2968 * @param context The object to which the context (`this`) of the function should be set.
2969 * @param a An argument to be passed to the function referenced in the `function` argument.
2970 * @param b An argument to be passed to the function referenced in the `function` argument.
2971 * @param c An argument to be passed to the function referenced in the `function` argument.
2972 * @param d An argument to be passed to the function referenced in the `function` argument.
2973 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2974 * @since 1.9
2975 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2976 */
2977 proxy<TReturn,
2978 A, B, C, D,
2979 T>(funсtion: (a: A, b: B, c: C, d: D,
2980 t: T) => TReturn,
2981 context: null | undefined,
2982 a: A, b: B, c: C, d: D): (t: T) => TReturn;
2983 /**
2984 * Takes a function and returns a new one that will always have a particular context.
2985 * @param funсtion The function whose context will be changed.
2986 * @param context The object to which the context (`this`) of the function should be set.
2987 * @param a An argument to be passed to the function referenced in the `function` argument.
2988 * @param b An argument to be passed to the function referenced in the `function` argument.
2989 * @param c An argument to be passed to the function referenced in the `function` argument.
2990 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2991 * @since 1.9
2992 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2993 */
2994 proxy<TReturn,
2995 A, B, C,
2996 T>(funсtion: (a: A, b: B, c: C,
2997 t: T) => TReturn,
2998 context: null | undefined,
2999 a: A, b: B, c: C): (t: T) => TReturn;
3000 /**
3001 * Takes a function and returns a new one that will always have a particular context.
3002 * @param funсtion The function whose context will be changed.
3003 * @param context The object to which the context (`this`) of the function should be set.
3004 * @param a An argument to be passed to the function referenced in the `function` argument.
3005 * @param b An argument to be passed to the function referenced in the `function` argument.
3006 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3007 * @since 1.9
3008 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3009 */
3010 proxy<TReturn,
3011 A, B,
3012 T>(funсtion: (a: A, b: B,
3013 t: T) => TReturn,
3014 context: null | undefined,
3015 a: A, b: B): (t: T) => TReturn;
3016 /**
3017 * Takes a function and returns a new one that will always have a particular context.
3018 * @param funсtion The function whose context will be changed.
3019 * @param context The object to which the context (`this`) of the function should be set.
3020 * @param a An argument to be passed to the function referenced in the `function` argument.
3021 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3022 * @since 1.9
3023 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3024 */
3025 proxy<TReturn,
3026 A,
3027 T>(funсtion: (a: A,
3028 t: T) => TReturn,
3029 context: null | undefined,
3030 a: A): (t: T) => TReturn;
3031 /**
3032 * Takes a function and returns a new one that will always have a particular context.
3033 * @param funсtion The function whose context will be changed.
3034 * @param context The object to which the context (`this`) of the function should be set.
3035 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3036 * @since 1.9
3037 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3038 */
3039 proxy<TReturn,
3040 T>(funсtion: (t: T) => TReturn,
3041 context: null | undefined): (t: T) => TReturn;
3042
3043 // #endregion
3044
3045 // region 2 parameters
3046 // #region 2 parameters
3047
3048 /**
3049 * Takes a function and returns a new one that will always have a particular context.
3050 * @param funсtion The function whose context will be changed.
3051 * @param context The object to which the context (`this`) of the function should be set.
3052 * @param a An argument to be passed to the function referenced in the `function` argument.
3053 * @param b An argument to be passed to the function referenced in the `function` argument.
3054 * @param c An argument to be passed to the function referenced in the `function` argument.
3055 * @param d An argument to be passed to the function referenced in the `function` argument.
3056 * @param e An argument to be passed to the function referenced in the `function` argument.
3057 * @param f An argument to be passed to the function referenced in the `function` argument.
3058 * @param g An argument to be passed to the function referenced in the `function` argument.
3059 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3060 * @since 1.9
3061 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3062 */
3063 proxy<TReturn,
3064 A, B, C, D, E, F, G,
3065 T, U>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3066 t: T, u: U) => TReturn,
3067 context: null | undefined,
3068 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U) => TReturn;
3069 /**
3070 * Takes a function and returns a new one that will always have a particular context.
3071 * @param funсtion The function whose context will be changed.
3072 * @param context The object to which the context (`this`) of the function should be set.
3073 * @param a An argument to be passed to the function referenced in the `function` argument.
3074 * @param b An argument to be passed to the function referenced in the `function` argument.
3075 * @param c An argument to be passed to the function referenced in the `function` argument.
3076 * @param d An argument to be passed to the function referenced in the `function` argument.
3077 * @param e An argument to be passed to the function referenced in the `function` argument.
3078 * @param f An argument to be passed to the function referenced in the `function` argument.
3079 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3080 * @since 1.9
3081 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3082 */
3083 proxy<TReturn,
3084 A, B, C, D, E, F,
3085 T, U>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3086 t: T, u: U) => TReturn,
3087 context: null | undefined,
3088 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U) => TReturn;
3089 /**
3090 * Takes a function and returns a new one that will always have a particular context.
3091 * @param funсtion The function whose context will be changed.
3092 * @param context The object to which the context (`this`) of the function should be set.
3093 * @param a An argument to be passed to the function referenced in the `function` argument.
3094 * @param b An argument to be passed to the function referenced in the `function` argument.
3095 * @param c An argument to be passed to the function referenced in the `function` argument.
3096 * @param d An argument to be passed to the function referenced in the `function` argument.
3097 * @param e An argument to be passed to the function referenced in the `function` argument.
3098 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3099 * @since 1.9
3100 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3101 */
3102 proxy<TReturn,
3103 A, B, C, D, E,
3104 T, U>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3105 t: T, u: U) => TReturn,
3106 context: null | undefined,
3107 a: A, b: B, c: C, d: D, e: E): (t: T, u: U) => TReturn;
3108 /**
3109 * Takes a function and returns a new one that will always have a particular context.
3110 * @param funсtion The function whose context will be changed.
3111 * @param context The object to which the context (`this`) of the function should be set.
3112 * @param a An argument to be passed to the function referenced in the `function` argument.
3113 * @param b An argument to be passed to the function referenced in the `function` argument.
3114 * @param c An argument to be passed to the function referenced in the `function` argument.
3115 * @param d An argument to be passed to the function referenced in the `function` argument.
3116 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3117 * @since 1.9
3118 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3119 */
3120 proxy<TReturn,
3121 A, B, C, D,
3122 T, U>(funсtion: (a: A, b: B, c: C, d: D,
3123 t: T, u: U) => TReturn,
3124 context: null | undefined,
3125 a: A, b: B, c: C, d: D): (t: T, u: U) => TReturn;
3126 /**
3127 * Takes a function and returns a new one that will always have a particular context.
3128 * @param funсtion The function whose context will be changed.
3129 * @param context The object to which the context (`this`) of the function should be set.
3130 * @param a An argument to be passed to the function referenced in the `function` argument.
3131 * @param b An argument to be passed to the function referenced in the `function` argument.
3132 * @param c An argument to be passed to the function referenced in the `function` argument.
3133 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3134 * @since 1.9
3135 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3136 */
3137 proxy<TReturn,
3138 A, B, C,
3139 T, U>(funсtion: (a: A, b: B, c: C,
3140 t: T, u: U) => TReturn,
3141 context: null | undefined,
3142 a: A, b: B, c: C): (t: T, u: U) => TReturn;
3143 /**
3144 * Takes a function and returns a new one that will always have a particular context.
3145 * @param funсtion The function whose context will be changed.
3146 * @param context The object to which the context (`this`) of the function should be set.
3147 * @param a An argument to be passed to the function referenced in the `function` argument.
3148 * @param b An argument to be passed to the function referenced in the `function` argument.
3149 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3150 * @since 1.9
3151 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3152 */
3153 proxy<TReturn,
3154 A, B,
3155 T, U>(funсtion: (a: A, b: B,
3156 t: T, u: U) => TReturn,
3157 context: null | undefined,
3158 a: A, b: B): (t: T, u: U) => TReturn;
3159 /**
3160 * Takes a function and returns a new one that will always have a particular context.
3161 * @param funсtion The function whose context will be changed.
3162 * @param context The object to which the context (`this`) of the function should be set.
3163 * @param a An argument to be passed to the function referenced in the `function` argument.
3164 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3165 * @since 1.9
3166 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3167 */
3168 proxy<TReturn,
3169 A,
3170 T, U>(funсtion: (a: A,
3171 t: T, u: U) => TReturn,
3172 context: null | undefined,
3173 a: A): (t: T, u: U) => TReturn;
3174 /**
3175 * Takes a function and returns a new one that will always have a particular context.
3176 * @param funсtion The function whose context will be changed.
3177 * @param context The object to which the context (`this`) of the function should be set.
3178 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3179 * @since 1.9
3180 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3181 */
3182 proxy<TReturn,
3183 T, U>(funсtion: (t: T, u: U) => TReturn,
3184 context: null | undefined): (t: T, u: U) => TReturn;
3185
3186 // #endregion
3187
3188 // region 3 parameters
3189 // #region 3 parameters
3190
3191 /**
3192 * Takes a function and returns a new one that will always have a particular context.
3193 * @param funсtion The function whose context will be changed.
3194 * @param context The object to which the context (`this`) of the function should be set.
3195 * @param a An argument to be passed to the function referenced in the `function` argument.
3196 * @param b An argument to be passed to the function referenced in the `function` argument.
3197 * @param c An argument to be passed to the function referenced in the `function` argument.
3198 * @param d An argument to be passed to the function referenced in the `function` argument.
3199 * @param e An argument to be passed to the function referenced in the `function` argument.
3200 * @param f An argument to be passed to the function referenced in the `function` argument.
3201 * @param g An argument to be passed to the function referenced in the `function` argument.
3202 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3203 * @since 1.9
3204 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3205 */
3206 proxy<TReturn,
3207 A, B, C, D, E, F, G,
3208 T, U, V>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3209 t: T, u: U, v: V) => TReturn,
3210 context: null | undefined,
3211 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V) => TReturn;
3212 /**
3213 * Takes a function and returns a new one that will always have a particular context.
3214 * @param funсtion The function whose context will be changed.
3215 * @param context The object to which the context (`this`) of the function should be set.
3216 * @param a An argument to be passed to the function referenced in the `function` argument.
3217 * @param b An argument to be passed to the function referenced in the `function` argument.
3218 * @param c An argument to be passed to the function referenced in the `function` argument.
3219 * @param d An argument to be passed to the function referenced in the `function` argument.
3220 * @param e An argument to be passed to the function referenced in the `function` argument.
3221 * @param f An argument to be passed to the function referenced in the `function` argument.
3222 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3223 * @since 1.9
3224 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3225 */
3226 proxy<TReturn,
3227 A, B, C, D, E, F,
3228 T, U, V>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3229 t: T, u: U, v: V) => TReturn,
3230 context: null | undefined,
3231 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V) => TReturn;
3232 /**
3233 * Takes a function and returns a new one that will always have a particular context.
3234 * @param funсtion The function whose context will be changed.
3235 * @param context The object to which the context (`this`) of the function should be set.
3236 * @param a An argument to be passed to the function referenced in the `function` argument.
3237 * @param b An argument to be passed to the function referenced in the `function` argument.
3238 * @param c An argument to be passed to the function referenced in the `function` argument.
3239 * @param d An argument to be passed to the function referenced in the `function` argument.
3240 * @param e An argument to be passed to the function referenced in the `function` argument.
3241 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3242 * @since 1.9
3243 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3244 */
3245 proxy<TReturn,
3246 A, B, C, D, E,
3247 T, U, V>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3248 t: T, u: U, v: V) => TReturn,
3249 context: null | undefined,
3250 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V) => TReturn;
3251 /**
3252 * Takes a function and returns a new one that will always have a particular context.
3253 * @param funсtion The function whose context will be changed.
3254 * @param context The object to which the context (`this`) of the function should be set.
3255 * @param a An argument to be passed to the function referenced in the `function` argument.
3256 * @param b An argument to be passed to the function referenced in the `function` argument.
3257 * @param c An argument to be passed to the function referenced in the `function` argument.
3258 * @param d An argument to be passed to the function referenced in the `function` argument.
3259 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3260 * @since 1.9
3261 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3262 */
3263 proxy<TReturn,
3264 A, B, C, D,
3265 T, U, V>(funсtion: (a: A, b: B, c: C, d: D,
3266 t: T, u: U, v: V) => TReturn,
3267 context: null | undefined,
3268 a: A, b: B, c: C, d: D): (t: T, u: U, v: V) => TReturn;
3269 /**
3270 * Takes a function and returns a new one that will always have a particular context.
3271 * @param funсtion The function whose context will be changed.
3272 * @param context The object to which the context (`this`) of the function should be set.
3273 * @param a An argument to be passed to the function referenced in the `function` argument.
3274 * @param b An argument to be passed to the function referenced in the `function` argument.
3275 * @param c An argument to be passed to the function referenced in the `function` argument.
3276 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3277 * @since 1.9
3278 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3279 */
3280 proxy<TReturn,
3281 A, B, C,
3282 T, U, V>(funсtion: (a: A, b: B, c: C,
3283 t: T, u: U, v: V) => TReturn,
3284 context: null | undefined,
3285 a: A, b: B, c: C): (t: T, u: U, v: V) => TReturn;
3286 /**
3287 * Takes a function and returns a new one that will always have a particular context.
3288 * @param funсtion The function whose context will be changed.
3289 * @param context The object to which the context (`this`) of the function should be set.
3290 * @param a An argument to be passed to the function referenced in the `function` argument.
3291 * @param b An argument to be passed to the function referenced in the `function` argument.
3292 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3293 * @since 1.9
3294 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3295 */
3296 proxy<TReturn,
3297 A, B,
3298 T, U, V>(funсtion: (a: A, b: B,
3299 t: T, u: U, v: V) => TReturn,
3300 context: null | undefined,
3301 a: A, b: B): (t: T, u: U, v: V) => TReturn;
3302 /**
3303 * Takes a function and returns a new one that will always have a particular context.
3304 * @param funсtion The function whose context will be changed.
3305 * @param context The object to which the context (`this`) of the function should be set.
3306 * @param a An argument to be passed to the function referenced in the `function` argument.
3307 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3308 * @since 1.9
3309 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3310 */
3311 proxy<TReturn,
3312 A,
3313 T, U, V>(funсtion: (a: A,
3314 t: T, u: U, v: V) => TReturn,
3315 context: null | undefined,
3316 a: A): (t: T, u: U, v: V) => TReturn;
3317 /**
3318 * Takes a function and returns a new one that will always have a particular context.
3319 * @param funсtion The function whose context will be changed.
3320 * @param context The object to which the context (`this`) of the function should be set.
3321 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3322 * @since 1.9
3323 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3324 */
3325 proxy<TReturn,
3326 T, U, V>(funсtion: (t: T, u: U, v: V) => TReturn,
3327 context: null | undefined): (t: T, u: U, v: V) => TReturn;
3328
3329 // #endregion
3330
3331 // region 4 parameters
3332 // #region 4 parameters
3333
3334 /**
3335 * Takes a function and returns a new one that will always have a particular context.
3336 * @param funсtion The function whose context will be changed.
3337 * @param context The object to which the context (`this`) of the function should be set.
3338 * @param a An argument to be passed to the function referenced in the `function` argument.
3339 * @param b An argument to be passed to the function referenced in the `function` argument.
3340 * @param c An argument to be passed to the function referenced in the `function` argument.
3341 * @param d An argument to be passed to the function referenced in the `function` argument.
3342 * @param e An argument to be passed to the function referenced in the `function` argument.
3343 * @param f An argument to be passed to the function referenced in the `function` argument.
3344 * @param g An argument to be passed to the function referenced in the `function` argument.
3345 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3346 * @since 1.9
3347 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3348 */
3349 proxy<TReturn,
3350 A, B, C, D, E, F, G,
3351 T, U, V, W>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3352 t: T, u: U, v: V, w: W) => TReturn,
3353 context: null | undefined,
3354 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W) => TReturn;
3355 /**
3356 * Takes a function and returns a new one that will always have a particular context.
3357 * @param funсtion The function whose context will be changed.
3358 * @param context The object to which the context (`this`) of the function should be set.
3359 * @param a An argument to be passed to the function referenced in the `function` argument.
3360 * @param b An argument to be passed to the function referenced in the `function` argument.
3361 * @param c An argument to be passed to the function referenced in the `function` argument.
3362 * @param d An argument to be passed to the function referenced in the `function` argument.
3363 * @param e An argument to be passed to the function referenced in the `function` argument.
3364 * @param f An argument to be passed to the function referenced in the `function` argument.
3365 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3366 * @since 1.9
3367 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3368 */
3369 proxy<TReturn,
3370 A, B, C, D, E, F,
3371 T, U, V, W>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3372 t: T, u: U, v: V, w: W) => TReturn,
3373 context: null | undefined,
3374 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W) => TReturn;
3375 /**
3376 * Takes a function and returns a new one that will always have a particular context.
3377 * @param funсtion The function whose context will be changed.
3378 * @param context The object to which the context (`this`) of the function should be set.
3379 * @param a An argument to be passed to the function referenced in the `function` argument.
3380 * @param b An argument to be passed to the function referenced in the `function` argument.
3381 * @param c An argument to be passed to the function referenced in the `function` argument.
3382 * @param d An argument to be passed to the function referenced in the `function` argument.
3383 * @param e An argument to be passed to the function referenced in the `function` argument.
3384 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3385 * @since 1.9
3386 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3387 */
3388 proxy<TReturn,
3389 A, B, C, D, E,
3390 T, U, V, W>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3391 t: T, u: U, v: V, w: W) => TReturn,
3392 context: null | undefined,
3393 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W) => TReturn;
3394 /**
3395 * Takes a function and returns a new one that will always have a particular context.
3396 * @param funсtion The function whose context will be changed.
3397 * @param context The object to which the context (`this`) of the function should be set.
3398 * @param a An argument to be passed to the function referenced in the `function` argument.
3399 * @param b An argument to be passed to the function referenced in the `function` argument.
3400 * @param c An argument to be passed to the function referenced in the `function` argument.
3401 * @param d An argument to be passed to the function referenced in the `function` argument.
3402 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3403 * @since 1.9
3404 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3405 */
3406 proxy<TReturn,
3407 A, B, C, D,
3408 T, U, V, W>(funсtion: (a: A, b: B, c: C, d: D,
3409 t: T, u: U, v: V, w: W) => TReturn,
3410 context: null | undefined,
3411 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W) => TReturn;
3412 /**
3413 * Takes a function and returns a new one that will always have a particular context.
3414 * @param funсtion The function whose context will be changed.
3415 * @param context The object to which the context (`this`) of the function should be set.
3416 * @param a An argument to be passed to the function referenced in the `function` argument.
3417 * @param b An argument to be passed to the function referenced in the `function` argument.
3418 * @param c An argument to be passed to the function referenced in the `function` argument.
3419 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3420 * @since 1.9
3421 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3422 */
3423 proxy<TReturn,
3424 A, B, C,
3425 T, U, V, W>(funсtion: (a: A, b: B, c: C,
3426 t: T, u: U, v: V, w: W) => TReturn,
3427 context: null | undefined,
3428 a: A, b: B, c: C): (t: T, u: U, v: V, w: W) => TReturn;
3429 /**
3430 * Takes a function and returns a new one that will always have a particular context.
3431 * @param funсtion The function whose context will be changed.
3432 * @param context The object to which the context (`this`) of the function should be set.
3433 * @param a An argument to be passed to the function referenced in the `function` argument.
3434 * @param b An argument to be passed to the function referenced in the `function` argument.
3435 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3436 * @since 1.9
3437 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3438 */
3439 proxy<TReturn,
3440 A, B,
3441 T, U, V, W>(funсtion: (a: A, b: B,
3442 t: T, u: U, v: V, w: W) => TReturn,
3443 context: null | undefined,
3444 a: A, b: B): (t: T, u: U, v: V, w: W) => TReturn;
3445 /**
3446 * Takes a function and returns a new one that will always have a particular context.
3447 * @param funсtion The function whose context will be changed.
3448 * @param context The object to which the context (`this`) of the function should be set.
3449 * @param a An argument to be passed to the function referenced in the `function` argument.
3450 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3451 * @since 1.9
3452 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3453 */
3454 proxy<TReturn,
3455 A,
3456 T, U, V, W>(funсtion: (a: A,
3457 t: T, u: U, v: V, w: W) => TReturn,
3458 context: null | undefined,
3459 a: A): (t: T, u: U, v: V, w: W) => TReturn;
3460 /**
3461 * Takes a function and returns a new one that will always have a particular context.
3462 * @param funсtion The function whose context will be changed.
3463 * @param context The object to which the context (`this`) of the function should be set.
3464 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3465 * @since 1.9
3466 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3467 */
3468 proxy<TReturn,
3469 T, U, V, W>(funсtion: (t: T, u: U, v: V, w: W) => TReturn,
3470 context: null | undefined): (t: T, u: U, v: V, w: W) => TReturn;
3471
3472 // #endregion
3473
3474 // region 5 parameters
3475 // #region 5 parameters
3476
3477 /**
3478 * Takes a function and returns a new one that will always have a particular context.
3479 * @param funсtion The function whose context will be changed.
3480 * @param context The object to which the context (`this`) of the function should be set.
3481 * @param a An argument to be passed to the function referenced in the `function` argument.
3482 * @param b An argument to be passed to the function referenced in the `function` argument.
3483 * @param c An argument to be passed to the function referenced in the `function` argument.
3484 * @param d An argument to be passed to the function referenced in the `function` argument.
3485 * @param e An argument to be passed to the function referenced in the `function` argument.
3486 * @param f An argument to be passed to the function referenced in the `function` argument.
3487 * @param g An argument to be passed to the function referenced in the `function` argument.
3488 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3489 * @since 1.9
3490 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3491 */
3492 proxy<TReturn,
3493 A, B, C, D, E, F, G,
3494 T, U, V, W, X>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3495 t: T, u: U, v: V, w: W, x: X) => TReturn,
3496 context: null | undefined,
3497 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;
3498 /**
3499 * Takes a function and returns a new one that will always have a particular context.
3500 * @param funсtion The function whose context will be changed.
3501 * @param context The object to which the context (`this`) of the function should be set.
3502 * @param a An argument to be passed to the function referenced in the `function` argument.
3503 * @param b An argument to be passed to the function referenced in the `function` argument.
3504 * @param c An argument to be passed to the function referenced in the `function` argument.
3505 * @param d An argument to be passed to the function referenced in the `function` argument.
3506 * @param e An argument to be passed to the function referenced in the `function` argument.
3507 * @param f An argument to be passed to the function referenced in the `function` argument.
3508 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3509 * @since 1.9
3510 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3511 */
3512 proxy<TReturn,
3513 A, B, C, D, E, F,
3514 T, U, V, W, X>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3515 t: T, u: U, v: V, w: W, x: X) => TReturn,
3516 context: null | undefined,
3517 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3518 /**
3519 * Takes a function and returns a new one that will always have a particular context.
3520 * @param funсtion The function whose context will be changed.
3521 * @param context The object to which the context (`this`) of the function should be set.
3522 * @param a An argument to be passed to the function referenced in the `function` argument.
3523 * @param b An argument to be passed to the function referenced in the `function` argument.
3524 * @param c An argument to be passed to the function referenced in the `function` argument.
3525 * @param d An argument to be passed to the function referenced in the `function` argument.
3526 * @param e An argument to be passed to the function referenced in the `function` argument.
3527 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3528 * @since 1.9
3529 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3530 */
3531 proxy<TReturn,
3532 A, B, C, D, E,
3533 T, U, V, W, X>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3534 t: T, u: U, v: V, w: W, x: X) => TReturn,
3535 context: null | undefined,
3536 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3537 /**
3538 * Takes a function and returns a new one that will always have a particular context.
3539 * @param funсtion The function whose context will be changed.
3540 * @param context The object to which the context (`this`) of the function should be set.
3541 * @param a An argument to be passed to the function referenced in the `function` argument.
3542 * @param b An argument to be passed to the function referenced in the `function` argument.
3543 * @param c An argument to be passed to the function referenced in the `function` argument.
3544 * @param d An argument to be passed to the function referenced in the `function` argument.
3545 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3546 * @since 1.9
3547 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3548 */
3549 proxy<TReturn,
3550 A, B, C, D,
3551 T, U, V, W, X>(funсtion: (a: A, b: B, c: C, d: D,
3552 t: T, u: U, v: V, w: W, x: X) => TReturn,
3553 context: null | undefined,
3554 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3555 /**
3556 * Takes a function and returns a new one that will always have a particular context.
3557 * @param funсtion The function whose context will be changed.
3558 * @param context The object to which the context (`this`) of the function should be set.
3559 * @param a An argument to be passed to the function referenced in the `function` argument.
3560 * @param b An argument to be passed to the function referenced in the `function` argument.
3561 * @param c An argument to be passed to the function referenced in the `function` argument.
3562 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3563 * @since 1.9
3564 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3565 */
3566 proxy<TReturn,
3567 A, B, C,
3568 T, U, V, W, X>(funсtion: (a: A, b: B, c: C,
3569 t: T, u: U, v: V, w: W, x: X) => TReturn,
3570 context: null | undefined,
3571 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3572 /**
3573 * Takes a function and returns a new one that will always have a particular context.
3574 * @param funсtion The function whose context will be changed.
3575 * @param context The object to which the context (`this`) of the function should be set.
3576 * @param a An argument to be passed to the function referenced in the `function` argument.
3577 * @param b An argument to be passed to the function referenced in the `function` argument.
3578 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3579 * @since 1.9
3580 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3581 */
3582 proxy<TReturn,
3583 A, B,
3584 T, U, V, W, X>(funсtion: (a: A, b: B,
3585 t: T, u: U, v: V, w: W, x: X) => TReturn,
3586 context: null | undefined,
3587 a: A, b: B): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3588 /**
3589 * Takes a function and returns a new one that will always have a particular context.
3590 * @param funсtion The function whose context will be changed.
3591 * @param context The object to which the context (`this`) of the function should be set.
3592 * @param a An argument to be passed to the function referenced in the `function` argument.
3593 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3594 * @since 1.9
3595 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3596 */
3597 proxy<TReturn,
3598 A,
3599 T, U, V, W, X>(funсtion: (a: A,
3600 t: T, u: U, v: V, w: W, x: X) => TReturn,
3601 context: null | undefined,
3602 a: A): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3603 /**
3604 * Takes a function and returns a new one that will always have a particular context.
3605 * @param funсtion The function whose context will be changed.
3606 * @param context The object to which the context (`this`) of the function should be set.
3607 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3608 * @since 1.9
3609 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3610 */
3611 proxy<TReturn,
3612 T, U, V, W, X>(funсtion: (t: T, u: U, v: V, w: W, x: X) => TReturn,
3613 context: null | undefined): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3614
3615 // #endregion
3616
3617 // region 6 parameters
3618 // #region 6 parameters
3619
3620 /**
3621 * Takes a function and returns a new one that will always have a particular context.
3622 * @param funсtion The function whose context will be changed.
3623 * @param context The object to which the context (`this`) of the function should be set.
3624 * @param a An argument to be passed to the function referenced in the `function` argument.
3625 * @param b An argument to be passed to the function referenced in the `function` argument.
3626 * @param c An argument to be passed to the function referenced in the `function` argument.
3627 * @param d An argument to be passed to the function referenced in the `function` argument.
3628 * @param e An argument to be passed to the function referenced in the `function` argument.
3629 * @param f An argument to be passed to the function referenced in the `function` argument.
3630 * @param g An argument to be passed to the function referenced in the `function` argument.
3631 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3632 * @since 1.9
3633 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3634 */
3635 proxy<TReturn,
3636 A, B, C, D, E, F, G,
3637 T, U, V, W, X, Y>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3638 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3639 context: null | undefined,
3640 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;
3641 /**
3642 * Takes a function and returns a new one that will always have a particular context.
3643 * @param funсtion The function whose context will be changed.
3644 * @param context The object to which the context (`this`) of the function should be set.
3645 * @param a An argument to be passed to the function referenced in the `function` argument.
3646 * @param b An argument to be passed to the function referenced in the `function` argument.
3647 * @param c An argument to be passed to the function referenced in the `function` argument.
3648 * @param d An argument to be passed to the function referenced in the `function` argument.
3649 * @param e An argument to be passed to the function referenced in the `function` argument.
3650 * @param f An argument to be passed to the function referenced in the `function` argument.
3651 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3652 * @since 1.9
3653 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3654 */
3655 proxy<TReturn,
3656 A, B, C, D, E, F,
3657 T, U, V, W, X, Y>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3658 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3659 context: null | undefined,
3660 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;
3661 /**
3662 * Takes a function and returns a new one that will always have a particular context.
3663 * @param funсtion The function whose context will be changed.
3664 * @param context The object to which the context (`this`) of the function should be set.
3665 * @param a An argument to be passed to the function referenced in the `function` argument.
3666 * @param b An argument to be passed to the function referenced in the `function` argument.
3667 * @param c An argument to be passed to the function referenced in the `function` argument.
3668 * @param d An argument to be passed to the function referenced in the `function` argument.
3669 * @param e An argument to be passed to the function referenced in the `function` argument.
3670 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3671 * @since 1.9
3672 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3673 */
3674 proxy<TReturn,
3675 A, B, C, D, E,
3676 T, U, V, W, X, Y>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3677 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3678 context: null | undefined,
3679 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3680 /**
3681 * Takes a function and returns a new one that will always have a particular context.
3682 * @param funсtion The function whose context will be changed.
3683 * @param context The object to which the context (`this`) of the function should be set.
3684 * @param a An argument to be passed to the function referenced in the `function` argument.
3685 * @param b An argument to be passed to the function referenced in the `function` argument.
3686 * @param c An argument to be passed to the function referenced in the `function` argument.
3687 * @param d An argument to be passed to the function referenced in the `function` argument.
3688 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3689 * @since 1.9
3690 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3691 */
3692 proxy<TReturn,
3693 A, B, C, D,
3694 T, U, V, W, X, Y>(funсtion: (a: A, b: B, c: C, d: D,
3695 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3696 context: null | undefined,
3697 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3698 /**
3699 * Takes a function and returns a new one that will always have a particular context.
3700 * @param funсtion The function whose context will be changed.
3701 * @param context The object to which the context (`this`) of the function should be set.
3702 * @param a An argument to be passed to the function referenced in the `function` argument.
3703 * @param b An argument to be passed to the function referenced in the `function` argument.
3704 * @param c An argument to be passed to the function referenced in the `function` argument.
3705 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3706 * @since 1.9
3707 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3708 */
3709 proxy<TReturn,
3710 A, B, C,
3711 T, U, V, W, X, Y>(funсtion: (a: A, b: B, c: C,
3712 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3713 context: null | undefined,
3714 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3715 /**
3716 * Takes a function and returns a new one that will always have a particular context.
3717 * @param funсtion The function whose context will be changed.
3718 * @param context The object to which the context (`this`) of the function should be set.
3719 * @param a An argument to be passed to the function referenced in the `function` argument.
3720 * @param b An argument to be passed to the function referenced in the `function` argument.
3721 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3722 * @since 1.9
3723 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3724 */
3725 proxy<TReturn,
3726 A, B,
3727 T, U, V, W, X, Y>(funсtion: (a: A, b: B,
3728 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3729 context: null | undefined,
3730 a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3731 /**
3732 * Takes a function and returns a new one that will always have a particular context.
3733 * @param funсtion The function whose context will be changed.
3734 * @param context The object to which the context (`this`) of the function should be set.
3735 * @param a An argument to be passed to the function referenced in the `function` argument.
3736 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3737 * @since 1.9
3738 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3739 */
3740 proxy<TReturn,
3741 A,
3742 T, U, V, W, X, Y>(funсtion: (a: A,
3743 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3744 context: null | undefined,
3745 a: A): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3746 /**
3747 * Takes a function and returns a new one that will always have a particular context.
3748 * @param funсtion The function whose context will be changed.
3749 * @param context The object to which the context (`this`) of the function should be set.
3750 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3751 * @since 1.9
3752 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3753 */
3754 proxy<TReturn,
3755 T, U, V, W, X, Y>(funсtion: (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3756 context: null | undefined): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3757
3758 // #endregion
3759
3760 // region 7+ parameters
3761 // #region 7+ parameters
3762
3763 /**
3764 * Takes a function and returns a new one that will always have a particular context.
3765 * @param funсtion The function whose context will be changed.
3766 * @param context The object to which the context (`this`) of the function should be set.
3767 * @param a An argument to be passed to the function referenced in the `function` argument.
3768 * @param b An argument to be passed to the function referenced in the `function` argument.
3769 * @param c An argument to be passed to the function referenced in the `function` argument.
3770 * @param d An argument to be passed to the function referenced in the `function` argument.
3771 * @param e An argument to be passed to the function referenced in the `function` argument.
3772 * @param f An argument to be passed to the function referenced in the `function` argument.
3773 * @param g An argument to be passed to the function referenced in the `function` argument.
3774 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3775 * @since 1.9
3776 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3777 */
3778 proxy<TReturn,
3779 A, B, C, D, E, F, G,
3780 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3781 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3782 context: null | undefined,
3783 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;
3784 /**
3785 * Takes a function and returns a new one that will always have a particular context.
3786 * @param funсtion The function whose context will be changed.
3787 * @param context The object to which the context (`this`) of the function should be set.
3788 * @param a An argument to be passed to the function referenced in the `function` argument.
3789 * @param b An argument to be passed to the function referenced in the `function` argument.
3790 * @param c An argument to be passed to the function referenced in the `function` argument.
3791 * @param d An argument to be passed to the function referenced in the `function` argument.
3792 * @param e An argument to be passed to the function referenced in the `function` argument.
3793 * @param f An argument to be passed to the function referenced in the `function` argument.
3794 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3795 * @since 1.9
3796 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3797 */
3798 proxy<TReturn,
3799 A, B, C, D, E, F,
3800 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3801 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3802 context: null | undefined,
3803 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;
3804 /**
3805 * Takes a function and returns a new one that will always have a particular context.
3806 * @param funсtion The function whose context will be changed.
3807 * @param context The object to which the context (`this`) of the function should be set.
3808 * @param a An argument to be passed to the function referenced in the `function` argument.
3809 * @param b An argument to be passed to the function referenced in the `function` argument.
3810 * @param c An argument to be passed to the function referenced in the `function` argument.
3811 * @param d An argument to be passed to the function referenced in the `function` argument.
3812 * @param e An argument to be passed to the function referenced in the `function` argument.
3813 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3814 * @since 1.9
3815 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3816 */
3817 proxy<TReturn,
3818 A, B, C, D, E,
3819 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3820 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3821 context: null | undefined,
3822 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;
3823 /**
3824 * Takes a function and returns a new one that will always have a particular context.
3825 * @param funсtion The function whose context will be changed.
3826 * @param context The object to which the context (`this`) of the function should be set.
3827 * @param a An argument to be passed to the function referenced in the `function` argument.
3828 * @param b An argument to be passed to the function referenced in the `function` argument.
3829 * @param c An argument to be passed to the function referenced in the `function` argument.
3830 * @param d An argument to be passed to the function referenced in the `function` argument.
3831 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3832 * @since 1.9
3833 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3834 */
3835 proxy<TReturn,
3836 A, B, C, D,
3837 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B, c: C, d: D,
3838 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3839 context: null | undefined,
3840 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;
3841 /**
3842 * Takes a function and returns a new one that will always have a particular context.
3843 * @param funсtion The function whose context will be changed.
3844 * @param context The object to which the context (`this`) of the function should be set.
3845 * @param a An argument to be passed to the function referenced in the `function` argument.
3846 * @param b An argument to be passed to the function referenced in the `function` argument.
3847 * @param c An argument to be passed to the function referenced in the `function` argument.
3848 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3849 * @since 1.9
3850 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3851 */
3852 proxy<TReturn,
3853 A, B, C,
3854 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B, c: C,
3855 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3856 context: null | undefined,
3857 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
3858 /**
3859 * Takes a function and returns a new one that will always have a particular context.
3860 * @param funсtion The function whose context will be changed.
3861 * @param context The object to which the context (`this`) of the function should be set.
3862 * @param a An argument to be passed to the function referenced in the `function` argument.
3863 * @param b An argument to be passed to the function referenced in the `function` argument.
3864 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3865 * @since 1.9
3866 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3867 */
3868 proxy<TReturn,
3869 A, B,
3870 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B,
3871 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3872 context: null | undefined,
3873 a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
3874 /**
3875 * Takes a function and returns a new one that will always have a particular context.
3876 * @param funсtion The function whose context will be changed.
3877 * @param context The object to which the context (`this`) of the function should be set.
3878 * @param a An argument to be passed to the function referenced in the `function` argument.
3879 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3880 * @since 1.9
3881 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3882 */
3883 proxy<TReturn,
3884 A,
3885 T, U, V, W, X, Y, Z>(funсtion: (a: A,
3886 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3887 context: null | undefined,
3888 a: A): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
3889 /**
3890 * Takes a function and returns a new one that will always have a particular context.
3891 * @param funсtion The function whose context will be changed.
3892 * @param context The object to which the context (`this`) of the function should be set.
3893 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3894 * @since 1.9
3895 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3896 */
3897 proxy<TReturn,
3898 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,
3899 context: null | undefined): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
3900
3901 // #endregion
3902
3903 // #endregion
3904
3905 // region 8+ additional arguments
3906 // #region 8+ additional arguments
3907
3908 /**
3909 * Takes a function and returns a new one that will always have a particular context.
3910 * @param funсtion The function whose context will be changed.
3911 * @param context The object to which the context (`this`) of the function should be set.
3912 * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument.
3913 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3914 * @since 1.9
3915 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3916 */
3917 proxy<TReturn>(funсtion: (...args: any[]) => TReturn,
3918 context: null | undefined,
3919 ...additionalArguments: any[]): (...args: any[]) => TReturn;
3920
3921 // #endregion
3922
3923 // #endregion
3924
3925 // region (funсtion, context)
3926 // #region (funсtion, context)
3927
3928 // region 0 to 7 additional arguments
3929 // #region 0 to 7 additional arguments
3930
3931 // region 0 parameters
3932 // #region 0 parameters
3933
3934 /**
3935 * Takes a function and returns a new one that will always have a particular context.
3936 * @param funсtion The function whose context will be changed.
3937 * @param context The object to which the context (`this`) of the function should be set.
3938 * @param a An argument to be passed to the function referenced in the `function` argument.
3939 * @param b An argument to be passed to the function referenced in the `function` argument.
3940 * @param c An argument to be passed to the function referenced in the `function` argument.
3941 * @param d An argument to be passed to the function referenced in the `function` argument.
3942 * @param e An argument to be passed to the function referenced in the `function` argument.
3943 * @param f An argument to be passed to the function referenced in the `function` argument.
3944 * @param g An argument to be passed to the function referenced in the `function` argument.
3945 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3946 * @since 1.4
3947 * @since 1.6
3948 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3949 * @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.
3950```html
3951<!doctype html>
3952<html lang="en">
3953<head>
3954 <meta charset="utf-8">
3955 <title>jQuery.proxy demo</title>
3956 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
3957</head>
3958<body>
3959
3960<p><button type="button" id="test">Test</button></p>
3961<div id="log"></div>
3962
3963<script>
3964var me = {
3965 type: "zombie",
3966 test: function( event ) {
3967 // Without proxy, `this` would refer to the event target
3968 // use event.target to reference that element.
3969 var element = event.target;
3970 $( element ).css( "background-color", "red" );
3971
3972 // With proxy, `this` refers to the me object encapsulating
3973 // this function.
3974 $( "#log" ).append( "Hello " + this.type + "<br>" );
3975 $( "#test" ).off( "click", this.test );
3976 }
3977};
3978
3979var you = {
3980 type: "person",
3981 test: function( event ) {
3982 $( "#log" ).append( this.type + " " );
3983 }
3984};
3985
3986// Execute you.test() in the context of the `you` object
3987// no matter where it is called
3988// i.e. the `this` keyword will refer to `you`
3989var youClick = $.proxy( you.test, you );
3990
3991// attach click handlers to #test
3992$( "#test" )
3993 // this === "zombie"; handler unbound after first click
3994 .on( "click", $.proxy( me.test, me ) )
3995
3996 // this === "person"
3997 .on( "click", youClick )
3998
3999 // this === "zombie"
4000 .on( "click", $.proxy( you.test, me ) )
4001
4002 // this === "<button> element"
4003 .on( "click", you.test );
4004</script>
4005
4006</body>
4007</html>
4008```
4009 * @example ​ ````Change the context of a function bound to the click handler,
4010```html
4011<!doctype html>
4012<html lang="en">
4013<head>
4014 <meta charset="utf-8">
4015 <title>jQuery.proxy demo</title>
4016 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4017</head>
4018<body>
4019
4020<p><button type="button" id="test">Test</button></p>
4021<div id="log"></div>
4022
4023<script>
4024var me = {
4025 // I'm a dog
4026 type: "dog",
4027
4028 // Note that event comes *after* one and two
4029 test: function( one, two, event ) {
4030 $( "#log" )
4031
4032 // `one` maps to `you`, the 1st additional
4033 // argument in the $.proxy function call
4034 .append( "<h3>Hello " + one.type + ":</h3>" )
4035
4036 // The `this` keyword refers to `me`
4037 // (the 2nd, context, argument of $.proxy)
4038 .append( "I am a " + this.type + ", " )
4039
4040 // `two` maps to `they`, the 2nd additional
4041 // argument in the $.proxy function call
4042 .append( "and they are " + two.type + ".<br>" )
4043
4044 // The event type is "click"
4045 .append( "Thanks for " + event.type + "ing." )
4046
4047 // The clicked element is `event.target`,
4048 // and its type is "button"
4049 .append( "the " + event.target.type + "." );
4050 }
4051};
4052
4053var you = { type: "cat" };
4054var they = { type: "fish" };
4055
4056// Set up handler to execute me.test() in the context
4057// of `me`, with `you` and `they` as additional arguments
4058var proxy = $.proxy( me.test, me, you, they );
4059
4060$( "#test" )
4061 .on( "click", proxy );
4062</script>
4063
4064</body>
4065</html>
4066```
4067 */
4068 proxy<TContext,
4069 TReturn,
4070 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,
4071 context: TContext,
4072 a: A, b: B, c: C, d: D, e: E, f: F, g: G): () => TReturn;
4073 /**
4074 * Takes a function and returns a new one that will always have a particular context.
4075 * @param funсtion The function whose context will be changed.
4076 * @param context The object to which the context (`this`) of the function should be set.
4077 * @param a An argument to be passed to the function referenced in the `function` argument.
4078 * @param b An argument to be passed to the function referenced in the `function` argument.
4079 * @param c An argument to be passed to the function referenced in the `function` argument.
4080 * @param d An argument to be passed to the function referenced in the `function` argument.
4081 * @param e An argument to be passed to the function referenced in the `function` argument.
4082 * @param f An argument to be passed to the function referenced in the `function` argument.
4083 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4084 * @since 1.4
4085 * @since 1.6
4086 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4087 * @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.
4088```html
4089<!doctype html>
4090<html lang="en">
4091<head>
4092 <meta charset="utf-8">
4093 <title>jQuery.proxy demo</title>
4094 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4095</head>
4096<body>
4097
4098<p><button type="button" id="test">Test</button></p>
4099<div id="log"></div>
4100
4101<script>
4102var me = {
4103 type: "zombie",
4104 test: function( event ) {
4105 // Without proxy, `this` would refer to the event target
4106 // use event.target to reference that element.
4107 var element = event.target;
4108 $( element ).css( "background-color", "red" );
4109
4110 // With proxy, `this` refers to the me object encapsulating
4111 // this function.
4112 $( "#log" ).append( "Hello " + this.type + "<br>" );
4113 $( "#test" ).off( "click", this.test );
4114 }
4115};
4116
4117var you = {
4118 type: "person",
4119 test: function( event ) {
4120 $( "#log" ).append( this.type + " " );
4121 }
4122};
4123
4124// Execute you.test() in the context of the `you` object
4125// no matter where it is called
4126// i.e. the `this` keyword will refer to `you`
4127var youClick = $.proxy( you.test, you );
4128
4129// attach click handlers to #test
4130$( "#test" )
4131 // this === "zombie"; handler unbound after first click
4132 .on( "click", $.proxy( me.test, me ) )
4133
4134 // this === "person"
4135 .on( "click", youClick )
4136
4137 // this === "zombie"
4138 .on( "click", $.proxy( you.test, me ) )
4139
4140 // this === "<button> element"
4141 .on( "click", you.test );
4142</script>
4143
4144</body>
4145</html>
4146```
4147 * @example ​ ````Change the context of a function bound to the click handler,
4148```html
4149<!doctype html>
4150<html lang="en">
4151<head>
4152 <meta charset="utf-8">
4153 <title>jQuery.proxy demo</title>
4154 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4155</head>
4156<body>
4157
4158<p><button type="button" id="test">Test</button></p>
4159<div id="log"></div>
4160
4161<script>
4162var me = {
4163 // I'm a dog
4164 type: "dog",
4165
4166 // Note that event comes *after* one and two
4167 test: function( one, two, event ) {
4168 $( "#log" )
4169
4170 // `one` maps to `you`, the 1st additional
4171 // argument in the $.proxy function call
4172 .append( "<h3>Hello " + one.type + ":</h3>" )
4173
4174 // The `this` keyword refers to `me`
4175 // (the 2nd, context, argument of $.proxy)
4176 .append( "I am a " + this.type + ", " )
4177
4178 // `two` maps to `they`, the 2nd additional
4179 // argument in the $.proxy function call
4180 .append( "and they are " + two.type + ".<br>" )
4181
4182 // The event type is "click"
4183 .append( "Thanks for " + event.type + "ing." )
4184
4185 // The clicked element is `event.target`,
4186 // and its type is "button"
4187 .append( "the " + event.target.type + "." );
4188 }
4189};
4190
4191var you = { type: "cat" };
4192var they = { type: "fish" };
4193
4194// Set up handler to execute me.test() in the context
4195// of `me`, with `you` and `they` as additional arguments
4196var proxy = $.proxy( me.test, me, you, they );
4197
4198$( "#test" )
4199 .on( "click", proxy );
4200</script>
4201
4202</body>
4203</html>
4204```
4205 */
4206 proxy<TContext,
4207 TReturn,
4208 A, B, C, D, E, F>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F) => TReturn,
4209 context: TContext,
4210 a: A, b: B, c: C, d: D, e: E, f: F): () => TReturn;
4211 /**
4212 * Takes a function and returns a new one that will always have a particular context.
4213 * @param funсtion The function whose context will be changed.
4214 * @param context The object to which the context (`this`) of the function should be set.
4215 * @param a An argument to be passed to the function referenced in the `function` argument.
4216 * @param b An argument to be passed to the function referenced in the `function` argument.
4217 * @param c An argument to be passed to the function referenced in the `function` argument.
4218 * @param d An argument to be passed to the function referenced in the `function` argument.
4219 * @param e An argument to be passed to the function referenced in the `function` argument.
4220 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4221 * @since 1.4
4222 * @since 1.6
4223 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4224 * @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.
4225```html
4226<!doctype html>
4227<html lang="en">
4228<head>
4229 <meta charset="utf-8">
4230 <title>jQuery.proxy demo</title>
4231 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4232</head>
4233<body>
4234
4235<p><button type="button" id="test">Test</button></p>
4236<div id="log"></div>
4237
4238<script>
4239var me = {
4240 type: "zombie",
4241 test: function( event ) {
4242 // Without proxy, `this` would refer to the event target
4243 // use event.target to reference that element.
4244 var element = event.target;
4245 $( element ).css( "background-color", "red" );
4246
4247 // With proxy, `this` refers to the me object encapsulating
4248 // this function.
4249 $( "#log" ).append( "Hello " + this.type + "<br>" );
4250 $( "#test" ).off( "click", this.test );
4251 }
4252};
4253
4254var you = {
4255 type: "person",
4256 test: function( event ) {
4257 $( "#log" ).append( this.type + " " );
4258 }
4259};
4260
4261// Execute you.test() in the context of the `you` object
4262// no matter where it is called
4263// i.e. the `this` keyword will refer to `you`
4264var youClick = $.proxy( you.test, you );
4265
4266// attach click handlers to #test
4267$( "#test" )
4268 // this === "zombie"; handler unbound after first click
4269 .on( "click", $.proxy( me.test, me ) )
4270
4271 // this === "person"
4272 .on( "click", youClick )
4273
4274 // this === "zombie"
4275 .on( "click", $.proxy( you.test, me ) )
4276
4277 // this === "<button> element"
4278 .on( "click", you.test );
4279</script>
4280
4281</body>
4282</html>
4283```
4284 * @example ​ ````Change the context of a function bound to the click handler,
4285```html
4286<!doctype html>
4287<html lang="en">
4288<head>
4289 <meta charset="utf-8">
4290 <title>jQuery.proxy demo</title>
4291 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4292</head>
4293<body>
4294
4295<p><button type="button" id="test">Test</button></p>
4296<div id="log"></div>
4297
4298<script>
4299var me = {
4300 // I'm a dog
4301 type: "dog",
4302
4303 // Note that event comes *after* one and two
4304 test: function( one, two, event ) {
4305 $( "#log" )
4306
4307 // `one` maps to `you`, the 1st additional
4308 // argument in the $.proxy function call
4309 .append( "<h3>Hello " + one.type + ":</h3>" )
4310
4311 // The `this` keyword refers to `me`
4312 // (the 2nd, context, argument of $.proxy)
4313 .append( "I am a " + this.type + ", " )
4314
4315 // `two` maps to `they`, the 2nd additional
4316 // argument in the $.proxy function call
4317 .append( "and they are " + two.type + ".<br>" )
4318
4319 // The event type is "click"
4320 .append( "Thanks for " + event.type + "ing." )
4321
4322 // The clicked element is `event.target`,
4323 // and its type is "button"
4324 .append( "the " + event.target.type + "." );
4325 }
4326};
4327
4328var you = { type: "cat" };
4329var they = { type: "fish" };
4330
4331// Set up handler to execute me.test() in the context
4332// of `me`, with `you` and `they` as additional arguments
4333var proxy = $.proxy( me.test, me, you, they );
4334
4335$( "#test" )
4336 .on( "click", proxy );
4337</script>
4338
4339</body>
4340</html>
4341```
4342 */
4343 proxy<TContext,
4344 TReturn,
4345 A, B, C, D, E>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E) => TReturn,
4346 context: TContext,
4347 a: A, b: B, c: C, d: D, e: E): () => TReturn;
4348 /**
4349 * Takes a function and returns a new one that will always have a particular context.
4350 * @param funсtion The function whose context will be changed.
4351 * @param context The object to which the context (`this`) of the function should be set.
4352 * @param a An argument to be passed to the function referenced in the `function` argument.
4353 * @param b An argument to be passed to the function referenced in the `function` argument.
4354 * @param c An argument to be passed to the function referenced in the `function` argument.
4355 * @param d An argument to be passed to the function referenced in the `function` argument.
4356 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4357 * @since 1.4
4358 * @since 1.6
4359 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4360 * @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.
4361```html
4362<!doctype html>
4363<html lang="en">
4364<head>
4365 <meta charset="utf-8">
4366 <title>jQuery.proxy demo</title>
4367 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4368</head>
4369<body>
4370
4371<p><button type="button" id="test">Test</button></p>
4372<div id="log"></div>
4373
4374<script>
4375var me = {
4376 type: "zombie",
4377 test: function( event ) {
4378 // Without proxy, `this` would refer to the event target
4379 // use event.target to reference that element.
4380 var element = event.target;
4381 $( element ).css( "background-color", "red" );
4382
4383 // With proxy, `this` refers to the me object encapsulating
4384 // this function.
4385 $( "#log" ).append( "Hello " + this.type + "<br>" );
4386 $( "#test" ).off( "click", this.test );
4387 }
4388};
4389
4390var you = {
4391 type: "person",
4392 test: function( event ) {
4393 $( "#log" ).append( this.type + " " );
4394 }
4395};
4396
4397// Execute you.test() in the context of the `you` object
4398// no matter where it is called
4399// i.e. the `this` keyword will refer to `you`
4400var youClick = $.proxy( you.test, you );
4401
4402// attach click handlers to #test
4403$( "#test" )
4404 // this === "zombie"; handler unbound after first click
4405 .on( "click", $.proxy( me.test, me ) )
4406
4407 // this === "person"
4408 .on( "click", youClick )
4409
4410 // this === "zombie"
4411 .on( "click", $.proxy( you.test, me ) )
4412
4413 // this === "<button> element"
4414 .on( "click", you.test );
4415</script>
4416
4417</body>
4418</html>
4419```
4420 * @example ​ ````Change the context of a function bound to the click handler,
4421```html
4422<!doctype html>
4423<html lang="en">
4424<head>
4425 <meta charset="utf-8">
4426 <title>jQuery.proxy demo</title>
4427 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4428</head>
4429<body>
4430
4431<p><button type="button" id="test">Test</button></p>
4432<div id="log"></div>
4433
4434<script>
4435var me = {
4436 // I'm a dog
4437 type: "dog",
4438
4439 // Note that event comes *after* one and two
4440 test: function( one, two, event ) {
4441 $( "#log" )
4442
4443 // `one` maps to `you`, the 1st additional
4444 // argument in the $.proxy function call
4445 .append( "<h3>Hello " + one.type + ":</h3>" )
4446
4447 // The `this` keyword refers to `me`
4448 // (the 2nd, context, argument of $.proxy)
4449 .append( "I am a " + this.type + ", " )
4450
4451 // `two` maps to `they`, the 2nd additional
4452 // argument in the $.proxy function call
4453 .append( "and they are " + two.type + ".<br>" )
4454
4455 // The event type is "click"
4456 .append( "Thanks for " + event.type + "ing." )
4457
4458 // The clicked element is `event.target`,
4459 // and its type is "button"
4460 .append( "the " + event.target.type + "." );
4461 }
4462};
4463
4464var you = { type: "cat" };
4465var they = { type: "fish" };
4466
4467// Set up handler to execute me.test() in the context
4468// of `me`, with `you` and `they` as additional arguments
4469var proxy = $.proxy( me.test, me, you, they );
4470
4471$( "#test" )
4472 .on( "click", proxy );
4473</script>
4474
4475</body>
4476</html>
4477```
4478 */
4479 proxy<TContext,
4480 TReturn,
4481 A, B, C, D>(funсtion: (this: TContext, a: A, b: B, c: C, d: D) => TReturn,
4482 context: TContext,
4483 a: A, b: B, c: C, d: D): () => TReturn;
4484 /**
4485 * Takes a function and returns a new one that will always have a particular context.
4486 * @param funсtion The function whose context will be changed.
4487 * @param context The object to which the context (`this`) of the function should be set.
4488 * @param a An argument to be passed to the function referenced in the `function` argument.
4489 * @param b An argument to be passed to the function referenced in the `function` argument.
4490 * @param c An argument to be passed to the function referenced in the `function` argument.
4491 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4492 * @since 1.4
4493 * @since 1.6
4494 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4495 * @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.
4496```html
4497<!doctype html>
4498<html lang="en">
4499<head>
4500 <meta charset="utf-8">
4501 <title>jQuery.proxy demo</title>
4502 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4503</head>
4504<body>
4505
4506<p><button type="button" id="test">Test</button></p>
4507<div id="log"></div>
4508
4509<script>
4510var me = {
4511 type: "zombie",
4512 test: function( event ) {
4513 // Without proxy, `this` would refer to the event target
4514 // use event.target to reference that element.
4515 var element = event.target;
4516 $( element ).css( "background-color", "red" );
4517
4518 // With proxy, `this` refers to the me object encapsulating
4519 // this function.
4520 $( "#log" ).append( "Hello " + this.type + "<br>" );
4521 $( "#test" ).off( "click", this.test );
4522 }
4523};
4524
4525var you = {
4526 type: "person",
4527 test: function( event ) {
4528 $( "#log" ).append( this.type + " " );
4529 }
4530};
4531
4532// Execute you.test() in the context of the `you` object
4533// no matter where it is called
4534// i.e. the `this` keyword will refer to `you`
4535var youClick = $.proxy( you.test, you );
4536
4537// attach click handlers to #test
4538$( "#test" )
4539 // this === "zombie"; handler unbound after first click
4540 .on( "click", $.proxy( me.test, me ) )
4541
4542 // this === "person"
4543 .on( "click", youClick )
4544
4545 // this === "zombie"
4546 .on( "click", $.proxy( you.test, me ) )
4547
4548 // this === "<button> element"
4549 .on( "click", you.test );
4550</script>
4551
4552</body>
4553</html>
4554```
4555 * @example ​ ````Change the context of a function bound to the click handler,
4556```html
4557<!doctype html>
4558<html lang="en">
4559<head>
4560 <meta charset="utf-8">
4561 <title>jQuery.proxy demo</title>
4562 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4563</head>
4564<body>
4565
4566<p><button type="button" id="test">Test</button></p>
4567<div id="log"></div>
4568
4569<script>
4570var me = {
4571 // I'm a dog
4572 type: "dog",
4573
4574 // Note that event comes *after* one and two
4575 test: function( one, two, event ) {
4576 $( "#log" )
4577
4578 // `one` maps to `you`, the 1st additional
4579 // argument in the $.proxy function call
4580 .append( "<h3>Hello " + one.type + ":</h3>" )
4581
4582 // The `this` keyword refers to `me`
4583 // (the 2nd, context, argument of $.proxy)
4584 .append( "I am a " + this.type + ", " )
4585
4586 // `two` maps to `they`, the 2nd additional
4587 // argument in the $.proxy function call
4588 .append( "and they are " + two.type + ".<br>" )
4589
4590 // The event type is "click"
4591 .append( "Thanks for " + event.type + "ing." )
4592
4593 // The clicked element is `event.target`,
4594 // and its type is "button"
4595 .append( "the " + event.target.type + "." );
4596 }
4597};
4598
4599var you = { type: "cat" };
4600var they = { type: "fish" };
4601
4602// Set up handler to execute me.test() in the context
4603// of `me`, with `you` and `they` as additional arguments
4604var proxy = $.proxy( me.test, me, you, they );
4605
4606$( "#test" )
4607 .on( "click", proxy );
4608</script>
4609
4610</body>
4611</html>
4612```
4613 */
4614 proxy<TContext,
4615 TReturn,
4616 A, B, C>(funсtion: (this: TContext, a: A, b: B, c: C) => TReturn,
4617 context: TContext,
4618 a: A, b: B, c: C): () => TReturn;
4619 /**
4620 * Takes a function and returns a new one that will always have a particular context.
4621 * @param funсtion The function whose context will be changed.
4622 * @param context The object to which the context (`this`) of the function should be set.
4623 * @param a An argument to be passed to the function referenced in the `function` argument.
4624 * @param b An argument to be passed to the function referenced in the `function` argument.
4625 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4626 * @since 1.4
4627 * @since 1.6
4628 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4629 * @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.
4630```html
4631<!doctype html>
4632<html lang="en">
4633<head>
4634 <meta charset="utf-8">
4635 <title>jQuery.proxy demo</title>
4636 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4637</head>
4638<body>
4639
4640<p><button type="button" id="test">Test</button></p>
4641<div id="log"></div>
4642
4643<script>
4644var me = {
4645 type: "zombie",
4646 test: function( event ) {
4647 // Without proxy, `this` would refer to the event target
4648 // use event.target to reference that element.
4649 var element = event.target;
4650 $( element ).css( "background-color", "red" );
4651
4652 // With proxy, `this` refers to the me object encapsulating
4653 // this function.
4654 $( "#log" ).append( "Hello " + this.type + "<br>" );
4655 $( "#test" ).off( "click", this.test );
4656 }
4657};
4658
4659var you = {
4660 type: "person",
4661 test: function( event ) {
4662 $( "#log" ).append( this.type + " " );
4663 }
4664};
4665
4666// Execute you.test() in the context of the `you` object
4667// no matter where it is called
4668// i.e. the `this` keyword will refer to `you`
4669var youClick = $.proxy( you.test, you );
4670
4671// attach click handlers to #test
4672$( "#test" )
4673 // this === "zombie"; handler unbound after first click
4674 .on( "click", $.proxy( me.test, me ) )
4675
4676 // this === "person"
4677 .on( "click", youClick )
4678
4679 // this === "zombie"
4680 .on( "click", $.proxy( you.test, me ) )
4681
4682 // this === "<button> element"
4683 .on( "click", you.test );
4684</script>
4685
4686</body>
4687</html>
4688```
4689 * @example ​ ````Change the context of a function bound to the click handler,
4690```html
4691<!doctype html>
4692<html lang="en">
4693<head>
4694 <meta charset="utf-8">
4695 <title>jQuery.proxy demo</title>
4696 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4697</head>
4698<body>
4699
4700<p><button type="button" id="test">Test</button></p>
4701<div id="log"></div>
4702
4703<script>
4704var me = {
4705 // I'm a dog
4706 type: "dog",
4707
4708 // Note that event comes *after* one and two
4709 test: function( one, two, event ) {
4710 $( "#log" )
4711
4712 // `one` maps to `you`, the 1st additional
4713 // argument in the $.proxy function call
4714 .append( "<h3>Hello " + one.type + ":</h3>" )
4715
4716 // The `this` keyword refers to `me`
4717 // (the 2nd, context, argument of $.proxy)
4718 .append( "I am a " + this.type + ", " )
4719
4720 // `two` maps to `they`, the 2nd additional
4721 // argument in the $.proxy function call
4722 .append( "and they are " + two.type + ".<br>" )
4723
4724 // The event type is "click"
4725 .append( "Thanks for " + event.type + "ing." )
4726
4727 // The clicked element is `event.target`,
4728 // and its type is "button"
4729 .append( "the " + event.target.type + "." );
4730 }
4731};
4732
4733var you = { type: "cat" };
4734var they = { type: "fish" };
4735
4736// Set up handler to execute me.test() in the context
4737// of `me`, with `you` and `they` as additional arguments
4738var proxy = $.proxy( me.test, me, you, they );
4739
4740$( "#test" )
4741 .on( "click", proxy );
4742</script>
4743
4744</body>
4745</html>
4746```
4747 */
4748 proxy<TContext,
4749 TReturn,
4750 A, B>(funсtion: (this: TContext, a: A, b: B) => TReturn,
4751 context: TContext,
4752 a: A, b: B): () => TReturn;
4753 /**
4754 * Takes a function and returns a new one that will always have a particular context.
4755 * @param funсtion The function whose context will be changed.
4756 * @param context The object to which the context (`this`) of the function should be set.
4757 * @param a An argument to be passed to the function referenced in the `function` argument.
4758 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4759 * @since 1.4`
4760 * @since 1.6
4761 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4762 * @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.
4763```html
4764<!doctype html>
4765<html lang="en">
4766<head>
4767 <meta charset="utf-8">
4768 <title>jQuery.proxy demo</title>
4769 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4770</head>
4771<body>
4772
4773<p><button type="button" id="test">Test</button></p>
4774<div id="log"></div>
4775
4776<script>
4777var me = {
4778 type: "zombie",
4779 test: function( event ) {
4780 // Without proxy, `this` would refer to the event target
4781 // use event.target to reference that element.
4782 var element = event.target;
4783 $( element ).css( "background-color", "red" );
4784
4785 // With proxy, `this` refers to the me object encapsulating
4786 // this function.
4787 $( "#log" ).append( "Hello " + this.type + "<br>" );
4788 $( "#test" ).off( "click", this.test );
4789 }
4790};
4791
4792var you = {
4793 type: "person",
4794 test: function( event ) {
4795 $( "#log" ).append( this.type + " " );
4796 }
4797};
4798
4799// Execute you.test() in the context of the `you` object
4800// no matter where it is called
4801// i.e. the `this` keyword will refer to `you`
4802var youClick = $.proxy( you.test, you );
4803
4804// attach click handlers to #test
4805$( "#test" )
4806 // this === "zombie"; handler unbound after first click
4807 .on( "click", $.proxy( me.test, me ) )
4808
4809 // this === "person"
4810 .on( "click", youClick )
4811
4812 // this === "zombie"
4813 .on( "click", $.proxy( you.test, me ) )
4814
4815 // this === "<button> element"
4816 .on( "click", you.test );
4817</script>
4818
4819</body>
4820</html>
4821```
4822 * @example ​ ````Change the context of a function bound to the click handler,
4823```html
4824<!doctype html>
4825<html lang="en">
4826<head>
4827 <meta charset="utf-8">
4828 <title>jQuery.proxy demo</title>
4829 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4830</head>
4831<body>
4832
4833<p><button type="button" id="test">Test</button></p>
4834<div id="log"></div>
4835
4836<script>
4837var me = {
4838 // I'm a dog
4839 type: "dog",
4840
4841 // Note that event comes *after* one and two
4842 test: function( one, two, event ) {
4843 $( "#log" )
4844
4845 // `one` maps to `you`, the 1st additional
4846 // argument in the $.proxy function call
4847 .append( "<h3>Hello " + one.type + ":</h3>" )
4848
4849 // The `this` keyword refers to `me`
4850 // (the 2nd, context, argument of $.proxy)
4851 .append( "I am a " + this.type + ", " )
4852
4853 // `two` maps to `they`, the 2nd additional
4854 // argument in the $.proxy function call
4855 .append( "and they are " + two.type + ".<br>" )
4856
4857 // The event type is "click"
4858 .append( "Thanks for " + event.type + "ing." )
4859
4860 // The clicked element is `event.target`,
4861 // and its type is "button"
4862 .append( "the " + event.target.type + "." );
4863 }
4864};
4865
4866var you = { type: "cat" };
4867var they = { type: "fish" };
4868
4869// Set up handler to execute me.test() in the context
4870// of `me`, with `you` and `they` as additional arguments
4871var proxy = $.proxy( me.test, me, you, they );
4872
4873$( "#test" )
4874 .on( "click", proxy );
4875</script>
4876
4877</body>
4878</html>
4879```
4880 */
4881 proxy<TContext,
4882 TReturn,
4883 A>(funсtion: (this: TContext, a: A) => TReturn,
4884 context: TContext,
4885 a: A): () => TReturn;
4886 /**
4887 * Takes a function and returns a new one that will always have a particular context.
4888 * @param funсtion The function whose context will be changed.
4889 * @param context The object to which the context (`this`) of the function should be set.
4890 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4891 * @since 1.4
4892 * @since 1.6
4893 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4894 * @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.
4895```html
4896<!doctype html>
4897<html lang="en">
4898<head>
4899 <meta charset="utf-8">
4900 <title>jQuery.proxy demo</title>
4901 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4902</head>
4903<body>
4904
4905<p><button type="button" id="test">Test</button></p>
4906<div id="log"></div>
4907
4908<script>
4909var me = {
4910 type: "zombie",
4911 test: function( event ) {
4912 // Without proxy, `this` would refer to the event target
4913 // use event.target to reference that element.
4914 var element = event.target;
4915 $( element ).css( "background-color", "red" );
4916
4917 // With proxy, `this` refers to the me object encapsulating
4918 // this function.
4919 $( "#log" ).append( "Hello " + this.type + "<br>" );
4920 $( "#test" ).off( "click", this.test );
4921 }
4922};
4923
4924var you = {
4925 type: "person",
4926 test: function( event ) {
4927 $( "#log" ).append( this.type + " " );
4928 }
4929};
4930
4931// Execute you.test() in the context of the `you` object
4932// no matter where it is called
4933// i.e. the `this` keyword will refer to `you`
4934var youClick = $.proxy( you.test, you );
4935
4936// attach click handlers to #test
4937$( "#test" )
4938 // this === "zombie"; handler unbound after first click
4939 .on( "click", $.proxy( me.test, me ) )
4940
4941 // this === "person"
4942 .on( "click", youClick )
4943
4944 // this === "zombie"
4945 .on( "click", $.proxy( you.test, me ) )
4946
4947 // this === "<button> element"
4948 .on( "click", you.test );
4949</script>
4950
4951</body>
4952</html>
4953```
4954 * @example ​ ````Change the context of a function bound to the click handler,
4955```html
4956<!doctype html>
4957<html lang="en">
4958<head>
4959 <meta charset="utf-8">
4960 <title>jQuery.proxy demo</title>
4961 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4962</head>
4963<body>
4964
4965<p><button type="button" id="test">Test</button></p>
4966<div id="log"></div>
4967
4968<script>
4969var me = {
4970 // I'm a dog
4971 type: "dog",
4972
4973 // Note that event comes *after* one and two
4974 test: function( one, two, event ) {
4975 $( "#log" )
4976
4977 // `one` maps to `you`, the 1st additional
4978 // argument in the $.proxy function call
4979 .append( "<h3>Hello " + one.type + ":</h3>" )
4980
4981 // The `this` keyword refers to `me`
4982 // (the 2nd, context, argument of $.proxy)
4983 .append( "I am a " + this.type + ", " )
4984
4985 // `two` maps to `they`, the 2nd additional
4986 // argument in the $.proxy function call
4987 .append( "and they are " + two.type + ".<br>" )
4988
4989 // The event type is "click"
4990 .append( "Thanks for " + event.type + "ing." )
4991
4992 // The clicked element is `event.target`,
4993 // and its type is "button"
4994 .append( "the " + event.target.type + "." );
4995 }
4996};
4997
4998var you = { type: "cat" };
4999var they = { type: "fish" };
5000
5001// Set up handler to execute me.test() in the context
5002// of `me`, with `you` and `they` as additional arguments
5003var proxy = $.proxy( me.test, me, you, they );
5004
5005$( "#test" )
5006 .on( "click", proxy );
5007</script>
5008
5009</body>
5010</html>
5011```
5012 */
5013 proxy<TContext,
5014 TReturn>(funсtion: (this: TContext) => TReturn,
5015 context: TContext): () => TReturn;
5016
5017 // #endregion
5018
5019 // region 1 parameters
5020 // #region 1 parameters
5021
5022 /**
5023 * Takes a function and returns a new one that will always have a particular context.
5024 * @param funсtion The function whose context will be changed.
5025 * @param context The object to which the context (`this`) of the function should be set.
5026 * @param a An argument to be passed to the function referenced in the `function` argument.
5027 * @param b An argument to be passed to the function referenced in the `function` argument.
5028 * @param c An argument to be passed to the function referenced in the `function` argument.
5029 * @param d An argument to be passed to the function referenced in the `function` argument.
5030 * @param e An argument to be passed to the function referenced in the `function` argument.
5031 * @param f An argument to be passed to the function referenced in the `function` argument.
5032 * @param g An argument to be passed to the function referenced in the `function` argument.
5033 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5034 * @since 1.4
5035 * @since 1.6
5036 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5037 * @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.
5038```html
5039<!doctype html>
5040<html lang="en">
5041<head>
5042 <meta charset="utf-8">
5043 <title>jQuery.proxy demo</title>
5044 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5045</head>
5046<body>
5047
5048<p><button type="button" id="test">Test</button></p>
5049<div id="log"></div>
5050
5051<script>
5052var me = {
5053 type: "zombie",
5054 test: function( event ) {
5055 // Without proxy, `this` would refer to the event target
5056 // use event.target to reference that element.
5057 var element = event.target;
5058 $( element ).css( "background-color", "red" );
5059
5060 // With proxy, `this` refers to the me object encapsulating
5061 // this function.
5062 $( "#log" ).append( "Hello " + this.type + "<br>" );
5063 $( "#test" ).off( "click", this.test );
5064 }
5065};
5066
5067var you = {
5068 type: "person",
5069 test: function( event ) {
5070 $( "#log" ).append( this.type + " " );
5071 }
5072};
5073
5074// Execute you.test() in the context of the `you` object
5075// no matter where it is called
5076// i.e. the `this` keyword will refer to `you`
5077var youClick = $.proxy( you.test, you );
5078
5079// attach click handlers to #test
5080$( "#test" )
5081 // this === "zombie"; handler unbound after first click
5082 .on( "click", $.proxy( me.test, me ) )
5083
5084 // this === "person"
5085 .on( "click", youClick )
5086
5087 // this === "zombie"
5088 .on( "click", $.proxy( you.test, me ) )
5089
5090 // this === "<button> element"
5091 .on( "click", you.test );
5092</script>
5093
5094</body>
5095</html>
5096```
5097 * @example ​ ````Change the context of a function bound to the click handler,
5098```html
5099<!doctype html>
5100<html lang="en">
5101<head>
5102 <meta charset="utf-8">
5103 <title>jQuery.proxy demo</title>
5104 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5105</head>
5106<body>
5107
5108<p><button type="button" id="test">Test</button></p>
5109<div id="log"></div>
5110
5111<script>
5112var me = {
5113 // I'm a dog
5114 type: "dog",
5115
5116 // Note that event comes *after* one and two
5117 test: function( one, two, event ) {
5118 $( "#log" )
5119
5120 // `one` maps to `you`, the 1st additional
5121 // argument in the $.proxy function call
5122 .append( "<h3>Hello " + one.type + ":</h3>" )
5123
5124 // The `this` keyword refers to `me`
5125 // (the 2nd, context, argument of $.proxy)
5126 .append( "I am a " + this.type + ", " )
5127
5128 // `two` maps to `they`, the 2nd additional
5129 // argument in the $.proxy function call
5130 .append( "and they are " + two.type + ".<br>" )
5131
5132 // The event type is "click"
5133 .append( "Thanks for " + event.type + "ing." )
5134
5135 // The clicked element is `event.target`,
5136 // and its type is "button"
5137 .append( "the " + event.target.type + "." );
5138 }
5139};
5140
5141var you = { type: "cat" };
5142var they = { type: "fish" };
5143
5144// Set up handler to execute me.test() in the context
5145// of `me`, with `you` and `they` as additional arguments
5146var proxy = $.proxy( me.test, me, you, they );
5147
5148$( "#test" )
5149 .on( "click", proxy );
5150</script>
5151
5152</body>
5153</html>
5154```
5155 */
5156 proxy<TContext,
5157 TReturn,
5158 A, B, C, D, E, F, G,
5159 T>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
5160 t: T) => TReturn,
5161 context: TContext,
5162 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T) => TReturn;
5163 /**
5164 * Takes a function and returns a new one that will always have a particular context.
5165 * @param funсtion The function whose context will be changed.
5166 * @param context The object to which the context (`this`) of the function should be set.
5167 * @param a An argument to be passed to the function referenced in the `function` argument.
5168 * @param b An argument to be passed to the function referenced in the `function` argument.
5169 * @param c An argument to be passed to the function referenced in the `function` argument.
5170 * @param d An argument to be passed to the function referenced in the `function` argument.
5171 * @param e An argument to be passed to the function referenced in the `function` argument.
5172 * @param f An argument to be passed to the function referenced in the `function` argument.
5173 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5174 * @since 1.4
5175 * @since 1.6
5176 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5177 * @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.
5178```html
5179<!doctype html>
5180<html lang="en">
5181<head>
5182 <meta charset="utf-8">
5183 <title>jQuery.proxy demo</title>
5184 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5185</head>
5186<body>
5187
5188<p><button type="button" id="test">Test</button></p>
5189<div id="log"></div>
5190
5191<script>
5192var me = {
5193 type: "zombie",
5194 test: function( event ) {
5195 // Without proxy, `this` would refer to the event target
5196 // use event.target to reference that element.
5197 var element = event.target;
5198 $( element ).css( "background-color", "red" );
5199
5200 // With proxy, `this` refers to the me object encapsulating
5201 // this function.
5202 $( "#log" ).append( "Hello " + this.type + "<br>" );
5203 $( "#test" ).off( "click", this.test );
5204 }
5205};
5206
5207var you = {
5208 type: "person",
5209 test: function( event ) {
5210 $( "#log" ).append( this.type + " " );
5211 }
5212};
5213
5214// Execute you.test() in the context of the `you` object
5215// no matter where it is called
5216// i.e. the `this` keyword will refer to `you`
5217var youClick = $.proxy( you.test, you );
5218
5219// attach click handlers to #test
5220$( "#test" )
5221 // this === "zombie"; handler unbound after first click
5222 .on( "click", $.proxy( me.test, me ) )
5223
5224 // this === "person"
5225 .on( "click", youClick )
5226
5227 // this === "zombie"
5228 .on( "click", $.proxy( you.test, me ) )
5229
5230 // this === "<button> element"
5231 .on( "click", you.test );
5232</script>
5233
5234</body>
5235</html>
5236```
5237 * @example ​ ````Change the context of a function bound to the click handler,
5238```html
5239<!doctype html>
5240<html lang="en">
5241<head>
5242 <meta charset="utf-8">
5243 <title>jQuery.proxy demo</title>
5244 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5245</head>
5246<body>
5247
5248<p><button type="button" id="test">Test</button></p>
5249<div id="log"></div>
5250
5251<script>
5252var me = {
5253 // I'm a dog
5254 type: "dog",
5255
5256 // Note that event comes *after* one and two
5257 test: function( one, two, event ) {
5258 $( "#log" )
5259
5260 // `one` maps to `you`, the 1st additional
5261 // argument in the $.proxy function call
5262 .append( "<h3>Hello " + one.type + ":</h3>" )
5263
5264 // The `this` keyword refers to `me`
5265 // (the 2nd, context, argument of $.proxy)
5266 .append( "I am a " + this.type + ", " )
5267
5268 // `two` maps to `they`, the 2nd additional
5269 // argument in the $.proxy function call
5270 .append( "and they are " + two.type + ".<br>" )
5271
5272 // The event type is "click"
5273 .append( "Thanks for " + event.type + "ing." )
5274
5275 // The clicked element is `event.target`,
5276 // and its type is "button"
5277 .append( "the " + event.target.type + "." );
5278 }
5279};
5280
5281var you = { type: "cat" };
5282var they = { type: "fish" };
5283
5284// Set up handler to execute me.test() in the context
5285// of `me`, with `you` and `they` as additional arguments
5286var proxy = $.proxy( me.test, me, you, they );
5287
5288$( "#test" )
5289 .on( "click", proxy );
5290</script>
5291
5292</body>
5293</html>
5294```
5295 */
5296 proxy<TContext,
5297 TReturn,
5298 A, B, C, D, E, F,
5299 T>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
5300 t: T) => TReturn,
5301 context: TContext,
5302 a: A, b: B, c: C, d: D, e: E, f: F): (t: T) => TReturn;
5303 /**
5304 * Takes a function and returns a new one that will always have a particular context.
5305 * @param funсtion The function whose context will be changed.
5306 * @param context The object to which the context (`this`) of the function should be set.
5307 * @param a An argument to be passed to the function referenced in the `function` argument.
5308 * @param b An argument to be passed to the function referenced in the `function` argument.
5309 * @param c An argument to be passed to the function referenced in the `function` argument.
5310 * @param d An argument to be passed to the function referenced in the `function` argument.
5311 * @param e An argument to be passed to the function referenced in the `function` argument.
5312 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5313 * @since 1.4
5314 * @since 1.6
5315 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5316 * @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.
5317```html
5318<!doctype html>
5319<html lang="en">
5320<head>
5321 <meta charset="utf-8">
5322 <title>jQuery.proxy demo</title>
5323 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5324</head>
5325<body>
5326
5327<p><button type="button" id="test">Test</button></p>
5328<div id="log"></div>
5329
5330<script>
5331var me = {
5332 type: "zombie",
5333 test: function( event ) {
5334 // Without proxy, `this` would refer to the event target
5335 // use event.target to reference that element.
5336 var element = event.target;
5337 $( element ).css( "background-color", "red" );
5338
5339 // With proxy, `this` refers to the me object encapsulating
5340 // this function.
5341 $( "#log" ).append( "Hello " + this.type + "<br>" );
5342 $( "#test" ).off( "click", this.test );
5343 }
5344};
5345
5346var you = {
5347 type: "person",
5348 test: function( event ) {
5349 $( "#log" ).append( this.type + " " );
5350 }
5351};
5352
5353// Execute you.test() in the context of the `you` object
5354// no matter where it is called
5355// i.e. the `this` keyword will refer to `you`
5356var youClick = $.proxy( you.test, you );
5357
5358// attach click handlers to #test
5359$( "#test" )
5360 // this === "zombie"; handler unbound after first click
5361 .on( "click", $.proxy( me.test, me ) )
5362
5363 // this === "person"
5364 .on( "click", youClick )
5365
5366 // this === "zombie"
5367 .on( "click", $.proxy( you.test, me ) )
5368
5369 // this === "<button> element"
5370 .on( "click", you.test );
5371</script>
5372
5373</body>
5374</html>
5375```
5376 * @example ​ ````Change the context of a function bound to the click handler,
5377```html
5378<!doctype html>
5379<html lang="en">
5380<head>
5381 <meta charset="utf-8">
5382 <title>jQuery.proxy demo</title>
5383 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5384</head>
5385<body>
5386
5387<p><button type="button" id="test">Test</button></p>
5388<div id="log"></div>
5389
5390<script>
5391var me = {
5392 // I'm a dog
5393 type: "dog",
5394
5395 // Note that event comes *after* one and two
5396 test: function( one, two, event ) {
5397 $( "#log" )
5398
5399 // `one` maps to `you`, the 1st additional
5400 // argument in the $.proxy function call
5401 .append( "<h3>Hello " + one.type + ":</h3>" )
5402
5403 // The `this` keyword refers to `me`
5404 // (the 2nd, context, argument of $.proxy)
5405 .append( "I am a " + this.type + ", " )
5406
5407 // `two` maps to `they`, the 2nd additional
5408 // argument in the $.proxy function call
5409 .append( "and they are " + two.type + ".<br>" )
5410
5411 // The event type is "click"
5412 .append( "Thanks for " + event.type + "ing." )
5413
5414 // The clicked element is `event.target`,
5415 // and its type is "button"
5416 .append( "the " + event.target.type + "." );
5417 }
5418};
5419
5420var you = { type: "cat" };
5421var they = { type: "fish" };
5422
5423// Set up handler to execute me.test() in the context
5424// of `me`, with `you` and `they` as additional arguments
5425var proxy = $.proxy( me.test, me, you, they );
5426
5427$( "#test" )
5428 .on( "click", proxy );
5429</script>
5430
5431</body>
5432</html>
5433```
5434 */
5435 proxy<TContext,
5436 TReturn,
5437 A, B, C, D, E,
5438 T>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
5439 t: T) => TReturn,
5440 context: TContext,
5441 a: A, b: B, c: C, d: D, e: E): (t: T) => TReturn;
5442 /**
5443 * Takes a function and returns a new one that will always have a particular context.
5444 * @param funсtion The function whose context will be changed.
5445 * @param context The object to which the context (`this`) of the function should be set.
5446 * @param a An argument to be passed to the function referenced in the `function` argument.
5447 * @param b An argument to be passed to the function referenced in the `function` argument.
5448 * @param c An argument to be passed to the function referenced in the `function` argument.
5449 * @param d An argument to be passed to the function referenced in the `function` argument.
5450 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5451 * @since 1.4
5452 * @since 1.6
5453 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5454 * @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.
5455```html
5456<!doctype html>
5457<html lang="en">
5458<head>
5459 <meta charset="utf-8">
5460 <title>jQuery.proxy demo</title>
5461 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5462</head>
5463<body>
5464
5465<p><button type="button" id="test">Test</button></p>
5466<div id="log"></div>
5467
5468<script>
5469var me = {
5470 type: "zombie",
5471 test: function( event ) {
5472 // Without proxy, `this` would refer to the event target
5473 // use event.target to reference that element.
5474 var element = event.target;
5475 $( element ).css( "background-color", "red" );
5476
5477 // With proxy, `this` refers to the me object encapsulating
5478 // this function.
5479 $( "#log" ).append( "Hello " + this.type + "<br>" );
5480 $( "#test" ).off( "click", this.test );
5481 }
5482};
5483
5484var you = {
5485 type: "person",
5486 test: function( event ) {
5487 $( "#log" ).append( this.type + " " );
5488 }
5489};
5490
5491// Execute you.test() in the context of the `you` object
5492// no matter where it is called
5493// i.e. the `this` keyword will refer to `you`
5494var youClick = $.proxy( you.test, you );
5495
5496// attach click handlers to #test
5497$( "#test" )
5498 // this === "zombie"; handler unbound after first click
5499 .on( "click", $.proxy( me.test, me ) )
5500
5501 // this === "person"
5502 .on( "click", youClick )
5503
5504 // this === "zombie"
5505 .on( "click", $.proxy( you.test, me ) )
5506
5507 // this === "<button> element"
5508 .on( "click", you.test );
5509</script>
5510
5511</body>
5512</html>
5513```
5514 * @example ​ ````Change the context of a function bound to the click handler,
5515```html
5516<!doctype html>
5517<html lang="en">
5518<head>
5519 <meta charset="utf-8">
5520 <title>jQuery.proxy demo</title>
5521 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5522</head>
5523<body>
5524
5525<p><button type="button" id="test">Test</button></p>
5526<div id="log"></div>
5527
5528<script>
5529var me = {
5530 // I'm a dog
5531 type: "dog",
5532
5533 // Note that event comes *after* one and two
5534 test: function( one, two, event ) {
5535 $( "#log" )
5536
5537 // `one` maps to `you`, the 1st additional
5538 // argument in the $.proxy function call
5539 .append( "<h3>Hello " + one.type + ":</h3>" )
5540
5541 // The `this` keyword refers to `me`
5542 // (the 2nd, context, argument of $.proxy)
5543 .append( "I am a " + this.type + ", " )
5544
5545 // `two` maps to `they`, the 2nd additional
5546 // argument in the $.proxy function call
5547 .append( "and they are " + two.type + ".<br>" )
5548
5549 // The event type is "click"
5550 .append( "Thanks for " + event.type + "ing." )
5551
5552 // The clicked element is `event.target`,
5553 // and its type is "button"
5554 .append( "the " + event.target.type + "." );
5555 }
5556};
5557
5558var you = { type: "cat" };
5559var they = { type: "fish" };
5560
5561// Set up handler to execute me.test() in the context
5562// of `me`, with `you` and `they` as additional arguments
5563var proxy = $.proxy( me.test, me, you, they );
5564
5565$( "#test" )
5566 .on( "click", proxy );
5567</script>
5568
5569</body>
5570</html>
5571```
5572 */
5573 proxy<TContext,
5574 TReturn,
5575 A, B, C, D,
5576 T>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
5577 t: T) => TReturn,
5578 context: TContext,
5579 a: A, b: B, c: C, d: D): (t: T) => TReturn;
5580 /**
5581 * Takes a function and returns a new one that will always have a particular context.
5582 * @param funсtion The function whose context will be changed.
5583 * @param context The object to which the context (`this`) of the function should be set.
5584 * @param a An argument to be passed to the function referenced in the `function` argument.
5585 * @param b An argument to be passed to the function referenced in the `function` argument.
5586 * @param c An argument to be passed to the function referenced in the `function` argument.
5587 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5588 * @since 1.4
5589 * @since 1.6
5590 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5591 * @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.
5592```html
5593<!doctype html>
5594<html lang="en">
5595<head>
5596 <meta charset="utf-8">
5597 <title>jQuery.proxy demo</title>
5598 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5599</head>
5600<body>
5601
5602<p><button type="button" id="test">Test</button></p>
5603<div id="log"></div>
5604
5605<script>
5606var me = {
5607 type: "zombie",
5608 test: function( event ) {
5609 // Without proxy, `this` would refer to the event target
5610 // use event.target to reference that element.
5611 var element = event.target;
5612 $( element ).css( "background-color", "red" );
5613
5614 // With proxy, `this` refers to the me object encapsulating
5615 // this function.
5616 $( "#log" ).append( "Hello " + this.type + "<br>" );
5617 $( "#test" ).off( "click", this.test );
5618 }
5619};
5620
5621var you = {
5622 type: "person",
5623 test: function( event ) {
5624 $( "#log" ).append( this.type + " " );
5625 }
5626};
5627
5628// Execute you.test() in the context of the `you` object
5629// no matter where it is called
5630// i.e. the `this` keyword will refer to `you`
5631var youClick = $.proxy( you.test, you );
5632
5633// attach click handlers to #test
5634$( "#test" )
5635 // this === "zombie"; handler unbound after first click
5636 .on( "click", $.proxy( me.test, me ) )
5637
5638 // this === "person"
5639 .on( "click", youClick )
5640
5641 // this === "zombie"
5642 .on( "click", $.proxy( you.test, me ) )
5643
5644 // this === "<button> element"
5645 .on( "click", you.test );
5646</script>
5647
5648</body>
5649</html>
5650```
5651 * @example ​ ````Change the context of a function bound to the click handler,
5652```html
5653<!doctype html>
5654<html lang="en">
5655<head>
5656 <meta charset="utf-8">
5657 <title>jQuery.proxy demo</title>
5658 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5659</head>
5660<body>
5661
5662<p><button type="button" id="test">Test</button></p>
5663<div id="log"></div>
5664
5665<script>
5666var me = {
5667 // I'm a dog
5668 type: "dog",
5669
5670 // Note that event comes *after* one and two
5671 test: function( one, two, event ) {
5672 $( "#log" )
5673
5674 // `one` maps to `you`, the 1st additional
5675 // argument in the $.proxy function call
5676 .append( "<h3>Hello " + one.type + ":</h3>" )
5677
5678 // The `this` keyword refers to `me`
5679 // (the 2nd, context, argument of $.proxy)
5680 .append( "I am a " + this.type + ", " )
5681
5682 // `two` maps to `they`, the 2nd additional
5683 // argument in the $.proxy function call
5684 .append( "and they are " + two.type + ".<br>" )
5685
5686 // The event type is "click"
5687 .append( "Thanks for " + event.type + "ing." )
5688
5689 // The clicked element is `event.target`,
5690 // and its type is "button"
5691 .append( "the " + event.target.type + "." );
5692 }
5693};
5694
5695var you = { type: "cat" };
5696var they = { type: "fish" };
5697
5698// Set up handler to execute me.test() in the context
5699// of `me`, with `you` and `they` as additional arguments
5700var proxy = $.proxy( me.test, me, you, they );
5701
5702$( "#test" )
5703 .on( "click", proxy );
5704</script>
5705
5706</body>
5707</html>
5708```
5709 */
5710 proxy<TContext,
5711 TReturn,
5712 A, B, C,
5713 T>(funсtion: (this: TContext, a: A, b: B, c: C,
5714 t: T) => TReturn,
5715 context: TContext,
5716 a: A, b: B, c: C): (t: T) => TReturn;
5717 /**
5718 * Takes a function and returns a new one that will always have a particular context.
5719 * @param funсtion The function whose context will be changed.
5720 * @param context The object to which the context (`this`) of the function should be set.
5721 * @param a An argument to be passed to the function referenced in the `function` argument.
5722 * @param b An argument to be passed to the function referenced in the `function` argument.
5723 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5724 * @since 1.4
5725 * @since 1.6
5726 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5727 * @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.
5728```html
5729<!doctype html>
5730<html lang="en">
5731<head>
5732 <meta charset="utf-8">
5733 <title>jQuery.proxy demo</title>
5734 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5735</head>
5736<body>
5737
5738<p><button type="button" id="test">Test</button></p>
5739<div id="log"></div>
5740
5741<script>
5742var me = {
5743 type: "zombie",
5744 test: function( event ) {
5745 // Without proxy, `this` would refer to the event target
5746 // use event.target to reference that element.
5747 var element = event.target;
5748 $( element ).css( "background-color", "red" );
5749
5750 // With proxy, `this` refers to the me object encapsulating
5751 // this function.
5752 $( "#log" ).append( "Hello " + this.type + "<br>" );
5753 $( "#test" ).off( "click", this.test );
5754 }
5755};
5756
5757var you = {
5758 type: "person",
5759 test: function( event ) {
5760 $( "#log" ).append( this.type + " " );
5761 }
5762};
5763
5764// Execute you.test() in the context of the `you` object
5765// no matter where it is called
5766// i.e. the `this` keyword will refer to `you`
5767var youClick = $.proxy( you.test, you );
5768
5769// attach click handlers to #test
5770$( "#test" )
5771 // this === "zombie"; handler unbound after first click
5772 .on( "click", $.proxy( me.test, me ) )
5773
5774 // this === "person"
5775 .on( "click", youClick )
5776
5777 // this === "zombie"
5778 .on( "click", $.proxy( you.test, me ) )
5779
5780 // this === "<button> element"
5781 .on( "click", you.test );
5782</script>
5783
5784</body>
5785</html>
5786```
5787 * @example ​ ````Change the context of a function bound to the click handler,
5788```html
5789<!doctype html>
5790<html lang="en">
5791<head>
5792 <meta charset="utf-8">
5793 <title>jQuery.proxy demo</title>
5794 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5795</head>
5796<body>
5797
5798<p><button type="button" id="test">Test</button></p>
5799<div id="log"></div>
5800
5801<script>
5802var me = {
5803 // I'm a dog
5804 type: "dog",
5805
5806 // Note that event comes *after* one and two
5807 test: function( one, two, event ) {
5808 $( "#log" )
5809
5810 // `one` maps to `you`, the 1st additional
5811 // argument in the $.proxy function call
5812 .append( "<h3>Hello " + one.type + ":</h3>" )
5813
5814 // The `this` keyword refers to `me`
5815 // (the 2nd, context, argument of $.proxy)
5816 .append( "I am a " + this.type + ", " )
5817
5818 // `two` maps to `they`, the 2nd additional
5819 // argument in the $.proxy function call
5820 .append( "and they are " + two.type + ".<br>" )
5821
5822 // The event type is "click"
5823 .append( "Thanks for " + event.type + "ing." )
5824
5825 // The clicked element is `event.target`,
5826 // and its type is "button"
5827 .append( "the " + event.target.type + "." );
5828 }
5829};
5830
5831var you = { type: "cat" };
5832var they = { type: "fish" };
5833
5834// Set up handler to execute me.test() in the context
5835// of `me`, with `you` and `they` as additional arguments
5836var proxy = $.proxy( me.test, me, you, they );
5837
5838$( "#test" )
5839 .on( "click", proxy );
5840</script>
5841
5842</body>
5843</html>
5844```
5845 */
5846 proxy<TContext,
5847 TReturn,
5848 A, B,
5849 T>(funсtion: (this: TContext, a: A, b: B,
5850 t: T) => TReturn,
5851 context: TContext,
5852 a: A, b: B): (t: T) => TReturn;
5853 /**
5854 * Takes a function and returns a new one that will always have a particular context.
5855 * @param funсtion The function whose context will be changed.
5856 * @param context The object to which the context (`this`) of the function should be set.
5857 * @param a An argument to be passed to the function referenced in the `function` argument.
5858 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5859 * @since 1.4
5860 * @since 1.6
5861 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5862 * @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.
5863```html
5864<!doctype html>
5865<html lang="en">
5866<head>
5867 <meta charset="utf-8">
5868 <title>jQuery.proxy demo</title>
5869 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5870</head>
5871<body>
5872
5873<p><button type="button" id="test">Test</button></p>
5874<div id="log"></div>
5875
5876<script>
5877var me = {
5878 type: "zombie",
5879 test: function( event ) {
5880 // Without proxy, `this` would refer to the event target
5881 // use event.target to reference that element.
5882 var element = event.target;
5883 $( element ).css( "background-color", "red" );
5884
5885 // With proxy, `this` refers to the me object encapsulating
5886 // this function.
5887 $( "#log" ).append( "Hello " + this.type + "<br>" );
5888 $( "#test" ).off( "click", this.test );
5889 }
5890};
5891
5892var you = {
5893 type: "person",
5894 test: function( event ) {
5895 $( "#log" ).append( this.type + " " );
5896 }
5897};
5898
5899// Execute you.test() in the context of the `you` object
5900// no matter where it is called
5901// i.e. the `this` keyword will refer to `you`
5902var youClick = $.proxy( you.test, you );
5903
5904// attach click handlers to #test
5905$( "#test" )
5906 // this === "zombie"; handler unbound after first click
5907 .on( "click", $.proxy( me.test, me ) )
5908
5909 // this === "person"
5910 .on( "click", youClick )
5911
5912 // this === "zombie"
5913 .on( "click", $.proxy( you.test, me ) )
5914
5915 // this === "<button> element"
5916 .on( "click", you.test );
5917</script>
5918
5919</body>
5920</html>
5921```
5922 * @example ​ ````Change the context of a function bound to the click handler,
5923```html
5924<!doctype html>
5925<html lang="en">
5926<head>
5927 <meta charset="utf-8">
5928 <title>jQuery.proxy demo</title>
5929 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5930</head>
5931<body>
5932
5933<p><button type="button" id="test">Test</button></p>
5934<div id="log"></div>
5935
5936<script>
5937var me = {
5938 // I'm a dog
5939 type: "dog",
5940
5941 // Note that event comes *after* one and two
5942 test: function( one, two, event ) {
5943 $( "#log" )
5944
5945 // `one` maps to `you`, the 1st additional
5946 // argument in the $.proxy function call
5947 .append( "<h3>Hello " + one.type + ":</h3>" )
5948
5949 // The `this` keyword refers to `me`
5950 // (the 2nd, context, argument of $.proxy)
5951 .append( "I am a " + this.type + ", " )
5952
5953 // `two` maps to `they`, the 2nd additional
5954 // argument in the $.proxy function call
5955 .append( "and they are " + two.type + ".<br>" )
5956
5957 // The event type is "click"
5958 .append( "Thanks for " + event.type + "ing." )
5959
5960 // The clicked element is `event.target`,
5961 // and its type is "button"
5962 .append( "the " + event.target.type + "." );
5963 }
5964};
5965
5966var you = { type: "cat" };
5967var they = { type: "fish" };
5968
5969// Set up handler to execute me.test() in the context
5970// of `me`, with `you` and `they` as additional arguments
5971var proxy = $.proxy( me.test, me, you, they );
5972
5973$( "#test" )
5974 .on( "click", proxy );
5975</script>
5976
5977</body>
5978</html>
5979```
5980 */
5981 proxy<TContext,
5982 TReturn,
5983 A,
5984 T>(funсtion: (this: TContext, a: A,
5985 t: T) => TReturn,
5986 context: TContext,
5987 a: A): (t: T) => TReturn;
5988 /**
5989 * Takes a function and returns a new one that will always have a particular context.
5990 * @param funсtion The function whose context will be changed.
5991 * @param context The object to which the context (`this`) of the function should be set.
5992 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5993 * @since 1.4
5994 * @since 1.6
5995 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5996 * @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.
5997```html
5998<!doctype html>
5999<html lang="en">
6000<head>
6001 <meta charset="utf-8">
6002 <title>jQuery.proxy demo</title>
6003 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6004</head>
6005<body>
6006
6007<p><button type="button" id="test">Test</button></p>
6008<div id="log"></div>
6009
6010<script>
6011var me = {
6012 type: "zombie",
6013 test: function( event ) {
6014 // Without proxy, `this` would refer to the event target
6015 // use event.target to reference that element.
6016 var element = event.target;
6017 $( element ).css( "background-color", "red" );
6018
6019 // With proxy, `this` refers to the me object encapsulating
6020 // this function.
6021 $( "#log" ).append( "Hello " + this.type + "<br>" );
6022 $( "#test" ).off( "click", this.test );
6023 }
6024};
6025
6026var you = {
6027 type: "person",
6028 test: function( event ) {
6029 $( "#log" ).append( this.type + " " );
6030 }
6031};
6032
6033// Execute you.test() in the context of the `you` object
6034// no matter where it is called
6035// i.e. the `this` keyword will refer to `you`
6036var youClick = $.proxy( you.test, you );
6037
6038// attach click handlers to #test
6039$( "#test" )
6040 // this === "zombie"; handler unbound after first click
6041 .on( "click", $.proxy( me.test, me ) )
6042
6043 // this === "person"
6044 .on( "click", youClick )
6045
6046 // this === "zombie"
6047 .on( "click", $.proxy( you.test, me ) )
6048
6049 // this === "<button> element"
6050 .on( "click", you.test );
6051</script>
6052
6053</body>
6054</html>
6055```
6056 * @example ​ ````Change the context of a function bound to the click handler,
6057```html
6058<!doctype html>
6059<html lang="en">
6060<head>
6061 <meta charset="utf-8">
6062 <title>jQuery.proxy demo</title>
6063 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6064</head>
6065<body>
6066
6067<p><button type="button" id="test">Test</button></p>
6068<div id="log"></div>
6069
6070<script>
6071var me = {
6072 // I'm a dog
6073 type: "dog",
6074
6075 // Note that event comes *after* one and two
6076 test: function( one, two, event ) {
6077 $( "#log" )
6078
6079 // `one` maps to `you`, the 1st additional
6080 // argument in the $.proxy function call
6081 .append( "<h3>Hello " + one.type + ":</h3>" )
6082
6083 // The `this` keyword refers to `me`
6084 // (the 2nd, context, argument of $.proxy)
6085 .append( "I am a " + this.type + ", " )
6086
6087 // `two` maps to `they`, the 2nd additional
6088 // argument in the $.proxy function call
6089 .append( "and they are " + two.type + ".<br>" )
6090
6091 // The event type is "click"
6092 .append( "Thanks for " + event.type + "ing." )
6093
6094 // The clicked element is `event.target`,
6095 // and its type is "button"
6096 .append( "the " + event.target.type + "." );
6097 }
6098};
6099
6100var you = { type: "cat" };
6101var they = { type: "fish" };
6102
6103// Set up handler to execute me.test() in the context
6104// of `me`, with `you` and `they` as additional arguments
6105var proxy = $.proxy( me.test, me, you, they );
6106
6107$( "#test" )
6108 .on( "click", proxy );
6109</script>
6110
6111</body>
6112</html>
6113```
6114 */
6115 proxy<TContext,
6116 TReturn,
6117 T>(funсtion: (this: TContext, t: T) => TReturn,
6118 context: TContext): (t: T) => TReturn;
6119
6120 // #endregion
6121
6122 // region 2 parameters
6123 // #region 2 parameters
6124
6125 /**
6126 * Takes a function and returns a new one that will always have a particular context.
6127 * @param funсtion The function whose context will be changed.
6128 * @param context The object to which the context (`this`) of the function should be set.
6129 * @param a An argument to be passed to the function referenced in the `function` argument.
6130 * @param b An argument to be passed to the function referenced in the `function` argument.
6131 * @param c An argument to be passed to the function referenced in the `function` argument.
6132 * @param d An argument to be passed to the function referenced in the `function` argument.
6133 * @param e An argument to be passed to the function referenced in the `function` argument.
6134 * @param f An argument to be passed to the function referenced in the `function` argument.
6135 * @param g An argument to be passed to the function referenced in the `function` argument.
6136 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6137 * @since 1.4
6138 * @since 1.6
6139 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6140 * @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.
6141```html
6142<!doctype html>
6143<html lang="en">
6144<head>
6145 <meta charset="utf-8">
6146 <title>jQuery.proxy demo</title>
6147 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6148</head>
6149<body>
6150
6151<p><button type="button" id="test">Test</button></p>
6152<div id="log"></div>
6153
6154<script>
6155var me = {
6156 type: "zombie",
6157 test: function( event ) {
6158 // Without proxy, `this` would refer to the event target
6159 // use event.target to reference that element.
6160 var element = event.target;
6161 $( element ).css( "background-color", "red" );
6162
6163 // With proxy, `this` refers to the me object encapsulating
6164 // this function.
6165 $( "#log" ).append( "Hello " + this.type + "<br>" );
6166 $( "#test" ).off( "click", this.test );
6167 }
6168};
6169
6170var you = {
6171 type: "person",
6172 test: function( event ) {
6173 $( "#log" ).append( this.type + " " );
6174 }
6175};
6176
6177// Execute you.test() in the context of the `you` object
6178// no matter where it is called
6179// i.e. the `this` keyword will refer to `you`
6180var youClick = $.proxy( you.test, you );
6181
6182// attach click handlers to #test
6183$( "#test" )
6184 // this === "zombie"; handler unbound after first click
6185 .on( "click", $.proxy( me.test, me ) )
6186
6187 // this === "person"
6188 .on( "click", youClick )
6189
6190 // this === "zombie"
6191 .on( "click", $.proxy( you.test, me ) )
6192
6193 // this === "<button> element"
6194 .on( "click", you.test );
6195</script>
6196
6197</body>
6198</html>
6199```
6200 * @example ​ ````Change the context of a function bound to the click handler,
6201```html
6202<!doctype html>
6203<html lang="en">
6204<head>
6205 <meta charset="utf-8">
6206 <title>jQuery.proxy demo</title>
6207 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6208</head>
6209<body>
6210
6211<p><button type="button" id="test">Test</button></p>
6212<div id="log"></div>
6213
6214<script>
6215var me = {
6216 // I'm a dog
6217 type: "dog",
6218
6219 // Note that event comes *after* one and two
6220 test: function( one, two, event ) {
6221 $( "#log" )
6222
6223 // `one` maps to `you`, the 1st additional
6224 // argument in the $.proxy function call
6225 .append( "<h3>Hello " + one.type + ":</h3>" )
6226
6227 // The `this` keyword refers to `me`
6228 // (the 2nd, context, argument of $.proxy)
6229 .append( "I am a " + this.type + ", " )
6230
6231 // `two` maps to `they`, the 2nd additional
6232 // argument in the $.proxy function call
6233 .append( "and they are " + two.type + ".<br>" )
6234
6235 // The event type is "click"
6236 .append( "Thanks for " + event.type + "ing." )
6237
6238 // The clicked element is `event.target`,
6239 // and its type is "button"
6240 .append( "the " + event.target.type + "." );
6241 }
6242};
6243
6244var you = { type: "cat" };
6245var they = { type: "fish" };
6246
6247// Set up handler to execute me.test() in the context
6248// of `me`, with `you` and `they` as additional arguments
6249var proxy = $.proxy( me.test, me, you, they );
6250
6251$( "#test" )
6252 .on( "click", proxy );
6253</script>
6254
6255</body>
6256</html>
6257```
6258 */
6259 proxy<TContext,
6260 TReturn,
6261 A, B, C, D, E, F, G,
6262 T, U>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
6263 t: T, u: U) => TReturn,
6264 context: TContext,
6265 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U) => TReturn;
6266 /**
6267 * Takes a function and returns a new one that will always have a particular context.
6268 * @param funсtion The function whose context will be changed.
6269 * @param context The object to which the context (`this`) of the function should be set.
6270 * @param a An argument to be passed to the function referenced in the `function` argument.
6271 * @param b An argument to be passed to the function referenced in the `function` argument.
6272 * @param c An argument to be passed to the function referenced in the `function` argument.
6273 * @param d An argument to be passed to the function referenced in the `function` argument.
6274 * @param e An argument to be passed to the function referenced in the `function` argument.
6275 * @param f An argument to be passed to the function referenced in the `function` argument.
6276 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6277 * @since 1.4
6278 * @since 1.6
6279 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6280 * @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.
6281```html
6282<!doctype html>
6283<html lang="en">
6284<head>
6285 <meta charset="utf-8">
6286 <title>jQuery.proxy demo</title>
6287 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6288</head>
6289<body>
6290
6291<p><button type="button" id="test">Test</button></p>
6292<div id="log"></div>
6293
6294<script>
6295var me = {
6296 type: "zombie",
6297 test: function( event ) {
6298 // Without proxy, `this` would refer to the event target
6299 // use event.target to reference that element.
6300 var element = event.target;
6301 $( element ).css( "background-color", "red" );
6302
6303 // With proxy, `this` refers to the me object encapsulating
6304 // this function.
6305 $( "#log" ).append( "Hello " + this.type + "<br>" );
6306 $( "#test" ).off( "click", this.test );
6307 }
6308};
6309
6310var you = {
6311 type: "person",
6312 test: function( event ) {
6313 $( "#log" ).append( this.type + " " );
6314 }
6315};
6316
6317// Execute you.test() in the context of the `you` object
6318// no matter where it is called
6319// i.e. the `this` keyword will refer to `you`
6320var youClick = $.proxy( you.test, you );
6321
6322// attach click handlers to #test
6323$( "#test" )
6324 // this === "zombie"; handler unbound after first click
6325 .on( "click", $.proxy( me.test, me ) )
6326
6327 // this === "person"
6328 .on( "click", youClick )
6329
6330 // this === "zombie"
6331 .on( "click", $.proxy( you.test, me ) )
6332
6333 // this === "<button> element"
6334 .on( "click", you.test );
6335</script>
6336
6337</body>
6338</html>
6339```
6340 * @example ​ ````Change the context of a function bound to the click handler,
6341```html
6342<!doctype html>
6343<html lang="en">
6344<head>
6345 <meta charset="utf-8">
6346 <title>jQuery.proxy demo</title>
6347 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6348</head>
6349<body>
6350
6351<p><button type="button" id="test">Test</button></p>
6352<div id="log"></div>
6353
6354<script>
6355var me = {
6356 // I'm a dog
6357 type: "dog",
6358
6359 // Note that event comes *after* one and two
6360 test: function( one, two, event ) {
6361 $( "#log" )
6362
6363 // `one` maps to `you`, the 1st additional
6364 // argument in the $.proxy function call
6365 .append( "<h3>Hello " + one.type + ":</h3>" )
6366
6367 // The `this` keyword refers to `me`
6368 // (the 2nd, context, argument of $.proxy)
6369 .append( "I am a " + this.type + ", " )
6370
6371 // `two` maps to `they`, the 2nd additional
6372 // argument in the $.proxy function call
6373 .append( "and they are " + two.type + ".<br>" )
6374
6375 // The event type is "click"
6376 .append( "Thanks for " + event.type + "ing." )
6377
6378 // The clicked element is `event.target`,
6379 // and its type is "button"
6380 .append( "the " + event.target.type + "." );
6381 }
6382};
6383
6384var you = { type: "cat" };
6385var they = { type: "fish" };
6386
6387// Set up handler to execute me.test() in the context
6388// of `me`, with `you` and `they` as additional arguments
6389var proxy = $.proxy( me.test, me, you, they );
6390
6391$( "#test" )
6392 .on( "click", proxy );
6393</script>
6394
6395</body>
6396</html>
6397```
6398 */
6399 proxy<TContext,
6400 TReturn,
6401 A, B, C, D, E, F,
6402 T, U>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
6403 t: T, u: U) => TReturn,
6404 context: TContext,
6405 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U) => TReturn;
6406 /**
6407 * Takes a function and returns a new one that will always have a particular context.
6408 * @param funсtion The function whose context will be changed.
6409 * @param context The object to which the context (`this`) of the function should be set.
6410 * @param a An argument to be passed to the function referenced in the `function` argument.
6411 * @param b An argument to be passed to the function referenced in the `function` argument.
6412 * @param c An argument to be passed to the function referenced in the `function` argument.
6413 * @param d An argument to be passed to the function referenced in the `function` argument.
6414 * @param e An argument to be passed to the function referenced in the `function` argument.
6415 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6416 * @since 1.4
6417 * @since 1.6
6418 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6419 * @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.
6420```html
6421<!doctype html>
6422<html lang="en">
6423<head>
6424 <meta charset="utf-8">
6425 <title>jQuery.proxy demo</title>
6426 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6427</head>
6428<body>
6429
6430<p><button type="button" id="test">Test</button></p>
6431<div id="log"></div>
6432
6433<script>
6434var me = {
6435 type: "zombie",
6436 test: function( event ) {
6437 // Without proxy, `this` would refer to the event target
6438 // use event.target to reference that element.
6439 var element = event.target;
6440 $( element ).css( "background-color", "red" );
6441
6442 // With proxy, `this` refers to the me object encapsulating
6443 // this function.
6444 $( "#log" ).append( "Hello " + this.type + "<br>" );
6445 $( "#test" ).off( "click", this.test );
6446 }
6447};
6448
6449var you = {
6450 type: "person",
6451 test: function( event ) {
6452 $( "#log" ).append( this.type + " " );
6453 }
6454};
6455
6456// Execute you.test() in the context of the `you` object
6457// no matter where it is called
6458// i.e. the `this` keyword will refer to `you`
6459var youClick = $.proxy( you.test, you );
6460
6461// attach click handlers to #test
6462$( "#test" )
6463 // this === "zombie"; handler unbound after first click
6464 .on( "click", $.proxy( me.test, me ) )
6465
6466 // this === "person"
6467 .on( "click", youClick )
6468
6469 // this === "zombie"
6470 .on( "click", $.proxy( you.test, me ) )
6471
6472 // this === "<button> element"
6473 .on( "click", you.test );
6474</script>
6475
6476</body>
6477</html>
6478```
6479 * @example ​ ````Change the context of a function bound to the click handler,
6480```html
6481<!doctype html>
6482<html lang="en">
6483<head>
6484 <meta charset="utf-8">
6485 <title>jQuery.proxy demo</title>
6486 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6487</head>
6488<body>
6489
6490<p><button type="button" id="test">Test</button></p>
6491<div id="log"></div>
6492
6493<script>
6494var me = {
6495 // I'm a dog
6496 type: "dog",
6497
6498 // Note that event comes *after* one and two
6499 test: function( one, two, event ) {
6500 $( "#log" )
6501
6502 // `one` maps to `you`, the 1st additional
6503 // argument in the $.proxy function call
6504 .append( "<h3>Hello " + one.type + ":</h3>" )
6505
6506 // The `this` keyword refers to `me`
6507 // (the 2nd, context, argument of $.proxy)
6508 .append( "I am a " + this.type + ", " )
6509
6510 // `two` maps to `they`, the 2nd additional
6511 // argument in the $.proxy function call
6512 .append( "and they are " + two.type + ".<br>" )
6513
6514 // The event type is "click"
6515 .append( "Thanks for " + event.type + "ing." )
6516
6517 // The clicked element is `event.target`,
6518 // and its type is "button"
6519 .append( "the " + event.target.type + "." );
6520 }
6521};
6522
6523var you = { type: "cat" };
6524var they = { type: "fish" };
6525
6526// Set up handler to execute me.test() in the context
6527// of `me`, with `you` and `they` as additional arguments
6528var proxy = $.proxy( me.test, me, you, they );
6529
6530$( "#test" )
6531 .on( "click", proxy );
6532</script>
6533
6534</body>
6535</html>
6536```
6537 */
6538 proxy<TContext,
6539 TReturn,
6540 A, B, C, D, E,
6541 T, U>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
6542 t: T, u: U) => TReturn,
6543 context: TContext,
6544 a: A, b: B, c: C, d: D, e: E): (t: T, u: U) => TReturn;
6545 /**
6546 * Takes a function and returns a new one that will always have a particular context.
6547 * @param funсtion The function whose context will be changed.
6548 * @param context The object to which the context (`this`) of the function should be set.
6549 * @param a An argument to be passed to the function referenced in the `function` argument.
6550 * @param b An argument to be passed to the function referenced in the `function` argument.
6551 * @param c An argument to be passed to the function referenced in the `function` argument.
6552 * @param d An argument to be passed to the function referenced in the `function` argument.
6553 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6554 * @since 1.4
6555 * @since 1.6
6556 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6557 * @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.
6558```html
6559<!doctype html>
6560<html lang="en">
6561<head>
6562 <meta charset="utf-8">
6563 <title>jQuery.proxy demo</title>
6564 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6565</head>
6566<body>
6567
6568<p><button type="button" id="test">Test</button></p>
6569<div id="log"></div>
6570
6571<script>
6572var me = {
6573 type: "zombie",
6574 test: function( event ) {
6575 // Without proxy, `this` would refer to the event target
6576 // use event.target to reference that element.
6577 var element = event.target;
6578 $( element ).css( "background-color", "red" );
6579
6580 // With proxy, `this` refers to the me object encapsulating
6581 // this function.
6582 $( "#log" ).append( "Hello " + this.type + "<br>" );
6583 $( "#test" ).off( "click", this.test );
6584 }
6585};
6586
6587var you = {
6588 type: "person",
6589 test: function( event ) {
6590 $( "#log" ).append( this.type + " " );
6591 }
6592};
6593
6594// Execute you.test() in the context of the `you` object
6595// no matter where it is called
6596// i.e. the `this` keyword will refer to `you`
6597var youClick = $.proxy( you.test, you );
6598
6599// attach click handlers to #test
6600$( "#test" )
6601 // this === "zombie"; handler unbound after first click
6602 .on( "click", $.proxy( me.test, me ) )
6603
6604 // this === "person"
6605 .on( "click", youClick )
6606
6607 // this === "zombie"
6608 .on( "click", $.proxy( you.test, me ) )
6609
6610 // this === "<button> element"
6611 .on( "click", you.test );
6612</script>
6613
6614</body>
6615</html>
6616```
6617 * @example ​ ````Change the context of a function bound to the click handler,
6618```html
6619<!doctype html>
6620<html lang="en">
6621<head>
6622 <meta charset="utf-8">
6623 <title>jQuery.proxy demo</title>
6624 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6625</head>
6626<body>
6627
6628<p><button type="button" id="test">Test</button></p>
6629<div id="log"></div>
6630
6631<script>
6632var me = {
6633 // I'm a dog
6634 type: "dog",
6635
6636 // Note that event comes *after* one and two
6637 test: function( one, two, event ) {
6638 $( "#log" )
6639
6640 // `one` maps to `you`, the 1st additional
6641 // argument in the $.proxy function call
6642 .append( "<h3>Hello " + one.type + ":</h3>" )
6643
6644 // The `this` keyword refers to `me`
6645 // (the 2nd, context, argument of $.proxy)
6646 .append( "I am a " + this.type + ", " )
6647
6648 // `two` maps to `they`, the 2nd additional
6649 // argument in the $.proxy function call
6650 .append( "and they are " + two.type + ".<br>" )
6651
6652 // The event type is "click"
6653 .append( "Thanks for " + event.type + "ing." )
6654
6655 // The clicked element is `event.target`,
6656 // and its type is "button"
6657 .append( "the " + event.target.type + "." );
6658 }
6659};
6660
6661var you = { type: "cat" };
6662var they = { type: "fish" };
6663
6664// Set up handler to execute me.test() in the context
6665// of `me`, with `you` and `they` as additional arguments
6666var proxy = $.proxy( me.test, me, you, they );
6667
6668$( "#test" )
6669 .on( "click", proxy );
6670</script>
6671
6672</body>
6673</html>
6674```
6675 */
6676 proxy<TContext,
6677 TReturn,
6678 A, B, C, D,
6679 T, U>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
6680 t: T, u: U) => TReturn,
6681 context: TContext,
6682 a: A, b: B, c: C, d: D): (t: T, u: U) => TReturn;
6683 /**
6684 * Takes a function and returns a new one that will always have a particular context.
6685 * @param funсtion The function whose context will be changed.
6686 * @param context The object to which the context (`this`) of the function should be set.
6687 * @param a An argument to be passed to the function referenced in the `function` argument.
6688 * @param b An argument to be passed to the function referenced in the `function` argument.
6689 * @param c An argument to be passed to the function referenced in the `function` argument.
6690 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6691 * @since 1.4
6692 * @since 1.6
6693 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6694 * @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.
6695```html
6696<!doctype html>
6697<html lang="en">
6698<head>
6699 <meta charset="utf-8">
6700 <title>jQuery.proxy demo</title>
6701 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6702</head>
6703<body>
6704
6705<p><button type="button" id="test">Test</button></p>
6706<div id="log"></div>
6707
6708<script>
6709var me = {
6710 type: "zombie",
6711 test: function( event ) {
6712 // Without proxy, `this` would refer to the event target
6713 // use event.target to reference that element.
6714 var element = event.target;
6715 $( element ).css( "background-color", "red" );
6716
6717 // With proxy, `this` refers to the me object encapsulating
6718 // this function.
6719 $( "#log" ).append( "Hello " + this.type + "<br>" );
6720 $( "#test" ).off( "click", this.test );
6721 }
6722};
6723
6724var you = {
6725 type: "person",
6726 test: function( event ) {
6727 $( "#log" ).append( this.type + " " );
6728 }
6729};
6730
6731// Execute you.test() in the context of the `you` object
6732// no matter where it is called
6733// i.e. the `this` keyword will refer to `you`
6734var youClick = $.proxy( you.test, you );
6735
6736// attach click handlers to #test
6737$( "#test" )
6738 // this === "zombie"; handler unbound after first click
6739 .on( "click", $.proxy( me.test, me ) )
6740
6741 // this === "person"
6742 .on( "click", youClick )
6743
6744 // this === "zombie"
6745 .on( "click", $.proxy( you.test, me ) )
6746
6747 // this === "<button> element"
6748 .on( "click", you.test );
6749</script>
6750
6751</body>
6752</html>
6753```
6754 * @example ​ ````Change the context of a function bound to the click handler,
6755```html
6756<!doctype html>
6757<html lang="en">
6758<head>
6759 <meta charset="utf-8">
6760 <title>jQuery.proxy demo</title>
6761 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6762</head>
6763<body>
6764
6765<p><button type="button" id="test">Test</button></p>
6766<div id="log"></div>
6767
6768<script>
6769var me = {
6770 // I'm a dog
6771 type: "dog",
6772
6773 // Note that event comes *after* one and two
6774 test: function( one, two, event ) {
6775 $( "#log" )
6776
6777 // `one` maps to `you`, the 1st additional
6778 // argument in the $.proxy function call
6779 .append( "<h3>Hello " + one.type + ":</h3>" )
6780
6781 // The `this` keyword refers to `me`
6782 // (the 2nd, context, argument of $.proxy)
6783 .append( "I am a " + this.type + ", " )
6784
6785 // `two` maps to `they`, the 2nd additional
6786 // argument in the $.proxy function call
6787 .append( "and they are " + two.type + ".<br>" )
6788
6789 // The event type is "click"
6790 .append( "Thanks for " + event.type + "ing." )
6791
6792 // The clicked element is `event.target`,
6793 // and its type is "button"
6794 .append( "the " + event.target.type + "." );
6795 }
6796};
6797
6798var you = { type: "cat" };
6799var they = { type: "fish" };
6800
6801// Set up handler to execute me.test() in the context
6802// of `me`, with `you` and `they` as additional arguments
6803var proxy = $.proxy( me.test, me, you, they );
6804
6805$( "#test" )
6806 .on( "click", proxy );
6807</script>
6808
6809</body>
6810</html>
6811```
6812 */
6813 proxy<TContext,
6814 TReturn,
6815 A, B, C,
6816 T, U>(funсtion: (this: TContext, a: A, b: B, c: C,
6817 t: T, u: U) => TReturn,
6818 context: TContext,
6819 a: A, b: B, c: C): (t: T, u: U) => TReturn;
6820 /**
6821 * Takes a function and returns a new one that will always have a particular context.
6822 * @param funсtion The function whose context will be changed.
6823 * @param context The object to which the context (`this`) of the function should be set.
6824 * @param a An argument to be passed to the function referenced in the `function` argument.
6825 * @param b An argument to be passed to the function referenced in the `function` argument.
6826 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6827 * @since 1.4
6828 * @since 1.6
6829 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6830 * @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.
6831```html
6832<!doctype html>
6833<html lang="en">
6834<head>
6835 <meta charset="utf-8">
6836 <title>jQuery.proxy demo</title>
6837 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6838</head>
6839<body>
6840
6841<p><button type="button" id="test">Test</button></p>
6842<div id="log"></div>
6843
6844<script>
6845var me = {
6846 type: "zombie",
6847 test: function( event ) {
6848 // Without proxy, `this` would refer to the event target
6849 // use event.target to reference that element.
6850 var element = event.target;
6851 $( element ).css( "background-color", "red" );
6852
6853 // With proxy, `this` refers to the me object encapsulating
6854 // this function.
6855 $( "#log" ).append( "Hello " + this.type + "<br>" );
6856 $( "#test" ).off( "click", this.test );
6857 }
6858};
6859
6860var you = {
6861 type: "person",
6862 test: function( event ) {
6863 $( "#log" ).append( this.type + " " );
6864 }
6865};
6866
6867// Execute you.test() in the context of the `you` object
6868// no matter where it is called
6869// i.e. the `this` keyword will refer to `you`
6870var youClick = $.proxy( you.test, you );
6871
6872// attach click handlers to #test
6873$( "#test" )
6874 // this === "zombie"; handler unbound after first click
6875 .on( "click", $.proxy( me.test, me ) )
6876
6877 // this === "person"
6878 .on( "click", youClick )
6879
6880 // this === "zombie"
6881 .on( "click", $.proxy( you.test, me ) )
6882
6883 // this === "<button> element"
6884 .on( "click", you.test );
6885</script>
6886
6887</body>
6888</html>
6889```
6890 * @example ​ ````Change the context of a function bound to the click handler,
6891```html
6892<!doctype html>
6893<html lang="en">
6894<head>
6895 <meta charset="utf-8">
6896 <title>jQuery.proxy demo</title>
6897 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6898</head>
6899<body>
6900
6901<p><button type="button" id="test">Test</button></p>
6902<div id="log"></div>
6903
6904<script>
6905var me = {
6906 // I'm a dog
6907 type: "dog",
6908
6909 // Note that event comes *after* one and two
6910 test: function( one, two, event ) {
6911 $( "#log" )
6912
6913 // `one` maps to `you`, the 1st additional
6914 // argument in the $.proxy function call
6915 .append( "<h3>Hello " + one.type + ":</h3>" )
6916
6917 // The `this` keyword refers to `me`
6918 // (the 2nd, context, argument of $.proxy)
6919 .append( "I am a " + this.type + ", " )
6920
6921 // `two` maps to `they`, the 2nd additional
6922 // argument in the $.proxy function call
6923 .append( "and they are " + two.type + ".<br>" )
6924
6925 // The event type is "click"
6926 .append( "Thanks for " + event.type + "ing." )
6927
6928 // The clicked element is `event.target`,
6929 // and its type is "button"
6930 .append( "the " + event.target.type + "." );
6931 }
6932};
6933
6934var you = { type: "cat" };
6935var they = { type: "fish" };
6936
6937// Set up handler to execute me.test() in the context
6938// of `me`, with `you` and `they` as additional arguments
6939var proxy = $.proxy( me.test, me, you, they );
6940
6941$( "#test" )
6942 .on( "click", proxy );
6943</script>
6944
6945</body>
6946</html>
6947```
6948 */
6949 proxy<TContext,
6950 TReturn,
6951 A, B,
6952 T, U>(funсtion: (this: TContext, a: A, b: B,
6953 t: T, u: U) => TReturn,
6954 context: TContext,
6955 a: A, b: B): (t: T, u: U) => TReturn;
6956 /**
6957 * Takes a function and returns a new one that will always have a particular context.
6958 * @param funсtion The function whose context will be changed.
6959 * @param context The object to which the context (`this`) of the function should be set.
6960 * @param a An argument to be passed to the function referenced in the `function` argument.
6961 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6962 * @since 1.4
6963 * @since 1.6
6964 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6965 * @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.
6966```html
6967<!doctype html>
6968<html lang="en">
6969<head>
6970 <meta charset="utf-8">
6971 <title>jQuery.proxy demo</title>
6972 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6973</head>
6974<body>
6975
6976<p><button type="button" id="test">Test</button></p>
6977<div id="log"></div>
6978
6979<script>
6980var me = {
6981 type: "zombie",
6982 test: function( event ) {
6983 // Without proxy, `this` would refer to the event target
6984 // use event.target to reference that element.
6985 var element = event.target;
6986 $( element ).css( "background-color", "red" );
6987
6988 // With proxy, `this` refers to the me object encapsulating
6989 // this function.
6990 $( "#log" ).append( "Hello " + this.type + "<br>" );
6991 $( "#test" ).off( "click", this.test );
6992 }
6993};
6994
6995var you = {
6996 type: "person",
6997 test: function( event ) {
6998 $( "#log" ).append( this.type + " " );
6999 }
7000};
7001
7002// Execute you.test() in the context of the `you` object
7003// no matter where it is called
7004// i.e. the `this` keyword will refer to `you`
7005var youClick = $.proxy( you.test, you );
7006
7007// attach click handlers to #test
7008$( "#test" )
7009 // this === "zombie"; handler unbound after first click
7010 .on( "click", $.proxy( me.test, me ) )
7011
7012 // this === "person"
7013 .on( "click", youClick )
7014
7015 // this === "zombie"
7016 .on( "click", $.proxy( you.test, me ) )
7017
7018 // this === "<button> element"
7019 .on( "click", you.test );
7020</script>
7021
7022</body>
7023</html>
7024```
7025 * @example ​ ````Change the context of a function bound to the click handler,
7026```html
7027<!doctype html>
7028<html lang="en">
7029<head>
7030 <meta charset="utf-8">
7031 <title>jQuery.proxy demo</title>
7032 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7033</head>
7034<body>
7035
7036<p><button type="button" id="test">Test</button></p>
7037<div id="log"></div>
7038
7039<script>
7040var me = {
7041 // I'm a dog
7042 type: "dog",
7043
7044 // Note that event comes *after* one and two
7045 test: function( one, two, event ) {
7046 $( "#log" )
7047
7048 // `one` maps to `you`, the 1st additional
7049 // argument in the $.proxy function call
7050 .append( "<h3>Hello " + one.type + ":</h3>" )
7051
7052 // The `this` keyword refers to `me`
7053 // (the 2nd, context, argument of $.proxy)
7054 .append( "I am a " + this.type + ", " )
7055
7056 // `two` maps to `they`, the 2nd additional
7057 // argument in the $.proxy function call
7058 .append( "and they are " + two.type + ".<br>" )
7059
7060 // The event type is "click"
7061 .append( "Thanks for " + event.type + "ing." )
7062
7063 // The clicked element is `event.target`,
7064 // and its type is "button"
7065 .append( "the " + event.target.type + "." );
7066 }
7067};
7068
7069var you = { type: "cat" };
7070var they = { type: "fish" };
7071
7072// Set up handler to execute me.test() in the context
7073// of `me`, with `you` and `they` as additional arguments
7074var proxy = $.proxy( me.test, me, you, they );
7075
7076$( "#test" )
7077 .on( "click", proxy );
7078</script>
7079
7080</body>
7081</html>
7082```
7083 */
7084 proxy<TContext,
7085 TReturn,
7086 A,
7087 T, U>(funсtion: (this: TContext, a: A,
7088 t: T, u: U) => TReturn,
7089 context: TContext,
7090 a: A): (t: T, u: U) => TReturn;
7091 /**
7092 * Takes a function and returns a new one that will always have a particular context.
7093 * @param funсtion The function whose context will be changed.
7094 * @param context The object to which the context (`this`) of the function should be set.
7095 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7096 * @since 1.4
7097 * @since 1.6
7098 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7099 * @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.
7100```html
7101<!doctype html>
7102<html lang="en">
7103<head>
7104 <meta charset="utf-8">
7105 <title>jQuery.proxy demo</title>
7106 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7107</head>
7108<body>
7109
7110<p><button type="button" id="test">Test</button></p>
7111<div id="log"></div>
7112
7113<script>
7114var me = {
7115 type: "zombie",
7116 test: function( event ) {
7117 // Without proxy, `this` would refer to the event target
7118 // use event.target to reference that element.
7119 var element = event.target;
7120 $( element ).css( "background-color", "red" );
7121
7122 // With proxy, `this` refers to the me object encapsulating
7123 // this function.
7124 $( "#log" ).append( "Hello " + this.type + "<br>" );
7125 $( "#test" ).off( "click", this.test );
7126 }
7127};
7128
7129var you = {
7130 type: "person",
7131 test: function( event ) {
7132 $( "#log" ).append( this.type + " " );
7133 }
7134};
7135
7136// Execute you.test() in the context of the `you` object
7137// no matter where it is called
7138// i.e. the `this` keyword will refer to `you`
7139var youClick = $.proxy( you.test, you );
7140
7141// attach click handlers to #test
7142$( "#test" )
7143 // this === "zombie"; handler unbound after first click
7144 .on( "click", $.proxy( me.test, me ) )
7145
7146 // this === "person"
7147 .on( "click", youClick )
7148
7149 // this === "zombie"
7150 .on( "click", $.proxy( you.test, me ) )
7151
7152 // this === "<button> element"
7153 .on( "click", you.test );
7154</script>
7155
7156</body>
7157</html>
7158```
7159 * @example ​ ````Change the context of a function bound to the click handler,
7160```html
7161<!doctype html>
7162<html lang="en">
7163<head>
7164 <meta charset="utf-8">
7165 <title>jQuery.proxy demo</title>
7166 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7167</head>
7168<body>
7169
7170<p><button type="button" id="test">Test</button></p>
7171<div id="log"></div>
7172
7173<script>
7174var me = {
7175 // I'm a dog
7176 type: "dog",
7177
7178 // Note that event comes *after* one and two
7179 test: function( one, two, event ) {
7180 $( "#log" )
7181
7182 // `one` maps to `you`, the 1st additional
7183 // argument in the $.proxy function call
7184 .append( "<h3>Hello " + one.type + ":</h3>" )
7185
7186 // The `this` keyword refers to `me`
7187 // (the 2nd, context, argument of $.proxy)
7188 .append( "I am a " + this.type + ", " )
7189
7190 // `two` maps to `they`, the 2nd additional
7191 // argument in the $.proxy function call
7192 .append( "and they are " + two.type + ".<br>" )
7193
7194 // The event type is "click"
7195 .append( "Thanks for " + event.type + "ing." )
7196
7197 // The clicked element is `event.target`,
7198 // and its type is "button"
7199 .append( "the " + event.target.type + "." );
7200 }
7201};
7202
7203var you = { type: "cat" };
7204var they = { type: "fish" };
7205
7206// Set up handler to execute me.test() in the context
7207// of `me`, with `you` and `they` as additional arguments
7208var proxy = $.proxy( me.test, me, you, they );
7209
7210$( "#test" )
7211 .on( "click", proxy );
7212</script>
7213
7214</body>
7215</html>
7216```
7217 */
7218 proxy<TContext,
7219 TReturn,
7220 T, U>(funсtion: (this: TContext, t: T, u: U) => TReturn,
7221 context: TContext): (t: T, u: U) => TReturn;
7222
7223 // #endregion
7224
7225 // region 3 parameters
7226 // #region 3 parameters
7227
7228 /**
7229 * Takes a function and returns a new one that will always have a particular context.
7230 * @param funсtion The function whose context will be changed.
7231 * @param context The object to which the context (`this`) of the function should be set.
7232 * @param a An argument to be passed to the function referenced in the `function` argument.
7233 * @param b An argument to be passed to the function referenced in the `function` argument.
7234 * @param c An argument to be passed to the function referenced in the `function` argument.
7235 * @param d An argument to be passed to the function referenced in the `function` argument.
7236 * @param e An argument to be passed to the function referenced in the `function` argument.
7237 * @param f An argument to be passed to the function referenced in the `function` argument.
7238 * @param g An argument to be passed to the function referenced in the `function` argument.
7239 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7240 * @since 1.4
7241 * @since 1.6
7242 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7243 * @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.
7244```html
7245<!doctype html>
7246<html lang="en">
7247<head>
7248 <meta charset="utf-8">
7249 <title>jQuery.proxy demo</title>
7250 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7251</head>
7252<body>
7253
7254<p><button type="button" id="test">Test</button></p>
7255<div id="log"></div>
7256
7257<script>
7258var me = {
7259 type: "zombie",
7260 test: function( event ) {
7261 // Without proxy, `this` would refer to the event target
7262 // use event.target to reference that element.
7263 var element = event.target;
7264 $( element ).css( "background-color", "red" );
7265
7266 // With proxy, `this` refers to the me object encapsulating
7267 // this function.
7268 $( "#log" ).append( "Hello " + this.type + "<br>" );
7269 $( "#test" ).off( "click", this.test );
7270 }
7271};
7272
7273var you = {
7274 type: "person",
7275 test: function( event ) {
7276 $( "#log" ).append( this.type + " " );
7277 }
7278};
7279
7280// Execute you.test() in the context of the `you` object
7281// no matter where it is called
7282// i.e. the `this` keyword will refer to `you`
7283var youClick = $.proxy( you.test, you );
7284
7285// attach click handlers to #test
7286$( "#test" )
7287 // this === "zombie"; handler unbound after first click
7288 .on( "click", $.proxy( me.test, me ) )
7289
7290 // this === "person"
7291 .on( "click", youClick )
7292
7293 // this === "zombie"
7294 .on( "click", $.proxy( you.test, me ) )
7295
7296 // this === "<button> element"
7297 .on( "click", you.test );
7298</script>
7299
7300</body>
7301</html>
7302```
7303 * @example ​ ````Change the context of a function bound to the click handler,
7304```html
7305<!doctype html>
7306<html lang="en">
7307<head>
7308 <meta charset="utf-8">
7309 <title>jQuery.proxy demo</title>
7310 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7311</head>
7312<body>
7313
7314<p><button type="button" id="test">Test</button></p>
7315<div id="log"></div>
7316
7317<script>
7318var me = {
7319 // I'm a dog
7320 type: "dog",
7321
7322 // Note that event comes *after* one and two
7323 test: function( one, two, event ) {
7324 $( "#log" )
7325
7326 // `one` maps to `you`, the 1st additional
7327 // argument in the $.proxy function call
7328 .append( "<h3>Hello " + one.type + ":</h3>" )
7329
7330 // The `this` keyword refers to `me`
7331 // (the 2nd, context, argument of $.proxy)
7332 .append( "I am a " + this.type + ", " )
7333
7334 // `two` maps to `they`, the 2nd additional
7335 // argument in the $.proxy function call
7336 .append( "and they are " + two.type + ".<br>" )
7337
7338 // The event type is "click"
7339 .append( "Thanks for " + event.type + "ing." )
7340
7341 // The clicked element is `event.target`,
7342 // and its type is "button"
7343 .append( "the " + event.target.type + "." );
7344 }
7345};
7346
7347var you = { type: "cat" };
7348var they = { type: "fish" };
7349
7350// Set up handler to execute me.test() in the context
7351// of `me`, with `you` and `they` as additional arguments
7352var proxy = $.proxy( me.test, me, you, they );
7353
7354$( "#test" )
7355 .on( "click", proxy );
7356</script>
7357
7358</body>
7359</html>
7360```
7361 */
7362 proxy<TContext,
7363 TReturn,
7364 A, B, C, D, E, F, G,
7365 T, U, V>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
7366 t: T, u: U, v: V) => TReturn,
7367 context: TContext,
7368 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V) => TReturn;
7369 /**
7370 * Takes a function and returns a new one that will always have a particular context.
7371 * @param funсtion The function whose context will be changed.
7372 * @param context The object to which the context (`this`) of the function should be set.
7373 * @param a An argument to be passed to the function referenced in the `function` argument.
7374 * @param b An argument to be passed to the function referenced in the `function` argument.
7375 * @param c An argument to be passed to the function referenced in the `function` argument.
7376 * @param d An argument to be passed to the function referenced in the `function` argument.
7377 * @param e An argument to be passed to the function referenced in the `function` argument.
7378 * @param f An argument to be passed to the function referenced in the `function` argument.
7379 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7380 * @since 1.4
7381 * @since 1.6
7382 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7383 * @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.
7384```html
7385<!doctype html>
7386<html lang="en">
7387<head>
7388 <meta charset="utf-8">
7389 <title>jQuery.proxy demo</title>
7390 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7391</head>
7392<body>
7393
7394<p><button type="button" id="test">Test</button></p>
7395<div id="log"></div>
7396
7397<script>
7398var me = {
7399 type: "zombie",
7400 test: function( event ) {
7401 // Without proxy, `this` would refer to the event target
7402 // use event.target to reference that element.
7403 var element = event.target;
7404 $( element ).css( "background-color", "red" );
7405
7406 // With proxy, `this` refers to the me object encapsulating
7407 // this function.
7408 $( "#log" ).append( "Hello " + this.type + "<br>" );
7409 $( "#test" ).off( "click", this.test );
7410 }
7411};
7412
7413var you = {
7414 type: "person",
7415 test: function( event ) {
7416 $( "#log" ).append( this.type + " " );
7417 }
7418};
7419
7420// Execute you.test() in the context of the `you` object
7421// no matter where it is called
7422// i.e. the `this` keyword will refer to `you`
7423var youClick = $.proxy( you.test, you );
7424
7425// attach click handlers to #test
7426$( "#test" )
7427 // this === "zombie"; handler unbound after first click
7428 .on( "click", $.proxy( me.test, me ) )
7429
7430 // this === "person"
7431 .on( "click", youClick )
7432
7433 // this === "zombie"
7434 .on( "click", $.proxy( you.test, me ) )
7435
7436 // this === "<button> element"
7437 .on( "click", you.test );
7438</script>
7439
7440</body>
7441</html>
7442```
7443 * @example ​ ````Change the context of a function bound to the click handler,
7444```html
7445<!doctype html>
7446<html lang="en">
7447<head>
7448 <meta charset="utf-8">
7449 <title>jQuery.proxy demo</title>
7450 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7451</head>
7452<body>
7453
7454<p><button type="button" id="test">Test</button></p>
7455<div id="log"></div>
7456
7457<script>
7458var me = {
7459 // I'm a dog
7460 type: "dog",
7461
7462 // Note that event comes *after* one and two
7463 test: function( one, two, event ) {
7464 $( "#log" )
7465
7466 // `one` maps to `you`, the 1st additional
7467 // argument in the $.proxy function call
7468 .append( "<h3>Hello " + one.type + ":</h3>" )
7469
7470 // The `this` keyword refers to `me`
7471 // (the 2nd, context, argument of $.proxy)
7472 .append( "I am a " + this.type + ", " )
7473
7474 // `two` maps to `they`, the 2nd additional
7475 // argument in the $.proxy function call
7476 .append( "and they are " + two.type + ".<br>" )
7477
7478 // The event type is "click"
7479 .append( "Thanks for " + event.type + "ing." )
7480
7481 // The clicked element is `event.target`,
7482 // and its type is "button"
7483 .append( "the " + event.target.type + "." );
7484 }
7485};
7486
7487var you = { type: "cat" };
7488var they = { type: "fish" };
7489
7490// Set up handler to execute me.test() in the context
7491// of `me`, with `you` and `they` as additional arguments
7492var proxy = $.proxy( me.test, me, you, they );
7493
7494$( "#test" )
7495 .on( "click", proxy );
7496</script>
7497
7498</body>
7499</html>
7500```
7501 */
7502 proxy<TContext,
7503 TReturn,
7504 A, B, C, D, E, F,
7505 T, U, V>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
7506 t: T, u: U, v: V) => TReturn,
7507 context: TContext,
7508 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V) => TReturn;
7509 /**
7510 * Takes a function and returns a new one that will always have a particular context.
7511 * @param funсtion The function whose context will be changed.
7512 * @param context The object to which the context (`this`) of the function should be set.
7513 * @param a An argument to be passed to the function referenced in the `function` argument.
7514 * @param b An argument to be passed to the function referenced in the `function` argument.
7515 * @param c An argument to be passed to the function referenced in the `function` argument.
7516 * @param d An argument to be passed to the function referenced in the `function` argument.
7517 * @param e An argument to be passed to the function referenced in the `function` argument.
7518 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7519 * @since 1.4
7520 * @since 1.6
7521 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7522 * @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.
7523```html
7524<!doctype html>
7525<html lang="en">
7526<head>
7527 <meta charset="utf-8">
7528 <title>jQuery.proxy demo</title>
7529 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7530</head>
7531<body>
7532
7533<p><button type="button" id="test">Test</button></p>
7534<div id="log"></div>
7535
7536<script>
7537var me = {
7538 type: "zombie",
7539 test: function( event ) {
7540 // Without proxy, `this` would refer to the event target
7541 // use event.target to reference that element.
7542 var element = event.target;
7543 $( element ).css( "background-color", "red" );
7544
7545 // With proxy, `this` refers to the me object encapsulating
7546 // this function.
7547 $( "#log" ).append( "Hello " + this.type + "<br>" );
7548 $( "#test" ).off( "click", this.test );
7549 }
7550};
7551
7552var you = {
7553 type: "person",
7554 test: function( event ) {
7555 $( "#log" ).append( this.type + " " );
7556 }
7557};
7558
7559// Execute you.test() in the context of the `you` object
7560// no matter where it is called
7561// i.e. the `this` keyword will refer to `you`
7562var youClick = $.proxy( you.test, you );
7563
7564// attach click handlers to #test
7565$( "#test" )
7566 // this === "zombie"; handler unbound after first click
7567 .on( "click", $.proxy( me.test, me ) )
7568
7569 // this === "person"
7570 .on( "click", youClick )
7571
7572 // this === "zombie"
7573 .on( "click", $.proxy( you.test, me ) )
7574
7575 // this === "<button> element"
7576 .on( "click", you.test );
7577</script>
7578
7579</body>
7580</html>
7581```
7582 * @example ​ ````Change the context of a function bound to the click handler,
7583```html
7584<!doctype html>
7585<html lang="en">
7586<head>
7587 <meta charset="utf-8">
7588 <title>jQuery.proxy demo</title>
7589 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7590</head>
7591<body>
7592
7593<p><button type="button" id="test">Test</button></p>
7594<div id="log"></div>
7595
7596<script>
7597var me = {
7598 // I'm a dog
7599 type: "dog",
7600
7601 // Note that event comes *after* one and two
7602 test: function( one, two, event ) {
7603 $( "#log" )
7604
7605 // `one` maps to `you`, the 1st additional
7606 // argument in the $.proxy function call
7607 .append( "<h3>Hello " + one.type + ":</h3>" )
7608
7609 // The `this` keyword refers to `me`
7610 // (the 2nd, context, argument of $.proxy)
7611 .append( "I am a " + this.type + ", " )
7612
7613 // `two` maps to `they`, the 2nd additional
7614 // argument in the $.proxy function call
7615 .append( "and they are " + two.type + ".<br>" )
7616
7617 // The event type is "click"
7618 .append( "Thanks for " + event.type + "ing." )
7619
7620 // The clicked element is `event.target`,
7621 // and its type is "button"
7622 .append( "the " + event.target.type + "." );
7623 }
7624};
7625
7626var you = { type: "cat" };
7627var they = { type: "fish" };
7628
7629// Set up handler to execute me.test() in the context
7630// of `me`, with `you` and `they` as additional arguments
7631var proxy = $.proxy( me.test, me, you, they );
7632
7633$( "#test" )
7634 .on( "click", proxy );
7635</script>
7636
7637</body>
7638</html>
7639```
7640 */
7641 proxy<TContext,
7642 TReturn,
7643 A, B, C, D, E,
7644 T, U, V>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
7645 t: T, u: U, v: V) => TReturn,
7646 context: TContext,
7647 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V) => TReturn;
7648 /**
7649 * Takes a function and returns a new one that will always have a particular context.
7650 * @param funсtion The function whose context will be changed.
7651 * @param context The object to which the context (`this`) of the function should be set.
7652 * @param a An argument to be passed to the function referenced in the `function` argument.
7653 * @param b An argument to be passed to the function referenced in the `function` argument.
7654 * @param c An argument to be passed to the function referenced in the `function` argument.
7655 * @param d An argument to be passed to the function referenced in the `function` argument.
7656 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7657 * @since 1.4
7658 * @since 1.6
7659 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7660 * @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.
7661```html
7662<!doctype html>
7663<html lang="en">
7664<head>
7665 <meta charset="utf-8">
7666 <title>jQuery.proxy demo</title>
7667 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7668</head>
7669<body>
7670
7671<p><button type="button" id="test">Test</button></p>
7672<div id="log"></div>
7673
7674<script>
7675var me = {
7676 type: "zombie",
7677 test: function( event ) {
7678 // Without proxy, `this` would refer to the event target
7679 // use event.target to reference that element.
7680 var element = event.target;
7681 $( element ).css( "background-color", "red" );
7682
7683 // With proxy, `this` refers to the me object encapsulating
7684 // this function.
7685 $( "#log" ).append( "Hello " + this.type + "<br>" );
7686 $( "#test" ).off( "click", this.test );
7687 }
7688};
7689
7690var you = {
7691 type: "person",
7692 test: function( event ) {
7693 $( "#log" ).append( this.type + " " );
7694 }
7695};
7696
7697// Execute you.test() in the context of the `you` object
7698// no matter where it is called
7699// i.e. the `this` keyword will refer to `you`
7700var youClick = $.proxy( you.test, you );
7701
7702// attach click handlers to #test
7703$( "#test" )
7704 // this === "zombie"; handler unbound after first click
7705 .on( "click", $.proxy( me.test, me ) )
7706
7707 // this === "person"
7708 .on( "click", youClick )
7709
7710 // this === "zombie"
7711 .on( "click", $.proxy( you.test, me ) )
7712
7713 // this === "<button> element"
7714 .on( "click", you.test );
7715</script>
7716
7717</body>
7718</html>
7719```
7720 * @example ​ ````Change the context of a function bound to the click handler,
7721```html
7722<!doctype html>
7723<html lang="en">
7724<head>
7725 <meta charset="utf-8">
7726 <title>jQuery.proxy demo</title>
7727 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7728</head>
7729<body>
7730
7731<p><button type="button" id="test">Test</button></p>
7732<div id="log"></div>
7733
7734<script>
7735var me = {
7736 // I'm a dog
7737 type: "dog",
7738
7739 // Note that event comes *after* one and two
7740 test: function( one, two, event ) {
7741 $( "#log" )
7742
7743 // `one` maps to `you`, the 1st additional
7744 // argument in the $.proxy function call
7745 .append( "<h3>Hello " + one.type + ":</h3>" )
7746
7747 // The `this` keyword refers to `me`
7748 // (the 2nd, context, argument of $.proxy)
7749 .append( "I am a " + this.type + ", " )
7750
7751 // `two` maps to `they`, the 2nd additional
7752 // argument in the $.proxy function call
7753 .append( "and they are " + two.type + ".<br>" )
7754
7755 // The event type is "click"
7756 .append( "Thanks for " + event.type + "ing." )
7757
7758 // The clicked element is `event.target`,
7759 // and its type is "button"
7760 .append( "the " + event.target.type + "." );
7761 }
7762};
7763
7764var you = { type: "cat" };
7765var they = { type: "fish" };
7766
7767// Set up handler to execute me.test() in the context
7768// of `me`, with `you` and `they` as additional arguments
7769var proxy = $.proxy( me.test, me, you, they );
7770
7771$( "#test" )
7772 .on( "click", proxy );
7773</script>
7774
7775</body>
7776</html>
7777```
7778 */
7779 proxy<TContext,
7780 TReturn,
7781 A, B, C, D,
7782 T, U, V>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
7783 t: T, u: U, v: V) => TReturn,
7784 context: TContext,
7785 a: A, b: B, c: C, d: D): (t: T, u: U, v: V) => TReturn;
7786 /**
7787 * Takes a function and returns a new one that will always have a particular context.
7788 * @param funсtion The function whose context will be changed.
7789 * @param context The object to which the context (`this`) of the function should be set.
7790 * @param a An argument to be passed to the function referenced in the `function` argument.
7791 * @param b An argument to be passed to the function referenced in the `function` argument.
7792 * @param c An argument to be passed to the function referenced in the `function` argument.
7793 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7794 * @since 1.4
7795 * @since 1.6
7796 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7797 * @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.
7798```html
7799<!doctype html>
7800<html lang="en">
7801<head>
7802 <meta charset="utf-8">
7803 <title>jQuery.proxy demo</title>
7804 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7805</head>
7806<body>
7807
7808<p><button type="button" id="test">Test</button></p>
7809<div id="log"></div>
7810
7811<script>
7812var me = {
7813 type: "zombie",
7814 test: function( event ) {
7815 // Without proxy, `this` would refer to the event target
7816 // use event.target to reference that element.
7817 var element = event.target;
7818 $( element ).css( "background-color", "red" );
7819
7820 // With proxy, `this` refers to the me object encapsulating
7821 // this function.
7822 $( "#log" ).append( "Hello " + this.type + "<br>" );
7823 $( "#test" ).off( "click", this.test );
7824 }
7825};
7826
7827var you = {
7828 type: "person",
7829 test: function( event ) {
7830 $( "#log" ).append( this.type + " " );
7831 }
7832};
7833
7834// Execute you.test() in the context of the `you` object
7835// no matter where it is called
7836// i.e. the `this` keyword will refer to `you`
7837var youClick = $.proxy( you.test, you );
7838
7839// attach click handlers to #test
7840$( "#test" )
7841 // this === "zombie"; handler unbound after first click
7842 .on( "click", $.proxy( me.test, me ) )
7843
7844 // this === "person"
7845 .on( "click", youClick )
7846
7847 // this === "zombie"
7848 .on( "click", $.proxy( you.test, me ) )
7849
7850 // this === "<button> element"
7851 .on( "click", you.test );
7852</script>
7853
7854</body>
7855</html>
7856```
7857 * @example ​ ````Change the context of a function bound to the click handler,
7858```html
7859<!doctype html>
7860<html lang="en">
7861<head>
7862 <meta charset="utf-8">
7863 <title>jQuery.proxy demo</title>
7864 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7865</head>
7866<body>
7867
7868<p><button type="button" id="test">Test</button></p>
7869<div id="log"></div>
7870
7871<script>
7872var me = {
7873 // I'm a dog
7874 type: "dog",
7875
7876 // Note that event comes *after* one and two
7877 test: function( one, two, event ) {
7878 $( "#log" )
7879
7880 // `one` maps to `you`, the 1st additional
7881 // argument in the $.proxy function call
7882 .append( "<h3>Hello " + one.type + ":</h3>" )
7883
7884 // The `this` keyword refers to `me`
7885 // (the 2nd, context, argument of $.proxy)
7886 .append( "I am a " + this.type + ", " )
7887
7888 // `two` maps to `they`, the 2nd additional
7889 // argument in the $.proxy function call
7890 .append( "and they are " + two.type + ".<br>" )
7891
7892 // The event type is "click"
7893 .append( "Thanks for " + event.type + "ing." )
7894
7895 // The clicked element is `event.target`,
7896 // and its type is "button"
7897 .append( "the " + event.target.type + "." );
7898 }
7899};
7900
7901var you = { type: "cat" };
7902var they = { type: "fish" };
7903
7904// Set up handler to execute me.test() in the context
7905// of `me`, with `you` and `they` as additional arguments
7906var proxy = $.proxy( me.test, me, you, they );
7907
7908$( "#test" )
7909 .on( "click", proxy );
7910</script>
7911
7912</body>
7913</html>
7914```
7915 */
7916 proxy<TContext,
7917 TReturn,
7918 A, B, C,
7919 T, U, V>(funсtion: (this: TContext, a: A, b: B, c: C,
7920 t: T, u: U, v: V) => TReturn,
7921 context: TContext,
7922 a: A, b: B, c: C): (t: T, u: U, v: V) => TReturn;
7923 /**
7924 * Takes a function and returns a new one that will always have a particular context.
7925 * @param funсtion The function whose context will be changed.
7926 * @param context The object to which the context (`this`) of the function should be set.
7927 * @param a An argument to be passed to the function referenced in the `function` argument.
7928 * @param b An argument to be passed to the function referenced in the `function` argument.
7929 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7930 * @since 1.4
7931 * @since 1.6
7932 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7933 * @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.
7934```html
7935<!doctype html>
7936<html lang="en">
7937<head>
7938 <meta charset="utf-8">
7939 <title>jQuery.proxy demo</title>
7940 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7941</head>
7942<body>
7943
7944<p><button type="button" id="test">Test</button></p>
7945<div id="log"></div>
7946
7947<script>
7948var me = {
7949 type: "zombie",
7950 test: function( event ) {
7951 // Without proxy, `this` would refer to the event target
7952 // use event.target to reference that element.
7953 var element = event.target;
7954 $( element ).css( "background-color", "red" );
7955
7956 // With proxy, `this` refers to the me object encapsulating
7957 // this function.
7958 $( "#log" ).append( "Hello " + this.type + "<br>" );
7959 $( "#test" ).off( "click", this.test );
7960 }
7961};
7962
7963var you = {
7964 type: "person",
7965 test: function( event ) {
7966 $( "#log" ).append( this.type + " " );
7967 }
7968};
7969
7970// Execute you.test() in the context of the `you` object
7971// no matter where it is called
7972// i.e. the `this` keyword will refer to `you`
7973var youClick = $.proxy( you.test, you );
7974
7975// attach click handlers to #test
7976$( "#test" )
7977 // this === "zombie"; handler unbound after first click
7978 .on( "click", $.proxy( me.test, me ) )
7979
7980 // this === "person"
7981 .on( "click", youClick )
7982
7983 // this === "zombie"
7984 .on( "click", $.proxy( you.test, me ) )
7985
7986 // this === "<button> element"
7987 .on( "click", you.test );
7988</script>
7989
7990</body>
7991</html>
7992```
7993 * @example ​ ````Change the context of a function bound to the click handler,
7994```html
7995<!doctype html>
7996<html lang="en">
7997<head>
7998 <meta charset="utf-8">
7999 <title>jQuery.proxy demo</title>
8000 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8001</head>
8002<body>
8003
8004<p><button type="button" id="test">Test</button></p>
8005<div id="log"></div>
8006
8007<script>
8008var me = {
8009 // I'm a dog
8010 type: "dog",
8011
8012 // Note that event comes *after* one and two
8013 test: function( one, two, event ) {
8014 $( "#log" )
8015
8016 // `one` maps to `you`, the 1st additional
8017 // argument in the $.proxy function call
8018 .append( "<h3>Hello " + one.type + ":</h3>" )
8019
8020 // The `this` keyword refers to `me`
8021 // (the 2nd, context, argument of $.proxy)
8022 .append( "I am a " + this.type + ", " )
8023
8024 // `two` maps to `they`, the 2nd additional
8025 // argument in the $.proxy function call
8026 .append( "and they are " + two.type + ".<br>" )
8027
8028 // The event type is "click"
8029 .append( "Thanks for " + event.type + "ing." )
8030
8031 // The clicked element is `event.target`,
8032 // and its type is "button"
8033 .append( "the " + event.target.type + "." );
8034 }
8035};
8036
8037var you = { type: "cat" };
8038var they = { type: "fish" };
8039
8040// Set up handler to execute me.test() in the context
8041// of `me`, with `you` and `they` as additional arguments
8042var proxy = $.proxy( me.test, me, you, they );
8043
8044$( "#test" )
8045 .on( "click", proxy );
8046</script>
8047
8048</body>
8049</html>
8050```
8051 */
8052 proxy<TContext,
8053 TReturn,
8054 A, B,
8055 T, U, V>(funсtion: (this: TContext, a: A, b: B,
8056 t: T, u: U, v: V) => TReturn,
8057 context: TContext,
8058 a: A, b: B): (t: T, u: U, v: V) => TReturn;
8059 /**
8060 * Takes a function and returns a new one that will always have a particular context.
8061 * @param funсtion The function whose context will be changed.
8062 * @param context The object to which the context (`this`) of the function should be set.
8063 * @param a An argument to be passed to the function referenced in the `function` argument.
8064 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8065 * @since 1.4
8066 * @since 1.6
8067 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8068 * @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.
8069```html
8070<!doctype html>
8071<html lang="en">
8072<head>
8073 <meta charset="utf-8">
8074 <title>jQuery.proxy demo</title>
8075 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8076</head>
8077<body>
8078
8079<p><button type="button" id="test">Test</button></p>
8080<div id="log"></div>
8081
8082<script>
8083var me = {
8084 type: "zombie",
8085 test: function( event ) {
8086 // Without proxy, `this` would refer to the event target
8087 // use event.target to reference that element.
8088 var element = event.target;
8089 $( element ).css( "background-color", "red" );
8090
8091 // With proxy, `this` refers to the me object encapsulating
8092 // this function.
8093 $( "#log" ).append( "Hello " + this.type + "<br>" );
8094 $( "#test" ).off( "click", this.test );
8095 }
8096};
8097
8098var you = {
8099 type: "person",
8100 test: function( event ) {
8101 $( "#log" ).append( this.type + " " );
8102 }
8103};
8104
8105// Execute you.test() in the context of the `you` object
8106// no matter where it is called
8107// i.e. the `this` keyword will refer to `you`
8108var youClick = $.proxy( you.test, you );
8109
8110// attach click handlers to #test
8111$( "#test" )
8112 // this === "zombie"; handler unbound after first click
8113 .on( "click", $.proxy( me.test, me ) )
8114
8115 // this === "person"
8116 .on( "click", youClick )
8117
8118 // this === "zombie"
8119 .on( "click", $.proxy( you.test, me ) )
8120
8121 // this === "<button> element"
8122 .on( "click", you.test );
8123</script>
8124
8125</body>
8126</html>
8127```
8128 * @example ​ ````Change the context of a function bound to the click handler,
8129```html
8130<!doctype html>
8131<html lang="en">
8132<head>
8133 <meta charset="utf-8">
8134 <title>jQuery.proxy demo</title>
8135 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8136</head>
8137<body>
8138
8139<p><button type="button" id="test">Test</button></p>
8140<div id="log"></div>
8141
8142<script>
8143var me = {
8144 // I'm a dog
8145 type: "dog",
8146
8147 // Note that event comes *after* one and two
8148 test: function( one, two, event ) {
8149 $( "#log" )
8150
8151 // `one` maps to `you`, the 1st additional
8152 // argument in the $.proxy function call
8153 .append( "<h3>Hello " + one.type + ":</h3>" )
8154
8155 // The `this` keyword refers to `me`
8156 // (the 2nd, context, argument of $.proxy)
8157 .append( "I am a " + this.type + ", " )
8158
8159 // `two` maps to `they`, the 2nd additional
8160 // argument in the $.proxy function call
8161 .append( "and they are " + two.type + ".<br>" )
8162
8163 // The event type is "click"
8164 .append( "Thanks for " + event.type + "ing." )
8165
8166 // The clicked element is `event.target`,
8167 // and its type is "button"
8168 .append( "the " + event.target.type + "." );
8169 }
8170};
8171
8172var you = { type: "cat" };
8173var they = { type: "fish" };
8174
8175// Set up handler to execute me.test() in the context
8176// of `me`, with `you` and `they` as additional arguments
8177var proxy = $.proxy( me.test, me, you, they );
8178
8179$( "#test" )
8180 .on( "click", proxy );
8181</script>
8182
8183</body>
8184</html>
8185```
8186 */
8187 proxy<TContext,
8188 TReturn,
8189 A,
8190 T, U, V>(funсtion: (this: TContext, a: A,
8191 t: T, u: U, v: V) => TReturn,
8192 context: TContext,
8193 a: A): (t: T, u: U, v: V) => TReturn;
8194 /**
8195 * Takes a function and returns a new one that will always have a particular context.
8196 * @param funсtion The function whose context will be changed.
8197 * @param context The object to which the context (`this`) of the function should be set.
8198 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8199 * @since 1.4
8200 * @since 1.6
8201 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8202 * @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.
8203```html
8204<!doctype html>
8205<html lang="en">
8206<head>
8207 <meta charset="utf-8">
8208 <title>jQuery.proxy demo</title>
8209 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8210</head>
8211<body>
8212
8213<p><button type="button" id="test">Test</button></p>
8214<div id="log"></div>
8215
8216<script>
8217var me = {
8218 type: "zombie",
8219 test: function( event ) {
8220 // Without proxy, `this` would refer to the event target
8221 // use event.target to reference that element.
8222 var element = event.target;
8223 $( element ).css( "background-color", "red" );
8224
8225 // With proxy, `this` refers to the me object encapsulating
8226 // this function.
8227 $( "#log" ).append( "Hello " + this.type + "<br>" );
8228 $( "#test" ).off( "click", this.test );
8229 }
8230};
8231
8232var you = {
8233 type: "person",
8234 test: function( event ) {
8235 $( "#log" ).append( this.type + " " );
8236 }
8237};
8238
8239// Execute you.test() in the context of the `you` object
8240// no matter where it is called
8241// i.e. the `this` keyword will refer to `you`
8242var youClick = $.proxy( you.test, you );
8243
8244// attach click handlers to #test
8245$( "#test" )
8246 // this === "zombie"; handler unbound after first click
8247 .on( "click", $.proxy( me.test, me ) )
8248
8249 // this === "person"
8250 .on( "click", youClick )
8251
8252 // this === "zombie"
8253 .on( "click", $.proxy( you.test, me ) )
8254
8255 // this === "<button> element"
8256 .on( "click", you.test );
8257</script>
8258
8259</body>
8260</html>
8261```
8262 * @example ​ ````Change the context of a function bound to the click handler,
8263```html
8264<!doctype html>
8265<html lang="en">
8266<head>
8267 <meta charset="utf-8">
8268 <title>jQuery.proxy demo</title>
8269 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8270</head>
8271<body>
8272
8273<p><button type="button" id="test">Test</button></p>
8274<div id="log"></div>
8275
8276<script>
8277var me = {
8278 // I'm a dog
8279 type: "dog",
8280
8281 // Note that event comes *after* one and two
8282 test: function( one, two, event ) {
8283 $( "#log" )
8284
8285 // `one` maps to `you`, the 1st additional
8286 // argument in the $.proxy function call
8287 .append( "<h3>Hello " + one.type + ":</h3>" )
8288
8289 // The `this` keyword refers to `me`
8290 // (the 2nd, context, argument of $.proxy)
8291 .append( "I am a " + this.type + ", " )
8292
8293 // `two` maps to `they`, the 2nd additional
8294 // argument in the $.proxy function call
8295 .append( "and they are " + two.type + ".<br>" )
8296
8297 // The event type is "click"
8298 .append( "Thanks for " + event.type + "ing." )
8299
8300 // The clicked element is `event.target`,
8301 // and its type is "button"
8302 .append( "the " + event.target.type + "." );
8303 }
8304};
8305
8306var you = { type: "cat" };
8307var they = { type: "fish" };
8308
8309// Set up handler to execute me.test() in the context
8310// of `me`, with `you` and `they` as additional arguments
8311var proxy = $.proxy( me.test, me, you, they );
8312
8313$( "#test" )
8314 .on( "click", proxy );
8315</script>
8316
8317</body>
8318</html>
8319```
8320 */
8321 proxy<TContext,
8322 TReturn,
8323 T, U, V>(funсtion: (this: TContext, t: T, u: U, v: V) => TReturn,
8324 context: TContext): (t: T, u: U, v: V) => TReturn;
8325
8326 // #endregion
8327
8328 // region 4 parameters
8329 // #region 4 parameters
8330
8331 /**
8332 * Takes a function and returns a new one that will always have a particular context.
8333 * @param funсtion The function whose context will be changed.
8334 * @param context The object to which the context (`this`) of the function should be set.
8335 * @param a An argument to be passed to the function referenced in the `function` argument.
8336 * @param b An argument to be passed to the function referenced in the `function` argument.
8337 * @param c An argument to be passed to the function referenced in the `function` argument.
8338 * @param d An argument to be passed to the function referenced in the `function` argument.
8339 * @param e An argument to be passed to the function referenced in the `function` argument.
8340 * @param f An argument to be passed to the function referenced in the `function` argument.
8341 * @param g An argument to be passed to the function referenced in the `function` argument.
8342 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8343 * @since 1.4
8344 * @since 1.6
8345 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8346 * @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.
8347```html
8348<!doctype html>
8349<html lang="en">
8350<head>
8351 <meta charset="utf-8">
8352 <title>jQuery.proxy demo</title>
8353 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8354</head>
8355<body>
8356
8357<p><button type="button" id="test">Test</button></p>
8358<div id="log"></div>
8359
8360<script>
8361var me = {
8362 type: "zombie",
8363 test: function( event ) {
8364 // Without proxy, `this` would refer to the event target
8365 // use event.target to reference that element.
8366 var element = event.target;
8367 $( element ).css( "background-color", "red" );
8368
8369 // With proxy, `this` refers to the me object encapsulating
8370 // this function.
8371 $( "#log" ).append( "Hello " + this.type + "<br>" );
8372 $( "#test" ).off( "click", this.test );
8373 }
8374};
8375
8376var you = {
8377 type: "person",
8378 test: function( event ) {
8379 $( "#log" ).append( this.type + " " );
8380 }
8381};
8382
8383// Execute you.test() in the context of the `you` object
8384// no matter where it is called
8385// i.e. the `this` keyword will refer to `you`
8386var youClick = $.proxy( you.test, you );
8387
8388// attach click handlers to #test
8389$( "#test" )
8390 // this === "zombie"; handler unbound after first click
8391 .on( "click", $.proxy( me.test, me ) )
8392
8393 // this === "person"
8394 .on( "click", youClick )
8395
8396 // this === "zombie"
8397 .on( "click", $.proxy( you.test, me ) )
8398
8399 // this === "<button> element"
8400 .on( "click", you.test );
8401</script>
8402
8403</body>
8404</html>
8405```
8406 * @example ​ ````Change the context of a function bound to the click handler,
8407```html
8408<!doctype html>
8409<html lang="en">
8410<head>
8411 <meta charset="utf-8">
8412 <title>jQuery.proxy demo</title>
8413 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8414</head>
8415<body>
8416
8417<p><button type="button" id="test">Test</button></p>
8418<div id="log"></div>
8419
8420<script>
8421var me = {
8422 // I'm a dog
8423 type: "dog",
8424
8425 // Note that event comes *after* one and two
8426 test: function( one, two, event ) {
8427 $( "#log" )
8428
8429 // `one` maps to `you`, the 1st additional
8430 // argument in the $.proxy function call
8431 .append( "<h3>Hello " + one.type + ":</h3>" )
8432
8433 // The `this` keyword refers to `me`
8434 // (the 2nd, context, argument of $.proxy)
8435 .append( "I am a " + this.type + ", " )
8436
8437 // `two` maps to `they`, the 2nd additional
8438 // argument in the $.proxy function call
8439 .append( "and they are " + two.type + ".<br>" )
8440
8441 // The event type is "click"
8442 .append( "Thanks for " + event.type + "ing." )
8443
8444 // The clicked element is `event.target`,
8445 // and its type is "button"
8446 .append( "the " + event.target.type + "." );
8447 }
8448};
8449
8450var you = { type: "cat" };
8451var they = { type: "fish" };
8452
8453// Set up handler to execute me.test() in the context
8454// of `me`, with `you` and `they` as additional arguments
8455var proxy = $.proxy( me.test, me, you, they );
8456
8457$( "#test" )
8458 .on( "click", proxy );
8459</script>
8460
8461</body>
8462</html>
8463```
8464 */
8465 proxy<TContext,
8466 TReturn,
8467 A, B, C, D, E, F, G,
8468 T, U, V, W>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
8469 t: T, u: U, v: V, w: W) => TReturn,
8470 context: TContext,
8471 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W) => TReturn;
8472 /**
8473 * Takes a function and returns a new one that will always have a particular context.
8474 * @param funсtion The function whose context will be changed.
8475 * @param context The object to which the context (`this`) of the function should be set.
8476 * @param a An argument to be passed to the function referenced in the `function` argument.
8477 * @param b An argument to be passed to the function referenced in the `function` argument.
8478 * @param c An argument to be passed to the function referenced in the `function` argument.
8479 * @param d An argument to be passed to the function referenced in the `function` argument.
8480 * @param e An argument to be passed to the function referenced in the `function` argument.
8481 * @param f An argument to be passed to the function referenced in the `function` argument.
8482 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8483 * @since 1.4
8484 * @since 1.6
8485 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8486 * @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.
8487```html
8488<!doctype html>
8489<html lang="en">
8490<head>
8491 <meta charset="utf-8">
8492 <title>jQuery.proxy demo</title>
8493 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8494</head>
8495<body>
8496
8497<p><button type="button" id="test">Test</button></p>
8498<div id="log"></div>
8499
8500<script>
8501var me = {
8502 type: "zombie",
8503 test: function( event ) {
8504 // Without proxy, `this` would refer to the event target
8505 // use event.target to reference that element.
8506 var element = event.target;
8507 $( element ).css( "background-color", "red" );
8508
8509 // With proxy, `this` refers to the me object encapsulating
8510 // this function.
8511 $( "#log" ).append( "Hello " + this.type + "<br>" );
8512 $( "#test" ).off( "click", this.test );
8513 }
8514};
8515
8516var you = {
8517 type: "person",
8518 test: function( event ) {
8519 $( "#log" ).append( this.type + " " );
8520 }
8521};
8522
8523// Execute you.test() in the context of the `you` object
8524// no matter where it is called
8525// i.e. the `this` keyword will refer to `you`
8526var youClick = $.proxy( you.test, you );
8527
8528// attach click handlers to #test
8529$( "#test" )
8530 // this === "zombie"; handler unbound after first click
8531 .on( "click", $.proxy( me.test, me ) )
8532
8533 // this === "person"
8534 .on( "click", youClick )
8535
8536 // this === "zombie"
8537 .on( "click", $.proxy( you.test, me ) )
8538
8539 // this === "<button> element"
8540 .on( "click", you.test );
8541</script>
8542
8543</body>
8544</html>
8545```
8546 * @example ​ ````Change the context of a function bound to the click handler,
8547```html
8548<!doctype html>
8549<html lang="en">
8550<head>
8551 <meta charset="utf-8">
8552 <title>jQuery.proxy demo</title>
8553 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8554</head>
8555<body>
8556
8557<p><button type="button" id="test">Test</button></p>
8558<div id="log"></div>
8559
8560<script>
8561var me = {
8562 // I'm a dog
8563 type: "dog",
8564
8565 // Note that event comes *after* one and two
8566 test: function( one, two, event ) {
8567 $( "#log" )
8568
8569 // `one` maps to `you`, the 1st additional
8570 // argument in the $.proxy function call
8571 .append( "<h3>Hello " + one.type + ":</h3>" )
8572
8573 // The `this` keyword refers to `me`
8574 // (the 2nd, context, argument of $.proxy)
8575 .append( "I am a " + this.type + ", " )
8576
8577 // `two` maps to `they`, the 2nd additional
8578 // argument in the $.proxy function call
8579 .append( "and they are " + two.type + ".<br>" )
8580
8581 // The event type is "click"
8582 .append( "Thanks for " + event.type + "ing." )
8583
8584 // The clicked element is `event.target`,
8585 // and its type is "button"
8586 .append( "the " + event.target.type + "." );
8587 }
8588};
8589
8590var you = { type: "cat" };
8591var they = { type: "fish" };
8592
8593// Set up handler to execute me.test() in the context
8594// of `me`, with `you` and `they` as additional arguments
8595var proxy = $.proxy( me.test, me, you, they );
8596
8597$( "#test" )
8598 .on( "click", proxy );
8599</script>
8600
8601</body>
8602</html>
8603```
8604 */
8605 proxy<TContext,
8606 TReturn,
8607 A, B, C, D, E, F,
8608 T, U, V, W>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
8609 t: T, u: U, v: V, w: W) => TReturn,
8610 context: TContext,
8611 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W) => TReturn;
8612 /**
8613 * Takes a function and returns a new one that will always have a particular context.
8614 * @param funсtion The function whose context will be changed.
8615 * @param context The object to which the context (`this`) of the function should be set.
8616 * @param a An argument to be passed to the function referenced in the `function` argument.
8617 * @param b An argument to be passed to the function referenced in the `function` argument.
8618 * @param c An argument to be passed to the function referenced in the `function` argument.
8619 * @param d An argument to be passed to the function referenced in the `function` argument.
8620 * @param e An argument to be passed to the function referenced in the `function` argument.
8621 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8622 * @since 1.4
8623 * @since 1.6
8624 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8625 * @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.
8626```html
8627<!doctype html>
8628<html lang="en">
8629<head>
8630 <meta charset="utf-8">
8631 <title>jQuery.proxy demo</title>
8632 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8633</head>
8634<body>
8635
8636<p><button type="button" id="test">Test</button></p>
8637<div id="log"></div>
8638
8639<script>
8640var me = {
8641 type: "zombie",
8642 test: function( event ) {
8643 // Without proxy, `this` would refer to the event target
8644 // use event.target to reference that element.
8645 var element = event.target;
8646 $( element ).css( "background-color", "red" );
8647
8648 // With proxy, `this` refers to the me object encapsulating
8649 // this function.
8650 $( "#log" ).append( "Hello " + this.type + "<br>" );
8651 $( "#test" ).off( "click", this.test );
8652 }
8653};
8654
8655var you = {
8656 type: "person",
8657 test: function( event ) {
8658 $( "#log" ).append( this.type + " " );
8659 }
8660};
8661
8662// Execute you.test() in the context of the `you` object
8663// no matter where it is called
8664// i.e. the `this` keyword will refer to `you`
8665var youClick = $.proxy( you.test, you );
8666
8667// attach click handlers to #test
8668$( "#test" )
8669 // this === "zombie"; handler unbound after first click
8670 .on( "click", $.proxy( me.test, me ) )
8671
8672 // this === "person"
8673 .on( "click", youClick )
8674
8675 // this === "zombie"
8676 .on( "click", $.proxy( you.test, me ) )
8677
8678 // this === "<button> element"
8679 .on( "click", you.test );
8680</script>
8681
8682</body>
8683</html>
8684```
8685 * @example ​ ````Change the context of a function bound to the click handler,
8686```html
8687<!doctype html>
8688<html lang="en">
8689<head>
8690 <meta charset="utf-8">
8691 <title>jQuery.proxy demo</title>
8692 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8693</head>
8694<body>
8695
8696<p><button type="button" id="test">Test</button></p>
8697<div id="log"></div>
8698
8699<script>
8700var me = {
8701 // I'm a dog
8702 type: "dog",
8703
8704 // Note that event comes *after* one and two
8705 test: function( one, two, event ) {
8706 $( "#log" )
8707
8708 // `one` maps to `you`, the 1st additional
8709 // argument in the $.proxy function call
8710 .append( "<h3>Hello " + one.type + ":</h3>" )
8711
8712 // The `this` keyword refers to `me`
8713 // (the 2nd, context, argument of $.proxy)
8714 .append( "I am a " + this.type + ", " )
8715
8716 // `two` maps to `they`, the 2nd additional
8717 // argument in the $.proxy function call
8718 .append( "and they are " + two.type + ".<br>" )
8719
8720 // The event type is "click"
8721 .append( "Thanks for " + event.type + "ing." )
8722
8723 // The clicked element is `event.target`,
8724 // and its type is "button"
8725 .append( "the " + event.target.type + "." );
8726 }
8727};
8728
8729var you = { type: "cat" };
8730var they = { type: "fish" };
8731
8732// Set up handler to execute me.test() in the context
8733// of `me`, with `you` and `they` as additional arguments
8734var proxy = $.proxy( me.test, me, you, they );
8735
8736$( "#test" )
8737 .on( "click", proxy );
8738</script>
8739
8740</body>
8741</html>
8742```
8743 */
8744 proxy<TContext,
8745 TReturn,
8746 A, B, C, D, E,
8747 T, U, V, W>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
8748 t: T, u: U, v: V, w: W) => TReturn,
8749 context: TContext,
8750 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W) => TReturn;
8751 /**
8752 * Takes a function and returns a new one that will always have a particular context.
8753 * @param funсtion The function whose context will be changed.
8754 * @param context The object to which the context (`this`) of the function should be set.
8755 * @param a An argument to be passed to the function referenced in the `function` argument.
8756 * @param b An argument to be passed to the function referenced in the `function` argument.
8757 * @param c An argument to be passed to the function referenced in the `function` argument.
8758 * @param d An argument to be passed to the function referenced in the `function` argument.
8759 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8760 * @since 1.4
8761 * @since 1.6
8762 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8763 * @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.
8764```html
8765<!doctype html>
8766<html lang="en">
8767<head>
8768 <meta charset="utf-8">
8769 <title>jQuery.proxy demo</title>
8770 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8771</head>
8772<body>
8773
8774<p><button type="button" id="test">Test</button></p>
8775<div id="log"></div>
8776
8777<script>
8778var me = {
8779 type: "zombie",
8780 test: function( event ) {
8781 // Without proxy, `this` would refer to the event target
8782 // use event.target to reference that element.
8783 var element = event.target;
8784 $( element ).css( "background-color", "red" );
8785
8786 // With proxy, `this` refers to the me object encapsulating
8787 // this function.
8788 $( "#log" ).append( "Hello " + this.type + "<br>" );
8789 $( "#test" ).off( "click", this.test );
8790 }
8791};
8792
8793var you = {
8794 type: "person",
8795 test: function( event ) {
8796 $( "#log" ).append( this.type + " " );
8797 }
8798};
8799
8800// Execute you.test() in the context of the `you` object
8801// no matter where it is called
8802// i.e. the `this` keyword will refer to `you`
8803var youClick = $.proxy( you.test, you );
8804
8805// attach click handlers to #test
8806$( "#test" )
8807 // this === "zombie"; handler unbound after first click
8808 .on( "click", $.proxy( me.test, me ) )
8809
8810 // this === "person"
8811 .on( "click", youClick )
8812
8813 // this === "zombie"
8814 .on( "click", $.proxy( you.test, me ) )
8815
8816 // this === "<button> element"
8817 .on( "click", you.test );
8818</script>
8819
8820</body>
8821</html>
8822```
8823 * @example ​ ````Change the context of a function bound to the click handler,
8824```html
8825<!doctype html>
8826<html lang="en">
8827<head>
8828 <meta charset="utf-8">
8829 <title>jQuery.proxy demo</title>
8830 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8831</head>
8832<body>
8833
8834<p><button type="button" id="test">Test</button></p>
8835<div id="log"></div>
8836
8837<script>
8838var me = {
8839 // I'm a dog
8840 type: "dog",
8841
8842 // Note that event comes *after* one and two
8843 test: function( one, two, event ) {
8844 $( "#log" )
8845
8846 // `one` maps to `you`, the 1st additional
8847 // argument in the $.proxy function call
8848 .append( "<h3>Hello " + one.type + ":</h3>" )
8849
8850 // The `this` keyword refers to `me`
8851 // (the 2nd, context, argument of $.proxy)
8852 .append( "I am a " + this.type + ", " )
8853
8854 // `two` maps to `they`, the 2nd additional
8855 // argument in the $.proxy function call
8856 .append( "and they are " + two.type + ".<br>" )
8857
8858 // The event type is "click"
8859 .append( "Thanks for " + event.type + "ing." )
8860
8861 // The clicked element is `event.target`,
8862 // and its type is "button"
8863 .append( "the " + event.target.type + "." );
8864 }
8865};
8866
8867var you = { type: "cat" };
8868var they = { type: "fish" };
8869
8870// Set up handler to execute me.test() in the context
8871// of `me`, with `you` and `they` as additional arguments
8872var proxy = $.proxy( me.test, me, you, they );
8873
8874$( "#test" )
8875 .on( "click", proxy );
8876</script>
8877
8878</body>
8879</html>
8880```
8881 */
8882 proxy<TContext,
8883 TReturn,
8884 A, B, C, D,
8885 T, U, V, W>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
8886 t: T, u: U, v: V, w: W) => TReturn,
8887 context: TContext,
8888 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W) => TReturn;
8889 /**
8890 * Takes a function and returns a new one that will always have a particular context.
8891 * @param funсtion The function whose context will be changed.
8892 * @param context The object to which the context (`this`) of the function should be set.
8893 * @param a An argument to be passed to the function referenced in the `function` argument.
8894 * @param b An argument to be passed to the function referenced in the `function` argument.
8895 * @param c An argument to be passed to the function referenced in the `function` argument.
8896 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8897 * @since 1.4
8898 * @since 1.6
8899 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8900 * @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.
8901```html
8902<!doctype html>
8903<html lang="en">
8904<head>
8905 <meta charset="utf-8">
8906 <title>jQuery.proxy demo</title>
8907 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8908</head>
8909<body>
8910
8911<p><button type="button" id="test">Test</button></p>
8912<div id="log"></div>
8913
8914<script>
8915var me = {
8916 type: "zombie",
8917 test: function( event ) {
8918 // Without proxy, `this` would refer to the event target
8919 // use event.target to reference that element.
8920 var element = event.target;
8921 $( element ).css( "background-color", "red" );
8922
8923 // With proxy, `this` refers to the me object encapsulating
8924 // this function.
8925 $( "#log" ).append( "Hello " + this.type + "<br>" );
8926 $( "#test" ).off( "click", this.test );
8927 }
8928};
8929
8930var you = {
8931 type: "person",
8932 test: function( event ) {
8933 $( "#log" ).append( this.type + " " );
8934 }
8935};
8936
8937// Execute you.test() in the context of the `you` object
8938// no matter where it is called
8939// i.e. the `this` keyword will refer to `you`
8940var youClick = $.proxy( you.test, you );
8941
8942// attach click handlers to #test
8943$( "#test" )
8944 // this === "zombie"; handler unbound after first click
8945 .on( "click", $.proxy( me.test, me ) )
8946
8947 // this === "person"
8948 .on( "click", youClick )
8949
8950 // this === "zombie"
8951 .on( "click", $.proxy( you.test, me ) )
8952
8953 // this === "<button> element"
8954 .on( "click", you.test );
8955</script>
8956
8957</body>
8958</html>
8959```
8960 * @example ​ ````Change the context of a function bound to the click handler,
8961```html
8962<!doctype html>
8963<html lang="en">
8964<head>
8965 <meta charset="utf-8">
8966 <title>jQuery.proxy demo</title>
8967 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8968</head>
8969<body>
8970
8971<p><button type="button" id="test">Test</button></p>
8972<div id="log"></div>
8973
8974<script>
8975var me = {
8976 // I'm a dog
8977 type: "dog",
8978
8979 // Note that event comes *after* one and two
8980 test: function( one, two, event ) {
8981 $( "#log" )
8982
8983 // `one` maps to `you`, the 1st additional
8984 // argument in the $.proxy function call
8985 .append( "<h3>Hello " + one.type + ":</h3>" )
8986
8987 // The `this` keyword refers to `me`
8988 // (the 2nd, context, argument of $.proxy)
8989 .append( "I am a " + this.type + ", " )
8990
8991 // `two` maps to `they`, the 2nd additional
8992 // argument in the $.proxy function call
8993 .append( "and they are " + two.type + ".<br>" )
8994
8995 // The event type is "click"
8996 .append( "Thanks for " + event.type + "ing." )
8997
8998 // The clicked element is `event.target`,
8999 // and its type is "button"
9000 .append( "the " + event.target.type + "." );
9001 }
9002};
9003
9004var you = { type: "cat" };
9005var they = { type: "fish" };
9006
9007// Set up handler to execute me.test() in the context
9008// of `me`, with `you` and `they` as additional arguments
9009var proxy = $.proxy( me.test, me, you, they );
9010
9011$( "#test" )
9012 .on( "click", proxy );
9013</script>
9014
9015</body>
9016</html>
9017```
9018 */
9019 proxy<TContext,
9020 TReturn,
9021 A, B, C,
9022 T, U, V, W>(funсtion: (this: TContext, a: A, b: B, c: C,
9023 t: T, u: U, v: V, w: W) => TReturn,
9024 context: TContext,
9025 a: A, b: B, c: C): (t: T, u: U, v: V, w: W) => TReturn;
9026 /**
9027 * Takes a function and returns a new one that will always have a particular context.
9028 * @param funсtion The function whose context will be changed.
9029 * @param context The object to which the context (`this`) of the function should be set.
9030 * @param a An argument to be passed to the function referenced in the `function` argument.
9031 * @param b An argument to be passed to the function referenced in the `function` argument.
9032 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9033 * @since 1.4
9034 * @since 1.6
9035 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9036 * @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.
9037```html
9038<!doctype html>
9039<html lang="en">
9040<head>
9041 <meta charset="utf-8">
9042 <title>jQuery.proxy demo</title>
9043 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9044</head>
9045<body>
9046
9047<p><button type="button" id="test">Test</button></p>
9048<div id="log"></div>
9049
9050<script>
9051var me = {
9052 type: "zombie",
9053 test: function( event ) {
9054 // Without proxy, `this` would refer to the event target
9055 // use event.target to reference that element.
9056 var element = event.target;
9057 $( element ).css( "background-color", "red" );
9058
9059 // With proxy, `this` refers to the me object encapsulating
9060 // this function.
9061 $( "#log" ).append( "Hello " + this.type + "<br>" );
9062 $( "#test" ).off( "click", this.test );
9063 }
9064};
9065
9066var you = {
9067 type: "person",
9068 test: function( event ) {
9069 $( "#log" ).append( this.type + " " );
9070 }
9071};
9072
9073// Execute you.test() in the context of the `you` object
9074// no matter where it is called
9075// i.e. the `this` keyword will refer to `you`
9076var youClick = $.proxy( you.test, you );
9077
9078// attach click handlers to #test
9079$( "#test" )
9080 // this === "zombie"; handler unbound after first click
9081 .on( "click", $.proxy( me.test, me ) )
9082
9083 // this === "person"
9084 .on( "click", youClick )
9085
9086 // this === "zombie"
9087 .on( "click", $.proxy( you.test, me ) )
9088
9089 // this === "<button> element"
9090 .on( "click", you.test );
9091</script>
9092
9093</body>
9094</html>
9095```
9096 * @example ​ ````Change the context of a function bound to the click handler,
9097```html
9098<!doctype html>
9099<html lang="en">
9100<head>
9101 <meta charset="utf-8">
9102 <title>jQuery.proxy demo</title>
9103 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9104</head>
9105<body>
9106
9107<p><button type="button" id="test">Test</button></p>
9108<div id="log"></div>
9109
9110<script>
9111var me = {
9112 // I'm a dog
9113 type: "dog",
9114
9115 // Note that event comes *after* one and two
9116 test: function( one, two, event ) {
9117 $( "#log" )
9118
9119 // `one` maps to `you`, the 1st additional
9120 // argument in the $.proxy function call
9121 .append( "<h3>Hello " + one.type + ":</h3>" )
9122
9123 // The `this` keyword refers to `me`
9124 // (the 2nd, context, argument of $.proxy)
9125 .append( "I am a " + this.type + ", " )
9126
9127 // `two` maps to `they`, the 2nd additional
9128 // argument in the $.proxy function call
9129 .append( "and they are " + two.type + ".<br>" )
9130
9131 // The event type is "click"
9132 .append( "Thanks for " + event.type + "ing." )
9133
9134 // The clicked element is `event.target`,
9135 // and its type is "button"
9136 .append( "the " + event.target.type + "." );
9137 }
9138};
9139
9140var you = { type: "cat" };
9141var they = { type: "fish" };
9142
9143// Set up handler to execute me.test() in the context
9144// of `me`, with `you` and `they` as additional arguments
9145var proxy = $.proxy( me.test, me, you, they );
9146
9147$( "#test" )
9148 .on( "click", proxy );
9149</script>
9150
9151</body>
9152</html>
9153```
9154 */
9155 proxy<TContext,
9156 TReturn,
9157 A, B,
9158 T, U, V, W>(funсtion: (this: TContext, a: A, b: B,
9159 t: T, u: U, v: V, w: W) => TReturn,
9160 context: TContext,
9161 a: A, b: B): (t: T, u: U, v: V, w: W) => TReturn;
9162 /**
9163 * Takes a function and returns a new one that will always have a particular context.
9164 * @param funсtion The function whose context will be changed.
9165 * @param context The object to which the context (`this`) of the function should be set.
9166 * @param a An argument to be passed to the function referenced in the `function` argument.
9167 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9168 * @since 1.4
9169 * @since 1.6
9170 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9171 * @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.
9172```html
9173<!doctype html>
9174<html lang="en">
9175<head>
9176 <meta charset="utf-8">
9177 <title>jQuery.proxy demo</title>
9178 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9179</head>
9180<body>
9181
9182<p><button type="button" id="test">Test</button></p>
9183<div id="log"></div>
9184
9185<script>
9186var me = {
9187 type: "zombie",
9188 test: function( event ) {
9189 // Without proxy, `this` would refer to the event target
9190 // use event.target to reference that element.
9191 var element = event.target;
9192 $( element ).css( "background-color", "red" );
9193
9194 // With proxy, `this` refers to the me object encapsulating
9195 // this function.
9196 $( "#log" ).append( "Hello " + this.type + "<br>" );
9197 $( "#test" ).off( "click", this.test );
9198 }
9199};
9200
9201var you = {
9202 type: "person",
9203 test: function( event ) {
9204 $( "#log" ).append( this.type + " " );
9205 }
9206};
9207
9208// Execute you.test() in the context of the `you` object
9209// no matter where it is called
9210// i.e. the `this` keyword will refer to `you`
9211var youClick = $.proxy( you.test, you );
9212
9213// attach click handlers to #test
9214$( "#test" )
9215 // this === "zombie"; handler unbound after first click
9216 .on( "click", $.proxy( me.test, me ) )
9217
9218 // this === "person"
9219 .on( "click", youClick )
9220
9221 // this === "zombie"
9222 .on( "click", $.proxy( you.test, me ) )
9223
9224 // this === "<button> element"
9225 .on( "click", you.test );
9226</script>
9227
9228</body>
9229</html>
9230```
9231 * @example ​ ````Change the context of a function bound to the click handler,
9232```html
9233<!doctype html>
9234<html lang="en">
9235<head>
9236 <meta charset="utf-8">
9237 <title>jQuery.proxy demo</title>
9238 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9239</head>
9240<body>
9241
9242<p><button type="button" id="test">Test</button></p>
9243<div id="log"></div>
9244
9245<script>
9246var me = {
9247 // I'm a dog
9248 type: "dog",
9249
9250 // Note that event comes *after* one and two
9251 test: function( one, two, event ) {
9252 $( "#log" )
9253
9254 // `one` maps to `you`, the 1st additional
9255 // argument in the $.proxy function call
9256 .append( "<h3>Hello " + one.type + ":</h3>" )
9257
9258 // The `this` keyword refers to `me`
9259 // (the 2nd, context, argument of $.proxy)
9260 .append( "I am a " + this.type + ", " )
9261
9262 // `two` maps to `they`, the 2nd additional
9263 // argument in the $.proxy function call
9264 .append( "and they are " + two.type + ".<br>" )
9265
9266 // The event type is "click"
9267 .append( "Thanks for " + event.type + "ing." )
9268
9269 // The clicked element is `event.target`,
9270 // and its type is "button"
9271 .append( "the " + event.target.type + "." );
9272 }
9273};
9274
9275var you = { type: "cat" };
9276var they = { type: "fish" };
9277
9278// Set up handler to execute me.test() in the context
9279// of `me`, with `you` and `they` as additional arguments
9280var proxy = $.proxy( me.test, me, you, they );
9281
9282$( "#test" )
9283 .on( "click", proxy );
9284</script>
9285
9286</body>
9287</html>
9288```
9289 */
9290 proxy<TContext,
9291 TReturn,
9292 A,
9293 T, U, V, W>(funсtion: (this: TContext, a: A,
9294 t: T, u: U, v: V, w: W) => TReturn,
9295 context: TContext,
9296 a: A): (t: T, u: U, v: V, w: W) => TReturn;
9297 /**
9298 * Takes a function and returns a new one that will always have a particular context.
9299 * @param funсtion The function whose context will be changed.
9300 * @param context The object to which the context (`this`) of the function should be set.
9301 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9302 * @since 1.4
9303 * @since 1.6
9304 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9305 * @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.
9306```html
9307<!doctype html>
9308<html lang="en">
9309<head>
9310 <meta charset="utf-8">
9311 <title>jQuery.proxy demo</title>
9312 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9313</head>
9314<body>
9315
9316<p><button type="button" id="test">Test</button></p>
9317<div id="log"></div>
9318
9319<script>
9320var me = {
9321 type: "zombie",
9322 test: function( event ) {
9323 // Without proxy, `this` would refer to the event target
9324 // use event.target to reference that element.
9325 var element = event.target;
9326 $( element ).css( "background-color", "red" );
9327
9328 // With proxy, `this` refers to the me object encapsulating
9329 // this function.
9330 $( "#log" ).append( "Hello " + this.type + "<br>" );
9331 $( "#test" ).off( "click", this.test );
9332 }
9333};
9334
9335var you = {
9336 type: "person",
9337 test: function( event ) {
9338 $( "#log" ).append( this.type + " " );
9339 }
9340};
9341
9342// Execute you.test() in the context of the `you` object
9343// no matter where it is called
9344// i.e. the `this` keyword will refer to `you`
9345var youClick = $.proxy( you.test, you );
9346
9347// attach click handlers to #test
9348$( "#test" )
9349 // this === "zombie"; handler unbound after first click
9350 .on( "click", $.proxy( me.test, me ) )
9351
9352 // this === "person"
9353 .on( "click", youClick )
9354
9355 // this === "zombie"
9356 .on( "click", $.proxy( you.test, me ) )
9357
9358 // this === "<button> element"
9359 .on( "click", you.test );
9360</script>
9361
9362</body>
9363</html>
9364```
9365 * @example ​ ````Change the context of a function bound to the click handler,
9366```html
9367<!doctype html>
9368<html lang="en">
9369<head>
9370 <meta charset="utf-8">
9371 <title>jQuery.proxy demo</title>
9372 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9373</head>
9374<body>
9375
9376<p><button type="button" id="test">Test</button></p>
9377<div id="log"></div>
9378
9379<script>
9380var me = {
9381 // I'm a dog
9382 type: "dog",
9383
9384 // Note that event comes *after* one and two
9385 test: function( one, two, event ) {
9386 $( "#log" )
9387
9388 // `one` maps to `you`, the 1st additional
9389 // argument in the $.proxy function call
9390 .append( "<h3>Hello " + one.type + ":</h3>" )
9391
9392 // The `this` keyword refers to `me`
9393 // (the 2nd, context, argument of $.proxy)
9394 .append( "I am a " + this.type + ", " )
9395
9396 // `two` maps to `they`, the 2nd additional
9397 // argument in the $.proxy function call
9398 .append( "and they are " + two.type + ".<br>" )
9399
9400 // The event type is "click"
9401 .append( "Thanks for " + event.type + "ing." )
9402
9403 // The clicked element is `event.target`,
9404 // and its type is "button"
9405 .append( "the " + event.target.type + "." );
9406 }
9407};
9408
9409var you = { type: "cat" };
9410var they = { type: "fish" };
9411
9412// Set up handler to execute me.test() in the context
9413// of `me`, with `you` and `they` as additional arguments
9414var proxy = $.proxy( me.test, me, you, they );
9415
9416$( "#test" )
9417 .on( "click", proxy );
9418</script>
9419
9420</body>
9421</html>
9422```
9423 */
9424 proxy<TContext,
9425 TReturn,
9426 T, U, V, W>(funсtion: (this: TContext, t: T, u: U, v: V, w: W) => TReturn,
9427 context: TContext): (t: T, u: U, v: V, w: W) => TReturn;
9428
9429 // #endregion
9430
9431 // region 5 parameters
9432 // #region 5 parameters
9433
9434 /**
9435 * Takes a function and returns a new one that will always have a particular context.
9436 * @param funсtion The function whose context will be changed.
9437 * @param context The object to which the context (`this`) of the function should be set.
9438 * @param a An argument to be passed to the function referenced in the `function` argument.
9439 * @param b An argument to be passed to the function referenced in the `function` argument.
9440 * @param c An argument to be passed to the function referenced in the `function` argument.
9441 * @param d An argument to be passed to the function referenced in the `function` argument.
9442 * @param e An argument to be passed to the function referenced in the `function` argument.
9443 * @param f An argument to be passed to the function referenced in the `function` argument.
9444 * @param g An argument to be passed to the function referenced in the `function` argument.
9445 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9446 * @since 1.4
9447 * @since 1.6
9448 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9449 * @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.
9450```html
9451<!doctype html>
9452<html lang="en">
9453<head>
9454 <meta charset="utf-8">
9455 <title>jQuery.proxy demo</title>
9456 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9457</head>
9458<body>
9459
9460<p><button type="button" id="test">Test</button></p>
9461<div id="log"></div>
9462
9463<script>
9464var me = {
9465 type: "zombie",
9466 test: function( event ) {
9467 // Without proxy, `this` would refer to the event target
9468 // use event.target to reference that element.
9469 var element = event.target;
9470 $( element ).css( "background-color", "red" );
9471
9472 // With proxy, `this` refers to the me object encapsulating
9473 // this function.
9474 $( "#log" ).append( "Hello " + this.type + "<br>" );
9475 $( "#test" ).off( "click", this.test );
9476 }
9477};
9478
9479var you = {
9480 type: "person",
9481 test: function( event ) {
9482 $( "#log" ).append( this.type + " " );
9483 }
9484};
9485
9486// Execute you.test() in the context of the `you` object
9487// no matter where it is called
9488// i.e. the `this` keyword will refer to `you`
9489var youClick = $.proxy( you.test, you );
9490
9491// attach click handlers to #test
9492$( "#test" )
9493 // this === "zombie"; handler unbound after first click
9494 .on( "click", $.proxy( me.test, me ) )
9495
9496 // this === "person"
9497 .on( "click", youClick )
9498
9499 // this === "zombie"
9500 .on( "click", $.proxy( you.test, me ) )
9501
9502 // this === "<button> element"
9503 .on( "click", you.test );
9504</script>
9505
9506</body>
9507</html>
9508```
9509 * @example ​ ````Change the context of a function bound to the click handler,
9510```html
9511<!doctype html>
9512<html lang="en">
9513<head>
9514 <meta charset="utf-8">
9515 <title>jQuery.proxy demo</title>
9516 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9517</head>
9518<body>
9519
9520<p><button type="button" id="test">Test</button></p>
9521<div id="log"></div>
9522
9523<script>
9524var me = {
9525 // I'm a dog
9526 type: "dog",
9527
9528 // Note that event comes *after* one and two
9529 test: function( one, two, event ) {
9530 $( "#log" )
9531
9532 // `one` maps to `you`, the 1st additional
9533 // argument in the $.proxy function call
9534 .append( "<h3>Hello " + one.type + ":</h3>" )
9535
9536 // The `this` keyword refers to `me`
9537 // (the 2nd, context, argument of $.proxy)
9538 .append( "I am a " + this.type + ", " )
9539
9540 // `two` maps to `they`, the 2nd additional
9541 // argument in the $.proxy function call
9542 .append( "and they are " + two.type + ".<br>" )
9543
9544 // The event type is "click"
9545 .append( "Thanks for " + event.type + "ing." )
9546
9547 // The clicked element is `event.target`,
9548 // and its type is "button"
9549 .append( "the " + event.target.type + "." );
9550 }
9551};
9552
9553var you = { type: "cat" };
9554var they = { type: "fish" };
9555
9556// Set up handler to execute me.test() in the context
9557// of `me`, with `you` and `they` as additional arguments
9558var proxy = $.proxy( me.test, me, you, they );
9559
9560$( "#test" )
9561 .on( "click", proxy );
9562</script>
9563
9564</body>
9565</html>
9566```
9567 */
9568 proxy<TContext,
9569 TReturn,
9570 A, B, C, D, E, F, G,
9571 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
9572 t: T, u: U, v: V, w: W, x: X) => TReturn,
9573 context: TContext,
9574 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;
9575 /**
9576 * Takes a function and returns a new one that will always have a particular context.
9577 * @param funсtion The function whose context will be changed.
9578 * @param context The object to which the context (`this`) of the function should be set.
9579 * @param a An argument to be passed to the function referenced in the `function` argument.
9580 * @param b An argument to be passed to the function referenced in the `function` argument.
9581 * @param c An argument to be passed to the function referenced in the `function` argument.
9582 * @param d An argument to be passed to the function referenced in the `function` argument.
9583 * @param e An argument to be passed to the function referenced in the `function` argument.
9584 * @param f An argument to be passed to the function referenced in the `function` argument.
9585 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9586 * @since 1.4
9587 * @since 1.6
9588 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9589 * @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.
9590```html
9591<!doctype html>
9592<html lang="en">
9593<head>
9594 <meta charset="utf-8">
9595 <title>jQuery.proxy demo</title>
9596 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9597</head>
9598<body>
9599
9600<p><button type="button" id="test">Test</button></p>
9601<div id="log"></div>
9602
9603<script>
9604var me = {
9605 type: "zombie",
9606 test: function( event ) {
9607 // Without proxy, `this` would refer to the event target
9608 // use event.target to reference that element.
9609 var element = event.target;
9610 $( element ).css( "background-color", "red" );
9611
9612 // With proxy, `this` refers to the me object encapsulating
9613 // this function.
9614 $( "#log" ).append( "Hello " + this.type + "<br>" );
9615 $( "#test" ).off( "click", this.test );
9616 }
9617};
9618
9619var you = {
9620 type: "person",
9621 test: function( event ) {
9622 $( "#log" ).append( this.type + " " );
9623 }
9624};
9625
9626// Execute you.test() in the context of the `you` object
9627// no matter where it is called
9628// i.e. the `this` keyword will refer to `you`
9629var youClick = $.proxy( you.test, you );
9630
9631// attach click handlers to #test
9632$( "#test" )
9633 // this === "zombie"; handler unbound after first click
9634 .on( "click", $.proxy( me.test, me ) )
9635
9636 // this === "person"
9637 .on( "click", youClick )
9638
9639 // this === "zombie"
9640 .on( "click", $.proxy( you.test, me ) )
9641
9642 // this === "<button> element"
9643 .on( "click", you.test );
9644</script>
9645
9646</body>
9647</html>
9648```
9649 * @example ​ ````Change the context of a function bound to the click handler,
9650```html
9651<!doctype html>
9652<html lang="en">
9653<head>
9654 <meta charset="utf-8">
9655 <title>jQuery.proxy demo</title>
9656 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9657</head>
9658<body>
9659
9660<p><button type="button" id="test">Test</button></p>
9661<div id="log"></div>
9662
9663<script>
9664var me = {
9665 // I'm a dog
9666 type: "dog",
9667
9668 // Note that event comes *after* one and two
9669 test: function( one, two, event ) {
9670 $( "#log" )
9671
9672 // `one` maps to `you`, the 1st additional
9673 // argument in the $.proxy function call
9674 .append( "<h3>Hello " + one.type + ":</h3>" )
9675
9676 // The `this` keyword refers to `me`
9677 // (the 2nd, context, argument of $.proxy)
9678 .append( "I am a " + this.type + ", " )
9679
9680 // `two` maps to `they`, the 2nd additional
9681 // argument in the $.proxy function call
9682 .append( "and they are " + two.type + ".<br>" )
9683
9684 // The event type is "click"
9685 .append( "Thanks for " + event.type + "ing." )
9686
9687 // The clicked element is `event.target`,
9688 // and its type is "button"
9689 .append( "the " + event.target.type + "." );
9690 }
9691};
9692
9693var you = { type: "cat" };
9694var they = { type: "fish" };
9695
9696// Set up handler to execute me.test() in the context
9697// of `me`, with `you` and `they` as additional arguments
9698var proxy = $.proxy( me.test, me, you, they );
9699
9700$( "#test" )
9701 .on( "click", proxy );
9702</script>
9703
9704</body>
9705</html>
9706```
9707 */
9708 proxy<TContext,
9709 TReturn,
9710 A, B, C, D, E, F,
9711 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
9712 t: T, u: U, v: V, w: W, x: X) => TReturn,
9713 context: TContext,
9714 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X) => TReturn;
9715 /**
9716 * Takes a function and returns a new one that will always have a particular context.
9717 * @param funсtion The function whose context will be changed.
9718 * @param context The object to which the context (`this`) of the function should be set.
9719 * @param a An argument to be passed to the function referenced in the `function` argument.
9720 * @param b An argument to be passed to the function referenced in the `function` argument.
9721 * @param c An argument to be passed to the function referenced in the `function` argument.
9722 * @param d An argument to be passed to the function referenced in the `function` argument.
9723 * @param e An argument to be passed to the function referenced in the `function` argument.
9724 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9725 * @since 1.4
9726 * @since 1.6
9727 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9728 * @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.
9729```html
9730<!doctype html>
9731<html lang="en">
9732<head>
9733 <meta charset="utf-8">
9734 <title>jQuery.proxy demo</title>
9735 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9736</head>
9737<body>
9738
9739<p><button type="button" id="test">Test</button></p>
9740<div id="log"></div>
9741
9742<script>
9743var me = {
9744 type: "zombie",
9745 test: function( event ) {
9746 // Without proxy, `this` would refer to the event target
9747 // use event.target to reference that element.
9748 var element = event.target;
9749 $( element ).css( "background-color", "red" );
9750
9751 // With proxy, `this` refers to the me object encapsulating
9752 // this function.
9753 $( "#log" ).append( "Hello " + this.type + "<br>" );
9754 $( "#test" ).off( "click", this.test );
9755 }
9756};
9757
9758var you = {
9759 type: "person",
9760 test: function( event ) {
9761 $( "#log" ).append( this.type + " " );
9762 }
9763};
9764
9765// Execute you.test() in the context of the `you` object
9766// no matter where it is called
9767// i.e. the `this` keyword will refer to `you`
9768var youClick = $.proxy( you.test, you );
9769
9770// attach click handlers to #test
9771$( "#test" )
9772 // this === "zombie"; handler unbound after first click
9773 .on( "click", $.proxy( me.test, me ) )
9774
9775 // this === "person"
9776 .on( "click", youClick )
9777
9778 // this === "zombie"
9779 .on( "click", $.proxy( you.test, me ) )
9780
9781 // this === "<button> element"
9782 .on( "click", you.test );
9783</script>
9784
9785</body>
9786</html>
9787```
9788 * @example ​ ````Change the context of a function bound to the click handler,
9789```html
9790<!doctype html>
9791<html lang="en">
9792<head>
9793 <meta charset="utf-8">
9794 <title>jQuery.proxy demo</title>
9795 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9796</head>
9797<body>
9798
9799<p><button type="button" id="test">Test</button></p>
9800<div id="log"></div>
9801
9802<script>
9803var me = {
9804 // I'm a dog
9805 type: "dog",
9806
9807 // Note that event comes *after* one and two
9808 test: function( one, two, event ) {
9809 $( "#log" )
9810
9811 // `one` maps to `you`, the 1st additional
9812 // argument in the $.proxy function call
9813 .append( "<h3>Hello " + one.type + ":</h3>" )
9814
9815 // The `this` keyword refers to `me`
9816 // (the 2nd, context, argument of $.proxy)
9817 .append( "I am a " + this.type + ", " )
9818
9819 // `two` maps to `they`, the 2nd additional
9820 // argument in the $.proxy function call
9821 .append( "and they are " + two.type + ".<br>" )
9822
9823 // The event type is "click"
9824 .append( "Thanks for " + event.type + "ing." )
9825
9826 // The clicked element is `event.target`,
9827 // and its type is "button"
9828 .append( "the " + event.target.type + "." );
9829 }
9830};
9831
9832var you = { type: "cat" };
9833var they = { type: "fish" };
9834
9835// Set up handler to execute me.test() in the context
9836// of `me`, with `you` and `they` as additional arguments
9837var proxy = $.proxy( me.test, me, you, they );
9838
9839$( "#test" )
9840 .on( "click", proxy );
9841</script>
9842
9843</body>
9844</html>
9845```
9846 */
9847 proxy<TContext,
9848 TReturn,
9849 A, B, C, D, E,
9850 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
9851 t: T, u: U, v: V, w: W, x: X) => TReturn,
9852 context: TContext,
9853 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X) => TReturn;
9854 /**
9855 * Takes a function and returns a new one that will always have a particular context.
9856 * @param funсtion The function whose context will be changed.
9857 * @param context The object to which the context (`this`) of the function should be set.
9858 * @param a An argument to be passed to the function referenced in the `function` argument.
9859 * @param b An argument to be passed to the function referenced in the `function` argument.
9860 * @param c An argument to be passed to the function referenced in the `function` argument.
9861 * @param d An argument to be passed to the function referenced in the `function` argument.
9862 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9863 * @since 1.4
9864 * @since 1.6
9865 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9866 * @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.
9867```html
9868<!doctype html>
9869<html lang="en">
9870<head>
9871 <meta charset="utf-8">
9872 <title>jQuery.proxy demo</title>
9873 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9874</head>
9875<body>
9876
9877<p><button type="button" id="test">Test</button></p>
9878<div id="log"></div>
9879
9880<script>
9881var me = {
9882 type: "zombie",
9883 test: function( event ) {
9884 // Without proxy, `this` would refer to the event target
9885 // use event.target to reference that element.
9886 var element = event.target;
9887 $( element ).css( "background-color", "red" );
9888
9889 // With proxy, `this` refers to the me object encapsulating
9890 // this function.
9891 $( "#log" ).append( "Hello " + this.type + "<br>" );
9892 $( "#test" ).off( "click", this.test );
9893 }
9894};
9895
9896var you = {
9897 type: "person",
9898 test: function( event ) {
9899 $( "#log" ).append( this.type + " " );
9900 }
9901};
9902
9903// Execute you.test() in the context of the `you` object
9904// no matter where it is called
9905// i.e. the `this` keyword will refer to `you`
9906var youClick = $.proxy( you.test, you );
9907
9908// attach click handlers to #test
9909$( "#test" )
9910 // this === "zombie"; handler unbound after first click
9911 .on( "click", $.proxy( me.test, me ) )
9912
9913 // this === "person"
9914 .on( "click", youClick )
9915
9916 // this === "zombie"
9917 .on( "click", $.proxy( you.test, me ) )
9918
9919 // this === "<button> element"
9920 .on( "click", you.test );
9921</script>
9922
9923</body>
9924</html>
9925```
9926 * @example ​ ````Change the context of a function bound to the click handler,
9927```html
9928<!doctype html>
9929<html lang="en">
9930<head>
9931 <meta charset="utf-8">
9932 <title>jQuery.proxy demo</title>
9933 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9934</head>
9935<body>
9936
9937<p><button type="button" id="test">Test</button></p>
9938<div id="log"></div>
9939
9940<script>
9941var me = {
9942 // I'm a dog
9943 type: "dog",
9944
9945 // Note that event comes *after* one and two
9946 test: function( one, two, event ) {
9947 $( "#log" )
9948
9949 // `one` maps to `you`, the 1st additional
9950 // argument in the $.proxy function call
9951 .append( "<h3>Hello " + one.type + ":</h3>" )
9952
9953 // The `this` keyword refers to `me`
9954 // (the 2nd, context, argument of $.proxy)
9955 .append( "I am a " + this.type + ", " )
9956
9957 // `two` maps to `they`, the 2nd additional
9958 // argument in the $.proxy function call
9959 .append( "and they are " + two.type + ".<br>" )
9960
9961 // The event type is "click"
9962 .append( "Thanks for " + event.type + "ing." )
9963
9964 // The clicked element is `event.target`,
9965 // and its type is "button"
9966 .append( "the " + event.target.type + "." );
9967 }
9968};
9969
9970var you = { type: "cat" };
9971var they = { type: "fish" };
9972
9973// Set up handler to execute me.test() in the context
9974// of `me`, with `you` and `they` as additional arguments
9975var proxy = $.proxy( me.test, me, you, they );
9976
9977$( "#test" )
9978 .on( "click", proxy );
9979</script>
9980
9981</body>
9982</html>
9983```
9984 */
9985 proxy<TContext,
9986 TReturn,
9987 A, B, C, D,
9988 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
9989 t: T, u: U, v: V, w: W, x: X) => TReturn,
9990 context: TContext,
9991 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X) => TReturn;
9992 /**
9993 * Takes a function and returns a new one that will always have a particular context.
9994 * @param funсtion The function whose context will be changed.
9995 * @param context The object to which the context (`this`) of the function should be set.
9996 * @param a An argument to be passed to the function referenced in the `function` argument.
9997 * @param b An argument to be passed to the function referenced in the `function` argument.
9998 * @param c An argument to be passed to the function referenced in the `function` argument.
9999 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10000 * @since 1.4
10001 * @since 1.6
10002 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10003 * @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.
10004```html
10005<!doctype html>
10006<html lang="en">
10007<head>
10008 <meta charset="utf-8">
10009 <title>jQuery.proxy demo</title>
10010 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10011</head>
10012<body>
10013
10014<p><button type="button" id="test">Test</button></p>
10015<div id="log"></div>
10016
10017<script>
10018var me = {
10019 type: "zombie",
10020 test: function( event ) {
10021 // Without proxy, `this` would refer to the event target
10022 // use event.target to reference that element.
10023 var element = event.target;
10024 $( element ).css( "background-color", "red" );
10025
10026 // With proxy, `this` refers to the me object encapsulating
10027 // this function.
10028 $( "#log" ).append( "Hello " + this.type + "<br>" );
10029 $( "#test" ).off( "click", this.test );
10030 }
10031};
10032
10033var you = {
10034 type: "person",
10035 test: function( event ) {
10036 $( "#log" ).append( this.type + " " );
10037 }
10038};
10039
10040// Execute you.test() in the context of the `you` object
10041// no matter where it is called
10042// i.e. the `this` keyword will refer to `you`
10043var youClick = $.proxy( you.test, you );
10044
10045// attach click handlers to #test
10046$( "#test" )
10047 // this === "zombie"; handler unbound after first click
10048 .on( "click", $.proxy( me.test, me ) )
10049
10050 // this === "person"
10051 .on( "click", youClick )
10052
10053 // this === "zombie"
10054 .on( "click", $.proxy( you.test, me ) )
10055
10056 // this === "<button> element"
10057 .on( "click", you.test );
10058</script>
10059
10060</body>
10061</html>
10062```
10063 * @example ​ ````Change the context of a function bound to the click handler,
10064```html
10065<!doctype html>
10066<html lang="en">
10067<head>
10068 <meta charset="utf-8">
10069 <title>jQuery.proxy demo</title>
10070 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10071</head>
10072<body>
10073
10074<p><button type="button" id="test">Test</button></p>
10075<div id="log"></div>
10076
10077<script>
10078var me = {
10079 // I'm a dog
10080 type: "dog",
10081
10082 // Note that event comes *after* one and two
10083 test: function( one, two, event ) {
10084 $( "#log" )
10085
10086 // `one` maps to `you`, the 1st additional
10087 // argument in the $.proxy function call
10088 .append( "<h3>Hello " + one.type + ":</h3>" )
10089
10090 // The `this` keyword refers to `me`
10091 // (the 2nd, context, argument of $.proxy)
10092 .append( "I am a " + this.type + ", " )
10093
10094 // `two` maps to `they`, the 2nd additional
10095 // argument in the $.proxy function call
10096 .append( "and they are " + two.type + ".<br>" )
10097
10098 // The event type is "click"
10099 .append( "Thanks for " + event.type + "ing." )
10100
10101 // The clicked element is `event.target`,
10102 // and its type is "button"
10103 .append( "the " + event.target.type + "." );
10104 }
10105};
10106
10107var you = { type: "cat" };
10108var they = { type: "fish" };
10109
10110// Set up handler to execute me.test() in the context
10111// of `me`, with `you` and `they` as additional arguments
10112var proxy = $.proxy( me.test, me, you, they );
10113
10114$( "#test" )
10115 .on( "click", proxy );
10116</script>
10117
10118</body>
10119</html>
10120```
10121 */
10122 proxy<TContext,
10123 TReturn,
10124 A, B, C,
10125 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B, c: C,
10126 t: T, u: U, v: V, w: W, x: X) => TReturn,
10127 context: TContext,
10128 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X) => TReturn;
10129 /**
10130 * Takes a function and returns a new one that will always have a particular context.
10131 * @param funсtion The function whose context will be changed.
10132 * @param context The object to which the context (`this`) of the function should be set.
10133 * @param a An argument to be passed to the function referenced in the `function` argument.
10134 * @param b An argument to be passed to the function referenced in the `function` argument.
10135 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10136 * @since 1.4
10137 * @since 1.6
10138 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10139 * @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.
10140```html
10141<!doctype html>
10142<html lang="en">
10143<head>
10144 <meta charset="utf-8">
10145 <title>jQuery.proxy demo</title>
10146 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10147</head>
10148<body>
10149
10150<p><button type="button" id="test">Test</button></p>
10151<div id="log"></div>
10152
10153<script>
10154var me = {
10155 type: "zombie",
10156 test: function( event ) {
10157 // Without proxy, `this` would refer to the event target
10158 // use event.target to reference that element.
10159 var element = event.target;
10160 $( element ).css( "background-color", "red" );
10161
10162 // With proxy, `this` refers to the me object encapsulating
10163 // this function.
10164 $( "#log" ).append( "Hello " + this.type + "<br>" );
10165 $( "#test" ).off( "click", this.test );
10166 }
10167};
10168
10169var you = {
10170 type: "person",
10171 test: function( event ) {
10172 $( "#log" ).append( this.type + " " );
10173 }
10174};
10175
10176// Execute you.test() in the context of the `you` object
10177// no matter where it is called
10178// i.e. the `this` keyword will refer to `you`
10179var youClick = $.proxy( you.test, you );
10180
10181// attach click handlers to #test
10182$( "#test" )
10183 // this === "zombie"; handler unbound after first click
10184 .on( "click", $.proxy( me.test, me ) )
10185
10186 // this === "person"
10187 .on( "click", youClick )
10188
10189 // this === "zombie"
10190 .on( "click", $.proxy( you.test, me ) )
10191
10192 // this === "<button> element"
10193 .on( "click", you.test );
10194</script>
10195
10196</body>
10197</html>
10198```
10199 * @example ​ ````Change the context of a function bound to the click handler,
10200```html
10201<!doctype html>
10202<html lang="en">
10203<head>
10204 <meta charset="utf-8">
10205 <title>jQuery.proxy demo</title>
10206 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10207</head>
10208<body>
10209
10210<p><button type="button" id="test">Test</button></p>
10211<div id="log"></div>
10212
10213<script>
10214var me = {
10215 // I'm a dog
10216 type: "dog",
10217
10218 // Note that event comes *after* one and two
10219 test: function( one, two, event ) {
10220 $( "#log" )
10221
10222 // `one` maps to `you`, the 1st additional
10223 // argument in the $.proxy function call
10224 .append( "<h3>Hello " + one.type + ":</h3>" )
10225
10226 // The `this` keyword refers to `me`
10227 // (the 2nd, context, argument of $.proxy)
10228 .append( "I am a " + this.type + ", " )
10229
10230 // `two` maps to `they`, the 2nd additional
10231 // argument in the $.proxy function call
10232 .append( "and they are " + two.type + ".<br>" )
10233
10234 // The event type is "click"
10235 .append( "Thanks for " + event.type + "ing." )
10236
10237 // The clicked element is `event.target`,
10238 // and its type is "button"
10239 .append( "the " + event.target.type + "." );
10240 }
10241};
10242
10243var you = { type: "cat" };
10244var they = { type: "fish" };
10245
10246// Set up handler to execute me.test() in the context
10247// of `me`, with `you` and `they` as additional arguments
10248var proxy = $.proxy( me.test, me, you, they );
10249
10250$( "#test" )
10251 .on( "click", proxy );
10252</script>
10253
10254</body>
10255</html>
10256```
10257 */
10258 proxy<TContext,
10259 TReturn,
10260 A, B,
10261 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B,
10262 t: T, u: U, v: V, w: W, x: X) => TReturn,
10263 context: TContext,
10264 a: A, b: B): (t: T, u: U, v: V, w: W, x: X) => TReturn;
10265 /**
10266 * Takes a function and returns a new one that will always have a particular context.
10267 * @param funсtion The function whose context will be changed.
10268 * @param context The object to which the context (`this`) of the function should be set.
10269 * @param a An argument to be passed to the function referenced in the `function` argument.
10270 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10271 * @since 1.4
10272 * @since 1.6
10273 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10274 * @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.
10275```html
10276<!doctype html>
10277<html lang="en">
10278<head>
10279 <meta charset="utf-8">
10280 <title>jQuery.proxy demo</title>
10281 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10282</head>
10283<body>
10284
10285<p><button type="button" id="test">Test</button></p>
10286<div id="log"></div>
10287
10288<script>
10289var me = {
10290 type: "zombie",
10291 test: function( event ) {
10292 // Without proxy, `this` would refer to the event target
10293 // use event.target to reference that element.
10294 var element = event.target;
10295 $( element ).css( "background-color", "red" );
10296
10297 // With proxy, `this` refers to the me object encapsulating
10298 // this function.
10299 $( "#log" ).append( "Hello " + this.type + "<br>" );
10300 $( "#test" ).off( "click", this.test );
10301 }
10302};
10303
10304var you = {
10305 type: "person",
10306 test: function( event ) {
10307 $( "#log" ).append( this.type + " " );
10308 }
10309};
10310
10311// Execute you.test() in the context of the `you` object
10312// no matter where it is called
10313// i.e. the `this` keyword will refer to `you`
10314var youClick = $.proxy( you.test, you );
10315
10316// attach click handlers to #test
10317$( "#test" )
10318 // this === "zombie"; handler unbound after first click
10319 .on( "click", $.proxy( me.test, me ) )
10320
10321 // this === "person"
10322 .on( "click", youClick )
10323
10324 // this === "zombie"
10325 .on( "click", $.proxy( you.test, me ) )
10326
10327 // this === "<button> element"
10328 .on( "click", you.test );
10329</script>
10330
10331</body>
10332</html>
10333```
10334 * @example ​ ````Change the context of a function bound to the click handler,
10335```html
10336<!doctype html>
10337<html lang="en">
10338<head>
10339 <meta charset="utf-8">
10340 <title>jQuery.proxy demo</title>
10341 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10342</head>
10343<body>
10344
10345<p><button type="button" id="test">Test</button></p>
10346<div id="log"></div>
10347
10348<script>
10349var me = {
10350 // I'm a dog
10351 type: "dog",
10352
10353 // Note that event comes *after* one and two
10354 test: function( one, two, event ) {
10355 $( "#log" )
10356
10357 // `one` maps to `you`, the 1st additional
10358 // argument in the $.proxy function call
10359 .append( "<h3>Hello " + one.type + ":</h3>" )
10360
10361 // The `this` keyword refers to `me`
10362 // (the 2nd, context, argument of $.proxy)
10363 .append( "I am a " + this.type + ", " )
10364
10365 // `two` maps to `they`, the 2nd additional
10366 // argument in the $.proxy function call
10367 .append( "and they are " + two.type + ".<br>" )
10368
10369 // The event type is "click"
10370 .append( "Thanks for " + event.type + "ing." )
10371
10372 // The clicked element is `event.target`,
10373 // and its type is "button"
10374 .append( "the " + event.target.type + "." );
10375 }
10376};
10377
10378var you = { type: "cat" };
10379var they = { type: "fish" };
10380
10381// Set up handler to execute me.test() in the context
10382// of `me`, with `you` and `they` as additional arguments
10383var proxy = $.proxy( me.test, me, you, they );
10384
10385$( "#test" )
10386 .on( "click", proxy );
10387</script>
10388
10389</body>
10390</html>
10391```
10392 */
10393 proxy<TContext,
10394 TReturn,
10395 A,
10396 T, U, V, W, X>(funсtion: (this: TContext, a: A,
10397 t: T, u: U, v: V, w: W, x: X) => TReturn,
10398 context: TContext,
10399 a: A): (t: T, u: U, v: V, w: W, x: X) => TReturn;
10400 /**
10401 * Takes a function and returns a new one that will always have a particular context.
10402 * @param funсtion The function whose context will be changed.
10403 * @param context The object to which the context (`this`) of the function should be set.
10404 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10405 * @since 1.4
10406 * @since 1.6
10407 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10408 * @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.
10409```html
10410<!doctype html>
10411<html lang="en">
10412<head>
10413 <meta charset="utf-8">
10414 <title>jQuery.proxy demo</title>
10415 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10416</head>
10417<body>
10418
10419<p><button type="button" id="test">Test</button></p>
10420<div id="log"></div>
10421
10422<script>
10423var me = {
10424 type: "zombie",
10425 test: function( event ) {
10426 // Without proxy, `this` would refer to the event target
10427 // use event.target to reference that element.
10428 var element = event.target;
10429 $( element ).css( "background-color", "red" );
10430
10431 // With proxy, `this` refers to the me object encapsulating
10432 // this function.
10433 $( "#log" ).append( "Hello " + this.type + "<br>" );
10434 $( "#test" ).off( "click", this.test );
10435 }
10436};
10437
10438var you = {
10439 type: "person",
10440 test: function( event ) {
10441 $( "#log" ).append( this.type + " " );
10442 }
10443};
10444
10445// Execute you.test() in the context of the `you` object
10446// no matter where it is called
10447// i.e. the `this` keyword will refer to `you`
10448var youClick = $.proxy( you.test, you );
10449
10450// attach click handlers to #test
10451$( "#test" )
10452 // this === "zombie"; handler unbound after first click
10453 .on( "click", $.proxy( me.test, me ) )
10454
10455 // this === "person"
10456 .on( "click", youClick )
10457
10458 // this === "zombie"
10459 .on( "click", $.proxy( you.test, me ) )
10460
10461 // this === "<button> element"
10462 .on( "click", you.test );
10463</script>
10464
10465</body>
10466</html>
10467```
10468 * @example ​ ````Change the context of a function bound to the click handler,
10469```html
10470<!doctype html>
10471<html lang="en">
10472<head>
10473 <meta charset="utf-8">
10474 <title>jQuery.proxy demo</title>
10475 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10476</head>
10477<body>
10478
10479<p><button type="button" id="test">Test</button></p>
10480<div id="log"></div>
10481
10482<script>
10483var me = {
10484 // I'm a dog
10485 type: "dog",
10486
10487 // Note that event comes *after* one and two
10488 test: function( one, two, event ) {
10489 $( "#log" )
10490
10491 // `one` maps to `you`, the 1st additional
10492 // argument in the $.proxy function call
10493 .append( "<h3>Hello " + one.type + ":</h3>" )
10494
10495 // The `this` keyword refers to `me`
10496 // (the 2nd, context, argument of $.proxy)
10497 .append( "I am a " + this.type + ", " )
10498
10499 // `two` maps to `they`, the 2nd additional
10500 // argument in the $.proxy function call
10501 .append( "and they are " + two.type + ".<br>" )
10502
10503 // The event type is "click"
10504 .append( "Thanks for " + event.type + "ing." )
10505
10506 // The clicked element is `event.target`,
10507 // and its type is "button"
10508 .append( "the " + event.target.type + "." );
10509 }
10510};
10511
10512var you = { type: "cat" };
10513var they = { type: "fish" };
10514
10515// Set up handler to execute me.test() in the context
10516// of `me`, with `you` and `they` as additional arguments
10517var proxy = $.proxy( me.test, me, you, they );
10518
10519$( "#test" )
10520 .on( "click", proxy );
10521</script>
10522
10523</body>
10524</html>
10525```
10526 */
10527 proxy<TContext,
10528 TReturn,
10529 T, U, V, W, X>(funсtion: (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn,
10530 context: TContext): (t: T, u: U, v: V, w: W, x: X) => TReturn;
10531
10532 // #endregion
10533
10534 // region 6 parameters
10535 // #region 6 parameters
10536
10537 /**
10538 * Takes a function and returns a new one that will always have a particular context.
10539 * @param funсtion The function whose context will be changed.
10540 * @param context The object to which the context (`this`) of the function should be set.
10541 * @param a An argument to be passed to the function referenced in the `function` argument.
10542 * @param b An argument to be passed to the function referenced in the `function` argument.
10543 * @param c An argument to be passed to the function referenced in the `function` argument.
10544 * @param d An argument to be passed to the function referenced in the `function` argument.
10545 * @param e An argument to be passed to the function referenced in the `function` argument.
10546 * @param f An argument to be passed to the function referenced in the `function` argument.
10547 * @param g An argument to be passed to the function referenced in the `function` argument.
10548 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10549 * @since 1.4
10550 * @since 1.6
10551 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10552 * @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.
10553```html
10554<!doctype html>
10555<html lang="en">
10556<head>
10557 <meta charset="utf-8">
10558 <title>jQuery.proxy demo</title>
10559 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10560</head>
10561<body>
10562
10563<p><button type="button" id="test">Test</button></p>
10564<div id="log"></div>
10565
10566<script>
10567var me = {
10568 type: "zombie",
10569 test: function( event ) {
10570 // Without proxy, `this` would refer to the event target
10571 // use event.target to reference that element.
10572 var element = event.target;
10573 $( element ).css( "background-color", "red" );
10574
10575 // With proxy, `this` refers to the me object encapsulating
10576 // this function.
10577 $( "#log" ).append( "Hello " + this.type + "<br>" );
10578 $( "#test" ).off( "click", this.test );
10579 }
10580};
10581
10582var you = {
10583 type: "person",
10584 test: function( event ) {
10585 $( "#log" ).append( this.type + " " );
10586 }
10587};
10588
10589// Execute you.test() in the context of the `you` object
10590// no matter where it is called
10591// i.e. the `this` keyword will refer to `you`
10592var youClick = $.proxy( you.test, you );
10593
10594// attach click handlers to #test
10595$( "#test" )
10596 // this === "zombie"; handler unbound after first click
10597 .on( "click", $.proxy( me.test, me ) )
10598
10599 // this === "person"
10600 .on( "click", youClick )
10601
10602 // this === "zombie"
10603 .on( "click", $.proxy( you.test, me ) )
10604
10605 // this === "<button> element"
10606 .on( "click", you.test );
10607</script>
10608
10609</body>
10610</html>
10611```
10612 * @example ​ ````Change the context of a function bound to the click handler,
10613```html
10614<!doctype html>
10615<html lang="en">
10616<head>
10617 <meta charset="utf-8">
10618 <title>jQuery.proxy demo</title>
10619 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10620</head>
10621<body>
10622
10623<p><button type="button" id="test">Test</button></p>
10624<div id="log"></div>
10625
10626<script>
10627var me = {
10628 // I'm a dog
10629 type: "dog",
10630
10631 // Note that event comes *after* one and two
10632 test: function( one, two, event ) {
10633 $( "#log" )
10634
10635 // `one` maps to `you`, the 1st additional
10636 // argument in the $.proxy function call
10637 .append( "<h3>Hello " + one.type + ":</h3>" )
10638
10639 // The `this` keyword refers to `me`
10640 // (the 2nd, context, argument of $.proxy)
10641 .append( "I am a " + this.type + ", " )
10642
10643 // `two` maps to `they`, the 2nd additional
10644 // argument in the $.proxy function call
10645 .append( "and they are " + two.type + ".<br>" )
10646
10647 // The event type is "click"
10648 .append( "Thanks for " + event.type + "ing." )
10649
10650 // The clicked element is `event.target`,
10651 // and its type is "button"
10652 .append( "the " + event.target.type + "." );
10653 }
10654};
10655
10656var you = { type: "cat" };
10657var they = { type: "fish" };
10658
10659// Set up handler to execute me.test() in the context
10660// of `me`, with `you` and `they` as additional arguments
10661var proxy = $.proxy( me.test, me, you, they );
10662
10663$( "#test" )
10664 .on( "click", proxy );
10665</script>
10666
10667</body>
10668</html>
10669```
10670 */
10671 proxy<TContext,
10672 TReturn,
10673 A, B, C, D, E, F, G,
10674 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
10675 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
10676 context: TContext,
10677 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;
10678 /**
10679 * Takes a function and returns a new one that will always have a particular context.
10680 * @param funсtion The function whose context will be changed.
10681 * @param context The object to which the context (`this`) of the function should be set.
10682 * @param a An argument to be passed to the function referenced in the `function` argument.
10683 * @param b An argument to be passed to the function referenced in the `function` argument.
10684 * @param c An argument to be passed to the function referenced in the `function` argument.
10685 * @param d An argument to be passed to the function referenced in the `function` argument.
10686 * @param e An argument to be passed to the function referenced in the `function` argument.
10687 * @param f An argument to be passed to the function referenced in the `function` argument.
10688 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10689 * @since 1.4
10690 * @since 1.6
10691 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10692 * @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.
10693```html
10694<!doctype html>
10695<html lang="en">
10696<head>
10697 <meta charset="utf-8">
10698 <title>jQuery.proxy demo</title>
10699 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10700</head>
10701<body>
10702
10703<p><button type="button" id="test">Test</button></p>
10704<div id="log"></div>
10705
10706<script>
10707var me = {
10708 type: "zombie",
10709 test: function( event ) {
10710 // Without proxy, `this` would refer to the event target
10711 // use event.target to reference that element.
10712 var element = event.target;
10713 $( element ).css( "background-color", "red" );
10714
10715 // With proxy, `this` refers to the me object encapsulating
10716 // this function.
10717 $( "#log" ).append( "Hello " + this.type + "<br>" );
10718 $( "#test" ).off( "click", this.test );
10719 }
10720};
10721
10722var you = {
10723 type: "person",
10724 test: function( event ) {
10725 $( "#log" ).append( this.type + " " );
10726 }
10727};
10728
10729// Execute you.test() in the context of the `you` object
10730// no matter where it is called
10731// i.e. the `this` keyword will refer to `you`
10732var youClick = $.proxy( you.test, you );
10733
10734// attach click handlers to #test
10735$( "#test" )
10736 // this === "zombie"; handler unbound after first click
10737 .on( "click", $.proxy( me.test, me ) )
10738
10739 // this === "person"
10740 .on( "click", youClick )
10741
10742 // this === "zombie"
10743 .on( "click", $.proxy( you.test, me ) )
10744
10745 // this === "<button> element"
10746 .on( "click", you.test );
10747</script>
10748
10749</body>
10750</html>
10751```
10752 * @example ​ ````Change the context of a function bound to the click handler,
10753```html
10754<!doctype html>
10755<html lang="en">
10756<head>
10757 <meta charset="utf-8">
10758 <title>jQuery.proxy demo</title>
10759 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10760</head>
10761<body>
10762
10763<p><button type="button" id="test">Test</button></p>
10764<div id="log"></div>
10765
10766<script>
10767var me = {
10768 // I'm a dog
10769 type: "dog",
10770
10771 // Note that event comes *after* one and two
10772 test: function( one, two, event ) {
10773 $( "#log" )
10774
10775 // `one` maps to `you`, the 1st additional
10776 // argument in the $.proxy function call
10777 .append( "<h3>Hello " + one.type + ":</h3>" )
10778
10779 // The `this` keyword refers to `me`
10780 // (the 2nd, context, argument of $.proxy)
10781 .append( "I am a " + this.type + ", " )
10782
10783 // `two` maps to `they`, the 2nd additional
10784 // argument in the $.proxy function call
10785 .append( "and they are " + two.type + ".<br>" )
10786
10787 // The event type is "click"
10788 .append( "Thanks for " + event.type + "ing." )
10789
10790 // The clicked element is `event.target`,
10791 // and its type is "button"
10792 .append( "the " + event.target.type + "." );
10793 }
10794};
10795
10796var you = { type: "cat" };
10797var they = { type: "fish" };
10798
10799// Set up handler to execute me.test() in the context
10800// of `me`, with `you` and `they` as additional arguments
10801var proxy = $.proxy( me.test, me, you, they );
10802
10803$( "#test" )
10804 .on( "click", proxy );
10805</script>
10806
10807</body>
10808</html>
10809```
10810 */
10811 proxy<TContext,
10812 TReturn,
10813 A, B, C, D, E, F,
10814 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
10815 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
10816 context: TContext,
10817 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;
10818 /**
10819 * Takes a function and returns a new one that will always have a particular context.
10820 * @param funсtion The function whose context will be changed.
10821 * @param context The object to which the context (`this`) of the function should be set.
10822 * @param a An argument to be passed to the function referenced in the `function` argument.
10823 * @param b An argument to be passed to the function referenced in the `function` argument.
10824 * @param c An argument to be passed to the function referenced in the `function` argument.
10825 * @param d An argument to be passed to the function referenced in the `function` argument.
10826 * @param e An argument to be passed to the function referenced in the `function` argument.
10827 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10828 * @since 1.4
10829 * @since 1.6
10830 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10831 * @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.
10832```html
10833<!doctype html>
10834<html lang="en">
10835<head>
10836 <meta charset="utf-8">
10837 <title>jQuery.proxy demo</title>
10838 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10839</head>
10840<body>
10841
10842<p><button type="button" id="test">Test</button></p>
10843<div id="log"></div>
10844
10845<script>
10846var me = {
10847 type: "zombie",
10848 test: function( event ) {
10849 // Without proxy, `this` would refer to the event target
10850 // use event.target to reference that element.
10851 var element = event.target;
10852 $( element ).css( "background-color", "red" );
10853
10854 // With proxy, `this` refers to the me object encapsulating
10855 // this function.
10856 $( "#log" ).append( "Hello " + this.type + "<br>" );
10857 $( "#test" ).off( "click", this.test );
10858 }
10859};
10860
10861var you = {
10862 type: "person",
10863 test: function( event ) {
10864 $( "#log" ).append( this.type + " " );
10865 }
10866};
10867
10868// Execute you.test() in the context of the `you` object
10869// no matter where it is called
10870// i.e. the `this` keyword will refer to `you`
10871var youClick = $.proxy( you.test, you );
10872
10873// attach click handlers to #test
10874$( "#test" )
10875 // this === "zombie"; handler unbound after first click
10876 .on( "click", $.proxy( me.test, me ) )
10877
10878 // this === "person"
10879 .on( "click", youClick )
10880
10881 // this === "zombie"
10882 .on( "click", $.proxy( you.test, me ) )
10883
10884 // this === "<button> element"
10885 .on( "click", you.test );
10886</script>
10887
10888</body>
10889</html>
10890```
10891 * @example ​ ````Change the context of a function bound to the click handler,
10892```html
10893<!doctype html>
10894<html lang="en">
10895<head>
10896 <meta charset="utf-8">
10897 <title>jQuery.proxy demo</title>
10898 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10899</head>
10900<body>
10901
10902<p><button type="button" id="test">Test</button></p>
10903<div id="log"></div>
10904
10905<script>
10906var me = {
10907 // I'm a dog
10908 type: "dog",
10909
10910 // Note that event comes *after* one and two
10911 test: function( one, two, event ) {
10912 $( "#log" )
10913
10914 // `one` maps to `you`, the 1st additional
10915 // argument in the $.proxy function call
10916 .append( "<h3>Hello " + one.type + ":</h3>" )
10917
10918 // The `this` keyword refers to `me`
10919 // (the 2nd, context, argument of $.proxy)
10920 .append( "I am a " + this.type + ", " )
10921
10922 // `two` maps to `they`, the 2nd additional
10923 // argument in the $.proxy function call
10924 .append( "and they are " + two.type + ".<br>" )
10925
10926 // The event type is "click"
10927 .append( "Thanks for " + event.type + "ing." )
10928
10929 // The clicked element is `event.target`,
10930 // and its type is "button"
10931 .append( "the " + event.target.type + "." );
10932 }
10933};
10934
10935var you = { type: "cat" };
10936var they = { type: "fish" };
10937
10938// Set up handler to execute me.test() in the context
10939// of `me`, with `you` and `they` as additional arguments
10940var proxy = $.proxy( me.test, me, you, they );
10941
10942$( "#test" )
10943 .on( "click", proxy );
10944</script>
10945
10946</body>
10947</html>
10948```
10949 */
10950 proxy<TContext,
10951 TReturn,
10952 A, B, C, D, E,
10953 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
10954 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
10955 context: TContext,
10956 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
10957 /**
10958 * Takes a function and returns a new one that will always have a particular context.
10959 * @param funсtion The function whose context will be changed.
10960 * @param context The object to which the context (`this`) of the function should be set.
10961 * @param a An argument to be passed to the function referenced in the `function` argument.
10962 * @param b An argument to be passed to the function referenced in the `function` argument.
10963 * @param c An argument to be passed to the function referenced in the `function` argument.
10964 * @param d An argument to be passed to the function referenced in the `function` argument.
10965 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10966 * @since 1.4
10967 * @since 1.6
10968 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10969 * @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.
10970```html
10971<!doctype html>
10972<html lang="en">
10973<head>
10974 <meta charset="utf-8">
10975 <title>jQuery.proxy demo</title>
10976 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10977</head>
10978<body>
10979
10980<p><button type="button" id="test">Test</button></p>
10981<div id="log"></div>
10982
10983<script>
10984var me = {
10985 type: "zombie",
10986 test: function( event ) {
10987 // Without proxy, `this` would refer to the event target
10988 // use event.target to reference that element.
10989 var element = event.target;
10990 $( element ).css( "background-color", "red" );
10991
10992 // With proxy, `this` refers to the me object encapsulating
10993 // this function.
10994 $( "#log" ).append( "Hello " + this.type + "<br>" );
10995 $( "#test" ).off( "click", this.test );
10996 }
10997};
10998
10999var you = {
11000 type: "person",
11001 test: function( event ) {
11002 $( "#log" ).append( this.type + " " );
11003 }
11004};
11005
11006// Execute you.test() in the context of the `you` object
11007// no matter where it is called
11008// i.e. the `this` keyword will refer to `you`
11009var youClick = $.proxy( you.test, you );
11010
11011// attach click handlers to #test
11012$( "#test" )
11013 // this === "zombie"; handler unbound after first click
11014 .on( "click", $.proxy( me.test, me ) )
11015
11016 // this === "person"
11017 .on( "click", youClick )
11018
11019 // this === "zombie"
11020 .on( "click", $.proxy( you.test, me ) )
11021
11022 // this === "<button> element"
11023 .on( "click", you.test );
11024</script>
11025
11026</body>
11027</html>
11028```
11029 * @example ​ ````Change the context of a function bound to the click handler,
11030```html
11031<!doctype html>
11032<html lang="en">
11033<head>
11034 <meta charset="utf-8">
11035 <title>jQuery.proxy demo</title>
11036 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11037</head>
11038<body>
11039
11040<p><button type="button" id="test">Test</button></p>
11041<div id="log"></div>
11042
11043<script>
11044var me = {
11045 // I'm a dog
11046 type: "dog",
11047
11048 // Note that event comes *after* one and two
11049 test: function( one, two, event ) {
11050 $( "#log" )
11051
11052 // `one` maps to `you`, the 1st additional
11053 // argument in the $.proxy function call
11054 .append( "<h3>Hello " + one.type + ":</h3>" )
11055
11056 // The `this` keyword refers to `me`
11057 // (the 2nd, context, argument of $.proxy)
11058 .append( "I am a " + this.type + ", " )
11059
11060 // `two` maps to `they`, the 2nd additional
11061 // argument in the $.proxy function call
11062 .append( "and they are " + two.type + ".<br>" )
11063
11064 // The event type is "click"
11065 .append( "Thanks for " + event.type + "ing." )
11066
11067 // The clicked element is `event.target`,
11068 // and its type is "button"
11069 .append( "the " + event.target.type + "." );
11070 }
11071};
11072
11073var you = { type: "cat" };
11074var they = { type: "fish" };
11075
11076// Set up handler to execute me.test() in the context
11077// of `me`, with `you` and `they` as additional arguments
11078var proxy = $.proxy( me.test, me, you, they );
11079
11080$( "#test" )
11081 .on( "click", proxy );
11082</script>
11083
11084</body>
11085</html>
11086```
11087 */
11088 proxy<TContext,
11089 TReturn,
11090 A, B, C, D,
11091 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
11092 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
11093 context: TContext,
11094 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
11095 /**
11096 * Takes a function and returns a new one that will always have a particular context.
11097 * @param funсtion The function whose context will be changed.
11098 * @param context The object to which the context (`this`) of the function should be set.
11099 * @param a An argument to be passed to the function referenced in the `function` argument.
11100 * @param b An argument to be passed to the function referenced in the `function` argument.
11101 * @param c An argument to be passed to the function referenced in the `function` argument.
11102 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11103 * @since 1.4
11104 * @since 1.6
11105 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11106 * @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.
11107```html
11108<!doctype html>
11109<html lang="en">
11110<head>
11111 <meta charset="utf-8">
11112 <title>jQuery.proxy demo</title>
11113 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11114</head>
11115<body>
11116
11117<p><button type="button" id="test">Test</button></p>
11118<div id="log"></div>
11119
11120<script>
11121var me = {
11122 type: "zombie",
11123 test: function( event ) {
11124 // Without proxy, `this` would refer to the event target
11125 // use event.target to reference that element.
11126 var element = event.target;
11127 $( element ).css( "background-color", "red" );
11128
11129 // With proxy, `this` refers to the me object encapsulating
11130 // this function.
11131 $( "#log" ).append( "Hello " + this.type + "<br>" );
11132 $( "#test" ).off( "click", this.test );
11133 }
11134};
11135
11136var you = {
11137 type: "person",
11138 test: function( event ) {
11139 $( "#log" ).append( this.type + " " );
11140 }
11141};
11142
11143// Execute you.test() in the context of the `you` object
11144// no matter where it is called
11145// i.e. the `this` keyword will refer to `you`
11146var youClick = $.proxy( you.test, you );
11147
11148// attach click handlers to #test
11149$( "#test" )
11150 // this === "zombie"; handler unbound after first click
11151 .on( "click", $.proxy( me.test, me ) )
11152
11153 // this === "person"
11154 .on( "click", youClick )
11155
11156 // this === "zombie"
11157 .on( "click", $.proxy( you.test, me ) )
11158
11159 // this === "<button> element"
11160 .on( "click", you.test );
11161</script>
11162
11163</body>
11164</html>
11165```
11166 * @example ​ ````Change the context of a function bound to the click handler,
11167```html
11168<!doctype html>
11169<html lang="en">
11170<head>
11171 <meta charset="utf-8">
11172 <title>jQuery.proxy demo</title>
11173 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11174</head>
11175<body>
11176
11177<p><button type="button" id="test">Test</button></p>
11178<div id="log"></div>
11179
11180<script>
11181var me = {
11182 // I'm a dog
11183 type: "dog",
11184
11185 // Note that event comes *after* one and two
11186 test: function( one, two, event ) {
11187 $( "#log" )
11188
11189 // `one` maps to `you`, the 1st additional
11190 // argument in the $.proxy function call
11191 .append( "<h3>Hello " + one.type + ":</h3>" )
11192
11193 // The `this` keyword refers to `me`
11194 // (the 2nd, context, argument of $.proxy)
11195 .append( "I am a " + this.type + ", " )
11196
11197 // `two` maps to `they`, the 2nd additional
11198 // argument in the $.proxy function call
11199 .append( "and they are " + two.type + ".<br>" )
11200
11201 // The event type is "click"
11202 .append( "Thanks for " + event.type + "ing." )
11203
11204 // The clicked element is `event.target`,
11205 // and its type is "button"
11206 .append( "the " + event.target.type + "." );
11207 }
11208};
11209
11210var you = { type: "cat" };
11211var they = { type: "fish" };
11212
11213// Set up handler to execute me.test() in the context
11214// of `me`, with `you` and `they` as additional arguments
11215var proxy = $.proxy( me.test, me, you, they );
11216
11217$( "#test" )
11218 .on( "click", proxy );
11219</script>
11220
11221</body>
11222</html>
11223```
11224 */
11225 proxy<TContext,
11226 TReturn,
11227 A, B, C,
11228 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B, c: C,
11229 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
11230 context: TContext,
11231 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
11232 /**
11233 * Takes a function and returns a new one that will always have a particular context.
11234 * @param funсtion The function whose context will be changed.
11235 * @param context The object to which the context (`this`) of the function should be set.
11236 * @param a An argument to be passed to the function referenced in the `function` argument.
11237 * @param b An argument to be passed to the function referenced in the `function` argument.
11238 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11239 * @since 1.4
11240 * @since 1.6
11241 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11242 * @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.
11243```html
11244<!doctype html>
11245<html lang="en">
11246<head>
11247 <meta charset="utf-8">
11248 <title>jQuery.proxy demo</title>
11249 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11250</head>
11251<body>
11252
11253<p><button type="button" id="test">Test</button></p>
11254<div id="log"></div>
11255
11256<script>
11257var me = {
11258 type: "zombie",
11259 test: function( event ) {
11260 // Without proxy, `this` would refer to the event target
11261 // use event.target to reference that element.
11262 var element = event.target;
11263 $( element ).css( "background-color", "red" );
11264
11265 // With proxy, `this` refers to the me object encapsulating
11266 // this function.
11267 $( "#log" ).append( "Hello " + this.type + "<br>" );
11268 $( "#test" ).off( "click", this.test );
11269 }
11270};
11271
11272var you = {
11273 type: "person",
11274 test: function( event ) {
11275 $( "#log" ).append( this.type + " " );
11276 }
11277};
11278
11279// Execute you.test() in the context of the `you` object
11280// no matter where it is called
11281// i.e. the `this` keyword will refer to `you`
11282var youClick = $.proxy( you.test, you );
11283
11284// attach click handlers to #test
11285$( "#test" )
11286 // this === "zombie"; handler unbound after first click
11287 .on( "click", $.proxy( me.test, me ) )
11288
11289 // this === "person"
11290 .on( "click", youClick )
11291
11292 // this === "zombie"
11293 .on( "click", $.proxy( you.test, me ) )
11294
11295 // this === "<button> element"
11296 .on( "click", you.test );
11297</script>
11298
11299</body>
11300</html>
11301```
11302 * @example ​ ````Change the context of a function bound to the click handler,
11303```html
11304<!doctype html>
11305<html lang="en">
11306<head>
11307 <meta charset="utf-8">
11308 <title>jQuery.proxy demo</title>
11309 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11310</head>
11311<body>
11312
11313<p><button type="button" id="test">Test</button></p>
11314<div id="log"></div>
11315
11316<script>
11317var me = {
11318 // I'm a dog
11319 type: "dog",
11320
11321 // Note that event comes *after* one and two
11322 test: function( one, two, event ) {
11323 $( "#log" )
11324
11325 // `one` maps to `you`, the 1st additional
11326 // argument in the $.proxy function call
11327 .append( "<h3>Hello " + one.type + ":</h3>" )
11328
11329 // The `this` keyword refers to `me`
11330 // (the 2nd, context, argument of $.proxy)
11331 .append( "I am a " + this.type + ", " )
11332
11333 // `two` maps to `they`, the 2nd additional
11334 // argument in the $.proxy function call
11335 .append( "and they are " + two.type + ".<br>" )
11336
11337 // The event type is "click"
11338 .append( "Thanks for " + event.type + "ing." )
11339
11340 // The clicked element is `event.target`,
11341 // and its type is "button"
11342 .append( "the " + event.target.type + "." );
11343 }
11344};
11345
11346var you = { type: "cat" };
11347var they = { type: "fish" };
11348
11349// Set up handler to execute me.test() in the context
11350// of `me`, with `you` and `they` as additional arguments
11351var proxy = $.proxy( me.test, me, you, they );
11352
11353$( "#test" )
11354 .on( "click", proxy );
11355</script>
11356
11357</body>
11358</html>
11359```
11360 */
11361 proxy<TContext,
11362 TReturn,
11363 A, B,
11364 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B,
11365 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
11366 context: TContext,
11367 a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
11368 /**
11369 * Takes a function and returns a new one that will always have a particular context.
11370 * @param funсtion The function whose context will be changed.
11371 * @param context The object to which the context (`this`) of the function should be set.
11372 * @param a An argument to be passed to the function referenced in the `function` argument.
11373 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11374 * @since 1.4
11375 * @since 1.6
11376 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11377 * @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.
11378```html
11379<!doctype html>
11380<html lang="en">
11381<head>
11382 <meta charset="utf-8">
11383 <title>jQuery.proxy demo</title>
11384 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11385</head>
11386<body>
11387
11388<p><button type="button" id="test">Test</button></p>
11389<div id="log"></div>
11390
11391<script>
11392var me = {
11393 type: "zombie",
11394 test: function( event ) {
11395 // Without proxy, `this` would refer to the event target
11396 // use event.target to reference that element.
11397 var element = event.target;
11398 $( element ).css( "background-color", "red" );
11399
11400 // With proxy, `this` refers to the me object encapsulating
11401 // this function.
11402 $( "#log" ).append( "Hello " + this.type + "<br>" );
11403 $( "#test" ).off( "click", this.test );
11404 }
11405};
11406
11407var you = {
11408 type: "person",
11409 test: function( event ) {
11410 $( "#log" ).append( this.type + " " );
11411 }
11412};
11413
11414// Execute you.test() in the context of the `you` object
11415// no matter where it is called
11416// i.e. the `this` keyword will refer to `you`
11417var youClick = $.proxy( you.test, you );
11418
11419// attach click handlers to #test
11420$( "#test" )
11421 // this === "zombie"; handler unbound after first click
11422 .on( "click", $.proxy( me.test, me ) )
11423
11424 // this === "person"
11425 .on( "click", youClick )
11426
11427 // this === "zombie"
11428 .on( "click", $.proxy( you.test, me ) )
11429
11430 // this === "<button> element"
11431 .on( "click", you.test );
11432</script>
11433
11434</body>
11435</html>
11436```
11437 * @example ​ ````Change the context of a function bound to the click handler,
11438```html
11439<!doctype html>
11440<html lang="en">
11441<head>
11442 <meta charset="utf-8">
11443 <title>jQuery.proxy demo</title>
11444 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11445</head>
11446<body>
11447
11448<p><button type="button" id="test">Test</button></p>
11449<div id="log"></div>
11450
11451<script>
11452var me = {
11453 // I'm a dog
11454 type: "dog",
11455
11456 // Note that event comes *after* one and two
11457 test: function( one, two, event ) {
11458 $( "#log" )
11459
11460 // `one` maps to `you`, the 1st additional
11461 // argument in the $.proxy function call
11462 .append( "<h3>Hello " + one.type + ":</h3>" )
11463
11464 // The `this` keyword refers to `me`
11465 // (the 2nd, context, argument of $.proxy)
11466 .append( "I am a " + this.type + ", " )
11467
11468 // `two` maps to `they`, the 2nd additional
11469 // argument in the $.proxy function call
11470 .append( "and they are " + two.type + ".<br>" )
11471
11472 // The event type is "click"
11473 .append( "Thanks for " + event.type + "ing." )
11474
11475 // The clicked element is `event.target`,
11476 // and its type is "button"
11477 .append( "the " + event.target.type + "." );
11478 }
11479};
11480
11481var you = { type: "cat" };
11482var they = { type: "fish" };
11483
11484// Set up handler to execute me.test() in the context
11485// of `me`, with `you` and `they` as additional arguments
11486var proxy = $.proxy( me.test, me, you, they );
11487
11488$( "#test" )
11489 .on( "click", proxy );
11490</script>
11491
11492</body>
11493</html>
11494```
11495 */
11496 proxy<TContext,
11497 TReturn,
11498 A,
11499 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A,
11500 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
11501 context: TContext,
11502 a: A): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
11503 /**
11504 * Takes a function and returns a new one that will always have a particular context.
11505 * @param funсtion The function whose context will be changed.
11506 * @param context The object to which the context (`this`) of the function should be set.
11507 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11508 * @since 1.4
11509 * @since 1.6
11510 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11511 * @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.
11512```html
11513<!doctype html>
11514<html lang="en">
11515<head>
11516 <meta charset="utf-8">
11517 <title>jQuery.proxy demo</title>
11518 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11519</head>
11520<body>
11521
11522<p><button type="button" id="test">Test</button></p>
11523<div id="log"></div>
11524
11525<script>
11526var me = {
11527 type: "zombie",
11528 test: function( event ) {
11529 // Without proxy, `this` would refer to the event target
11530 // use event.target to reference that element.
11531 var element = event.target;
11532 $( element ).css( "background-color", "red" );
11533
11534 // With proxy, `this` refers to the me object encapsulating
11535 // this function.
11536 $( "#log" ).append( "Hello " + this.type + "<br>" );
11537 $( "#test" ).off( "click", this.test );
11538 }
11539};
11540
11541var you = {
11542 type: "person",
11543 test: function( event ) {
11544 $( "#log" ).append( this.type + " " );
11545 }
11546};
11547
11548// Execute you.test() in the context of the `you` object
11549// no matter where it is called
11550// i.e. the `this` keyword will refer to `you`
11551var youClick = $.proxy( you.test, you );
11552
11553// attach click handlers to #test
11554$( "#test" )
11555 // this === "zombie"; handler unbound after first click
11556 .on( "click", $.proxy( me.test, me ) )
11557
11558 // this === "person"
11559 .on( "click", youClick )
11560
11561 // this === "zombie"
11562 .on( "click", $.proxy( you.test, me ) )
11563
11564 // this === "<button> element"
11565 .on( "click", you.test );
11566</script>
11567
11568</body>
11569</html>
11570```
11571 * @example ​ ````Change the context of a function bound to the click handler,
11572```html
11573<!doctype html>
11574<html lang="en">
11575<head>
11576 <meta charset="utf-8">
11577 <title>jQuery.proxy demo</title>
11578 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11579</head>
11580<body>
11581
11582<p><button type="button" id="test">Test</button></p>
11583<div id="log"></div>
11584
11585<script>
11586var me = {
11587 // I'm a dog
11588 type: "dog",
11589
11590 // Note that event comes *after* one and two
11591 test: function( one, two, event ) {
11592 $( "#log" )
11593
11594 // `one` maps to `you`, the 1st additional
11595 // argument in the $.proxy function call
11596 .append( "<h3>Hello " + one.type + ":</h3>" )
11597
11598 // The `this` keyword refers to `me`
11599 // (the 2nd, context, argument of $.proxy)
11600 .append( "I am a " + this.type + ", " )
11601
11602 // `two` maps to `they`, the 2nd additional
11603 // argument in the $.proxy function call
11604 .append( "and they are " + two.type + ".<br>" )
11605
11606 // The event type is "click"
11607 .append( "Thanks for " + event.type + "ing." )
11608
11609 // The clicked element is `event.target`,
11610 // and its type is "button"
11611 .append( "the " + event.target.type + "." );
11612 }
11613};
11614
11615var you = { type: "cat" };
11616var they = { type: "fish" };
11617
11618// Set up handler to execute me.test() in the context
11619// of `me`, with `you` and `they` as additional arguments
11620var proxy = $.proxy( me.test, me, you, they );
11621
11622$( "#test" )
11623 .on( "click", proxy );
11624</script>
11625
11626</body>
11627</html>
11628```
11629 */
11630 proxy<TContext,
11631 TReturn,
11632 T, U, V, W, X, Y>(funсtion: (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
11633 context: TContext): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
11634
11635 // #endregion
11636
11637 // region 7+ parameters
11638 // #region 7+ parameters
11639
11640 /**
11641 * Takes a function and returns a new one that will always have a particular context.
11642 * @param funсtion The function whose context will be changed.
11643 * @param context The object to which the context (`this`) of the function should be set.
11644 * @param a An argument to be passed to the function referenced in the `function` argument.
11645 * @param b An argument to be passed to the function referenced in the `function` argument.
11646 * @param c An argument to be passed to the function referenced in the `function` argument.
11647 * @param d An argument to be passed to the function referenced in the `function` argument.
11648 * @param e An argument to be passed to the function referenced in the `function` argument.
11649 * @param f An argument to be passed to the function referenced in the `function` argument.
11650 * @param g An argument to be passed to the function referenced in the `function` argument.
11651 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11652 * @since 1.4
11653 * @since 1.6
11654 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11655 * @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.
11656```html
11657<!doctype html>
11658<html lang="en">
11659<head>
11660 <meta charset="utf-8">
11661 <title>jQuery.proxy demo</title>
11662 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11663</head>
11664<body>
11665
11666<p><button type="button" id="test">Test</button></p>
11667<div id="log"></div>
11668
11669<script>
11670var me = {
11671 type: "zombie",
11672 test: function( event ) {
11673 // Without proxy, `this` would refer to the event target
11674 // use event.target to reference that element.
11675 var element = event.target;
11676 $( element ).css( "background-color", "red" );
11677
11678 // With proxy, `this` refers to the me object encapsulating
11679 // this function.
11680 $( "#log" ).append( "Hello " + this.type + "<br>" );
11681 $( "#test" ).off( "click", this.test );
11682 }
11683};
11684
11685var you = {
11686 type: "person",
11687 test: function( event ) {
11688 $( "#log" ).append( this.type + " " );
11689 }
11690};
11691
11692// Execute you.test() in the context of the `you` object
11693// no matter where it is called
11694// i.e. the `this` keyword will refer to `you`
11695var youClick = $.proxy( you.test, you );
11696
11697// attach click handlers to #test
11698$( "#test" )
11699 // this === "zombie"; handler unbound after first click
11700 .on( "click", $.proxy( me.test, me ) )
11701
11702 // this === "person"
11703 .on( "click", youClick )
11704
11705 // this === "zombie"
11706 .on( "click", $.proxy( you.test, me ) )
11707
11708 // this === "<button> element"
11709 .on( "click", you.test );
11710</script>
11711
11712</body>
11713</html>
11714```
11715 * @example ​ ````Change the context of a function bound to the click handler,
11716```html
11717<!doctype html>
11718<html lang="en">
11719<head>
11720 <meta charset="utf-8">
11721 <title>jQuery.proxy demo</title>
11722 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11723</head>
11724<body>
11725
11726<p><button type="button" id="test">Test</button></p>
11727<div id="log"></div>
11728
11729<script>
11730var me = {
11731 // I'm a dog
11732 type: "dog",
11733
11734 // Note that event comes *after* one and two
11735 test: function( one, two, event ) {
11736 $( "#log" )
11737
11738 // `one` maps to `you`, the 1st additional
11739 // argument in the $.proxy function call
11740 .append( "<h3>Hello " + one.type + ":</h3>" )
11741
11742 // The `this` keyword refers to `me`
11743 // (the 2nd, context, argument of $.proxy)
11744 .append( "I am a " + this.type + ", " )
11745
11746 // `two` maps to `they`, the 2nd additional
11747 // argument in the $.proxy function call
11748 .append( "and they are " + two.type + ".<br>" )
11749
11750 // The event type is "click"
11751 .append( "Thanks for " + event.type + "ing." )
11752
11753 // The clicked element is `event.target`,
11754 // and its type is "button"
11755 .append( "the " + event.target.type + "." );
11756 }
11757};
11758
11759var you = { type: "cat" };
11760var they = { type: "fish" };
11761
11762// Set up handler to execute me.test() in the context
11763// of `me`, with `you` and `they` as additional arguments
11764var proxy = $.proxy( me.test, me, you, they );
11765
11766$( "#test" )
11767 .on( "click", proxy );
11768</script>
11769
11770</body>
11771</html>
11772```
11773 */
11774 proxy<TContext,
11775 TReturn,
11776 A, B, C, D, E, F, G,
11777 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,
11778 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
11779 context: TContext,
11780 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;
11781 /**
11782 * Takes a function and returns a new one that will always have a particular context.
11783 * @param funсtion The function whose context will be changed.
11784 * @param context The object to which the context (`this`) of the function should be set.
11785 * @param a An argument to be passed to the function referenced in the `function` argument.
11786 * @param b An argument to be passed to the function referenced in the `function` argument.
11787 * @param c An argument to be passed to the function referenced in the `function` argument.
11788 * @param d An argument to be passed to the function referenced in the `function` argument.
11789 * @param e An argument to be passed to the function referenced in the `function` argument.
11790 * @param f An argument to be passed to the function referenced in the `function` argument.
11791 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11792 * @since 1.4
11793 * @since 1.6
11794 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11795 * @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.
11796```html
11797<!doctype html>
11798<html lang="en">
11799<head>
11800 <meta charset="utf-8">
11801 <title>jQuery.proxy demo</title>
11802 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11803</head>
11804<body>
11805
11806<p><button type="button" id="test">Test</button></p>
11807<div id="log"></div>
11808
11809<script>
11810var me = {
11811 type: "zombie",
11812 test: function( event ) {
11813 // Without proxy, `this` would refer to the event target
11814 // use event.target to reference that element.
11815 var element = event.target;
11816 $( element ).css( "background-color", "red" );
11817
11818 // With proxy, `this` refers to the me object encapsulating
11819 // this function.
11820 $( "#log" ).append( "Hello " + this.type + "<br>" );
11821 $( "#test" ).off( "click", this.test );
11822 }
11823};
11824
11825var you = {
11826 type: "person",
11827 test: function( event ) {
11828 $( "#log" ).append( this.type + " " );
11829 }
11830};
11831
11832// Execute you.test() in the context of the `you` object
11833// no matter where it is called
11834// i.e. the `this` keyword will refer to `you`
11835var youClick = $.proxy( you.test, you );
11836
11837// attach click handlers to #test
11838$( "#test" )
11839 // this === "zombie"; handler unbound after first click
11840 .on( "click", $.proxy( me.test, me ) )
11841
11842 // this === "person"
11843 .on( "click", youClick )
11844
11845 // this === "zombie"
11846 .on( "click", $.proxy( you.test, me ) )
11847
11848 // this === "<button> element"
11849 .on( "click", you.test );
11850</script>
11851
11852</body>
11853</html>
11854```
11855 * @example ​ ````Change the context of a function bound to the click handler,
11856```html
11857<!doctype html>
11858<html lang="en">
11859<head>
11860 <meta charset="utf-8">
11861 <title>jQuery.proxy demo</title>
11862 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11863</head>
11864<body>
11865
11866<p><button type="button" id="test">Test</button></p>
11867<div id="log"></div>
11868
11869<script>
11870var me = {
11871 // I'm a dog
11872 type: "dog",
11873
11874 // Note that event comes *after* one and two
11875 test: function( one, two, event ) {
11876 $( "#log" )
11877
11878 // `one` maps to `you`, the 1st additional
11879 // argument in the $.proxy function call
11880 .append( "<h3>Hello " + one.type + ":</h3>" )
11881
11882 // The `this` keyword refers to `me`
11883 // (the 2nd, context, argument of $.proxy)
11884 .append( "I am a " + this.type + ", " )
11885
11886 // `two` maps to `they`, the 2nd additional
11887 // argument in the $.proxy function call
11888 .append( "and they are " + two.type + ".<br>" )
11889
11890 // The event type is "click"
11891 .append( "Thanks for " + event.type + "ing." )
11892
11893 // The clicked element is `event.target`,
11894 // and its type is "button"
11895 .append( "the " + event.target.type + "." );
11896 }
11897};
11898
11899var you = { type: "cat" };
11900var they = { type: "fish" };
11901
11902// Set up handler to execute me.test() in the context
11903// of `me`, with `you` and `they` as additional arguments
11904var proxy = $.proxy( me.test, me, you, they );
11905
11906$( "#test" )
11907 .on( "click", proxy );
11908</script>
11909
11910</body>
11911</html>
11912```
11913 */
11914 proxy<TContext,
11915 TReturn,
11916 A, B, C, D, E, F,
11917 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
11918 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
11919 context: TContext,
11920 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;
11921 /**
11922 * Takes a function and returns a new one that will always have a particular context.
11923 * @param funсtion The function whose context will be changed.
11924 * @param context The object to which the context (`this`) of the function should be set.
11925 * @param a An argument to be passed to the function referenced in the `function` argument.
11926 * @param b An argument to be passed to the function referenced in the `function` argument.
11927 * @param c An argument to be passed to the function referenced in the `function` argument.
11928 * @param d An argument to be passed to the function referenced in the `function` argument.
11929 * @param e An argument to be passed to the function referenced in the `function` argument.
11930 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11931 * @since 1.4
11932 * @since 1.6
11933 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11934 * @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.
11935```html
11936<!doctype html>
11937<html lang="en">
11938<head>
11939 <meta charset="utf-8">
11940 <title>jQuery.proxy demo</title>
11941 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11942</head>
11943<body>
11944
11945<p><button type="button" id="test">Test</button></p>
11946<div id="log"></div>
11947
11948<script>
11949var me = {
11950 type: "zombie",
11951 test: function( event ) {
11952 // Without proxy, `this` would refer to the event target
11953 // use event.target to reference that element.
11954 var element = event.target;
11955 $( element ).css( "background-color", "red" );
11956
11957 // With proxy, `this` refers to the me object encapsulating
11958 // this function.
11959 $( "#log" ).append( "Hello " + this.type + "<br>" );
11960 $( "#test" ).off( "click", this.test );
11961 }
11962};
11963
11964var you = {
11965 type: "person",
11966 test: function( event ) {
11967 $( "#log" ).append( this.type + " " );
11968 }
11969};
11970
11971// Execute you.test() in the context of the `you` object
11972// no matter where it is called
11973// i.e. the `this` keyword will refer to `you`
11974var youClick = $.proxy( you.test, you );
11975
11976// attach click handlers to #test
11977$( "#test" )
11978 // this === "zombie"; handler unbound after first click
11979 .on( "click", $.proxy( me.test, me ) )
11980
11981 // this === "person"
11982 .on( "click", youClick )
11983
11984 // this === "zombie"
11985 .on( "click", $.proxy( you.test, me ) )
11986
11987 // this === "<button> element"
11988 .on( "click", you.test );
11989</script>
11990
11991</body>
11992</html>
11993```
11994 * @example ​ ````Change the context of a function bound to the click handler,
11995```html
11996<!doctype html>
11997<html lang="en">
11998<head>
11999 <meta charset="utf-8">
12000 <title>jQuery.proxy demo</title>
12001 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12002</head>
12003<body>
12004
12005<p><button type="button" id="test">Test</button></p>
12006<div id="log"></div>
12007
12008<script>
12009var me = {
12010 // I'm a dog
12011 type: "dog",
12012
12013 // Note that event comes *after* one and two
12014 test: function( one, two, event ) {
12015 $( "#log" )
12016
12017 // `one` maps to `you`, the 1st additional
12018 // argument in the $.proxy function call
12019 .append( "<h3>Hello " + one.type + ":</h3>" )
12020
12021 // The `this` keyword refers to `me`
12022 // (the 2nd, context, argument of $.proxy)
12023 .append( "I am a " + this.type + ", " )
12024
12025 // `two` maps to `they`, the 2nd additional
12026 // argument in the $.proxy function call
12027 .append( "and they are " + two.type + ".<br>" )
12028
12029 // The event type is "click"
12030 .append( "Thanks for " + event.type + "ing." )
12031
12032 // The clicked element is `event.target`,
12033 // and its type is "button"
12034 .append( "the " + event.target.type + "." );
12035 }
12036};
12037
12038var you = { type: "cat" };
12039var they = { type: "fish" };
12040
12041// Set up handler to execute me.test() in the context
12042// of `me`, with `you` and `they` as additional arguments
12043var proxy = $.proxy( me.test, me, you, they );
12044
12045$( "#test" )
12046 .on( "click", proxy );
12047</script>
12048
12049</body>
12050</html>
12051```
12052 */
12053 proxy<TContext,
12054 TReturn,
12055 A, B, C, D, E,
12056 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
12057 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
12058 context: TContext,
12059 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;
12060 /**
12061 * Takes a function and returns a new one that will always have a particular context.
12062 * @param funсtion The function whose context will be changed.
12063 * @param context The object to which the context (`this`) of the function should be set.
12064 * @param a An argument to be passed to the function referenced in the `function` argument.
12065 * @param b An argument to be passed to the function referenced in the `function` argument.
12066 * @param c An argument to be passed to the function referenced in the `function` argument.
12067 * @param d An argument to be passed to the function referenced in the `function` argument.
12068 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12069 * @since 1.4
12070 * @since 1.6
12071 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12072 * @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.
12073```html
12074<!doctype html>
12075<html lang="en">
12076<head>
12077 <meta charset="utf-8">
12078 <title>jQuery.proxy demo</title>
12079 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12080</head>
12081<body>
12082
12083<p><button type="button" id="test">Test</button></p>
12084<div id="log"></div>
12085
12086<script>
12087var me = {
12088 type: "zombie",
12089 test: function( event ) {
12090 // Without proxy, `this` would refer to the event target
12091 // use event.target to reference that element.
12092 var element = event.target;
12093 $( element ).css( "background-color", "red" );
12094
12095 // With proxy, `this` refers to the me object encapsulating
12096 // this function.
12097 $( "#log" ).append( "Hello " + this.type + "<br>" );
12098 $( "#test" ).off( "click", this.test );
12099 }
12100};
12101
12102var you = {
12103 type: "person",
12104 test: function( event ) {
12105 $( "#log" ).append( this.type + " " );
12106 }
12107};
12108
12109// Execute you.test() in the context of the `you` object
12110// no matter where it is called
12111// i.e. the `this` keyword will refer to `you`
12112var youClick = $.proxy( you.test, you );
12113
12114// attach click handlers to #test
12115$( "#test" )
12116 // this === "zombie"; handler unbound after first click
12117 .on( "click", $.proxy( me.test, me ) )
12118
12119 // this === "person"
12120 .on( "click", youClick )
12121
12122 // this === "zombie"
12123 .on( "click", $.proxy( you.test, me ) )
12124
12125 // this === "<button> element"
12126 .on( "click", you.test );
12127</script>
12128
12129</body>
12130</html>
12131```
12132 * @example ​ ````Change the context of a function bound to the click handler,
12133```html
12134<!doctype html>
12135<html lang="en">
12136<head>
12137 <meta charset="utf-8">
12138 <title>jQuery.proxy demo</title>
12139 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12140</head>
12141<body>
12142
12143<p><button type="button" id="test">Test</button></p>
12144<div id="log"></div>
12145
12146<script>
12147var me = {
12148 // I'm a dog
12149 type: "dog",
12150
12151 // Note that event comes *after* one and two
12152 test: function( one, two, event ) {
12153 $( "#log" )
12154
12155 // `one` maps to `you`, the 1st additional
12156 // argument in the $.proxy function call
12157 .append( "<h3>Hello " + one.type + ":</h3>" )
12158
12159 // The `this` keyword refers to `me`
12160 // (the 2nd, context, argument of $.proxy)
12161 .append( "I am a " + this.type + ", " )
12162
12163 // `two` maps to `they`, the 2nd additional
12164 // argument in the $.proxy function call
12165 .append( "and they are " + two.type + ".<br>" )
12166
12167 // The event type is "click"
12168 .append( "Thanks for " + event.type + "ing." )
12169
12170 // The clicked element is `event.target`,
12171 // and its type is "button"
12172 .append( "the " + event.target.type + "." );
12173 }
12174};
12175
12176var you = { type: "cat" };
12177var they = { type: "fish" };
12178
12179// Set up handler to execute me.test() in the context
12180// of `me`, with `you` and `they` as additional arguments
12181var proxy = $.proxy( me.test, me, you, they );
12182
12183$( "#test" )
12184 .on( "click", proxy );
12185</script>
12186
12187</body>
12188</html>
12189```
12190 */
12191 proxy<TContext,
12192 TReturn,
12193 A, B, C, D,
12194 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
12195 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
12196 context: TContext,
12197 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;
12198 /**
12199 * Takes a function and returns a new one that will always have a particular context.
12200 * @param funсtion The function whose context will be changed.
12201 * @param context The object to which the context (`this`) of the function should be set.
12202 * @param a An argument to be passed to the function referenced in the `function` argument.
12203 * @param b An argument to be passed to the function referenced in the `function` argument.
12204 * @param c An argument to be passed to the function referenced in the `function` argument.
12205 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12206 * @since 1.4
12207 * @since 1.6
12208 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12209 * @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.
12210```html
12211<!doctype html>
12212<html lang="en">
12213<head>
12214 <meta charset="utf-8">
12215 <title>jQuery.proxy demo</title>
12216 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12217</head>
12218<body>
12219
12220<p><button type="button" id="test">Test</button></p>
12221<div id="log"></div>
12222
12223<script>
12224var me = {
12225 type: "zombie",
12226 test: function( event ) {
12227 // Without proxy, `this` would refer to the event target
12228 // use event.target to reference that element.
12229 var element = event.target;
12230 $( element ).css( "background-color", "red" );
12231
12232 // With proxy, `this` refers to the me object encapsulating
12233 // this function.
12234 $( "#log" ).append( "Hello " + this.type + "<br>" );
12235 $( "#test" ).off( "click", this.test );
12236 }
12237};
12238
12239var you = {
12240 type: "person",
12241 test: function( event ) {
12242 $( "#log" ).append( this.type + " " );
12243 }
12244};
12245
12246// Execute you.test() in the context of the `you` object
12247// no matter where it is called
12248// i.e. the `this` keyword will refer to `you`
12249var youClick = $.proxy( you.test, you );
12250
12251// attach click handlers to #test
12252$( "#test" )
12253 // this === "zombie"; handler unbound after first click
12254 .on( "click", $.proxy( me.test, me ) )
12255
12256 // this === "person"
12257 .on( "click", youClick )
12258
12259 // this === "zombie"
12260 .on( "click", $.proxy( you.test, me ) )
12261
12262 // this === "<button> element"
12263 .on( "click", you.test );
12264</script>
12265
12266</body>
12267</html>
12268```
12269 * @example ​ ````Change the context of a function bound to the click handler,
12270```html
12271<!doctype html>
12272<html lang="en">
12273<head>
12274 <meta charset="utf-8">
12275 <title>jQuery.proxy demo</title>
12276 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12277</head>
12278<body>
12279
12280<p><button type="button" id="test">Test</button></p>
12281<div id="log"></div>
12282
12283<script>
12284var me = {
12285 // I'm a dog
12286 type: "dog",
12287
12288 // Note that event comes *after* one and two
12289 test: function( one, two, event ) {
12290 $( "#log" )
12291
12292 // `one` maps to `you`, the 1st additional
12293 // argument in the $.proxy function call
12294 .append( "<h3>Hello " + one.type + ":</h3>" )
12295
12296 // The `this` keyword refers to `me`
12297 // (the 2nd, context, argument of $.proxy)
12298 .append( "I am a " + this.type + ", " )
12299
12300 // `two` maps to `they`, the 2nd additional
12301 // argument in the $.proxy function call
12302 .append( "and they are " + two.type + ".<br>" )
12303
12304 // The event type is "click"
12305 .append( "Thanks for " + event.type + "ing." )
12306
12307 // The clicked element is `event.target`,
12308 // and its type is "button"
12309 .append( "the " + event.target.type + "." );
12310 }
12311};
12312
12313var you = { type: "cat" };
12314var they = { type: "fish" };
12315
12316// Set up handler to execute me.test() in the context
12317// of `me`, with `you` and `they` as additional arguments
12318var proxy = $.proxy( me.test, me, you, they );
12319
12320$( "#test" )
12321 .on( "click", proxy );
12322</script>
12323
12324</body>
12325</html>
12326```
12327 */
12328 proxy<TContext,
12329 TReturn,
12330 A, B, C,
12331 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A, b: B, c: C,
12332 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
12333 context: TContext,
12334 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
12335 /**
12336 * Takes a function and returns a new one that will always have a particular context.
12337 * @param funсtion The function whose context will be changed.
12338 * @param context The object to which the context (`this`) of the function should be set.
12339 * @param a An argument to be passed to the function referenced in the `function` argument.
12340 * @param b An argument to be passed to the function referenced in the `function` argument.
12341 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12342 * @since 1.4
12343 * @since 1.6
12344 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12345 * @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.
12346```html
12347<!doctype html>
12348<html lang="en">
12349<head>
12350 <meta charset="utf-8">
12351 <title>jQuery.proxy demo</title>
12352 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12353</head>
12354<body>
12355
12356<p><button type="button" id="test">Test</button></p>
12357<div id="log"></div>
12358
12359<script>
12360var me = {
12361 type: "zombie",
12362 test: function( event ) {
12363 // Without proxy, `this` would refer to the event target
12364 // use event.target to reference that element.
12365 var element = event.target;
12366 $( element ).css( "background-color", "red" );
12367
12368 // With proxy, `this` refers to the me object encapsulating
12369 // this function.
12370 $( "#log" ).append( "Hello " + this.type + "<br>" );
12371 $( "#test" ).off( "click", this.test );
12372 }
12373};
12374
12375var you = {
12376 type: "person",
12377 test: function( event ) {
12378 $( "#log" ).append( this.type + " " );
12379 }
12380};
12381
12382// Execute you.test() in the context of the `you` object
12383// no matter where it is called
12384// i.e. the `this` keyword will refer to `you`
12385var youClick = $.proxy( you.test, you );
12386
12387// attach click handlers to #test
12388$( "#test" )
12389 // this === "zombie"; handler unbound after first click
12390 .on( "click", $.proxy( me.test, me ) )
12391
12392 // this === "person"
12393 .on( "click", youClick )
12394
12395 // this === "zombie"
12396 .on( "click", $.proxy( you.test, me ) )
12397
12398 // this === "<button> element"
12399 .on( "click", you.test );
12400</script>
12401
12402</body>
12403</html>
12404```
12405 * @example ​ ````Change the context of a function bound to the click handler,
12406```html
12407<!doctype html>
12408<html lang="en">
12409<head>
12410 <meta charset="utf-8">
12411 <title>jQuery.proxy demo</title>
12412 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12413</head>
12414<body>
12415
12416<p><button type="button" id="test">Test</button></p>
12417<div id="log"></div>
12418
12419<script>
12420var me = {
12421 // I'm a dog
12422 type: "dog",
12423
12424 // Note that event comes *after* one and two
12425 test: function( one, two, event ) {
12426 $( "#log" )
12427
12428 // `one` maps to `you`, the 1st additional
12429 // argument in the $.proxy function call
12430 .append( "<h3>Hello " + one.type + ":</h3>" )
12431
12432 // The `this` keyword refers to `me`
12433 // (the 2nd, context, argument of $.proxy)
12434 .append( "I am a " + this.type + ", " )
12435
12436 // `two` maps to `they`, the 2nd additional
12437 // argument in the $.proxy function call
12438 .append( "and they are " + two.type + ".<br>" )
12439
12440 // The event type is "click"
12441 .append( "Thanks for " + event.type + "ing." )
12442
12443 // The clicked element is `event.target`,
12444 // and its type is "button"
12445 .append( "the " + event.target.type + "." );
12446 }
12447};
12448
12449var you = { type: "cat" };
12450var they = { type: "fish" };
12451
12452// Set up handler to execute me.test() in the context
12453// of `me`, with `you` and `they` as additional arguments
12454var proxy = $.proxy( me.test, me, you, they );
12455
12456$( "#test" )
12457 .on( "click", proxy );
12458</script>
12459
12460</body>
12461</html>
12462```
12463 */
12464 proxy<TContext,
12465 TReturn,
12466 A, B,
12467 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A, b: B,
12468 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
12469 context: TContext,
12470 a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
12471 /**
12472 * Takes a function and returns a new one that will always have a particular context.
12473 * @param funсtion The function whose context will be changed.
12474 * @param context The object to which the context (`this`) of the function should be set.
12475 * @param a An argument to be passed to the function referenced in the `function` argument.
12476 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12477 * @since 1.4
12478 * @since 1.6
12479 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12480 * @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.
12481```html
12482<!doctype html>
12483<html lang="en">
12484<head>
12485 <meta charset="utf-8">
12486 <title>jQuery.proxy demo</title>
12487 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12488</head>
12489<body>
12490
12491<p><button type="button" id="test">Test</button></p>
12492<div id="log"></div>
12493
12494<script>
12495var me = {
12496 type: "zombie",
12497 test: function( event ) {
12498 // Without proxy, `this` would refer to the event target
12499 // use event.target to reference that element.
12500 var element = event.target;
12501 $( element ).css( "background-color", "red" );
12502
12503 // With proxy, `this` refers to the me object encapsulating
12504 // this function.
12505 $( "#log" ).append( "Hello " + this.type + "<br>" );
12506 $( "#test" ).off( "click", this.test );
12507 }
12508};
12509
12510var you = {
12511 type: "person",
12512 test: function( event ) {
12513 $( "#log" ).append( this.type + " " );
12514 }
12515};
12516
12517// Execute you.test() in the context of the `you` object
12518// no matter where it is called
12519// i.e. the `this` keyword will refer to `you`
12520var youClick = $.proxy( you.test, you );
12521
12522// attach click handlers to #test
12523$( "#test" )
12524 // this === "zombie"; handler unbound after first click
12525 .on( "click", $.proxy( me.test, me ) )
12526
12527 // this === "person"
12528 .on( "click", youClick )
12529
12530 // this === "zombie"
12531 .on( "click", $.proxy( you.test, me ) )
12532
12533 // this === "<button> element"
12534 .on( "click", you.test );
12535</script>
12536
12537</body>
12538</html>
12539```
12540 * @example ​ ````Change the context of a function bound to the click handler,
12541```html
12542<!doctype html>
12543<html lang="en">
12544<head>
12545 <meta charset="utf-8">
12546 <title>jQuery.proxy demo</title>
12547 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12548</head>
12549<body>
12550
12551<p><button type="button" id="test">Test</button></p>
12552<div id="log"></div>
12553
12554<script>
12555var me = {
12556 // I'm a dog
12557 type: "dog",
12558
12559 // Note that event comes *after* one and two
12560 test: function( one, two, event ) {
12561 $( "#log" )
12562
12563 // `one` maps to `you`, the 1st additional
12564 // argument in the $.proxy function call
12565 .append( "<h3>Hello " + one.type + ":</h3>" )
12566
12567 // The `this` keyword refers to `me`
12568 // (the 2nd, context, argument of $.proxy)
12569 .append( "I am a " + this.type + ", " )
12570
12571 // `two` maps to `they`, the 2nd additional
12572 // argument in the $.proxy function call
12573 .append( "and they are " + two.type + ".<br>" )
12574
12575 // The event type is "click"
12576 .append( "Thanks for " + event.type + "ing." )
12577
12578 // The clicked element is `event.target`,
12579 // and its type is "button"
12580 .append( "the " + event.target.type + "." );
12581 }
12582};
12583
12584var you = { type: "cat" };
12585var they = { type: "fish" };
12586
12587// Set up handler to execute me.test() in the context
12588// of `me`, with `you` and `they` as additional arguments
12589var proxy = $.proxy( me.test, me, you, they );
12590
12591$( "#test" )
12592 .on( "click", proxy );
12593</script>
12594
12595</body>
12596</html>
12597```
12598 */
12599 proxy<TContext,
12600 TReturn,
12601 A,
12602 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A,
12603 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
12604 context: TContext,
12605 a: A): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
12606 /**
12607 * Takes a function and returns a new one that will always have a particular context.
12608 * @param funсtion The function whose context will be changed.
12609 * @param context The object to which the context (`this`) of the function should be set.
12610 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12611 * @since 1.4
12612 * @since 1.6
12613 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12614 * @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.
12615```html
12616<!doctype html>
12617<html lang="en">
12618<head>
12619 <meta charset="utf-8">
12620 <title>jQuery.proxy demo</title>
12621 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12622</head>
12623<body>
12624
12625<p><button type="button" id="test">Test</button></p>
12626<div id="log"></div>
12627
12628<script>
12629var me = {
12630 type: "zombie",
12631 test: function( event ) {
12632 // Without proxy, `this` would refer to the event target
12633 // use event.target to reference that element.
12634 var element = event.target;
12635 $( element ).css( "background-color", "red" );
12636
12637 // With proxy, `this` refers to the me object encapsulating
12638 // this function.
12639 $( "#log" ).append( "Hello " + this.type + "<br>" );
12640 $( "#test" ).off( "click", this.test );
12641 }
12642};
12643
12644var you = {
12645 type: "person",
12646 test: function( event ) {
12647 $( "#log" ).append( this.type + " " );
12648 }
12649};
12650
12651// Execute you.test() in the context of the `you` object
12652// no matter where it is called
12653// i.e. the `this` keyword will refer to `you`
12654var youClick = $.proxy( you.test, you );
12655
12656// attach click handlers to #test
12657$( "#test" )
12658 // this === "zombie"; handler unbound after first click
12659 .on( "click", $.proxy( me.test, me ) )
12660
12661 // this === "person"
12662 .on( "click", youClick )
12663
12664 // this === "zombie"
12665 .on( "click", $.proxy( you.test, me ) )
12666
12667 // this === "<button> element"
12668 .on( "click", you.test );
12669</script>
12670
12671</body>
12672</html>
12673```
12674 * @example ​ ````Change the context of a function bound to the click handler,
12675```html
12676<!doctype html>
12677<html lang="en">
12678<head>
12679 <meta charset="utf-8">
12680 <title>jQuery.proxy demo</title>
12681 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12682</head>
12683<body>
12684
12685<p><button type="button" id="test">Test</button></p>
12686<div id="log"></div>
12687
12688<script>
12689var me = {
12690 // I'm a dog
12691 type: "dog",
12692
12693 // Note that event comes *after* one and two
12694 test: function( one, two, event ) {
12695 $( "#log" )
12696
12697 // `one` maps to `you`, the 1st additional
12698 // argument in the $.proxy function call
12699 .append( "<h3>Hello " + one.type + ":</h3>" )
12700
12701 // The `this` keyword refers to `me`
12702 // (the 2nd, context, argument of $.proxy)
12703 .append( "I am a " + this.type + ", " )
12704
12705 // `two` maps to `they`, the 2nd additional
12706 // argument in the $.proxy function call
12707 .append( "and they are " + two.type + ".<br>" )
12708
12709 // The event type is "click"
12710 .append( "Thanks for " + event.type + "ing." )
12711
12712 // The clicked element is `event.target`,
12713 // and its type is "button"
12714 .append( "the " + event.target.type + "." );
12715 }
12716};
12717
12718var you = { type: "cat" };
12719var they = { type: "fish" };
12720
12721// Set up handler to execute me.test() in the context
12722// of `me`, with `you` and `they` as additional arguments
12723var proxy = $.proxy( me.test, me, you, they );
12724
12725$( "#test" )
12726 .on( "click", proxy );
12727</script>
12728
12729</body>
12730</html>
12731```
12732 */
12733 proxy<TContext,
12734 TReturn,
12735 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,
12736 context: TContext): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
12737
12738 // #endregion
12739
12740 // #endregion
12741
12742 // region 8+ additional arguments
12743 // #region 8+ additional arguments
12744
12745 /**
12746 * Takes a function and returns a new one that will always have a particular context.
12747 * @param funсtion The function whose context will be changed.
12748 * @param context The object to which the context (`this`) of the function should be set.
12749 * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument.
12750 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12751 * @since 1.4
12752 * @since 1.6
12753 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12754 * @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.
12755```html
12756<!doctype html>
12757<html lang="en">
12758<head>
12759 <meta charset="utf-8">
12760 <title>jQuery.proxy demo</title>
12761 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12762</head>
12763<body>
12764
12765<p><button type="button" id="test">Test</button></p>
12766<div id="log"></div>
12767
12768<script>
12769var me = {
12770 type: "zombie",
12771 test: function( event ) {
12772 // Without proxy, `this` would refer to the event target
12773 // use event.target to reference that element.
12774 var element = event.target;
12775 $( element ).css( "background-color", "red" );
12776
12777 // With proxy, `this` refers to the me object encapsulating
12778 // this function.
12779 $( "#log" ).append( "Hello " + this.type + "<br>" );
12780 $( "#test" ).off( "click", this.test );
12781 }
12782};
12783
12784var you = {
12785 type: "person",
12786 test: function( event ) {
12787 $( "#log" ).append( this.type + " " );
12788 }
12789};
12790
12791// Execute you.test() in the context of the `you` object
12792// no matter where it is called
12793// i.e. the `this` keyword will refer to `you`
12794var youClick = $.proxy( you.test, you );
12795
12796// attach click handlers to #test
12797$( "#test" )
12798 // this === "zombie"; handler unbound after first click
12799 .on( "click", $.proxy( me.test, me ) )
12800
12801 // this === "person"
12802 .on( "click", youClick )
12803
12804 // this === "zombie"
12805 .on( "click", $.proxy( you.test, me ) )
12806
12807 // this === "<button> element"
12808 .on( "click", you.test );
12809</script>
12810
12811</body>
12812</html>
12813```
12814 * @example ​ ````Change the context of a function bound to the click handler,
12815```html
12816<!doctype html>
12817<html lang="en">
12818<head>
12819 <meta charset="utf-8">
12820 <title>jQuery.proxy demo</title>
12821 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12822</head>
12823<body>
12824
12825<p><button type="button" id="test">Test</button></p>
12826<div id="log"></div>
12827
12828<script>
12829var me = {
12830 // I'm a dog
12831 type: "dog",
12832
12833 // Note that event comes *after* one and two
12834 test: function( one, two, event ) {
12835 $( "#log" )
12836
12837 // `one` maps to `you`, the 1st additional
12838 // argument in the $.proxy function call
12839 .append( "<h3>Hello " + one.type + ":</h3>" )
12840
12841 // The `this` keyword refers to `me`
12842 // (the 2nd, context, argument of $.proxy)
12843 .append( "I am a " + this.type + ", " )
12844
12845 // `two` maps to `they`, the 2nd additional
12846 // argument in the $.proxy function call
12847 .append( "and they are " + two.type + ".<br>" )
12848
12849 // The event type is "click"
12850 .append( "Thanks for " + event.type + "ing." )
12851
12852 // The clicked element is `event.target`,
12853 // and its type is "button"
12854 .append( "the " + event.target.type + "." );
12855 }
12856};
12857
12858var you = { type: "cat" };
12859var they = { type: "fish" };
12860
12861// Set up handler to execute me.test() in the context
12862// of `me`, with `you` and `they` as additional arguments
12863var proxy = $.proxy( me.test, me, you, they );
12864
12865$( "#test" )
12866 .on( "click", proxy );
12867</script>
12868
12869</body>
12870</html>
12871```
12872 */
12873 proxy<TContext,
12874 TReturn>(funсtion: (this: TContext, ...args: any[]) => TReturn,
12875 context: TContext,
12876 ...additionalArguments: any[]): (...args: any[]) => TReturn;
12877
12878 // #endregion
12879
12880 // #endregion
12881
12882 // region (context, name)
12883 // #region (context, name)
12884
12885 /**
12886 * Takes a function and returns a new one that will always have a particular context.
12887 * @param context The object to which the context of the function should be set.
12888 * @param name The name of the function whose context will be changed (should be a property of the context object).
12889 * @param additionalArguments Any number of arguments to be passed to the function named in the name argument.
12890 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12891 * @since 1.4
12892 * @since 1.6
12893 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12894 * @example ​ ````Enforce the context of the function using the &quot;context, function name&quot; signature. Unbind the handler after first click.
12895```html
12896<!doctype html>
12897<html lang="en">
12898<head>
12899 <meta charset="utf-8">
12900 <title>jQuery.proxy demo</title>
12901 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12902</head>
12903<body>
12904
12905 <p><button id="test">Test</button></p>
12906 <p id="log"></p>
12907
12908<script>
12909var obj = {
12910 name: "John",
12911 test: function() {
12912 $( "#log" ).append( this.name );
12913 $( "#test" ).off( "click", obj.test );
12914 }
12915};
12916$( "#test" ).on( "click", jQuery.proxy( obj, "test" ) );
12917</script>
12918
12919</body>
12920</html>
12921```
12922 */
12923 proxy<TContext>(context: TContext,
12924 name: keyof TContext,
12925 ...additionalArguments: any[]): (...args: any[]) => any;
12926
12927 // #endregion
12928
12929 // #endregion
12930
12931 /**
12932 * Manipulate the queue of functions to be executed on the matched element.
12933 * @param element A DOM element where the array of queued functions is attached.
12934 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
12935 * @param newQueue The new function to add to the queue.
12936 * An array of functions to replace the current queue contents.
12937 * @see \`{@link https://api.jquery.com/jQuery.queue/ }\`
12938 * @since 1.3
12939 * @example ​ ````Show the length of the queue.
12940```html
12941<!doctype html>
12942<html lang="en">
12943<head>
12944 <meta charset="utf-8">
12945 <title>jQuery.queue demo</title>
12946 <style>
12947 div {
12948 margin: 3px;
12949 width: 40px;
12950 height: 40px;
12951 position: absolute;
12952 left: 0px;
12953 top: 30px;
12954 background: green;
12955 display: none;
12956 }
12957 div.newcolor {
12958 background: blue;
12959 }
12960 span {
12961 color: red;
12962 }
12963 </style>
12964 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12965</head>
12966<body>
12967
12968<button id="show">Show Length of Queue</button>
12969<span></span>
12970<div></div>
12971
12972<script>
12973$( "#show" ).click(function() {
12974 var n = jQuery.queue( $( "div" )[ 0 ], "fx" );
12975 $( "span" ).text( "Queue length is: " + n.length );
12976});
12977
12978function runIt() {
12979 $( "div" )
12980 .show( "slow" )
12981 .animate({
12982 left: "+=200"
12983 }, 2000 )
12984 .slideToggle( 1000 )
12985 .slideToggle( "fast" )
12986 .animate({
12987 left: "-=200"
12988 }, 1500 )
12989 .hide( "slow" )
12990 .show( 1200 )
12991 .slideUp( "normal", runIt );
12992}
12993
12994runIt();
12995</script>
12996
12997</body>
12998</html>
12999```
13000 * @example ​ ````Queue a custom function.
13001```html
13002<!doctype html>
13003<html lang="en">
13004<head>
13005 <meta charset="utf-8">
13006 <title>jQuery.queue demo</title>
13007 <style>
13008 div {
13009 margin: 3px;
13010 width: 40px;
13011 height: 40px;
13012 position: absolute;
13013 left: 0px;
13014 top: 30px;
13015 background: green;
13016 display: none;
13017 }
13018 div.newcolor {
13019 background: blue;
13020 }
13021 </style>
13022 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13023</head>
13024<body>
13025
13026Click here...
13027<div></div>
13028
13029<script>
13030$( document.body ).click(function() {
13031 var divs = $( "div" )
13032 .show( "slow" )
13033 .animate({ left: "+=200" }, 2000 );
13034 jQuery.queue( divs[ 0 ], "fx", function() {
13035 $( this ).addClass( "newcolor" );
13036 jQuery.dequeue( this );
13037 });
13038 divs.animate({ left: "-=200" }, 500 );
13039 jQuery.queue( divs[ 0 ], "fx", function() {
13040 $( this ).removeClass( "newcolor" );
13041 jQuery.dequeue( this );
13042 });
13043 divs.slideUp();
13044});
13045</script>
13046
13047</body>
13048</html>
13049```
13050 * @example ​ ````Set a queue array to delete the queue.
13051```html
13052<!doctype html>
13053<html lang="en">
13054<head>
13055 <meta charset="utf-8">
13056 <title>jQuery.queue demo</title>
13057 <style>
13058 div {
13059 margin: 3px;
13060 width: 40px;
13061 height: 40px;
13062 position: absolute;
13063 left: 0px;
13064 top: 30px;
13065 background: green;
13066 display: none;
13067 }
13068 div.newcolor {
13069 background: blue;
13070 }
13071 </style>
13072 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13073</head>
13074<body>
13075
13076<button id="start">Start</button>
13077<button id="stop">Stop</button>
13078<div></div>
13079
13080<script>
13081$( "#start" ).click(function() {
13082 var divs = $( "div" )
13083 .show( "slow" )
13084 .animate({ left: "+=200" }, 5000 );
13085 jQuery.queue( divs[ 0 ], "fx", function() {
13086 $( this ).addClass( "newcolor" );
13087 jQuery.dequeue( this );
13088 });
13089 divs.animate({ left: "-=200" }, 1500 );
13090 jQuery.queue( divs[ 0 ], "fx", function() {
13091 $( this ).removeClass( "newcolor" );
13092 jQuery.dequeue( this );
13093 });
13094 divs.slideUp();
13095});
13096$( "#stop" ).click(function() {
13097 jQuery.queue( $( "div" )[ 0 ], "fx", [] );
13098 $( "div" ).stop();
13099});
13100</script>
13101
13102</body>
13103</html>
13104```
13105 */
13106 queue<T extends Element>(element: T, queueName?: string, newQueue?: JQuery.TypeOrArray<JQuery.QueueFunction<T>>): JQuery.Queue<T>;
13107 /**
13108 * Handles errors thrown synchronously in functions wrapped in jQuery().
13109 * @param error An error thrown in the function wrapped in jQuery().
13110 * @see \`{@link https://api.jquery.com/jQuery.readyException/ }\`
13111 * @since 3.1
13112 * @example ​ ````Pass the received error to console.error.
13113```javascript
13114jQuery.readyException = function( error ) {
13115 console.error( error );
13116};
13117```
13118 */
13119 readyException(error: Error): any;
13120 /**
13121 * Remove a previously-stored piece of data.
13122 * @param element A DOM element from which to remove data.
13123 * @param name A string naming the piece of data to remove.
13124 * @see \`{@link https://api.jquery.com/jQuery.removeData/ }\`
13125 * @since 1.2.3
13126 * @example ​ ````Set a data store for 2 names then remove one of them.
13127```html
13128<!doctype html>
13129<html lang="en">
13130<head>
13131 <meta charset="utf-8">
13132 <title>jQuery.removeData demo</title>
13133 <style>
13134 div {
13135 margin: 2px;
13136 color: blue;
13137 }
13138 span {
13139 color: red;
13140 }
13141 </style>
13142 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13143</head>
13144<body>
13145
13146<div>value1 before creation: <span></span></div>
13147<div>value1 after creation: <span></span></div>
13148<div>value1 after removal: <span></span></div>
13149<div>value2 after removal: <span></span></div>
13150
13151<script>
13152var div = $( "div" )[ 0 ];
13153$( "span:eq(0)" ).text( "" + $( "div" ).data( "test1" ) );
13154jQuery.data( div, "test1", "VALUE-1" );
13155jQuery.data( div, "test2", "VALUE-2" );
13156$( "span:eq(1)" ).text( "" + jQuery.data( div, "test1" ) );
13157jQuery.removeData( div, "test1" );
13158$( "span:eq(2)" ).text( "" + jQuery.data( div, "test1" ) );
13159$( "span:eq(3)" ).text( "" + jQuery.data( div, "test2" ) );
13160</script>
13161
13162</body>
13163</html>
13164```
13165 */
13166 removeData(element: Element | Document | Window | JQuery.PlainObject, name?: string): void;
13167 /**
13168 * Creates an object containing a set of properties ready to be used in the definition of custom animations.
13169 * @param duration A string or number determining how long the animation will run.
13170 * @param easing A string indicating which easing function to use for the transition.
13171 * @param complete A function to call once the animation is complete, called once per matched element.
13172 * @see \`{@link https://api.jquery.com/jQuery.speed/ }\`
13173 * @since 1.1
13174 */
13175 speed<TElement extends Element = HTMLElement>(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): JQuery.EffectsOptions<TElement>;
13176 /**
13177 * Creates an object containing a set of properties ready to be used in the definition of custom animations.
13178 * @param duration A string or number determining how long the animation will run.
13179 * @param easing_complete _&#x40;param_ `easing_complete`
13180 * <br>
13181 * * `easing` — A string indicating which easing function to use for the transition. <br>
13182 * * `complete` — A function to call once the animation is complete, called once per matched element.
13183 * @see \`{@link https://api.jquery.com/jQuery.speed/ }\`
13184 * @since 1.0
13185 * @since 1.1
13186 */
13187 speed<TElement extends Element = HTMLElement>(duration: JQuery.Duration,
13188 easing_complete: string | ((this: TElement) => void)): JQuery.EffectsOptions<TElement>;
13189 /**
13190 * Creates an object containing a set of properties ready to be used in the definition of custom animations.
13191 * @param duration_complete_settings _&#x40;param_ `duration_complete_settings`
13192 * <br>
13193 * * `duration` — A string or number determining how long the animation will run. <br>
13194 * * `complete` — A function to call once the animation is complete, called once per matched element. <br>
13195 * * `settings` —
13196 * @see \`{@link https://api.jquery.com/jQuery.speed/ }\`
13197 * @since 1.0
13198 * @since 1.1
13199 */
13200 speed<TElement extends Element = HTMLElement>(duration_complete_settings?: JQuery.Duration | ((this: TElement) => void) | JQuery.SpeedSettings<TElement>): JQuery.EffectsOptions<TElement>;
13201 /**
13202 * Remove the whitespace from the beginning and end of a string.
13203 * @param str The string to trim.
13204 * @see \`{@link https://api.jquery.com/jQuery.trim/ }\`
13205 * @since 1.0
13206 * @example ​ ````Remove the white spaces at the start and at the end of the string.
13207```html
13208<!doctype html>
13209<html lang="en">
13210<head>
13211 <meta charset="utf-8">
13212 <title>jQuery.trim demo</title>
13213 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13214</head>
13215<body>
13216
13217<pre id="original"></pre>
13218<pre id="trimmed"></pre>
13219
13220<script>
13221var str = " lots of spaces before and after ";
13222$( "#original" ).html( "Original String: '" + str + "'" );
13223$( "#trimmed" ).html( "$.trim()'ed: '" + $.trim(str) + "'" );
13224</script>
13225
13226</body>
13227</html>
13228```
13229 * @example ​ ````Remove the white spaces at the start and at the end of the string.
13230```javascript
13231$.trim(" hello, how are you? ");
13232```
13233 * @example ​ ````Remove the white spaces at the start and at the end of the string.
13234```javascript
13235$.trim(" hello, how are you? ");
13236```
13237 */
13238 trim(str: string): string;
13239 /**
13240 * Determine the internal JavaScript [[Class]] of an object.
13241 * @param obj Object to get the internal JavaScript [[Class]] of.
13242 * @see \`{@link https://api.jquery.com/jQuery.type/ }\`
13243 * @since 1.4.3
13244 * @deprecatedDeprecated since 3.3. See \`{@link https://github.com/jquery/jquery/issues/3605 }\`.
13245 * @example ​ ````Find out if the parameter is a RegExp.
13246```html
13247<!doctype html>
13248<html lang="en">
13249<head>
13250 <meta charset="utf-8">
13251 <title>jQuery.type demo</title>
13252 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13253</head>
13254<body>
13255
13256Is it a RegExp? <b></b>
13257
13258<script>
13259$( "b" ).append( "" + jQuery.type( /test/ ) );
13260</script>
13261
13262</body>
13263</html>
13264```
13265 */
13266 type(obj: any): 'array' | 'boolean' | 'date' | 'error' | 'function' | 'null' | 'number' | 'object' | 'regexp' | 'string' | 'symbol' | 'undefined';
13267 /**
13268 * 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.
13269 * @param array The Array of DOM elements.
13270 * @see \`{@link https://api.jquery.com/jQuery.unique/ }\`
13271 * @since 1.1.3
13272 * @deprecatedDeprecated since 3.0. Use \`{@link uniqueSort }\`.
13273 *
13274 * **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.
13275 *
13276 * **Solution**: Replace all uses of `jQuery.unique` with `jQuery.uniqueSort` which is the same function with a better name.
13277 * @example ​ ````Removes any duplicate elements from the array of divs.
13278```html
13279<!doctype html>
13280<html lang="en">
13281<head>
13282 <meta charset="utf-8">
13283 <title>jQuery.unique demo</title>
13284 <style>
13285 div {
13286 color: blue;
13287 }
13288 </style>
13289 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13290</head>
13291<body>
13292
13293<div>There are 6 divs in this document.</div>
13294<div></div>
13295<div class="dup"></div>
13296<div class="dup"></div>
13297<div class="dup"></div>
13298<div></div>
13299
13300<script>
13301// unique() must take a native array
13302var divs = $( "div" ).get();
13303
13304// Add 3 elements of class dup too (they are divs)
13305divs = divs.concat( $( ".dup" ).get() );
13306$( "div:eq(1)" ).text( "Pre-unique there are " + divs.length + " elements." );
13307
13308divs = jQuery.unique( divs );
13309$( "div:eq(2)" ).text( "Post-unique there are " + divs.length + " elements." )
13310 .css( "color", "red" );
13311</script>
13312
13313</body>
13314</html>
13315```
13316 */
13317 unique<T extends Element>(array: T[]): T[];
13318 /**
13319 * 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.
13320 * @param array The Array of DOM elements.
13321 * @see \`{@link https://api.jquery.com/jQuery.uniqueSort/ }\`
13322 * @since 1.12
13323 * @since 2.2
13324 * @example ​ ````Removes any duplicate elements from the array of divs.
13325```html
13326<!doctype html>
13327<html lang="en">
13328<head>
13329 <meta charset="utf-8">
13330 <title>jQuery.uniqueSort demo</title>
13331 <style>
13332 div {
13333 color: blue;
13334 }
13335 </style>
13336 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13337</head>
13338<body>
13339
13340<div>There are 6 divs in this document.</div>
13341<div></div>
13342<div class="dup"></div>
13343<div class="dup"></div>
13344<div class="dup"></div>
13345<div></div>
13346
13347<script>
13348// unique() must take a native array
13349var divs = $( "div" ).get();
13350
13351// Add 3 elements of class dup too (they are divs)
13352divs = divs.concat( $( ".dup" ).get() );
13353$( "div:eq(1)" ).text( "Pre-unique there are " + divs.length + " elements." );
13354
13355divs = jQuery.uniqueSort( divs );
13356$( "div:eq(2)" ).text( "Post-unique there are " + divs.length + " elements." )
13357 .css( "color", "red" );
13358</script>
13359
13360</body>
13361</html>
13362```
13363 */
13364 uniqueSort<T extends Element>(array: T[]): T[];
13365 /**
13366 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13367 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13368 * @since 1.5
13369 * @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).
13370```javascript
13371$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13372 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13373 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13374 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13375 if ( /Whip It/.test( data ) ) {
13376 alert( "We got what we came for!" );
13377 }
13378});
13379```
13380 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13381```javascript
13382$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13383 .then( myFunc, myFailure );
13384```
13385 */
13386 when<TR1, UR1, VR1,
13387 TJ1 = any, UJ1 = any, VJ1 = any>(
13388 deferredT: JQuery.Promise<TR1, TJ1> | JQuery.Thenable<TR1> | TR1,
13389 deferredU: JQuery.Promise<UR1, UJ1> | JQuery.Thenable<UR1> | UR1,
13390 deferredV: JQuery.Promise<VR1, VJ1> | JQuery.Thenable<VR1> | VR1,
13391 ): JQuery.Promise3<
13392 TR1, TJ1, never,
13393 UR1, UJ1, never,
13394 VR1, VJ1, never>;
13395 /**
13396 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13397 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13398 * @since 1.5
13399 * @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).
13400```javascript
13401$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13402 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13403 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13404 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13405 if ( /Whip It/.test( data ) ) {
13406 alert( "We got what we came for!" );
13407 }
13408});
13409```
13410 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13411```javascript
13412$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13413 .then( myFunc, myFailure );
13414```
13415 */
13416 when<TR1, UR1,
13417 TJ1 = any, UJ1 = any>(
13418 deferredT: JQuery.Promise<TR1, TJ1> | JQuery.Thenable<TR1> | TR1,
13419 deferredU: JQuery.Promise<UR1, UJ1> | JQuery.Thenable<UR1> | UR1,
13420 ): JQuery.Promise2<
13421 TR1, TJ1, never,
13422 UR1, UJ1, never>;
13423 /**
13424 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13425 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13426 * @since 1.5
13427 * @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).
13428```javascript
13429$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13430 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13431 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13432 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13433 if ( /Whip It/.test( data ) ) {
13434 alert( "We got what we came for!" );
13435 }
13436});
13437```
13438 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13439```javascript
13440$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13441 .then( myFunc, myFailure );
13442```
13443 */
13444 when<TR1, TJ1,
13445 TR2, TJ2,
13446 TR3 = never, TJ3 = never>(
13447 deferredT: JQuery.Promise3<TR1, TJ1, any, TR2, TJ2, any, TR3, TJ3, any> |
13448 JQuery.Promise2<TR1, TJ1, any, TR2, TJ2, any>
13449 ): JQuery.Promise3<
13450 TR1, TJ1, never,
13451 TR2, TJ2, never,
13452 TR3, TJ3, never>;
13453 /**
13454 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13455 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13456 * @since 1.5
13457 * @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).
13458```javascript
13459$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13460 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13461 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13462 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13463 if ( /Whip It/.test( data ) ) {
13464 alert( "We got what we came for!" );
13465 }
13466});
13467```
13468 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13469```javascript
13470$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13471 .then( myFunc, myFailure );
13472```
13473 */
13474 when<TR1, TJ1 = any>(deferred: JQuery.Promise<TR1, TJ1> | JQuery.Thenable<TR1> | TR1): JQuery.Promise<TR1, TJ1, never>;
13475 /**
13476 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13477 * @param deferreds Zero or more Thenable objects.
13478 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13479 * @since 1.5
13480 * @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).
13481```javascript
13482$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13483 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13484 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13485 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13486 if ( /Whip It/.test( data ) ) {
13487 alert( "We got what we came for!" );
13488 }
13489});
13490```
13491 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13492```javascript
13493$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13494 .then( myFunc, myFailure );
13495```
13496 */
13497 when<TR1 = never, TJ1 = never>(...deferreds: Array<JQuery.Promise<TR1, TJ1> | JQuery.Thenable<TR1> | TR1>): JQuery.Promise<TR1, TJ1, never>;
13498 /**
13499 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13500 * @param deferreds Zero or more Thenable objects.
13501 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13502 * @since 1.5
13503 * @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).
13504```javascript
13505$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13506 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13507 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13508 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13509 if ( /Whip It/.test( data ) ) {
13510 alert( "We got what we came for!" );
13511 }
13512});
13513```
13514 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13515```javascript
13516$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13517 .then( myFunc, myFailure );
13518```
13519 */
13520 when(...deferreds: any[]): JQuery.Promise<any, any, never>;
13521}
13522
\No newline at end of file