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_data _&#x40;param_ `success_data`
1546 * <br>
1547 * * `success` — A callback function that is executed if the request succeeds. Required if `dataType` is provided,
1548 * but you can use `null` or \`{@link noop jQuery.noop}\` as a placeholder. <br>
1549 * * `data` — A plain object or string that is sent to the server with the request.
1550 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
1551 * @see \`{@link https://api.jquery.com/jQuery.get/ }\`
1552 * @since 1.0
1553 * @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.
1554```javascript
1555$.get( "test.php", function( data ) {
1556 $( "body" )
1557 .append( "Name: " + data.name ) // John
1558 .append( "Time: " + data.time ); // 2pm
1559}, "json" );
1560```
1561 */
1562 get(url: string,
1563 data_success: JQuery.PlainObject | string | JQuery.jqXHR.DoneCallback | null,
1564 dataType: string): JQuery.jqXHR;
1565 /**
1566 * Load data from the server using a HTTP GET request.
1567 * @param url A string containing the URL to which the request is sent.
1568 * @param success_data _&#x40;param_ `success_data`
1569 * <br>
1570 * * `success` — A callback function that is executed if the request succeeds. Required if `dataType` is provided,
1571 * but you can use `null` or \`{@link noop jQuery.noop}\` as a placeholder. <br>
1572 * * `data` — A plain object or string that is sent to the server with the request.
1573 * @see \`{@link https://api.jquery.com/jQuery.get/ }\`
1574 * @since 1.0
1575 * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results).
1576```javascript
1577$.get( "test.php", { name: "John", time: "2pm" } );
1578```
1579 * @example ​ ````Pass arrays of data to the server (while still ignoring the return results).
1580```javascript
1581$.get( "test.php", { "choices[]": ["Jon", "Susan"] } );
1582```
1583 * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned).
1584```javascript
1585$.get( "test.php", function( data ) {
1586 alert( "Data Loaded: " + data );
1587});
1588```
1589 * @example ​ ````Alert the results from requesting test.cgi with an additional payload of data (HTML or XML, depending on what was returned).
1590```javascript
1591$.get( "test.cgi", { name: "John", time: "2pm" } )
1592 .done(function( data ) {
1593 alert( "Data Loaded: " + data );
1594 });
1595```
1596 */
1597 get(url: string,
1598 success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR;
1599 /**
1600 * Load data from the server using a HTTP GET request.
1601 * @param url_settings _&#x40;param_ `url_settings`
1602 * <br>
1603 * * `url` — A string containing the URL to which the request is sent. <br>
1604 * * `settings` — A set of key/value pairs that configure the Ajax request. All properties except for `url` are
1605 * 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 )}\`
1606 * for a complete list of all settings. The type option will automatically be set to `GET`.
1607 * @see \`{@link https://api.jquery.com/jQuery.get/ }\`
1608 * @since 1.0
1609 * @since 1.12
1610 * @since 2.2
1611 * @example ​ ````Request the test.php page, but ignore the return results.
1612```javascript
1613$.get( "test.php" );
1614```
1615 */
1616 get(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR;
1617 /**
1618 * Load JSON-encoded data from the server using a GET HTTP request.
1619 * @param url A string containing the URL to which the request is sent.
1620 * @param data A plain object or string that is sent to the server with the request.
1621 * @param success A callback function that is executed if the request succeeds.
1622 * @see \`{@link https://api.jquery.com/jQuery.getJSON/ }\`
1623 * @since 1.0
1624 */
1625 getJSON(url: string,
1626 data: JQuery.PlainObject | string,
1627 success: JQuery.jqXHR.DoneCallback): JQuery.jqXHR;
1628 /**
1629 * Load JSON-encoded data from the server using a GET HTTP request.
1630 * @param url A string containing the URL to which the request is sent.
1631 * @param success_data _&#x40;param_ `url_settings`
1632 * <br>
1633 * * `success` — A callback function that is executed if the request succeeds. <br>
1634 * * `data` — A plain object or string that is sent to the server with the request.
1635 * @see \`{@link https://api.jquery.com/jQuery.getJSON/ }\`
1636 * @since 1.0
1637 * @example ​ ````Loads the four most recent pictures of Mount Rainier from the Flickr JSONP API.
1638```html
1639<!doctype html>
1640<html lang="en">
1641<head>
1642 <meta charset="utf-8">
1643 <title>jQuery.getJSON demo</title>
1644 <style>
1645 img {
1646 height: 100px;
1647 float: left;
1648 }
1649 </style>
1650 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1651</head>
1652<body>
1653
1654<div id="images"></div>
1655
1656<script>
1657(function() {
1658 var flickerAPI = "https://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?";
1659 $.getJSON( flickerAPI, {
1660 tags: "mount rainier",
1661 tagmode: "any",
1662 format: "json"
1663 })
1664 .done(function( data ) {
1665 $.each( data.items, function( i, item ) {
1666 $( "<img>" ).attr( "src", item.media.m ).appendTo( "#images" );
1667 if ( i === 3 ) {
1668 return false;
1669 }
1670 });
1671 });
1672})();
1673</script>
1674
1675</body>
1676</html>
1677```
1678 * @example ​ ````Load the JSON data from test.js and access a name from the returned JSON data.
1679```javascript
1680$.getJSON( "test.js", function( json ) {
1681 console.log( "JSON Data: " + json.users[ 3 ].name );
1682 });
1683 ```
1684 * @example ​ ````Load the JSON data from test.js, passing along additional data, and access a name from the returned JSON data.
1685 If an error occurs, log an error message instead.
1686```javascript
1687$.getJSON( "test.js", { name: "John", time: "2pm" } )
1688 .done(function( json ) {
1689 console.log( "JSON Data: " + json.users[ 3 ].name );
1690 })
1691 .fail(function( jqxhr, textStatus, error ) {
1692 var err = textStatus + ", " + error;
1693 console.log( "Request Failed: " + err );
1694});
1695```
1696 */
1697 getJSON(url: string,
1698 success_data?: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR;
1699 /**
1700 * Load a JavaScript file from the server using a GET HTTP request, then execute it.
1701 * @param url A string containing the URL to which the request is sent.
1702 * @param success A callback function that is executed if the request succeeds.
1703 * @see \`{@link https://api.jquery.com/jQuery.getScript/ }\`
1704 * @since 1.0
1705 * @example ​ ````Define a $.cachedScript() method that allows fetching a cached script:
1706```javascript
1707jQuery.cachedScript = function( url, options ) {
1708
1709 // Allow user to set any option except for dataType, cache, and url
1710 options = $.extend( options || {}, {
1711 dataType: "script",
1712 cache: true,
1713 url: url
1714 });
1715
1716 // Use $.ajax() since it is more flexible than $.getScript
1717 // Return the jqXHR object so we can chain callbacks
1718 return jQuery.ajax( options );
1719};
1720
1721// Usage
1722$.cachedScript( "ajax/test.js" ).done(function( script, textStatus ) {
1723 console.log( textStatus );
1724});
1725```
1726 * @example ​ ````Load the official jQuery Color Animation plugin dynamically and bind some color animations to occur once the new functionality is loaded.
1727```html
1728<!doctype html>
1729<html lang="en">
1730<head>
1731 <meta charset="utf-8">
1732 <title>jQuery.getScript demo</title>
1733 <style>
1734 .block {
1735 background-color: blue;
1736 width: 150px;
1737 height: 70px;
1738 margin: 10px;
1739 }
1740 </style>
1741 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1742</head>
1743<body>
1744
1745<button id="go">&raquo; Run</button>
1746<div class="block"></div>
1747
1748<script>
1749var url = "https://code.jquery.com/color/jquery.color.js";
1750$.getScript( url, function() {
1751 $( "#go" ).click(function() {
1752 $( ".block" )
1753 .animate({
1754 backgroundColor: "rgb(255, 180, 180)"
1755 }, 1000 )
1756 .delay( 500 )
1757 .animate({
1758 backgroundColor: "olive"
1759 }, 1000 )
1760 .delay( 500 )
1761 .animate({
1762 backgroundColor: "#00f"
1763 }, 1000 );
1764 });
1765});
1766</script>
1767
1768</body>
1769</html>
1770```
1771 */
1772 getScript(url: string,
1773 success?: JQuery.jqXHR.DoneCallback<string | undefined>): JQuery.jqXHR<string | undefined>;
1774 /**
1775 * Load a JavaScript file from the server using a GET HTTP request, then execute it.
1776 * @see \`{@link https://api.jquery.com/jQuery.getScript/ }\`
1777 * @since 1.12
1778 * @since 2.2
1779 */
1780 getScript(options: JQuery.UrlAjaxSettings): JQuery.jqXHR<string | undefined>;
1781 /**
1782 * Execute some JavaScript code globally.
1783 * @param code The JavaScript code to execute.
1784 * @see \`{@link https://api.jquery.com/jQuery.globalEval/ }\`
1785 * @since 1.0.4
1786 * @example ​ ````Execute a script in the global context.
1787```javascript
1788function test() {
1789 jQuery.globalEval( "var newVar = true;" )
1790}
1791test();
1792// newVar === true
1793```
1794 */
1795 globalEval(code: string): void;
1796 /**
1797 * Finds the elements of an array which satisfy a filter function. The original array is not affected.
1798 * @param array The array-like object to search through.
1799 * @param funсtion The function to process each item against. The first argument to the function is the item, and the
1800 * second argument is the index. The function should return a Boolean value. `this` will be the global
1801 * window object.
1802 * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements
1803 * for which "callback" returns true. If "invert" is true, then the function returns an array
1804 * consisting of all elements for which "callback" returns false.
1805 * @see \`{@link https://api.jquery.com/jQuery.grep/ }\`
1806 * @since 1.0
1807 * @example ​ ````Filters the original array of numbers leaving that are not 5 and have an index greater than 4. Then it removes all 9s.
1808```html
1809<!doctype html>
1810<html lang="en">
1811<head>
1812 <meta charset="utf-8">
1813 <title>jQuery.grep demo</title>
1814 <style>
1815 div {
1816 color: blue;
1817 }
1818 p {
1819 color: green;
1820 margin: 0;
1821 }
1822 span {
1823 color: red;
1824 }
1825 </style>
1826 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1827</head>
1828<body>
1829
1830<div></div>
1831<p></p>
1832<span></span>
1833
1834<script>
1835var arr = [ 1, 9, 3, 8, 6, 1, 5, 9, 4, 7, 3, 8, 6, 9, 1 ];
1836$( "div" ).text( arr.join( ", " ) );
1837
1838arr = jQuery.grep(arr, function( n, i ) {
1839 return ( n !== 5 && i > 4 );
1840});
1841$( "p" ).text( arr.join( ", " ) );
1842
1843arr = jQuery.grep(arr, function( a ) {
1844 return a !== 9;
1845});
1846
1847$( "span" ).text( arr.join( ", " ) );
1848</script>
1849
1850</body>
1851</html>
1852```
1853 * @example ​ ````Filter an array of numbers to include only numbers bigger then zero.
1854```javascript
1855$.grep( [ 0, 1, 2 ], function( n, i ) {
1856 return n > 0;
1857});
1858```
1859 * @example ​ ````Filter an array of numbers to include numbers that are not bigger than zero.
1860```javascript
1861$.grep( [ 0, 1, 2 ], function( n, i ) {
1862 return n > 0;
1863}, true );
1864```
1865 */
1866 grep<T>(array: ArrayLike<T>,
1867 funсtion: (elementOfArray: T, indexInArray: number) => boolean,
1868 invert?: boolean): T[];
1869 /**
1870 * Determine whether an element has any jQuery data associated with it.
1871 * @param element A DOM element to be checked for data.
1872 * @see \`{@link https://api.jquery.com/jQuery.hasData/ }\`
1873 * @since 1.5
1874 * @example ​ ````Set data on an element and see the results of hasData.
1875```html
1876<!doctype html>
1877<html lang="en">
1878<head>
1879 <meta charset="utf-8">
1880 <title>jQuery.hasData demo</title>
1881 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1882</head>
1883<body>
1884
1885<p>Results: </p>
1886
1887<script>
1888var $p = jQuery( "p" ), p = $p[ 0 ];
1889$p.append( jQuery.hasData( p ) + " " ); // false
1890
1891$.data( p, "testing", 123 );
1892$p.append( jQuery.hasData( p ) + " " ); // true
1893
1894$.removeData( p, "testing" );
1895$p.append( jQuery.hasData( p ) + " " ); // false
1896
1897$p.on( "click", function() {} );
1898$p.append( jQuery.hasData( p ) + " " ); // true
1899
1900$p.off( "click" );
1901$p.append( jQuery.hasData( p ) + " " ); // false
1902</script>
1903
1904</body>
1905</html>
1906```
1907 */
1908 hasData(element: Element | Document | Window | JQuery.PlainObject): boolean;
1909 /**
1910 * Holds or releases the execution of jQuery's ready event.
1911 * @param hold Indicates whether the ready hold is being requested or released
1912 * @see \`{@link https://api.jquery.com/jQuery.holdReady/ }\`
1913 * @since 1.6
1914 * @deprecatedDeprecated since 3.2. See \`{@link https://github.com/jquery/jquery/issues/3288 }\`.
1915 *
1916 * **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.
1917 *
1918 * **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.
1919 * @example ​ ````Delay the ready event until a custom plugin has loaded.
1920```javascript
1921$.holdReady( true );
1922$.getScript( "myplugin.js", function() {
1923 $.holdReady( false );
1924});
1925```
1926 */
1927 holdReady(hold: boolean): void;
1928 /**
1929 * Modify and filter HTML strings passed through jQuery manipulation methods.
1930 * @param html The HTML string on which to operate.
1931 * @see \`{@link https://api.jquery.com/jQuery.htmlPrefilter/ }\`
1932 * @since 1.12
1933 * @since 2.2
1934 */
1935 htmlPrefilter(html: JQuery.htmlString): JQuery.htmlString;
1936 /**
1937 * Search for a specified value within an array and return its index (or -1 if not found).
1938 * @param value The value to search for.
1939 * @param array An array through which to search.
1940 * @param fromIndex The index of the array at which to begin the search. The default is 0, which will search the whole array.
1941 * @see \`{@link https://api.jquery.com/jQuery.inArray/ }\`
1942 * @since 1.2
1943 * @example ​ ````Report the index of some elements in the array.
1944```html
1945<!doctype html>
1946<html lang="en">
1947<head>
1948 <meta charset="utf-8">
1949 <title>jQuery.inArray demo</title>
1950 <style>
1951 div {
1952 color: blue;
1953 }
1954 span {
1955 color: red;
1956 }
1957 </style>
1958 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1959</head>
1960<body>
1961
1962<div>"John" found at <span></span></div>
1963<div>4 found at <span></span></div>
1964<div>"Karl" not found, so <span></span></div>
1965<div>"Pete" is in the array, but not at or after index 2, so <span></span></div>
1966
1967<script>
1968var arr = [ 4, "Pete", 8, "John" ];
1969var $spans = $( "span" );
1970$spans.eq( 0 ).text( jQuery.inArray( "John", arr ) );
1971$spans.eq( 1 ).text( jQuery.inArray( 4, arr ) );
1972$spans.eq( 2 ).text( jQuery.inArray( "Karl", arr ) );
1973$spans.eq( 3 ).text( jQuery.inArray( "Pete", arr, 2 ) );
1974</script>
1975
1976</body>
1977</html>
1978```
1979 */
1980 inArray<T>(value: T, array: T[], fromIndex?: number): number;
1981 /**
1982 * Determine whether the argument is an array.
1983 * @param obj Object to test whether or not it is an array.
1984 * @see \`{@link https://api.jquery.com/jQuery.isArray/ }\`
1985 * @since 1.3
1986 * @deprecatedDeprecated since 3.2. Use \`{@link ArrayConstructor.isArray Array.isArray}\`.
1987 * @example ​ ````Finds out if the parameter is an array.
1988```html
1989<!doctype html>
1990<html lang="en">
1991<head>
1992 <meta charset="utf-8">
1993 <title>jQuery.isArray demo</title>
1994 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
1995</head>
1996<body>
1997
1998Is [] an Array? <b></b>
1999
2000<script>
2001$( "b" ).append( "" + $.isArray([]) );
2002</script>
2003
2004</body>
2005</html>
2006```
2007 */
2008 isArray(obj: any): obj is any[];
2009 /**
2010 * Check to see if an object is empty (contains no enumerable properties).
2011 * @param obj The object that will be checked to see if it's empty.
2012 * @see \`{@link https://api.jquery.com/jQuery.isEmptyObject/ }\`
2013 * @since 1.4
2014 * @example ​ ````Check an object to see if it&#39;s empty.
2015```javascript
2016jQuery.isEmptyObject({}); // true
2017jQuery.isEmptyObject({ foo: "bar" }); // false
2018```
2019 */
2020 isEmptyObject(obj: any): boolean;
2021 /**
2022 * Determine if the argument passed is a JavaScript function object.
2023 * @param obj Object to test whether or not it is a function.
2024 * @see \`{@link https://api.jquery.com/jQuery.isFunction/ }\`
2025 * @since 1.2
2026 * @deprecatedDeprecated since 3.3. Use `typeof x === "function"`.
2027 * @example ​ ````Test a few parameter examples.
2028```html
2029<!doctype html>
2030<html lang="en">
2031<head>
2032 <meta charset="utf-8">
2033 <title>jQuery.isFunction demo</title>
2034 <style>
2035 div {
2036 color: blue;
2037 margin: 2px;
2038 font-size: 14px;
2039 }
2040 span {
2041 color: red;
2042 }
2043 </style>
2044 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2045</head>
2046<body>
2047
2048<div>jQuery.isFunction( objs[ 0 ] ) = <span></span></div>
2049<div>jQuery.isFunction( objs[ 1 ] ) = <span></span></div>
2050<div>jQuery.isFunction( objs[ 2 ] ) = <span></span></div>
2051<div>jQuery.isFunction( objs[ 3 ] ) = <span></span></div>
2052<div>jQuery.isFunction( objs[ 4 ] ) = <span></span></div>
2053
2054<script>
2055function stub() {}
2056var objs = [
2057 function() {},
2058 { x:15, y:20 },
2059 null,
2060 stub,
2061 "function"
2062];
2063
2064jQuery.each( objs, function( i ) {
2065 var isFunc = jQuery.isFunction( objs[ i ]);
2066 $( "span" ).eq( i ).text( isFunc );
2067});
2068</script>
2069
2070</body>
2071</html>
2072```
2073 * @example ​ ````Finds out if the parameter is a function.
2074```javascript
2075$.isFunction(function() {});
2076```
2077 */
2078 // tslint:disable-next-line:ban-types
2079 isFunction(obj: any): obj is Function;
2080 /**
2081 * Determines whether its argument represents a JavaScript number.
2082 * @param value The value to be tested.
2083 * @see \`{@link https://api.jquery.com/jQuery.isNumeric/ }\`
2084 * @since 1.7
2085 * @deprecatedDeprecated since 3.3. Internal. See \`{@link https://github.com/jquery/jquery/issues/2960 }\`.
2086 * @example ​ ````Sample return values of $.isNumeric with various inputs.
2087```javascript
2088// true (numeric)
2089$.isNumeric( "-10" )
2090$.isNumeric( "0" )
2091$.isNumeric( 0xFF )
2092$.isNumeric( "0xFF" )
2093$.isNumeric( "8e5" )
2094$.isNumeric( "3.1415" )
2095$.isNumeric( +10 )
2096$.isNumeric( 0144 )
2097
2098// false (non-numeric)
2099$.isNumeric( "-0x42" )
2100$.isNumeric( "7.2acdgs" )
2101$.isNumeric( "" )
2102$.isNumeric( {} )
2103$.isNumeric( NaN )
2104$.isNumeric( null )
2105$.isNumeric( true )
2106$.isNumeric( Infinity )
2107$.isNumeric( undefined )
2108```
2109 */
2110 isNumeric(value: any): boolean;
2111 /**
2112 * Check to see if an object is a plain object (created using "{}" or "new Object").
2113 * @param obj The object that will be checked to see if it's a plain object.
2114 * @see \`{@link https://api.jquery.com/jQuery.isPlainObject/ }\`
2115 * @since 1.4
2116 * @example ​ ````Check an object to see if it&#39;s a plain object.
2117```javascript
2118jQuery.isPlainObject({}) // true
2119jQuery.isPlainObject( "test" ) // false
2120```
2121 */
2122 isPlainObject(obj: any): boolean;
2123 /**
2124 * Determine whether the argument is a window.
2125 * @param obj Object to test whether or not it is a window.
2126 * @see \`{@link https://api.jquery.com/jQuery.isWindow/ }\`
2127 * @since 1.4.3
2128 * @deprecatedDeprecated since 3.3. Internal. See \`{@link https://github.com/jquery/jquery/issues/3629 }\`.
2129 *
2130 * **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.
2131 *
2132 * **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.
2133 * @example ​ ````Finds out if the parameter is a window.
2134```html
2135<!doctype html>
2136<html lang="en">
2137<head>
2138 <meta charset="utf-8">
2139 <title>jQuery.isWindow demo</title>
2140 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2141</head>
2142<body>
2143
2144Is 'window' a window? <b></b>
2145
2146<script>
2147$( "b" ).append( "" + $.isWindow( window ) );
2148</script>
2149
2150</body>
2151</html>
2152```
2153 */
2154 isWindow(obj: any): obj is Window;
2155 /**
2156 * Check to see if a DOM node is within an XML document (or is an XML document).
2157 * @param node The DOM node that will be checked to see if it's in an XML document.
2158 * @see \`{@link https://api.jquery.com/jQuery.isXMLDoc/ }\`
2159 * @since 1.1.4
2160 * @example ​ ````Check an object to see if it&#39;s in an XML document.
2161```javascript
2162jQuery.isXMLDoc( document ) // false
2163jQuery.isXMLDoc( document.body ) // false
2164```
2165 */
2166 isXMLDoc(node: Node): boolean;
2167 /**
2168 * Convert an array-like object into a true JavaScript array.
2169 * @param obj Any object to turn into a native Array.
2170 * @see \`{@link https://api.jquery.com/jQuery.makeArray/ }\`
2171 * @since 1.2
2172 * @example ​ ````Turn a collection of HTMLElements into an Array of them.
2173```html
2174<!doctype html>
2175<html lang="en">
2176<head>
2177 <meta charset="utf-8">
2178 <title>jQuery.makeArray demo</title>
2179 <style>
2180 div {
2181 color: red;
2182 }
2183 </style>
2184 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2185</head>
2186<body>
2187
2188<div>First</div>
2189<div>Second</div>
2190<div>Third</div>
2191<div>Fourth</div>
2192
2193<script>
2194// Returns a NodeList
2195var elems = document.getElementsByTagName( "div" );
2196// Convert the NodeList to an Array
2197var arr = jQuery.makeArray( elems );
2198// Use an Array method on list of dom elements
2199arr.reverse();
2200$( arr ).appendTo( document.body );
2201</script>
2202
2203</body>
2204</html>
2205```
2206 * @example ​ ````Turn a jQuery object into an array
2207```javascript
2208var obj = $( "li" );
2209var arr = $.makeArray( obj );
2210```
2211 */
2212 makeArray<T>(obj: ArrayLike<T>): T[];
2213 /**
2214 * Translate all items in an array or object to new array of items.
2215 * @param array The Array to translate.
2216 * @param callback The function to process each item against. The first argument to the function is the array item, the
2217 * second argument is the index in array The function can return any value. A returned array will be
2218 * flattened into the resulting array. Within the function, this refers to the global (window) object.
2219 * @see \`{@link https://api.jquery.com/jQuery.map/ }\`
2220 * @since 1.0
2221 * @example ​ ````Use $.map() to change the values of an array.
2222```html
2223<!doctype html>
2224<html lang="en">
2225<head>
2226 <meta charset="utf-8">
2227 <title>jQuery.map demo</title>
2228 <style>
2229 div {
2230 color: blue;
2231 }
2232 p {
2233 color: green;
2234 margin: 0;
2235 }
2236 span {
2237 color: red;
2238 }
2239 </style>
2240 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2241</head>
2242<body>
2243
2244<div></div>
2245<p></p>
2246<span></span>
2247
2248<script>
2249var arr = [ "a", "b", "c", "d", "e" ];
2250$( "div" ).text( arr.join( ", " ) );
2251
2252arr = jQuery.map( arr, function( n, i ) {
2253 return ( n.toUpperCase() + i );
2254});
2255$( "p" ).text( arr.join( ", " ) );
2256
2257arr = jQuery.map( arr, function( a ) {
2258 return a + a;
2259});
2260$( "span" ).text( arr.join( ", " ) );
2261</script>
2262
2263</body>
2264</html>
2265```
2266 * @example ​ ````Map the original array to a new one and add 4 to each value.
2267```javascript
2268$.map( [ 0, 1, 2 ], function( n ) {
2269 return n + 4;
2270});
2271```
2272 * @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.
2273```javascript
2274$.map( [ 0, 1, 2 ], function( n ) {
2275 return n > 0 ? n + 1 : null;
2276});
2277```
2278 * @example ​ ````Map the original array to a new one; each element is added with its original value and the value plus one.
2279```javascript
2280$.map( [ 0, 1, 2 ], function( n ) {
2281 return [ n, n + 1 ];
2282});
2283```
2284 * @example ​ ````Map the original array to a new one; each element is squared.
2285```javascript
2286$.map( [ 0, 1, 2, 3 ], function( a ) {
2287 return a * a;
2288});
2289```
2290 * @example ​ ````Map the original array to a new one, removing numbers less than 50 by returning null and subtracting 45 from the rest.
2291```javascript
2292$.map( [ 0, 1, 52, 97 ], function( a ) {
2293 return (a > 50 ? a - 45 : null);
2294});
2295```
2296 * @example ​ ````Augment the resulting array by returning an array inside the function.
2297```javascript
2298var array = [ 0, 1, 52, 97 ];
2299array = $.map( array, function( a, index ) {
2300 return [ a - 45, index ];
2301});
2302```
2303 */
2304 map<T, TReturn>(array: T[], callback: (this: Window, elementOfArray: T, indexInArray: number) => JQuery.TypeOrArray<TReturn> | null | undefined): TReturn[];
2305 /**
2306 * Translate all items in an array or object to new array of items.
2307 * @param obj The Object to translate.
2308 * @param callback The function to process each item against. The first argument to the function is the value; the
2309 * second argument is the key of the object property. The function can return any value to add to the
2310 * array. A returned array will be flattened into the resulting array. Within the function, this refers
2311 * to the global (window) object.
2312 * @see \`{@link https://api.jquery.com/jQuery.map/ }\`
2313 * @since 1.6
2314 * @example ​ ````Map the original object to a new array and double each value.
2315```javascript
2316var dimensions = { width: 10, height: 15, length: 20 };
2317dimensions = $.map( dimensions, function( value, index ) {
2318 return value * 2;
2319});
2320```
2321 * @example ​ ````Map an object&#39;s keys to an array.
2322```javascript
2323var dimensions = { width: 10, height: 15, length: 20 };
2324var keys = $.map( dimensions, function( value, key ) {
2325 return key;
2326});
2327```
2328 */
2329 map<T, K extends keyof T, TReturn>(obj: T, callback: (this: Window, propertyOfObject: T[K], key: K) => JQuery.TypeOrArray<TReturn> | null | undefined): TReturn[];
2330 /**
2331 * Merge the contents of two arrays together into the first array.
2332 * @param first The first array-like object to merge, the elements of second added.
2333 * @param second The second array-like object to merge into the first, unaltered.
2334 * @see \`{@link https://api.jquery.com/jQuery.merge/ }\`
2335 * @since 1.0
2336 * @example ​ ````Merges two arrays, altering the first argument.
2337```javascript
2338$.merge( [ 0, 1, 2 ], [ 2, 3, 4 ] )
2339```
2340 * @example ​ ````Merges two arrays, altering the first argument.
2341```javascript
2342$.merge( [ 3, 2, 1 ], [ 4, 3, 2 ] )
2343```
2344 * @example ​ ````Merges two arrays, but uses a copy, so the original isn&#39;t altered.
2345```javascript
2346var first = [ "a", "b", "c" ];
2347var second = [ "d", "e", "f" ];
2348$.merge( $.merge( [], first ), second );
2349```
2350 */
2351 merge<T, U>(first: ArrayLike<T>, second: ArrayLike<U>): Array<T | U>;
2352 /**
2353 * Relinquish jQuery's control of the $ variable.
2354 * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).
2355 * @see \`{@link https://api.jquery.com/jQuery.noConflict/ }\`
2356 * @since 1.0
2357 * @example ​ ````Map the original object that was referenced by $ back to $.
2358```javascript
2359jQuery.noConflict();
2360// Do something with jQuery
2361jQuery( "div p" ).hide();
2362// Do something with another library's $()
2363$( "content" ).style.display = "none";
2364```
2365 * @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.
2366```javascript
2367jQuery.noConflict();
2368(function( $ ) {
2369 $(function() {
2370 // More code using $ as alias to jQuery
2371 });
2372})(jQuery);
2373
2374// Other code using $ as an alias to the other library
2375```
2376 * @example ​ ````Create a different alias instead of jQuery to use in the rest of the script.
2377```javascript
2378var j = jQuery.noConflict();
2379
2380// Do something with jQuery
2381j( "div p" ).hide();
2382
2383// Do something with another library's $()
2384$( "content" ).style.display = "none";
2385```
2386 * @example ​ ````Completely move jQuery to a new namespace in another object.
2387```javascript
2388var dom = {};
2389dom.query = jQuery.noConflict( true );
2390```
2391 * @example ​ ````Load two versions of jQuery (not recommended). Then, restore jQuery&#39;s globally scoped variables to the first loaded jQuery.
2392```html
2393<!doctype html>
2394<html lang="en">
2395<head>
2396 <meta charset="utf-8">
2397 <title>jQuery.noConflict demo</title>
2398 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2399</head>
2400<body>
2401
2402<div id="log">
2403 <h3>Before $.noConflict(true)</h3>
2404</div>
2405<script src="https://code.jquery.com/jquery-1.6.2.js"></script>
2406
2407<script>
2408var $log = $( "#log" );
2409
2410$log.append( "2nd loaded jQuery version ($): " + $.fn.jquery + "<br>" );
2411
2412// Restore globally scoped jQuery variables to the first version loaded
2413// (the newer version)
2414
2415jq162 = jQuery.noConflict( true );
2416
2417$log.append( "<h3>After $.noConflict(true)</h3>" );
2418$log.append( "1st loaded jQuery version ($): " + $.fn.jquery + "<br>" );
2419$log.append( "2nd loaded jQuery version (jq162): " + jq162.fn.jquery + "<br>" );
2420</script>
2421
2422</body>
2423</html>
2424```
2425 */
2426 noConflict(removeAll?: boolean): this;
2427 /**
2428 * @deprecatedDeprecated since 3.2.
2429 *
2430 * **Cause**: This public but never-documented method has been deprecated as of jQuery 3.2.0.
2431 *
2432 * **Solution**: Replace calls such as `jQuery.nodeName( elem, "div" )` with a test such as `elem.nodeName.toLowerCase() === "div"`.
2433 */
2434 nodeName(elem: Node, name: string): boolean;
2435 /**
2436 * An empty function.
2437 * @see \`{@link https://api.jquery.com/jQuery.noop/ }\`
2438 * @since 1.4
2439 */
2440 noop(): undefined;
2441 /**
2442 * Return a number representing the current time.
2443 * @see \`{@link https://api.jquery.com/jQuery.now/ }\`
2444 * @since 1.4.3
2445 * @deprecatedDeprecated since 3.3. Use \`{@link DateConstructor.now Date.now}\`.
2446 */
2447 now(): number;
2448 /**
2449 * 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.
2450 * @param obj An array, a plain object, or a jQuery object to serialize.
2451 * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization.
2452 * @see \`{@link https://api.jquery.com/jQuery.param/ }\`
2453 * @since 1.2
2454 * @since 1.4
2455 * @example ​ ````Serialize a key/value object.
2456```html
2457<!doctype html>
2458<html lang="en">
2459<head>
2460 <meta charset="utf-8">
2461 <title>jQuery.param demo</title>
2462 <style>
2463 div {
2464 color: red;
2465 }
2466 </style>
2467 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2468</head>
2469<body>
2470
2471<div id="results"></div>
2472
2473<script>
2474var params = { width:1680, height:1050 };
2475var str = jQuery.param( params );
2476$( "#results" ).text( str );
2477</script>
2478
2479</body>
2480</html>
2481```
2482 * @example ​ ````Serialize a few complex objects
2483```html
2484<!doctype html>
2485<html lang="en">
2486<head>
2487 <meta charset="utf-8">
2488 <title>jQuery.param demo</title>
2489 <style>
2490 div {
2491 color: red;
2492 }
2493 </style>
2494 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2495</head>
2496<body>
2497​​
2498<script>
2499// <=1.3.2:
2500$.param({ a: [ 2, 3, 4 ] }); // "a=2&a=3&a=4"
2501// >=1.4:
2502$.param({ a: [ 2, 3, 4 ] }); // "a[]=2&a[]=3&a[]=4"
2503
2504// <=1.3.2:
2505$.param({ a: { b: 1, c: 2 }, d: [ 3, 4, { e: 5 } ] });
2506// "a=[object+Object]&d=3&d=4&d=[object+Object]"
2507
2508// >=1.4:
2509$.param({ a: { b: 1, c: 2 }, d: [ 3, 4, { e: 5 } ] });
2510// "a[b]=1&a[c]=2&d[]=3&d[]=4&d[2][e]=5"
2511</script>
2512
2513</body>
2514</html>
2515```
2516 */
2517 param(obj: any[] | JQuery.PlainObject | JQuery, traditional?: boolean): string;
2518 /**
2519 * Parses a string into an array of DOM nodes.
2520 * @param data HTML string to be parsed
2521 * @param context Document element to serve as the context in which the HTML fragment will be created
2522 * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
2523 * @see \`{@link https://api.jquery.com/jQuery.parseHTML/ }\`
2524 * @since 1.8
2525 */
2526 parseHTML(data: string, context: Document | null | undefined, keepScripts: boolean): JQuery.Node[];
2527 /**
2528 * Parses a string into an array of DOM nodes.
2529 * @param data HTML string to be parsed
2530 * @param context_keepScripts _&#x40;param_ `context_keepScripts`
2531 * <br>
2532 * * `context` — Document element to serve as the context in which the HTML fragment will be created <br>
2533 * * `keepScripts` — A Boolean indicating whether to include scripts passed in the HTML string
2534 * @see \`{@link https://api.jquery.com/jQuery.parseHTML/ }\`
2535 * @since 1.8
2536 * @example ​ ````Create an array of DOM nodes using an HTML string and insert it into a div.
2537```html
2538<!doctype html>
2539<html lang="en">
2540<head>
2541 <meta charset="utf-8">
2542 <title>jQuery.parseHTML demo</title>
2543 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2544</head>
2545<body>
2546
2547<div id="log">
2548 <h3>Content:</h3>
2549</div>
2550
2551<script>
2552var $log = $( "#log" ),
2553 str = "hello, <b>my name is</b> jQuery.",
2554 html = $.parseHTML( str ),
2555 nodeNames = [];
2556
2557// Append the parsed HTML
2558$log.append( html );
2559
2560// Gather the parsed HTML's node names
2561$.each( html, function( i, el ) {
2562 nodeNames[ i ] = "<li>" + el.nodeName + "</li>";
2563});
2564
2565// Insert the node names
2566$log.append( "<h3>Node Names:</h3>" );
2567$( "<ol></ol>" )
2568 .append( nodeNames.join( "" ) )
2569 .appendTo( $log );
2570</script>
2571
2572</body>
2573</html>
2574```
2575 */
2576 parseHTML(data: string, context_keepScripts?: Document | null | boolean): JQuery.Node[];
2577 /**
2578 * Takes a well-formed JSON string and returns the resulting JavaScript value.
2579 * @param json The JSON string to parse.
2580 * @see \`{@link https://api.jquery.com/jQuery.parseJSON/ }\`
2581 * @since 1.4.1
2582 * @deprecatedDeprecated since 3.0. Use \`{@link JSON.parse }\`.
2583 *
2584 * **Cause**: The `jQuery.parseJSON` method in recent jQuery is identical to the native `JSON.parse`. As of jQuery 3.0 `jQuery.parseJSON` is deprecated.
2585 *
2586 * **Solution**: Replace any use of `jQuery.parseJSON` with `JSON.parse`.
2587 * @example ​ ````Parse a JSON string.
2588```javascript
2589var obj = jQuery.parseJSON( '{ "name": "John" }' );
2590alert( obj.name === "John" );
2591```
2592 */
2593 parseJSON(json: string): any;
2594 /**
2595 * Parses a string into an XML document.
2596 * @param data a well-formed XML string to be parsed
2597 * @see \`{@link https://api.jquery.com/jQuery.parseXML/ }\`
2598 * @since 1.5
2599 * @example ​ ````Create a jQuery object using an XML string and obtain the value of the title node.
2600```html
2601<!doctype html>
2602<html lang="en">
2603<head>
2604 <meta charset="utf-8">
2605 <title>jQuery.parseXML demo</title>
2606 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2607</head>
2608<body>
2609
2610<p id="someElement"></p>
2611<p id="anotherElement"></p>
2612
2613<script>
2614var xml = "<rss version='2.0'><channel><title>RSS Title</title></channel></rss>",
2615 xmlDoc = $.parseXML( xml ),
2616 $xml = $( xmlDoc ),
2617 $title = $xml.find( "title" );
2618
2619// Append "RSS Title" to #someElement
2620$( "#someElement" ).append( $title.text() );
2621
2622// Change the title to "XML Title"
2623$title.text( "XML Title" );
2624
2625// Append "XML Title" to #anotherElement
2626$( "#anotherElement" ).append( $title.text() );
2627</script>
2628
2629</body>
2630</html>
2631```
2632 */
2633 parseXML(data: string): XMLDocument;
2634 /**
2635 * Load data from the server using a HTTP POST request.
2636 * @param url A string containing the URL to which the request is sent.
2637 * @param data A plain object or string that is sent to the server with the request.
2638 * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but
2639 * can be null in that case.
2640 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
2641 * @see \`{@link https://api.jquery.com/jQuery.post/ }\`
2642 * @since 1.0
2643 * @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;).
2644```javascript
2645$.post( "test.php", { func: "getNameAndTime" }, function( data ) {
2646 console.log( data.name ); // John
2647 console.log( data.time ); // 2pm
2648}, "json");
2649```
2650 */
2651 post(url: string,
2652 data: JQuery.PlainObject | string,
2653 success: JQuery.jqXHR.DoneCallback | null,
2654 dataType?: string): JQuery.jqXHR;
2655 /**
2656 * Load data from the server using a HTTP POST request.
2657 * @param url A string containing the URL to which the request is sent.
2658 * @param success_data _&#x40;param_ `success_data`
2659 * <br>
2660 * * `success` — A callback function that is executed if the request succeeds. Required if `dataType` is provided,
2661 * but can be `null` in that case. <br>
2662 * * `data` — A plain object or string that is sent to the server with the request.
2663 * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
2664 * @see \`{@link https://api.jquery.com/jQuery.post/ }\`
2665 * @since 1.0
2666 */
2667 post(url: string,
2668 data_success: JQuery.PlainObject | string | JQuery.jqXHR.DoneCallback | null,
2669 dataType: string): JQuery.jqXHR;
2670 /**
2671 * Load data from the server using a HTTP POST request.
2672 * @param url A string containing the URL to which the request is sent.
2673 * @param success_data _&#x40;param_ `success_data`
2674 * <br>
2675 * * `success` — A callback function that is executed if the request succeeds. Required if `dataType` is provided,
2676 * but can be `null` in that case. <br>
2677 * * `data` — A plain object or string that is sent to the server with the request.
2678 * @see \`{@link https://api.jquery.com/jQuery.post/ }\`
2679 * @since 1.0
2680 * @example ​ ````Request the test.php page and send some additional data along (while still ignoring the return results).
2681```javascript
2682$.post( "test.php", { name: "John", time: "2pm" } );
2683```
2684 * @example ​ ````Pass arrays of data to the server (while still ignoring the return results).
2685```javascript
2686$.post( "test.php", { 'choices[]': [ "Jon", "Susan" ] } );
2687```
2688 * @example ​ ````Send form data using Ajax requests
2689```javascript
2690$.post( "test.php", $( "#testform" ).serialize() );
2691```
2692 * @example ​ ````Alert the results from requesting test.php (HTML or XML, depending on what was returned).
2693```javascript
2694$.post( "test.php", function( data ) {
2695 alert( "Data Loaded: " + data );
2696});
2697```
2698 * @example ​ ````Alert the results from requesting test.php with an additional payload of data (HTML or XML, depending on what was returned).
2699```javascript
2700$.post( "test.php", { name: "John", time: "2pm" })
2701 .done(function( data ) {
2702 alert( "Data Loaded: " + data );
2703 });
2704```
2705 * @example ​ ````Post a form using Ajax and put results in a div
2706```html
2707<!doctype html>
2708<html lang="en">
2709<head>
2710 <meta charset="utf-8">
2711 <title>jQuery.post demo</title>
2712 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2713</head>
2714<body>
2715
2716<form action="/" id="searchForm">
2717 <input type="text" name="s" placeholder="Search...">
2718 <input type="submit" value="Search">
2719</form>
2720<!-- the result of the search will be rendered inside this div -->
2721<div id="result"></div>
2722
2723<script>
2724// Attach a submit handler to the form
2725$( "#searchForm" ).submit(function( event ) {
2726
2727 // Stop form from submitting normally
2728 event.preventDefault();
2729
2730 // Get some values from elements on the page:
2731 var $form = $( this ),
2732 term = $form.find( "input[name='s']" ).val(),
2733 url = $form.attr( "action" );
2734
2735 // Send the data using post
2736 var posting = $.post( url, { s: term } );
2737
2738 // Put the results in a div
2739 posting.done(function( data ) {
2740 var content = $( data ).find( "#content" );
2741 $( "#result" ).empty().append( content );
2742 });
2743});
2744</script>
2745
2746</body>
2747</html>
2748```
2749 */
2750 post(url: string,
2751 success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR;
2752 /**
2753 * Load data from the server using a HTTP POST request.
2754 * @param url_settings _&#x40;param_ `url_settings`
2755 * <br>
2756 * * `url` — A string containing the URL to which the request is sent. <br>
2757 * * `settings` — A set of key/value pairs that configure the Ajax request. All properties except for `url` are optional.
2758 * 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 )}\`
2759 * for a complete list of all settings. Type will automatically be set to `POST`.
2760 * @see \`{@link https://api.jquery.com/jQuery.post/ }\`
2761 * @since 1.0
2762 * @since 1.12
2763 * @since 2.2
2764 * @example ​ ````Request the test.php page, but ignore the return results.
2765```javascript
2766$.post( "test.php" );
2767```
2768 */
2769 post(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR;
2770
2771 // region proxy
2772 // #region proxy
2773
2774 // region (funсtion, null | undefined)
2775 // #region (funсtion, null | undefined)
2776
2777 // region 0 to 7 additional arguments
2778 // #region 0 to 7 additional arguments
2779
2780 // region 0 parameters
2781 // #region 0 parameters
2782
2783 /**
2784 * Takes a function and returns a new one that will always have a particular context.
2785 * @param funсtion The function whose context will be changed.
2786 * @param context The object to which the context (`this`) of the function should be set.
2787 * @param a An argument to be passed to the function referenced in the `function` argument.
2788 * @param b An argument to be passed to the function referenced in the `function` argument.
2789 * @param c An argument to be passed to the function referenced in the `function` argument.
2790 * @param d An argument to be passed to the function referenced in the `function` argument.
2791 * @param e An argument to be passed to the function referenced in the `function` argument.
2792 * @param f An argument to be passed to the function referenced in the `function` argument.
2793 * @param g An argument to be passed to the function referenced in the `function` argument.
2794 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2795 * @since 1.9
2796 * @deprecatedDeprecated since 3.3. Use \`{@link Function#bind }\`.
2797 */
2798 proxy<TReturn,
2799 A, B, C, D, E, F, G>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => TReturn,
2800 context: null | undefined,
2801 a: A, b: B, c: C, d: D, e: E, f: F, g: G): () => TReturn;
2802 /**
2803 * Takes a function and returns a new one that will always have a particular context.
2804 * @param funсtion The function whose context will be changed.
2805 * @param context The object to which the context (`this`) of the function should be set.
2806 * @param a An argument to be passed to the function referenced in the `function` argument.
2807 * @param b An argument to be passed to the function referenced in the `function` argument.
2808 * @param c An argument to be passed to the function referenced in the `function` argument.
2809 * @param d An argument to be passed to the function referenced in the `function` argument.
2810 * @param e An argument to be passed to the function referenced in the `function` argument.
2811 * @param f An argument to be passed to the function referenced in the `function` argument.
2812 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2813 * @since 1.9
2814 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2815 */
2816 proxy<TReturn,
2817 A, B, C, D, E, F>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F) => TReturn,
2818 context: null | undefined,
2819 a: A, b: B, c: C, d: D, e: E, f: F): () => TReturn;
2820 /**
2821 * Takes a function and returns a new one that will always have a particular context.
2822 * @param funсtion The function whose context will be changed.
2823 * @param context The object to which the context (`this`) of the function should be set.
2824 * @param a An argument to be passed to the function referenced in the `function` argument.
2825 * @param b An argument to be passed to the function referenced in the `function` argument.
2826 * @param c An argument to be passed to the function referenced in the `function` argument.
2827 * @param d An argument to be passed to the function referenced in the `function` argument.
2828 * @param e An argument to be passed to the function referenced in the `function` argument.
2829 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2830 * @since 1.9
2831 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2832 */
2833 proxy<TReturn,
2834 A, B, C, D, E>(funсtion: (a: A, b: B, c: C, d: D, e: E) => TReturn,
2835 context: null | undefined,
2836 a: A, b: B, c: C, d: D, e: E): () => TReturn;
2837 /**
2838 * Takes a function and returns a new one that will always have a particular context.
2839 * @param funсtion The function whose context will be changed.
2840 * @param context The object to which the context (`this`) of the function should be set.
2841 * @param a An argument to be passed to the function referenced in the `function` argument.
2842 * @param b An argument to be passed to the function referenced in the `function` argument.
2843 * @param c An argument to be passed to the function referenced in the `function` argument.
2844 * @param d An argument to be passed to the function referenced in the `function` argument.
2845 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2846 * @since 1.9
2847 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2848 */
2849 proxy<TReturn,
2850 A, B, C, D>(funсtion: (a: A, b: B, c: C, d: D) => TReturn,
2851 context: null | undefined,
2852 a: A, b: B, c: C, d: D): () => TReturn;
2853 /**
2854 * Takes a function and returns a new one that will always have a particular context.
2855 * @param funсtion The function whose context will be changed.
2856 * @param context The object to which the context (`this`) of the function should be set.
2857 * @param a An argument to be passed to the function referenced in the `function` argument.
2858 * @param b An argument to be passed to the function referenced in the `function` argument.
2859 * @param c An argument to be passed to the function referenced in the `function` argument.
2860 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2861 * @since 1.9
2862 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2863 */
2864 proxy<TReturn,
2865 A, B, C>(funсtion: (a: A, b: B, c: C) => TReturn,
2866 context: null | undefined,
2867 a: A, b: B, c: C): () => TReturn;
2868 /**
2869 * Takes a function and returns a new one that will always have a particular context.
2870 * @param funсtion The function whose context will be changed.
2871 * @param context The object to which the context (`this`) of the function should be set.
2872 * @param a An argument to be passed to the function referenced in the `function` argument.
2873 * @param b An argument to be passed to the function referenced in the `function` argument.
2874 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2875 * @since 1.9
2876 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2877 */
2878 proxy<TReturn,
2879 A, B>(funсtion: (a: A, b: B) => TReturn,
2880 context: null | undefined,
2881 a: A, b: B): () => TReturn;
2882 /**
2883 * Takes a function and returns a new one that will always have a particular context.
2884 * @param funсtion The function whose context will be changed.
2885 * @param context The object to which the context (`this`) of the function should be set.
2886 * @param a An argument to be passed to the function referenced in the `function` argument.
2887 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2888 * @since 1.9
2889 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2890 */
2891 proxy<TReturn,
2892 A>(funсtion: (a: A) => TReturn,
2893 context: null | undefined,
2894 a: A): () => TReturn;
2895 /**
2896 * Takes a function and returns a new one that will always have a particular context.
2897 * @param funсtion The function whose context will be changed.
2898 * @param context The object to which the context (`this`) of the function should be set.
2899 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2900 * @since 1.9
2901 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2902 */
2903 proxy<TReturn>(funсtion: () => TReturn,
2904 context: null | undefined): () => TReturn;
2905
2906 // #endregion
2907
2908 // region 1 parameters
2909 // #region 1 parameters
2910
2911 /**
2912 * Takes a function and returns a new one that will always have a particular context.
2913 * @param funсtion The function whose context will be changed.
2914 * @param context The object to which the context (`this`) of the function should be set.
2915 * @param a An argument to be passed to the function referenced in the `function` argument.
2916 * @param b An argument to be passed to the function referenced in the `function` argument.
2917 * @param c An argument to be passed to the function referenced in the `function` argument.
2918 * @param d An argument to be passed to the function referenced in the `function` argument.
2919 * @param e An argument to be passed to the function referenced in the `function` argument.
2920 * @param f An argument to be passed to the function referenced in the `function` argument.
2921 * @param g An argument to be passed to the function referenced in the `function` argument.
2922 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2923 * @since 1.9
2924 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2925 */
2926 proxy<TReturn,
2927 A, B, C, D, E, F, G,
2928 T>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
2929 t: T) => TReturn,
2930 context: null | undefined,
2931 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T) => TReturn;
2932 /**
2933 * Takes a function and returns a new one that will always have a particular context.
2934 * @param funсtion The function whose context will be changed.
2935 * @param context The object to which the context (`this`) of the function should be set.
2936 * @param a An argument to be passed to the function referenced in the `function` argument.
2937 * @param b An argument to be passed to the function referenced in the `function` argument.
2938 * @param c An argument to be passed to the function referenced in the `function` argument.
2939 * @param d An argument to be passed to the function referenced in the `function` argument.
2940 * @param e An argument to be passed to the function referenced in the `function` argument.
2941 * @param f An argument to be passed to the function referenced in the `function` argument.
2942 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2943 * @since 1.9
2944 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2945 */
2946 proxy<TReturn,
2947 A, B, C, D, E, F,
2948 T>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
2949 t: T) => TReturn,
2950 context: null | undefined,
2951 a: A, b: B, c: C, d: D, e: E, f: F): (t: T) => TReturn;
2952 /**
2953 * Takes a function and returns a new one that will always have a particular context.
2954 * @param funсtion The function whose context will be changed.
2955 * @param context The object to which the context (`this`) of the function should be set.
2956 * @param a An argument to be passed to the function referenced in the `function` argument.
2957 * @param b An argument to be passed to the function referenced in the `function` argument.
2958 * @param c An argument to be passed to the function referenced in the `function` argument.
2959 * @param d An argument to be passed to the function referenced in the `function` argument.
2960 * @param e An argument to be passed to the function referenced in the `function` argument.
2961 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2962 * @since 1.9
2963 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2964 */
2965 proxy<TReturn,
2966 A, B, C, D, E,
2967 T>(funсtion: (a: A, b: B, c: C, d: D, e: E,
2968 t: T) => TReturn,
2969 context: null | undefined,
2970 a: A, b: B, c: C, d: D, e: E): (t: T) => TReturn;
2971 /**
2972 * Takes a function and returns a new one that will always have a particular context.
2973 * @param funсtion The function whose context will be changed.
2974 * @param context The object to which the context (`this`) of the function should be set.
2975 * @param a An argument to be passed to the function referenced in the `function` argument.
2976 * @param b An argument to be passed to the function referenced in the `function` argument.
2977 * @param c An argument to be passed to the function referenced in the `function` argument.
2978 * @param d An argument to be passed to the function referenced in the `function` argument.
2979 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2980 * @since 1.9
2981 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2982 */
2983 proxy<TReturn,
2984 A, B, C, D,
2985 T>(funсtion: (a: A, b: B, c: C, d: D,
2986 t: T) => TReturn,
2987 context: null | undefined,
2988 a: A, b: B, c: C, d: D): (t: T) => TReturn;
2989 /**
2990 * Takes a function and returns a new one that will always have a particular context.
2991 * @param funсtion The function whose context will be changed.
2992 * @param context The object to which the context (`this`) of the function should be set.
2993 * @param a An argument to be passed to the function referenced in the `function` argument.
2994 * @param b An argument to be passed to the function referenced in the `function` argument.
2995 * @param c An argument to be passed to the function referenced in the `function` argument.
2996 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
2997 * @since 1.9
2998 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
2999 */
3000 proxy<TReturn,
3001 A, B, C,
3002 T>(funсtion: (a: A, b: B, c: C,
3003 t: T) => TReturn,
3004 context: null | undefined,
3005 a: A, b: B, c: C): (t: T) => TReturn;
3006 /**
3007 * Takes a function and returns a new one that will always have a particular context.
3008 * @param funсtion The function whose context will be changed.
3009 * @param context The object to which the context (`this`) of the function should be set.
3010 * @param a An argument to be passed to the function referenced in the `function` argument.
3011 * @param b An argument to be passed to the function referenced in the `function` argument.
3012 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3013 * @since 1.9
3014 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3015 */
3016 proxy<TReturn,
3017 A, B,
3018 T>(funсtion: (a: A, b: B,
3019 t: T) => TReturn,
3020 context: null | undefined,
3021 a: A, b: B): (t: T) => TReturn;
3022 /**
3023 * Takes a function and returns a new one that will always have a particular context.
3024 * @param funсtion The function whose context will be changed.
3025 * @param context The object to which the context (`this`) of the function should be set.
3026 * @param a An argument to be passed to the function referenced in the `function` argument.
3027 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3028 * @since 1.9
3029 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3030 */
3031 proxy<TReturn,
3032 A,
3033 T>(funсtion: (a: A,
3034 t: T) => TReturn,
3035 context: null | undefined,
3036 a: A): (t: T) => TReturn;
3037 /**
3038 * Takes a function and returns a new one that will always have a particular context.
3039 * @param funсtion The function whose context will be changed.
3040 * @param context The object to which the context (`this`) of the function should be set.
3041 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3042 * @since 1.9
3043 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3044 */
3045 proxy<TReturn,
3046 T>(funсtion: (t: T) => TReturn,
3047 context: null | undefined): (t: T) => TReturn;
3048
3049 // #endregion
3050
3051 // region 2 parameters
3052 // #region 2 parameters
3053
3054 /**
3055 * Takes a function and returns a new one that will always have a particular context.
3056 * @param funсtion The function whose context will be changed.
3057 * @param context The object to which the context (`this`) of the function should be set.
3058 * @param a An argument to be passed to the function referenced in the `function` argument.
3059 * @param b An argument to be passed to the function referenced in the `function` argument.
3060 * @param c An argument to be passed to the function referenced in the `function` argument.
3061 * @param d An argument to be passed to the function referenced in the `function` argument.
3062 * @param e An argument to be passed to the function referenced in the `function` argument.
3063 * @param f An argument to be passed to the function referenced in the `function` argument.
3064 * @param g An argument to be passed to the function referenced in the `function` argument.
3065 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3066 * @since 1.9
3067 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3068 */
3069 proxy<TReturn,
3070 A, B, C, D, E, F, G,
3071 T, U>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3072 t: T, u: U) => TReturn,
3073 context: null | undefined,
3074 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U) => TReturn;
3075 /**
3076 * Takes a function and returns a new one that will always have a particular context.
3077 * @param funсtion The function whose context will be changed.
3078 * @param context The object to which the context (`this`) of the function should be set.
3079 * @param a An argument to be passed to the function referenced in the `function` argument.
3080 * @param b An argument to be passed to the function referenced in the `function` argument.
3081 * @param c An argument to be passed to the function referenced in the `function` argument.
3082 * @param d An argument to be passed to the function referenced in the `function` argument.
3083 * @param e An argument to be passed to the function referenced in the `function` argument.
3084 * @param f An argument to be passed to the function referenced in the `function` argument.
3085 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3086 * @since 1.9
3087 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3088 */
3089 proxy<TReturn,
3090 A, B, C, D, E, F,
3091 T, U>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3092 t: T, u: U) => TReturn,
3093 context: null | undefined,
3094 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U) => TReturn;
3095 /**
3096 * Takes a function and returns a new one that will always have a particular context.
3097 * @param funсtion The function whose context will be changed.
3098 * @param context The object to which the context (`this`) of the function should be set.
3099 * @param a An argument to be passed to the function referenced in the `function` argument.
3100 * @param b An argument to be passed to the function referenced in the `function` argument.
3101 * @param c An argument to be passed to the function referenced in the `function` argument.
3102 * @param d An argument to be passed to the function referenced in the `function` argument.
3103 * @param e An argument to be passed to the function referenced in the `function` argument.
3104 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3105 * @since 1.9
3106 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3107 */
3108 proxy<TReturn,
3109 A, B, C, D, E,
3110 T, U>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3111 t: T, u: U) => TReturn,
3112 context: null | undefined,
3113 a: A, b: B, c: C, d: D, e: E): (t: T, u: U) => TReturn;
3114 /**
3115 * Takes a function and returns a new one that will always have a particular context.
3116 * @param funсtion The function whose context will be changed.
3117 * @param context The object to which the context (`this`) of the function should be set.
3118 * @param a An argument to be passed to the function referenced in the `function` argument.
3119 * @param b An argument to be passed to the function referenced in the `function` argument.
3120 * @param c An argument to be passed to the function referenced in the `function` argument.
3121 * @param d An argument to be passed to the function referenced in the `function` argument.
3122 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3123 * @since 1.9
3124 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3125 */
3126 proxy<TReturn,
3127 A, B, C, D,
3128 T, U>(funсtion: (a: A, b: B, c: C, d: D,
3129 t: T, u: U) => TReturn,
3130 context: null | undefined,
3131 a: A, b: B, c: C, d: D): (t: T, u: U) => TReturn;
3132 /**
3133 * Takes a function and returns a new one that will always have a particular context.
3134 * @param funсtion The function whose context will be changed.
3135 * @param context The object to which the context (`this`) of the function should be set.
3136 * @param a An argument to be passed to the function referenced in the `function` argument.
3137 * @param b An argument to be passed to the function referenced in the `function` argument.
3138 * @param c An argument to be passed to the function referenced in the `function` argument.
3139 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3140 * @since 1.9
3141 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3142 */
3143 proxy<TReturn,
3144 A, B, C,
3145 T, U>(funсtion: (a: A, b: B, c: C,
3146 t: T, u: U) => TReturn,
3147 context: null | undefined,
3148 a: A, b: B, c: C): (t: T, u: U) => TReturn;
3149 /**
3150 * Takes a function and returns a new one that will always have a particular context.
3151 * @param funсtion The function whose context will be changed.
3152 * @param context The object to which the context (`this`) of the function should be set.
3153 * @param a An argument to be passed to the function referenced in the `function` argument.
3154 * @param b An argument to be passed to the function referenced in the `function` argument.
3155 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3156 * @since 1.9
3157 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3158 */
3159 proxy<TReturn,
3160 A, B,
3161 T, U>(funсtion: (a: A, b: B,
3162 t: T, u: U) => TReturn,
3163 context: null | undefined,
3164 a: A, b: B): (t: T, u: U) => TReturn;
3165 /**
3166 * Takes a function and returns a new one that will always have a particular context.
3167 * @param funсtion The function whose context will be changed.
3168 * @param context The object to which the context (`this`) of the function should be set.
3169 * @param a An argument to be passed to the function referenced in the `function` argument.
3170 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3171 * @since 1.9
3172 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3173 */
3174 proxy<TReturn,
3175 A,
3176 T, U>(funсtion: (a: A,
3177 t: T, u: U) => TReturn,
3178 context: null | undefined,
3179 a: A): (t: T, u: U) => TReturn;
3180 /**
3181 * Takes a function and returns a new one that will always have a particular context.
3182 * @param funсtion The function whose context will be changed.
3183 * @param context The object to which the context (`this`) of the function should be set.
3184 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3185 * @since 1.9
3186 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3187 */
3188 proxy<TReturn,
3189 T, U>(funсtion: (t: T, u: U) => TReturn,
3190 context: null | undefined): (t: T, u: U) => TReturn;
3191
3192 // #endregion
3193
3194 // region 3 parameters
3195 // #region 3 parameters
3196
3197 /**
3198 * Takes a function and returns a new one that will always have a particular context.
3199 * @param funсtion The function whose context will be changed.
3200 * @param context The object to which the context (`this`) of the function should be set.
3201 * @param a An argument to be passed to the function referenced in the `function` argument.
3202 * @param b An argument to be passed to the function referenced in the `function` argument.
3203 * @param c An argument to be passed to the function referenced in the `function` argument.
3204 * @param d An argument to be passed to the function referenced in the `function` argument.
3205 * @param e An argument to be passed to the function referenced in the `function` argument.
3206 * @param f An argument to be passed to the function referenced in the `function` argument.
3207 * @param g An argument to be passed to the function referenced in the `function` argument.
3208 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3209 * @since 1.9
3210 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3211 */
3212 proxy<TReturn,
3213 A, B, C, D, E, F, G,
3214 T, U, V>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3215 t: T, u: U, v: V) => TReturn,
3216 context: null | undefined,
3217 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V) => TReturn;
3218 /**
3219 * Takes a function and returns a new one that will always have a particular context.
3220 * @param funсtion The function whose context will be changed.
3221 * @param context The object to which the context (`this`) of the function should be set.
3222 * @param a An argument to be passed to the function referenced in the `function` argument.
3223 * @param b An argument to be passed to the function referenced in the `function` argument.
3224 * @param c An argument to be passed to the function referenced in the `function` argument.
3225 * @param d An argument to be passed to the function referenced in the `function` argument.
3226 * @param e An argument to be passed to the function referenced in the `function` argument.
3227 * @param f An argument to be passed to the function referenced in the `function` argument.
3228 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3229 * @since 1.9
3230 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3231 */
3232 proxy<TReturn,
3233 A, B, C, D, E, F,
3234 T, U, V>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3235 t: T, u: U, v: V) => TReturn,
3236 context: null | undefined,
3237 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V) => TReturn;
3238 /**
3239 * Takes a function and returns a new one that will always have a particular context.
3240 * @param funсtion The function whose context will be changed.
3241 * @param context The object to which the context (`this`) of the function should be set.
3242 * @param a An argument to be passed to the function referenced in the `function` argument.
3243 * @param b An argument to be passed to the function referenced in the `function` argument.
3244 * @param c An argument to be passed to the function referenced in the `function` argument.
3245 * @param d An argument to be passed to the function referenced in the `function` argument.
3246 * @param e An argument to be passed to the function referenced in the `function` argument.
3247 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3248 * @since 1.9
3249 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3250 */
3251 proxy<TReturn,
3252 A, B, C, D, E,
3253 T, U, V>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3254 t: T, u: U, v: V) => TReturn,
3255 context: null | undefined,
3256 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V) => TReturn;
3257 /**
3258 * Takes a function and returns a new one that will always have a particular context.
3259 * @param funсtion The function whose context will be changed.
3260 * @param context The object to which the context (`this`) of the function should be set.
3261 * @param a An argument to be passed to the function referenced in the `function` argument.
3262 * @param b An argument to be passed to the function referenced in the `function` argument.
3263 * @param c An argument to be passed to the function referenced in the `function` argument.
3264 * @param d An argument to be passed to the function referenced in the `function` argument.
3265 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3266 * @since 1.9
3267 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3268 */
3269 proxy<TReturn,
3270 A, B, C, D,
3271 T, U, V>(funсtion: (a: A, b: B, c: C, d: D,
3272 t: T, u: U, v: V) => TReturn,
3273 context: null | undefined,
3274 a: A, b: B, c: C, d: D): (t: T, u: U, v: V) => TReturn;
3275 /**
3276 * Takes a function and returns a new one that will always have a particular context.
3277 * @param funсtion The function whose context will be changed.
3278 * @param context The object to which the context (`this`) of the function should be set.
3279 * @param a An argument to be passed to the function referenced in the `function` argument.
3280 * @param b An argument to be passed to the function referenced in the `function` argument.
3281 * @param c An argument to be passed to the function referenced in the `function` argument.
3282 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3283 * @since 1.9
3284 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3285 */
3286 proxy<TReturn,
3287 A, B, C,
3288 T, U, V>(funсtion: (a: A, b: B, c: C,
3289 t: T, u: U, v: V) => TReturn,
3290 context: null | undefined,
3291 a: A, b: B, c: C): (t: T, u: U, v: V) => TReturn;
3292 /**
3293 * Takes a function and returns a new one that will always have a particular context.
3294 * @param funсtion The function whose context will be changed.
3295 * @param context The object to which the context (`this`) of the function should be set.
3296 * @param a An argument to be passed to the function referenced in the `function` argument.
3297 * @param b An argument to be passed to the function referenced in the `function` argument.
3298 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3299 * @since 1.9
3300 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3301 */
3302 proxy<TReturn,
3303 A, B,
3304 T, U, V>(funсtion: (a: A, b: B,
3305 t: T, u: U, v: V) => TReturn,
3306 context: null | undefined,
3307 a: A, b: B): (t: T, u: U, v: V) => TReturn;
3308 /**
3309 * Takes a function and returns a new one that will always have a particular context.
3310 * @param funсtion The function whose context will be changed.
3311 * @param context The object to which the context (`this`) of the function should be set.
3312 * @param a An argument to be passed to the function referenced in the `function` argument.
3313 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3314 * @since 1.9
3315 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3316 */
3317 proxy<TReturn,
3318 A,
3319 T, U, V>(funсtion: (a: A,
3320 t: T, u: U, v: V) => TReturn,
3321 context: null | undefined,
3322 a: A): (t: T, u: U, v: V) => TReturn;
3323 /**
3324 * Takes a function and returns a new one that will always have a particular context.
3325 * @param funсtion The function whose context will be changed.
3326 * @param context The object to which the context (`this`) of the function should be set.
3327 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3328 * @since 1.9
3329 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3330 */
3331 proxy<TReturn,
3332 T, U, V>(funсtion: (t: T, u: U, v: V) => TReturn,
3333 context: null | undefined): (t: T, u: U, v: V) => TReturn;
3334
3335 // #endregion
3336
3337 // region 4 parameters
3338 // #region 4 parameters
3339
3340 /**
3341 * Takes a function and returns a new one that will always have a particular context.
3342 * @param funсtion The function whose context will be changed.
3343 * @param context The object to which the context (`this`) of the function should be set.
3344 * @param a An argument to be passed to the function referenced in the `function` argument.
3345 * @param b An argument to be passed to the function referenced in the `function` argument.
3346 * @param c An argument to be passed to the function referenced in the `function` argument.
3347 * @param d An argument to be passed to the function referenced in the `function` argument.
3348 * @param e An argument to be passed to the function referenced in the `function` argument.
3349 * @param f An argument to be passed to the function referenced in the `function` argument.
3350 * @param g An argument to be passed to the function referenced in the `function` argument.
3351 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3352 * @since 1.9
3353 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3354 */
3355 proxy<TReturn,
3356 A, B, C, D, E, F, G,
3357 T, U, V, W>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3358 t: T, u: U, v: V, w: W) => TReturn,
3359 context: null | undefined,
3360 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W) => TReturn;
3361 /**
3362 * Takes a function and returns a new one that will always have a particular context.
3363 * @param funсtion The function whose context will be changed.
3364 * @param context The object to which the context (`this`) of the function should be set.
3365 * @param a An argument to be passed to the function referenced in the `function` argument.
3366 * @param b An argument to be passed to the function referenced in the `function` argument.
3367 * @param c An argument to be passed to the function referenced in the `function` argument.
3368 * @param d An argument to be passed to the function referenced in the `function` argument.
3369 * @param e An argument to be passed to the function referenced in the `function` argument.
3370 * @param f An argument to be passed to the function referenced in the `function` argument.
3371 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3372 * @since 1.9
3373 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3374 */
3375 proxy<TReturn,
3376 A, B, C, D, E, F,
3377 T, U, V, W>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3378 t: T, u: U, v: V, w: W) => TReturn,
3379 context: null | undefined,
3380 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W) => TReturn;
3381 /**
3382 * Takes a function and returns a new one that will always have a particular context.
3383 * @param funсtion The function whose context will be changed.
3384 * @param context The object to which the context (`this`) of the function should be set.
3385 * @param a An argument to be passed to the function referenced in the `function` argument.
3386 * @param b An argument to be passed to the function referenced in the `function` argument.
3387 * @param c An argument to be passed to the function referenced in the `function` argument.
3388 * @param d An argument to be passed to the function referenced in the `function` argument.
3389 * @param e An argument to be passed to the function referenced in the `function` argument.
3390 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3391 * @since 1.9
3392 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3393 */
3394 proxy<TReturn,
3395 A, B, C, D, E,
3396 T, U, V, W>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3397 t: T, u: U, v: V, w: W) => TReturn,
3398 context: null | undefined,
3399 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W) => TReturn;
3400 /**
3401 * Takes a function and returns a new one that will always have a particular context.
3402 * @param funсtion The function whose context will be changed.
3403 * @param context The object to which the context (`this`) of the function should be set.
3404 * @param a An argument to be passed to the function referenced in the `function` argument.
3405 * @param b An argument to be passed to the function referenced in the `function` argument.
3406 * @param c An argument to be passed to the function referenced in the `function` argument.
3407 * @param d An argument to be passed to the function referenced in the `function` argument.
3408 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3409 * @since 1.9
3410 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3411 */
3412 proxy<TReturn,
3413 A, B, C, D,
3414 T, U, V, W>(funсtion: (a: A, b: B, c: C, d: D,
3415 t: T, u: U, v: V, w: W) => TReturn,
3416 context: null | undefined,
3417 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W) => TReturn;
3418 /**
3419 * Takes a function and returns a new one that will always have a particular context.
3420 * @param funсtion The function whose context will be changed.
3421 * @param context The object to which the context (`this`) of the function should be set.
3422 * @param a An argument to be passed to the function referenced in the `function` argument.
3423 * @param b An argument to be passed to the function referenced in the `function` argument.
3424 * @param c An argument to be passed to the function referenced in the `function` argument.
3425 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3426 * @since 1.9
3427 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3428 */
3429 proxy<TReturn,
3430 A, B, C,
3431 T, U, V, W>(funсtion: (a: A, b: B, c: C,
3432 t: T, u: U, v: V, w: W) => TReturn,
3433 context: null | undefined,
3434 a: A, b: B, c: C): (t: T, u: U, v: V, w: W) => TReturn;
3435 /**
3436 * Takes a function and returns a new one that will always have a particular context.
3437 * @param funсtion The function whose context will be changed.
3438 * @param context The object to which the context (`this`) of the function should be set.
3439 * @param a An argument to be passed to the function referenced in the `function` argument.
3440 * @param b An argument to be passed to the function referenced in the `function` argument.
3441 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3442 * @since 1.9
3443 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3444 */
3445 proxy<TReturn,
3446 A, B,
3447 T, U, V, W>(funсtion: (a: A, b: B,
3448 t: T, u: U, v: V, w: W) => TReturn,
3449 context: null | undefined,
3450 a: A, b: B): (t: T, u: U, v: V, w: W) => TReturn;
3451 /**
3452 * Takes a function and returns a new one that will always have a particular context.
3453 * @param funсtion The function whose context will be changed.
3454 * @param context The object to which the context (`this`) of the function should be set.
3455 * @param a An argument to be passed to the function referenced in the `function` argument.
3456 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3457 * @since 1.9
3458 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3459 */
3460 proxy<TReturn,
3461 A,
3462 T, U, V, W>(funсtion: (a: A,
3463 t: T, u: U, v: V, w: W) => TReturn,
3464 context: null | undefined,
3465 a: A): (t: T, u: U, v: V, w: W) => TReturn;
3466 /**
3467 * Takes a function and returns a new one that will always have a particular context.
3468 * @param funсtion The function whose context will be changed.
3469 * @param context The object to which the context (`this`) of the function should be set.
3470 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3471 * @since 1.9
3472 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3473 */
3474 proxy<TReturn,
3475 T, U, V, W>(funсtion: (t: T, u: U, v: V, w: W) => TReturn,
3476 context: null | undefined): (t: T, u: U, v: V, w: W) => TReturn;
3477
3478 // #endregion
3479
3480 // region 5 parameters
3481 // #region 5 parameters
3482
3483 /**
3484 * Takes a function and returns a new one that will always have a particular context.
3485 * @param funсtion The function whose context will be changed.
3486 * @param context The object to which the context (`this`) of the function should be set.
3487 * @param a An argument to be passed to the function referenced in the `function` argument.
3488 * @param b An argument to be passed to the function referenced in the `function` argument.
3489 * @param c An argument to be passed to the function referenced in the `function` argument.
3490 * @param d An argument to be passed to the function referenced in the `function` argument.
3491 * @param e An argument to be passed to the function referenced in the `function` argument.
3492 * @param f An argument to be passed to the function referenced in the `function` argument.
3493 * @param g An argument to be passed to the function referenced in the `function` argument.
3494 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3495 * @since 1.9
3496 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3497 */
3498 proxy<TReturn,
3499 A, B, C, D, E, F, G,
3500 T, U, V, W, X>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3501 t: T, u: U, v: V, w: W, x: X) => TReturn,
3502 context: null | undefined,
3503 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;
3504 /**
3505 * Takes a function and returns a new one that will always have a particular context.
3506 * @param funсtion The function whose context will be changed.
3507 * @param context The object to which the context (`this`) of the function should be set.
3508 * @param a An argument to be passed to the function referenced in the `function` argument.
3509 * @param b An argument to be passed to the function referenced in the `function` argument.
3510 * @param c An argument to be passed to the function referenced in the `function` argument.
3511 * @param d An argument to be passed to the function referenced in the `function` argument.
3512 * @param e An argument to be passed to the function referenced in the `function` argument.
3513 * @param f An argument to be passed to the function referenced in the `function` argument.
3514 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3515 * @since 1.9
3516 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3517 */
3518 proxy<TReturn,
3519 A, B, C, D, E, F,
3520 T, U, V, W, X>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3521 t: T, u: U, v: V, w: W, x: X) => TReturn,
3522 context: null | undefined,
3523 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3524 /**
3525 * Takes a function and returns a new one that will always have a particular context.
3526 * @param funсtion The function whose context will be changed.
3527 * @param context The object to which the context (`this`) of the function should be set.
3528 * @param a An argument to be passed to the function referenced in the `function` argument.
3529 * @param b An argument to be passed to the function referenced in the `function` argument.
3530 * @param c An argument to be passed to the function referenced in the `function` argument.
3531 * @param d An argument to be passed to the function referenced in the `function` argument.
3532 * @param e An argument to be passed to the function referenced in the `function` argument.
3533 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3534 * @since 1.9
3535 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3536 */
3537 proxy<TReturn,
3538 A, B, C, D, E,
3539 T, U, V, W, X>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3540 t: T, u: U, v: V, w: W, x: X) => TReturn,
3541 context: null | undefined,
3542 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3543 /**
3544 * Takes a function and returns a new one that will always have a particular context.
3545 * @param funсtion The function whose context will be changed.
3546 * @param context The object to which the context (`this`) of the function should be set.
3547 * @param a An argument to be passed to the function referenced in the `function` argument.
3548 * @param b An argument to be passed to the function referenced in the `function` argument.
3549 * @param c An argument to be passed to the function referenced in the `function` argument.
3550 * @param d An argument to be passed to the function referenced in the `function` argument.
3551 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3552 * @since 1.9
3553 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3554 */
3555 proxy<TReturn,
3556 A, B, C, D,
3557 T, U, V, W, X>(funсtion: (a: A, b: B, c: C, d: D,
3558 t: T, u: U, v: V, w: W, x: X) => TReturn,
3559 context: null | undefined,
3560 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3561 /**
3562 * Takes a function and returns a new one that will always have a particular context.
3563 * @param funсtion The function whose context will be changed.
3564 * @param context The object to which the context (`this`) of the function should be set.
3565 * @param a An argument to be passed to the function referenced in the `function` argument.
3566 * @param b An argument to be passed to the function referenced in the `function` argument.
3567 * @param c An argument to be passed to the function referenced in the `function` argument.
3568 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3569 * @since 1.9
3570 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3571 */
3572 proxy<TReturn,
3573 A, B, C,
3574 T, U, V, W, X>(funсtion: (a: A, b: B, c: C,
3575 t: T, u: U, v: V, w: W, x: X) => TReturn,
3576 context: null | undefined,
3577 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3578 /**
3579 * Takes a function and returns a new one that will always have a particular context.
3580 * @param funсtion The function whose context will be changed.
3581 * @param context The object to which the context (`this`) of the function should be set.
3582 * @param a An argument to be passed to the function referenced in the `function` argument.
3583 * @param b An argument to be passed to the function referenced in the `function` argument.
3584 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3585 * @since 1.9
3586 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3587 */
3588 proxy<TReturn,
3589 A, B,
3590 T, U, V, W, X>(funсtion: (a: A, b: B,
3591 t: T, u: U, v: V, w: W, x: X) => TReturn,
3592 context: null | undefined,
3593 a: A, b: B): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3594 /**
3595 * Takes a function and returns a new one that will always have a particular context.
3596 * @param funсtion The function whose context will be changed.
3597 * @param context The object to which the context (`this`) of the function should be set.
3598 * @param a An argument to be passed to the function referenced in the `function` argument.
3599 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3600 * @since 1.9
3601 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3602 */
3603 proxy<TReturn,
3604 A,
3605 T, U, V, W, X>(funсtion: (a: A,
3606 t: T, u: U, v: V, w: W, x: X) => TReturn,
3607 context: null | undefined,
3608 a: A): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3609 /**
3610 * Takes a function and returns a new one that will always have a particular context.
3611 * @param funсtion The function whose context will be changed.
3612 * @param context The object to which the context (`this`) of the function should be set.
3613 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3614 * @since 1.9
3615 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3616 */
3617 proxy<TReturn,
3618 T, U, V, W, X>(funсtion: (t: T, u: U, v: V, w: W, x: X) => TReturn,
3619 context: null | undefined): (t: T, u: U, v: V, w: W, x: X) => TReturn;
3620
3621 // #endregion
3622
3623 // region 6 parameters
3624 // #region 6 parameters
3625
3626 /**
3627 * Takes a function and returns a new one that will always have a particular context.
3628 * @param funсtion The function whose context will be changed.
3629 * @param context The object to which the context (`this`) of the function should be set.
3630 * @param a An argument to be passed to the function referenced in the `function` argument.
3631 * @param b An argument to be passed to the function referenced in the `function` argument.
3632 * @param c An argument to be passed to the function referenced in the `function` argument.
3633 * @param d An argument to be passed to the function referenced in the `function` argument.
3634 * @param e An argument to be passed to the function referenced in the `function` argument.
3635 * @param f An argument to be passed to the function referenced in the `function` argument.
3636 * @param g An argument to be passed to the function referenced in the `function` argument.
3637 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3638 * @since 1.9
3639 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3640 */
3641 proxy<TReturn,
3642 A, B, C, D, E, F, G,
3643 T, U, V, W, X, Y>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3644 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3645 context: null | undefined,
3646 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;
3647 /**
3648 * Takes a function and returns a new one that will always have a particular context.
3649 * @param funсtion The function whose context will be changed.
3650 * @param context The object to which the context (`this`) of the function should be set.
3651 * @param a An argument to be passed to the function referenced in the `function` argument.
3652 * @param b An argument to be passed to the function referenced in the `function` argument.
3653 * @param c An argument to be passed to the function referenced in the `function` argument.
3654 * @param d An argument to be passed to the function referenced in the `function` argument.
3655 * @param e An argument to be passed to the function referenced in the `function` argument.
3656 * @param f An argument to be passed to the function referenced in the `function` argument.
3657 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3658 * @since 1.9
3659 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3660 */
3661 proxy<TReturn,
3662 A, B, C, D, E, F,
3663 T, U, V, W, X, Y>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3664 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3665 context: null | undefined,
3666 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;
3667 /**
3668 * Takes a function and returns a new one that will always have a particular context.
3669 * @param funсtion The function whose context will be changed.
3670 * @param context The object to which the context (`this`) of the function should be set.
3671 * @param a An argument to be passed to the function referenced in the `function` argument.
3672 * @param b An argument to be passed to the function referenced in the `function` argument.
3673 * @param c An argument to be passed to the function referenced in the `function` argument.
3674 * @param d An argument to be passed to the function referenced in the `function` argument.
3675 * @param e An argument to be passed to the function referenced in the `function` argument.
3676 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3677 * @since 1.9
3678 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3679 */
3680 proxy<TReturn,
3681 A, B, C, D, E,
3682 T, U, V, W, X, Y>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3683 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3684 context: null | undefined,
3685 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3686 /**
3687 * Takes a function and returns a new one that will always have a particular context.
3688 * @param funсtion The function whose context will be changed.
3689 * @param context The object to which the context (`this`) of the function should be set.
3690 * @param a An argument to be passed to the function referenced in the `function` argument.
3691 * @param b An argument to be passed to the function referenced in the `function` argument.
3692 * @param c An argument to be passed to the function referenced in the `function` argument.
3693 * @param d An argument to be passed to the function referenced in the `function` argument.
3694 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3695 * @since 1.9
3696 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3697 */
3698 proxy<TReturn,
3699 A, B, C, D,
3700 T, U, V, W, X, Y>(funсtion: (a: A, b: B, c: C, d: D,
3701 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3702 context: null | undefined,
3703 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3704 /**
3705 * Takes a function and returns a new one that will always have a particular context.
3706 * @param funсtion The function whose context will be changed.
3707 * @param context The object to which the context (`this`) of the function should be set.
3708 * @param a An argument to be passed to the function referenced in the `function` argument.
3709 * @param b An argument to be passed to the function referenced in the `function` argument.
3710 * @param c An argument to be passed to the function referenced in the `function` argument.
3711 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3712 * @since 1.9
3713 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3714 */
3715 proxy<TReturn,
3716 A, B, C,
3717 T, U, V, W, X, Y>(funсtion: (a: A, b: B, c: C,
3718 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3719 context: null | undefined,
3720 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3721 /**
3722 * Takes a function and returns a new one that will always have a particular context.
3723 * @param funсtion The function whose context will be changed.
3724 * @param context The object to which the context (`this`) of the function should be set.
3725 * @param a An argument to be passed to the function referenced in the `function` argument.
3726 * @param b An argument to be passed to the function referenced in the `function` argument.
3727 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3728 * @since 1.9
3729 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3730 */
3731 proxy<TReturn,
3732 A, B,
3733 T, U, V, W, X, Y>(funсtion: (a: A, b: B,
3734 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3735 context: null | undefined,
3736 a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3737 /**
3738 * Takes a function and returns a new one that will always have a particular context.
3739 * @param funсtion The function whose context will be changed.
3740 * @param context The object to which the context (`this`) of the function should be set.
3741 * @param a An argument to be passed to the function referenced in the `function` argument.
3742 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3743 * @since 1.9
3744 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3745 */
3746 proxy<TReturn,
3747 A,
3748 T, U, V, W, X, Y>(funсtion: (a: A,
3749 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3750 context: null | undefined,
3751 a: A): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3752 /**
3753 * Takes a function and returns a new one that will always have a particular context.
3754 * @param funсtion The function whose context will be changed.
3755 * @param context The object to which the context (`this`) of the function should be set.
3756 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3757 * @since 1.9
3758 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3759 */
3760 proxy<TReturn,
3761 T, U, V, W, X, Y>(funсtion: (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
3762 context: null | undefined): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
3763
3764 // #endregion
3765
3766 // region 7+ parameters
3767 // #region 7+ parameters
3768
3769 /**
3770 * Takes a function and returns a new one that will always have a particular context.
3771 * @param funсtion The function whose context will be changed.
3772 * @param context The object to which the context (`this`) of the function should be set.
3773 * @param a An argument to be passed to the function referenced in the `function` argument.
3774 * @param b An argument to be passed to the function referenced in the `function` argument.
3775 * @param c An argument to be passed to the function referenced in the `function` argument.
3776 * @param d An argument to be passed to the function referenced in the `function` argument.
3777 * @param e An argument to be passed to the function referenced in the `function` argument.
3778 * @param f An argument to be passed to the function referenced in the `function` argument.
3779 * @param g An argument to be passed to the function referenced in the `function` argument.
3780 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3781 * @since 1.9
3782 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3783 */
3784 proxy<TReturn,
3785 A, B, C, D, E, F, G,
3786 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
3787 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3788 context: null | undefined,
3789 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;
3790 /**
3791 * Takes a function and returns a new one that will always have a particular context.
3792 * @param funсtion The function whose context will be changed.
3793 * @param context The object to which the context (`this`) of the function should be set.
3794 * @param a An argument to be passed to the function referenced in the `function` argument.
3795 * @param b An argument to be passed to the function referenced in the `function` argument.
3796 * @param c An argument to be passed to the function referenced in the `function` argument.
3797 * @param d An argument to be passed to the function referenced in the `function` argument.
3798 * @param e An argument to be passed to the function referenced in the `function` argument.
3799 * @param f An argument to be passed to the function referenced in the `function` argument.
3800 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3801 * @since 1.9
3802 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3803 */
3804 proxy<TReturn,
3805 A, B, C, D, E, F,
3806 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B, c: C, d: D, e: E, f: F,
3807 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3808 context: null | undefined,
3809 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;
3810 /**
3811 * Takes a function and returns a new one that will always have a particular context.
3812 * @param funсtion The function whose context will be changed.
3813 * @param context The object to which the context (`this`) of the function should be set.
3814 * @param a An argument to be passed to the function referenced in the `function` argument.
3815 * @param b An argument to be passed to the function referenced in the `function` argument.
3816 * @param c An argument to be passed to the function referenced in the `function` argument.
3817 * @param d An argument to be passed to the function referenced in the `function` argument.
3818 * @param e An argument to be passed to the function referenced in the `function` argument.
3819 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3820 * @since 1.9
3821 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3822 */
3823 proxy<TReturn,
3824 A, B, C, D, E,
3825 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B, c: C, d: D, e: E,
3826 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3827 context: null | undefined,
3828 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;
3829 /**
3830 * Takes a function and returns a new one that will always have a particular context.
3831 * @param funсtion The function whose context will be changed.
3832 * @param context The object to which the context (`this`) of the function should be set.
3833 * @param a An argument to be passed to the function referenced in the `function` argument.
3834 * @param b An argument to be passed to the function referenced in the `function` argument.
3835 * @param c An argument to be passed to the function referenced in the `function` argument.
3836 * @param d An argument to be passed to the function referenced in the `function` argument.
3837 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3838 * @since 1.9
3839 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3840 */
3841 proxy<TReturn,
3842 A, B, C, D,
3843 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B, c: C, d: D,
3844 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3845 context: null | undefined,
3846 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;
3847 /**
3848 * Takes a function and returns a new one that will always have a particular context.
3849 * @param funсtion The function whose context will be changed.
3850 * @param context The object to which the context (`this`) of the function should be set.
3851 * @param a An argument to be passed to the function referenced in the `function` argument.
3852 * @param b An argument to be passed to the function referenced in the `function` argument.
3853 * @param c An argument to be passed to the function referenced in the `function` argument.
3854 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3855 * @since 1.9
3856 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3857 */
3858 proxy<TReturn,
3859 A, B, C,
3860 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B, c: C,
3861 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3862 context: null | undefined,
3863 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
3864 /**
3865 * Takes a function and returns a new one that will always have a particular context.
3866 * @param funсtion The function whose context will be changed.
3867 * @param context The object to which the context (`this`) of the function should be set.
3868 * @param a An argument to be passed to the function referenced in the `function` argument.
3869 * @param b An argument to be passed to the function referenced in the `function` argument.
3870 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3871 * @since 1.9
3872 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3873 */
3874 proxy<TReturn,
3875 A, B,
3876 T, U, V, W, X, Y, Z>(funсtion: (a: A, b: B,
3877 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3878 context: null | undefined,
3879 a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
3880 /**
3881 * Takes a function and returns a new one that will always have a particular context.
3882 * @param funсtion The function whose context will be changed.
3883 * @param context The object to which the context (`this`) of the function should be set.
3884 * @param a An argument to be passed to the function referenced in the `function` argument.
3885 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3886 * @since 1.9
3887 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3888 */
3889 proxy<TReturn,
3890 A,
3891 T, U, V, W, X, Y, Z>(funсtion: (a: A,
3892 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
3893 context: null | undefined,
3894 a: A): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
3895 /**
3896 * Takes a function and returns a new one that will always have a particular context.
3897 * @param funсtion The function whose context will be changed.
3898 * @param context The object to which the context (`this`) of the function should be set.
3899 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3900 * @since 1.9
3901 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3902 */
3903 proxy<TReturn,
3904 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,
3905 context: null | undefined): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
3906
3907 // #endregion
3908
3909 // #endregion
3910
3911 // region 8+ additional arguments
3912 // #region 8+ additional arguments
3913
3914 /**
3915 * Takes a function and returns a new one that will always have a particular context.
3916 * @param funсtion The function whose context will be changed.
3917 * @param context The object to which the context (`this`) of the function should be set.
3918 * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument.
3919 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3920 * @since 1.9
3921 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3922 */
3923 proxy<TReturn>(funсtion: (...args: any[]) => TReturn,
3924 context: null | undefined,
3925 ...additionalArguments: any[]): (...args: any[]) => TReturn;
3926
3927 // #endregion
3928
3929 // #endregion
3930
3931 // region (funсtion, context)
3932 // #region (funсtion, context)
3933
3934 // region 0 to 7 additional arguments
3935 // #region 0 to 7 additional arguments
3936
3937 // region 0 parameters
3938 // #region 0 parameters
3939
3940 /**
3941 * Takes a function and returns a new one that will always have a particular context.
3942 * @param funсtion The function whose context will be changed.
3943 * @param context The object to which the context (`this`) of the function should be set.
3944 * @param a An argument to be passed to the function referenced in the `function` argument.
3945 * @param b An argument to be passed to the function referenced in the `function` argument.
3946 * @param c An argument to be passed to the function referenced in the `function` argument.
3947 * @param d An argument to be passed to the function referenced in the `function` argument.
3948 * @param e An argument to be passed to the function referenced in the `function` argument.
3949 * @param f An argument to be passed to the function referenced in the `function` argument.
3950 * @param g An argument to be passed to the function referenced in the `function` argument.
3951 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
3952 * @since 1.4
3953 * @since 1.6
3954 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
3955 * @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.
3956```html
3957<!doctype html>
3958<html lang="en">
3959<head>
3960 <meta charset="utf-8">
3961 <title>jQuery.proxy demo</title>
3962 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
3963</head>
3964<body>
3965
3966<p><button type="button" id="test">Test</button></p>
3967<div id="log"></div>
3968
3969<script>
3970var me = {
3971 type: "zombie",
3972 test: function( event ) {
3973 // Without proxy, `this` would refer to the event target
3974 // use event.target to reference that element.
3975 var element = event.target;
3976 $( element ).css( "background-color", "red" );
3977
3978 // With proxy, `this` refers to the me object encapsulating
3979 // this function.
3980 $( "#log" ).append( "Hello " + this.type + "<br>" );
3981 $( "#test" ).off( "click", this.test );
3982 }
3983};
3984
3985var you = {
3986 type: "person",
3987 test: function( event ) {
3988 $( "#log" ).append( this.type + " " );
3989 }
3990};
3991
3992// Execute you.test() in the context of the `you` object
3993// no matter where it is called
3994// i.e. the `this` keyword will refer to `you`
3995var youClick = $.proxy( you.test, you );
3996
3997// attach click handlers to #test
3998$( "#test" )
3999 // this === "zombie"; handler unbound after first click
4000 .on( "click", $.proxy( me.test, me ) )
4001
4002 // this === "person"
4003 .on( "click", youClick )
4004
4005 // this === "zombie"
4006 .on( "click", $.proxy( you.test, me ) )
4007
4008 // this === "<button> element"
4009 .on( "click", you.test );
4010</script>
4011
4012</body>
4013</html>
4014```
4015 * @example ​ ````Change the context of a function bound to the click handler,
4016```html
4017<!doctype html>
4018<html lang="en">
4019<head>
4020 <meta charset="utf-8">
4021 <title>jQuery.proxy demo</title>
4022 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4023</head>
4024<body>
4025
4026<p><button type="button" id="test">Test</button></p>
4027<div id="log"></div>
4028
4029<script>
4030var me = {
4031 // I'm a dog
4032 type: "dog",
4033
4034 // Note that event comes *after* one and two
4035 test: function( one, two, event ) {
4036 $( "#log" )
4037
4038 // `one` maps to `you`, the 1st additional
4039 // argument in the $.proxy function call
4040 .append( "<h3>Hello " + one.type + ":</h3>" )
4041
4042 // The `this` keyword refers to `me`
4043 // (the 2nd, context, argument of $.proxy)
4044 .append( "I am a " + this.type + ", " )
4045
4046 // `two` maps to `they`, the 2nd additional
4047 // argument in the $.proxy function call
4048 .append( "and they are " + two.type + ".<br>" )
4049
4050 // The event type is "click"
4051 .append( "Thanks for " + event.type + "ing." )
4052
4053 // The clicked element is `event.target`,
4054 // and its type is "button"
4055 .append( "the " + event.target.type + "." );
4056 }
4057};
4058
4059var you = { type: "cat" };
4060var they = { type: "fish" };
4061
4062// Set up handler to execute me.test() in the context
4063// of `me`, with `you` and `they` as additional arguments
4064var proxy = $.proxy( me.test, me, you, they );
4065
4066$( "#test" )
4067 .on( "click", proxy );
4068</script>
4069
4070</body>
4071</html>
4072```
4073 */
4074 proxy<TContext,
4075 TReturn,
4076 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,
4077 context: TContext,
4078 a: A, b: B, c: C, d: D, e: E, f: F, g: G): () => TReturn;
4079 /**
4080 * Takes a function and returns a new one that will always have a particular context.
4081 * @param funсtion The function whose context will be changed.
4082 * @param context The object to which the context (`this`) of the function should be set.
4083 * @param a An argument to be passed to the function referenced in the `function` argument.
4084 * @param b An argument to be passed to the function referenced in the `function` argument.
4085 * @param c An argument to be passed to the function referenced in the `function` argument.
4086 * @param d An argument to be passed to the function referenced in the `function` argument.
4087 * @param e An argument to be passed to the function referenced in the `function` argument.
4088 * @param f An argument to be passed to the function referenced in the `function` argument.
4089 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4090 * @since 1.4
4091 * @since 1.6
4092 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4093 * @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.
4094```html
4095<!doctype html>
4096<html lang="en">
4097<head>
4098 <meta charset="utf-8">
4099 <title>jQuery.proxy demo</title>
4100 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4101</head>
4102<body>
4103
4104<p><button type="button" id="test">Test</button></p>
4105<div id="log"></div>
4106
4107<script>
4108var me = {
4109 type: "zombie",
4110 test: function( event ) {
4111 // Without proxy, `this` would refer to the event target
4112 // use event.target to reference that element.
4113 var element = event.target;
4114 $( element ).css( "background-color", "red" );
4115
4116 // With proxy, `this` refers to the me object encapsulating
4117 // this function.
4118 $( "#log" ).append( "Hello " + this.type + "<br>" );
4119 $( "#test" ).off( "click", this.test );
4120 }
4121};
4122
4123var you = {
4124 type: "person",
4125 test: function( event ) {
4126 $( "#log" ).append( this.type + " " );
4127 }
4128};
4129
4130// Execute you.test() in the context of the `you` object
4131// no matter where it is called
4132// i.e. the `this` keyword will refer to `you`
4133var youClick = $.proxy( you.test, you );
4134
4135// attach click handlers to #test
4136$( "#test" )
4137 // this === "zombie"; handler unbound after first click
4138 .on( "click", $.proxy( me.test, me ) )
4139
4140 // this === "person"
4141 .on( "click", youClick )
4142
4143 // this === "zombie"
4144 .on( "click", $.proxy( you.test, me ) )
4145
4146 // this === "<button> element"
4147 .on( "click", you.test );
4148</script>
4149
4150</body>
4151</html>
4152```
4153 * @example ​ ````Change the context of a function bound to the click handler,
4154```html
4155<!doctype html>
4156<html lang="en">
4157<head>
4158 <meta charset="utf-8">
4159 <title>jQuery.proxy demo</title>
4160 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4161</head>
4162<body>
4163
4164<p><button type="button" id="test">Test</button></p>
4165<div id="log"></div>
4166
4167<script>
4168var me = {
4169 // I'm a dog
4170 type: "dog",
4171
4172 // Note that event comes *after* one and two
4173 test: function( one, two, event ) {
4174 $( "#log" )
4175
4176 // `one` maps to `you`, the 1st additional
4177 // argument in the $.proxy function call
4178 .append( "<h3>Hello " + one.type + ":</h3>" )
4179
4180 // The `this` keyword refers to `me`
4181 // (the 2nd, context, argument of $.proxy)
4182 .append( "I am a " + this.type + ", " )
4183
4184 // `two` maps to `they`, the 2nd additional
4185 // argument in the $.proxy function call
4186 .append( "and they are " + two.type + ".<br>" )
4187
4188 // The event type is "click"
4189 .append( "Thanks for " + event.type + "ing." )
4190
4191 // The clicked element is `event.target`,
4192 // and its type is "button"
4193 .append( "the " + event.target.type + "." );
4194 }
4195};
4196
4197var you = { type: "cat" };
4198var they = { type: "fish" };
4199
4200// Set up handler to execute me.test() in the context
4201// of `me`, with `you` and `they` as additional arguments
4202var proxy = $.proxy( me.test, me, you, they );
4203
4204$( "#test" )
4205 .on( "click", proxy );
4206</script>
4207
4208</body>
4209</html>
4210```
4211 */
4212 proxy<TContext,
4213 TReturn,
4214 A, B, C, D, E, F>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F) => TReturn,
4215 context: TContext,
4216 a: A, b: B, c: C, d: D, e: E, f: F): () => TReturn;
4217 /**
4218 * Takes a function and returns a new one that will always have a particular context.
4219 * @param funсtion The function whose context will be changed.
4220 * @param context The object to which the context (`this`) of the function should be set.
4221 * @param a An argument to be passed to the function referenced in the `function` argument.
4222 * @param b An argument to be passed to the function referenced in the `function` argument.
4223 * @param c An argument to be passed to the function referenced in the `function` argument.
4224 * @param d An argument to be passed to the function referenced in the `function` argument.
4225 * @param e An argument to be passed to the function referenced in the `function` argument.
4226 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4227 * @since 1.4
4228 * @since 1.6
4229 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4230 * @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.
4231```html
4232<!doctype html>
4233<html lang="en">
4234<head>
4235 <meta charset="utf-8">
4236 <title>jQuery.proxy demo</title>
4237 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4238</head>
4239<body>
4240
4241<p><button type="button" id="test">Test</button></p>
4242<div id="log"></div>
4243
4244<script>
4245var me = {
4246 type: "zombie",
4247 test: function( event ) {
4248 // Without proxy, `this` would refer to the event target
4249 // use event.target to reference that element.
4250 var element = event.target;
4251 $( element ).css( "background-color", "red" );
4252
4253 // With proxy, `this` refers to the me object encapsulating
4254 // this function.
4255 $( "#log" ).append( "Hello " + this.type + "<br>" );
4256 $( "#test" ).off( "click", this.test );
4257 }
4258};
4259
4260var you = {
4261 type: "person",
4262 test: function( event ) {
4263 $( "#log" ).append( this.type + " " );
4264 }
4265};
4266
4267// Execute you.test() in the context of the `you` object
4268// no matter where it is called
4269// i.e. the `this` keyword will refer to `you`
4270var youClick = $.proxy( you.test, you );
4271
4272// attach click handlers to #test
4273$( "#test" )
4274 // this === "zombie"; handler unbound after first click
4275 .on( "click", $.proxy( me.test, me ) )
4276
4277 // this === "person"
4278 .on( "click", youClick )
4279
4280 // this === "zombie"
4281 .on( "click", $.proxy( you.test, me ) )
4282
4283 // this === "<button> element"
4284 .on( "click", you.test );
4285</script>
4286
4287</body>
4288</html>
4289```
4290 * @example ​ ````Change the context of a function bound to the click handler,
4291```html
4292<!doctype html>
4293<html lang="en">
4294<head>
4295 <meta charset="utf-8">
4296 <title>jQuery.proxy demo</title>
4297 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4298</head>
4299<body>
4300
4301<p><button type="button" id="test">Test</button></p>
4302<div id="log"></div>
4303
4304<script>
4305var me = {
4306 // I'm a dog
4307 type: "dog",
4308
4309 // Note that event comes *after* one and two
4310 test: function( one, two, event ) {
4311 $( "#log" )
4312
4313 // `one` maps to `you`, the 1st additional
4314 // argument in the $.proxy function call
4315 .append( "<h3>Hello " + one.type + ":</h3>" )
4316
4317 // The `this` keyword refers to `me`
4318 // (the 2nd, context, argument of $.proxy)
4319 .append( "I am a " + this.type + ", " )
4320
4321 // `two` maps to `they`, the 2nd additional
4322 // argument in the $.proxy function call
4323 .append( "and they are " + two.type + ".<br>" )
4324
4325 // The event type is "click"
4326 .append( "Thanks for " + event.type + "ing." )
4327
4328 // The clicked element is `event.target`,
4329 // and its type is "button"
4330 .append( "the " + event.target.type + "." );
4331 }
4332};
4333
4334var you = { type: "cat" };
4335var they = { type: "fish" };
4336
4337// Set up handler to execute me.test() in the context
4338// of `me`, with `you` and `they` as additional arguments
4339var proxy = $.proxy( me.test, me, you, they );
4340
4341$( "#test" )
4342 .on( "click", proxy );
4343</script>
4344
4345</body>
4346</html>
4347```
4348 */
4349 proxy<TContext,
4350 TReturn,
4351 A, B, C, D, E>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E) => TReturn,
4352 context: TContext,
4353 a: A, b: B, c: C, d: D, e: E): () => TReturn;
4354 /**
4355 * Takes a function and returns a new one that will always have a particular context.
4356 * @param funсtion The function whose context will be changed.
4357 * @param context The object to which the context (`this`) of the function should be set.
4358 * @param a An argument to be passed to the function referenced in the `function` argument.
4359 * @param b An argument to be passed to the function referenced in the `function` argument.
4360 * @param c An argument to be passed to the function referenced in the `function` argument.
4361 * @param d An argument to be passed to the function referenced in the `function` argument.
4362 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4363 * @since 1.4
4364 * @since 1.6
4365 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4366 * @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.
4367```html
4368<!doctype html>
4369<html lang="en">
4370<head>
4371 <meta charset="utf-8">
4372 <title>jQuery.proxy demo</title>
4373 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4374</head>
4375<body>
4376
4377<p><button type="button" id="test">Test</button></p>
4378<div id="log"></div>
4379
4380<script>
4381var me = {
4382 type: "zombie",
4383 test: function( event ) {
4384 // Without proxy, `this` would refer to the event target
4385 // use event.target to reference that element.
4386 var element = event.target;
4387 $( element ).css( "background-color", "red" );
4388
4389 // With proxy, `this` refers to the me object encapsulating
4390 // this function.
4391 $( "#log" ).append( "Hello " + this.type + "<br>" );
4392 $( "#test" ).off( "click", this.test );
4393 }
4394};
4395
4396var you = {
4397 type: "person",
4398 test: function( event ) {
4399 $( "#log" ).append( this.type + " " );
4400 }
4401};
4402
4403// Execute you.test() in the context of the `you` object
4404// no matter where it is called
4405// i.e. the `this` keyword will refer to `you`
4406var youClick = $.proxy( you.test, you );
4407
4408// attach click handlers to #test
4409$( "#test" )
4410 // this === "zombie"; handler unbound after first click
4411 .on( "click", $.proxy( me.test, me ) )
4412
4413 // this === "person"
4414 .on( "click", youClick )
4415
4416 // this === "zombie"
4417 .on( "click", $.proxy( you.test, me ) )
4418
4419 // this === "<button> element"
4420 .on( "click", you.test );
4421</script>
4422
4423</body>
4424</html>
4425```
4426 * @example ​ ````Change the context of a function bound to the click handler,
4427```html
4428<!doctype html>
4429<html lang="en">
4430<head>
4431 <meta charset="utf-8">
4432 <title>jQuery.proxy demo</title>
4433 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4434</head>
4435<body>
4436
4437<p><button type="button" id="test">Test</button></p>
4438<div id="log"></div>
4439
4440<script>
4441var me = {
4442 // I'm a dog
4443 type: "dog",
4444
4445 // Note that event comes *after* one and two
4446 test: function( one, two, event ) {
4447 $( "#log" )
4448
4449 // `one` maps to `you`, the 1st additional
4450 // argument in the $.proxy function call
4451 .append( "<h3>Hello " + one.type + ":</h3>" )
4452
4453 // The `this` keyword refers to `me`
4454 // (the 2nd, context, argument of $.proxy)
4455 .append( "I am a " + this.type + ", " )
4456
4457 // `two` maps to `they`, the 2nd additional
4458 // argument in the $.proxy function call
4459 .append( "and they are " + two.type + ".<br>" )
4460
4461 // The event type is "click"
4462 .append( "Thanks for " + event.type + "ing." )
4463
4464 // The clicked element is `event.target`,
4465 // and its type is "button"
4466 .append( "the " + event.target.type + "." );
4467 }
4468};
4469
4470var you = { type: "cat" };
4471var they = { type: "fish" };
4472
4473// Set up handler to execute me.test() in the context
4474// of `me`, with `you` and `they` as additional arguments
4475var proxy = $.proxy( me.test, me, you, they );
4476
4477$( "#test" )
4478 .on( "click", proxy );
4479</script>
4480
4481</body>
4482</html>
4483```
4484 */
4485 proxy<TContext,
4486 TReturn,
4487 A, B, C, D>(funсtion: (this: TContext, a: A, b: B, c: C, d: D) => TReturn,
4488 context: TContext,
4489 a: A, b: B, c: C, d: D): () => TReturn;
4490 /**
4491 * Takes a function and returns a new one that will always have a particular context.
4492 * @param funсtion The function whose context will be changed.
4493 * @param context The object to which the context (`this`) of the function should be set.
4494 * @param a An argument to be passed to the function referenced in the `function` argument.
4495 * @param b An argument to be passed to the function referenced in the `function` argument.
4496 * @param c An argument to be passed to the function referenced in the `function` argument.
4497 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4498 * @since 1.4
4499 * @since 1.6
4500 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4501 * @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.
4502```html
4503<!doctype html>
4504<html lang="en">
4505<head>
4506 <meta charset="utf-8">
4507 <title>jQuery.proxy demo</title>
4508 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4509</head>
4510<body>
4511
4512<p><button type="button" id="test">Test</button></p>
4513<div id="log"></div>
4514
4515<script>
4516var me = {
4517 type: "zombie",
4518 test: function( event ) {
4519 // Without proxy, `this` would refer to the event target
4520 // use event.target to reference that element.
4521 var element = event.target;
4522 $( element ).css( "background-color", "red" );
4523
4524 // With proxy, `this` refers to the me object encapsulating
4525 // this function.
4526 $( "#log" ).append( "Hello " + this.type + "<br>" );
4527 $( "#test" ).off( "click", this.test );
4528 }
4529};
4530
4531var you = {
4532 type: "person",
4533 test: function( event ) {
4534 $( "#log" ).append( this.type + " " );
4535 }
4536};
4537
4538// Execute you.test() in the context of the `you` object
4539// no matter where it is called
4540// i.e. the `this` keyword will refer to `you`
4541var youClick = $.proxy( you.test, you );
4542
4543// attach click handlers to #test
4544$( "#test" )
4545 // this === "zombie"; handler unbound after first click
4546 .on( "click", $.proxy( me.test, me ) )
4547
4548 // this === "person"
4549 .on( "click", youClick )
4550
4551 // this === "zombie"
4552 .on( "click", $.proxy( you.test, me ) )
4553
4554 // this === "<button> element"
4555 .on( "click", you.test );
4556</script>
4557
4558</body>
4559</html>
4560```
4561 * @example ​ ````Change the context of a function bound to the click handler,
4562```html
4563<!doctype html>
4564<html lang="en">
4565<head>
4566 <meta charset="utf-8">
4567 <title>jQuery.proxy demo</title>
4568 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4569</head>
4570<body>
4571
4572<p><button type="button" id="test">Test</button></p>
4573<div id="log"></div>
4574
4575<script>
4576var me = {
4577 // I'm a dog
4578 type: "dog",
4579
4580 // Note that event comes *after* one and two
4581 test: function( one, two, event ) {
4582 $( "#log" )
4583
4584 // `one` maps to `you`, the 1st additional
4585 // argument in the $.proxy function call
4586 .append( "<h3>Hello " + one.type + ":</h3>" )
4587
4588 // The `this` keyword refers to `me`
4589 // (the 2nd, context, argument of $.proxy)
4590 .append( "I am a " + this.type + ", " )
4591
4592 // `two` maps to `they`, the 2nd additional
4593 // argument in the $.proxy function call
4594 .append( "and they are " + two.type + ".<br>" )
4595
4596 // The event type is "click"
4597 .append( "Thanks for " + event.type + "ing." )
4598
4599 // The clicked element is `event.target`,
4600 // and its type is "button"
4601 .append( "the " + event.target.type + "." );
4602 }
4603};
4604
4605var you = { type: "cat" };
4606var they = { type: "fish" };
4607
4608// Set up handler to execute me.test() in the context
4609// of `me`, with `you` and `they` as additional arguments
4610var proxy = $.proxy( me.test, me, you, they );
4611
4612$( "#test" )
4613 .on( "click", proxy );
4614</script>
4615
4616</body>
4617</html>
4618```
4619 */
4620 proxy<TContext,
4621 TReturn,
4622 A, B, C>(funсtion: (this: TContext, a: A, b: B, c: C) => TReturn,
4623 context: TContext,
4624 a: A, b: B, c: C): () => TReturn;
4625 /**
4626 * Takes a function and returns a new one that will always have a particular context.
4627 * @param funсtion The function whose context will be changed.
4628 * @param context The object to which the context (`this`) of the function should be set.
4629 * @param a An argument to be passed to the function referenced in the `function` argument.
4630 * @param b An argument to be passed to the function referenced in the `function` argument.
4631 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4632 * @since 1.4
4633 * @since 1.6
4634 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4635 * @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.
4636```html
4637<!doctype html>
4638<html lang="en">
4639<head>
4640 <meta charset="utf-8">
4641 <title>jQuery.proxy demo</title>
4642 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4643</head>
4644<body>
4645
4646<p><button type="button" id="test">Test</button></p>
4647<div id="log"></div>
4648
4649<script>
4650var me = {
4651 type: "zombie",
4652 test: function( event ) {
4653 // Without proxy, `this` would refer to the event target
4654 // use event.target to reference that element.
4655 var element = event.target;
4656 $( element ).css( "background-color", "red" );
4657
4658 // With proxy, `this` refers to the me object encapsulating
4659 // this function.
4660 $( "#log" ).append( "Hello " + this.type + "<br>" );
4661 $( "#test" ).off( "click", this.test );
4662 }
4663};
4664
4665var you = {
4666 type: "person",
4667 test: function( event ) {
4668 $( "#log" ).append( this.type + " " );
4669 }
4670};
4671
4672// Execute you.test() in the context of the `you` object
4673// no matter where it is called
4674// i.e. the `this` keyword will refer to `you`
4675var youClick = $.proxy( you.test, you );
4676
4677// attach click handlers to #test
4678$( "#test" )
4679 // this === "zombie"; handler unbound after first click
4680 .on( "click", $.proxy( me.test, me ) )
4681
4682 // this === "person"
4683 .on( "click", youClick )
4684
4685 // this === "zombie"
4686 .on( "click", $.proxy( you.test, me ) )
4687
4688 // this === "<button> element"
4689 .on( "click", you.test );
4690</script>
4691
4692</body>
4693</html>
4694```
4695 * @example ​ ````Change the context of a function bound to the click handler,
4696```html
4697<!doctype html>
4698<html lang="en">
4699<head>
4700 <meta charset="utf-8">
4701 <title>jQuery.proxy demo</title>
4702 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4703</head>
4704<body>
4705
4706<p><button type="button" id="test">Test</button></p>
4707<div id="log"></div>
4708
4709<script>
4710var me = {
4711 // I'm a dog
4712 type: "dog",
4713
4714 // Note that event comes *after* one and two
4715 test: function( one, two, event ) {
4716 $( "#log" )
4717
4718 // `one` maps to `you`, the 1st additional
4719 // argument in the $.proxy function call
4720 .append( "<h3>Hello " + one.type + ":</h3>" )
4721
4722 // The `this` keyword refers to `me`
4723 // (the 2nd, context, argument of $.proxy)
4724 .append( "I am a " + this.type + ", " )
4725
4726 // `two` maps to `they`, the 2nd additional
4727 // argument in the $.proxy function call
4728 .append( "and they are " + two.type + ".<br>" )
4729
4730 // The event type is "click"
4731 .append( "Thanks for " + event.type + "ing." )
4732
4733 // The clicked element is `event.target`,
4734 // and its type is "button"
4735 .append( "the " + event.target.type + "." );
4736 }
4737};
4738
4739var you = { type: "cat" };
4740var they = { type: "fish" };
4741
4742// Set up handler to execute me.test() in the context
4743// of `me`, with `you` and `they` as additional arguments
4744var proxy = $.proxy( me.test, me, you, they );
4745
4746$( "#test" )
4747 .on( "click", proxy );
4748</script>
4749
4750</body>
4751</html>
4752```
4753 */
4754 proxy<TContext,
4755 TReturn,
4756 A, B>(funсtion: (this: TContext, a: A, b: B) => TReturn,
4757 context: TContext,
4758 a: A, b: B): () => TReturn;
4759 /**
4760 * Takes a function and returns a new one that will always have a particular context.
4761 * @param funсtion The function whose context will be changed.
4762 * @param context The object to which the context (`this`) of the function should be set.
4763 * @param a An argument to be passed to the function referenced in the `function` argument.
4764 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4765 * @since 1.4`
4766 * @since 1.6
4767 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4768 * @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.
4769```html
4770<!doctype html>
4771<html lang="en">
4772<head>
4773 <meta charset="utf-8">
4774 <title>jQuery.proxy demo</title>
4775 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4776</head>
4777<body>
4778
4779<p><button type="button" id="test">Test</button></p>
4780<div id="log"></div>
4781
4782<script>
4783var me = {
4784 type: "zombie",
4785 test: function( event ) {
4786 // Without proxy, `this` would refer to the event target
4787 // use event.target to reference that element.
4788 var element = event.target;
4789 $( element ).css( "background-color", "red" );
4790
4791 // With proxy, `this` refers to the me object encapsulating
4792 // this function.
4793 $( "#log" ).append( "Hello " + this.type + "<br>" );
4794 $( "#test" ).off( "click", this.test );
4795 }
4796};
4797
4798var you = {
4799 type: "person",
4800 test: function( event ) {
4801 $( "#log" ).append( this.type + " " );
4802 }
4803};
4804
4805// Execute you.test() in the context of the `you` object
4806// no matter where it is called
4807// i.e. the `this` keyword will refer to `you`
4808var youClick = $.proxy( you.test, you );
4809
4810// attach click handlers to #test
4811$( "#test" )
4812 // this === "zombie"; handler unbound after first click
4813 .on( "click", $.proxy( me.test, me ) )
4814
4815 // this === "person"
4816 .on( "click", youClick )
4817
4818 // this === "zombie"
4819 .on( "click", $.proxy( you.test, me ) )
4820
4821 // this === "<button> element"
4822 .on( "click", you.test );
4823</script>
4824
4825</body>
4826</html>
4827```
4828 * @example ​ ````Change the context of a function bound to the click handler,
4829```html
4830<!doctype html>
4831<html lang="en">
4832<head>
4833 <meta charset="utf-8">
4834 <title>jQuery.proxy demo</title>
4835 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4836</head>
4837<body>
4838
4839<p><button type="button" id="test">Test</button></p>
4840<div id="log"></div>
4841
4842<script>
4843var me = {
4844 // I'm a dog
4845 type: "dog",
4846
4847 // Note that event comes *after* one and two
4848 test: function( one, two, event ) {
4849 $( "#log" )
4850
4851 // `one` maps to `you`, the 1st additional
4852 // argument in the $.proxy function call
4853 .append( "<h3>Hello " + one.type + ":</h3>" )
4854
4855 // The `this` keyword refers to `me`
4856 // (the 2nd, context, argument of $.proxy)
4857 .append( "I am a " + this.type + ", " )
4858
4859 // `two` maps to `they`, the 2nd additional
4860 // argument in the $.proxy function call
4861 .append( "and they are " + two.type + ".<br>" )
4862
4863 // The event type is "click"
4864 .append( "Thanks for " + event.type + "ing." )
4865
4866 // The clicked element is `event.target`,
4867 // and its type is "button"
4868 .append( "the " + event.target.type + "." );
4869 }
4870};
4871
4872var you = { type: "cat" };
4873var they = { type: "fish" };
4874
4875// Set up handler to execute me.test() in the context
4876// of `me`, with `you` and `they` as additional arguments
4877var proxy = $.proxy( me.test, me, you, they );
4878
4879$( "#test" )
4880 .on( "click", proxy );
4881</script>
4882
4883</body>
4884</html>
4885```
4886 */
4887 proxy<TContext,
4888 TReturn,
4889 A>(funсtion: (this: TContext, a: A) => TReturn,
4890 context: TContext,
4891 a: A): () => TReturn;
4892 /**
4893 * Takes a function and returns a new one that will always have a particular context.
4894 * @param funсtion The function whose context will be changed.
4895 * @param context The object to which the context (`this`) of the function should be set.
4896 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
4897 * @since 1.4
4898 * @since 1.6
4899 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
4900 * @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.
4901```html
4902<!doctype html>
4903<html lang="en">
4904<head>
4905 <meta charset="utf-8">
4906 <title>jQuery.proxy demo</title>
4907 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4908</head>
4909<body>
4910
4911<p><button type="button" id="test">Test</button></p>
4912<div id="log"></div>
4913
4914<script>
4915var me = {
4916 type: "zombie",
4917 test: function( event ) {
4918 // Without proxy, `this` would refer to the event target
4919 // use event.target to reference that element.
4920 var element = event.target;
4921 $( element ).css( "background-color", "red" );
4922
4923 // With proxy, `this` refers to the me object encapsulating
4924 // this function.
4925 $( "#log" ).append( "Hello " + this.type + "<br>" );
4926 $( "#test" ).off( "click", this.test );
4927 }
4928};
4929
4930var you = {
4931 type: "person",
4932 test: function( event ) {
4933 $( "#log" ).append( this.type + " " );
4934 }
4935};
4936
4937// Execute you.test() in the context of the `you` object
4938// no matter where it is called
4939// i.e. the `this` keyword will refer to `you`
4940var youClick = $.proxy( you.test, you );
4941
4942// attach click handlers to #test
4943$( "#test" )
4944 // this === "zombie"; handler unbound after first click
4945 .on( "click", $.proxy( me.test, me ) )
4946
4947 // this === "person"
4948 .on( "click", youClick )
4949
4950 // this === "zombie"
4951 .on( "click", $.proxy( you.test, me ) )
4952
4953 // this === "<button> element"
4954 .on( "click", you.test );
4955</script>
4956
4957</body>
4958</html>
4959```
4960 * @example ​ ````Change the context of a function bound to the click handler,
4961```html
4962<!doctype html>
4963<html lang="en">
4964<head>
4965 <meta charset="utf-8">
4966 <title>jQuery.proxy demo</title>
4967 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
4968</head>
4969<body>
4970
4971<p><button type="button" id="test">Test</button></p>
4972<div id="log"></div>
4973
4974<script>
4975var me = {
4976 // I'm a dog
4977 type: "dog",
4978
4979 // Note that event comes *after* one and two
4980 test: function( one, two, event ) {
4981 $( "#log" )
4982
4983 // `one` maps to `you`, the 1st additional
4984 // argument in the $.proxy function call
4985 .append( "<h3>Hello " + one.type + ":</h3>" )
4986
4987 // The `this` keyword refers to `me`
4988 // (the 2nd, context, argument of $.proxy)
4989 .append( "I am a " + this.type + ", " )
4990
4991 // `two` maps to `they`, the 2nd additional
4992 // argument in the $.proxy function call
4993 .append( "and they are " + two.type + ".<br>" )
4994
4995 // The event type is "click"
4996 .append( "Thanks for " + event.type + "ing." )
4997
4998 // The clicked element is `event.target`,
4999 // and its type is "button"
5000 .append( "the " + event.target.type + "." );
5001 }
5002};
5003
5004var you = { type: "cat" };
5005var they = { type: "fish" };
5006
5007// Set up handler to execute me.test() in the context
5008// of `me`, with `you` and `they` as additional arguments
5009var proxy = $.proxy( me.test, me, you, they );
5010
5011$( "#test" )
5012 .on( "click", proxy );
5013</script>
5014
5015</body>
5016</html>
5017```
5018 */
5019 proxy<TContext,
5020 TReturn>(funсtion: (this: TContext) => TReturn,
5021 context: TContext): () => TReturn;
5022
5023 // #endregion
5024
5025 // region 1 parameters
5026 // #region 1 parameters
5027
5028 /**
5029 * Takes a function and returns a new one that will always have a particular context.
5030 * @param funсtion The function whose context will be changed.
5031 * @param context The object to which the context (`this`) of the function should be set.
5032 * @param a An argument to be passed to the function referenced in the `function` argument.
5033 * @param b An argument to be passed to the function referenced in the `function` argument.
5034 * @param c An argument to be passed to the function referenced in the `function` argument.
5035 * @param d An argument to be passed to the function referenced in the `function` argument.
5036 * @param e An argument to be passed to the function referenced in the `function` argument.
5037 * @param f An argument to be passed to the function referenced in the `function` argument.
5038 * @param g An argument to be passed to the function referenced in the `function` argument.
5039 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5040 * @since 1.4
5041 * @since 1.6
5042 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5043 * @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.
5044```html
5045<!doctype html>
5046<html lang="en">
5047<head>
5048 <meta charset="utf-8">
5049 <title>jQuery.proxy demo</title>
5050 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5051</head>
5052<body>
5053
5054<p><button type="button" id="test">Test</button></p>
5055<div id="log"></div>
5056
5057<script>
5058var me = {
5059 type: "zombie",
5060 test: function( event ) {
5061 // Without proxy, `this` would refer to the event target
5062 // use event.target to reference that element.
5063 var element = event.target;
5064 $( element ).css( "background-color", "red" );
5065
5066 // With proxy, `this` refers to the me object encapsulating
5067 // this function.
5068 $( "#log" ).append( "Hello " + this.type + "<br>" );
5069 $( "#test" ).off( "click", this.test );
5070 }
5071};
5072
5073var you = {
5074 type: "person",
5075 test: function( event ) {
5076 $( "#log" ).append( this.type + " " );
5077 }
5078};
5079
5080// Execute you.test() in the context of the `you` object
5081// no matter where it is called
5082// i.e. the `this` keyword will refer to `you`
5083var youClick = $.proxy( you.test, you );
5084
5085// attach click handlers to #test
5086$( "#test" )
5087 // this === "zombie"; handler unbound after first click
5088 .on( "click", $.proxy( me.test, me ) )
5089
5090 // this === "person"
5091 .on( "click", youClick )
5092
5093 // this === "zombie"
5094 .on( "click", $.proxy( you.test, me ) )
5095
5096 // this === "<button> element"
5097 .on( "click", you.test );
5098</script>
5099
5100</body>
5101</html>
5102```
5103 * @example ​ ````Change the context of a function bound to the click handler,
5104```html
5105<!doctype html>
5106<html lang="en">
5107<head>
5108 <meta charset="utf-8">
5109 <title>jQuery.proxy demo</title>
5110 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5111</head>
5112<body>
5113
5114<p><button type="button" id="test">Test</button></p>
5115<div id="log"></div>
5116
5117<script>
5118var me = {
5119 // I'm a dog
5120 type: "dog",
5121
5122 // Note that event comes *after* one and two
5123 test: function( one, two, event ) {
5124 $( "#log" )
5125
5126 // `one` maps to `you`, the 1st additional
5127 // argument in the $.proxy function call
5128 .append( "<h3>Hello " + one.type + ":</h3>" )
5129
5130 // The `this` keyword refers to `me`
5131 // (the 2nd, context, argument of $.proxy)
5132 .append( "I am a " + this.type + ", " )
5133
5134 // `two` maps to `they`, the 2nd additional
5135 // argument in the $.proxy function call
5136 .append( "and they are " + two.type + ".<br>" )
5137
5138 // The event type is "click"
5139 .append( "Thanks for " + event.type + "ing." )
5140
5141 // The clicked element is `event.target`,
5142 // and its type is "button"
5143 .append( "the " + event.target.type + "." );
5144 }
5145};
5146
5147var you = { type: "cat" };
5148var they = { type: "fish" };
5149
5150// Set up handler to execute me.test() in the context
5151// of `me`, with `you` and `they` as additional arguments
5152var proxy = $.proxy( me.test, me, you, they );
5153
5154$( "#test" )
5155 .on( "click", proxy );
5156</script>
5157
5158</body>
5159</html>
5160```
5161 */
5162 proxy<TContext,
5163 TReturn,
5164 A, B, C, D, E, F, G,
5165 T>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
5166 t: T) => TReturn,
5167 context: TContext,
5168 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T) => TReturn;
5169 /**
5170 * Takes a function and returns a new one that will always have a particular context.
5171 * @param funсtion The function whose context will be changed.
5172 * @param context The object to which the context (`this`) of the function should be set.
5173 * @param a An argument to be passed to the function referenced in the `function` argument.
5174 * @param b An argument to be passed to the function referenced in the `function` argument.
5175 * @param c An argument to be passed to the function referenced in the `function` argument.
5176 * @param d An argument to be passed to the function referenced in the `function` argument.
5177 * @param e An argument to be passed to the function referenced in the `function` argument.
5178 * @param f An argument to be passed to the function referenced in the `function` argument.
5179 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5180 * @since 1.4
5181 * @since 1.6
5182 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5183 * @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.
5184```html
5185<!doctype html>
5186<html lang="en">
5187<head>
5188 <meta charset="utf-8">
5189 <title>jQuery.proxy demo</title>
5190 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5191</head>
5192<body>
5193
5194<p><button type="button" id="test">Test</button></p>
5195<div id="log"></div>
5196
5197<script>
5198var me = {
5199 type: "zombie",
5200 test: function( event ) {
5201 // Without proxy, `this` would refer to the event target
5202 // use event.target to reference that element.
5203 var element = event.target;
5204 $( element ).css( "background-color", "red" );
5205
5206 // With proxy, `this` refers to the me object encapsulating
5207 // this function.
5208 $( "#log" ).append( "Hello " + this.type + "<br>" );
5209 $( "#test" ).off( "click", this.test );
5210 }
5211};
5212
5213var you = {
5214 type: "person",
5215 test: function( event ) {
5216 $( "#log" ).append( this.type + " " );
5217 }
5218};
5219
5220// Execute you.test() in the context of the `you` object
5221// no matter where it is called
5222// i.e. the `this` keyword will refer to `you`
5223var youClick = $.proxy( you.test, you );
5224
5225// attach click handlers to #test
5226$( "#test" )
5227 // this === "zombie"; handler unbound after first click
5228 .on( "click", $.proxy( me.test, me ) )
5229
5230 // this === "person"
5231 .on( "click", youClick )
5232
5233 // this === "zombie"
5234 .on( "click", $.proxy( you.test, me ) )
5235
5236 // this === "<button> element"
5237 .on( "click", you.test );
5238</script>
5239
5240</body>
5241</html>
5242```
5243 * @example ​ ````Change the context of a function bound to the click handler,
5244```html
5245<!doctype html>
5246<html lang="en">
5247<head>
5248 <meta charset="utf-8">
5249 <title>jQuery.proxy demo</title>
5250 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5251</head>
5252<body>
5253
5254<p><button type="button" id="test">Test</button></p>
5255<div id="log"></div>
5256
5257<script>
5258var me = {
5259 // I'm a dog
5260 type: "dog",
5261
5262 // Note that event comes *after* one and two
5263 test: function( one, two, event ) {
5264 $( "#log" )
5265
5266 // `one` maps to `you`, the 1st additional
5267 // argument in the $.proxy function call
5268 .append( "<h3>Hello " + one.type + ":</h3>" )
5269
5270 // The `this` keyword refers to `me`
5271 // (the 2nd, context, argument of $.proxy)
5272 .append( "I am a " + this.type + ", " )
5273
5274 // `two` maps to `they`, the 2nd additional
5275 // argument in the $.proxy function call
5276 .append( "and they are " + two.type + ".<br>" )
5277
5278 // The event type is "click"
5279 .append( "Thanks for " + event.type + "ing." )
5280
5281 // The clicked element is `event.target`,
5282 // and its type is "button"
5283 .append( "the " + event.target.type + "." );
5284 }
5285};
5286
5287var you = { type: "cat" };
5288var they = { type: "fish" };
5289
5290// Set up handler to execute me.test() in the context
5291// of `me`, with `you` and `they` as additional arguments
5292var proxy = $.proxy( me.test, me, you, they );
5293
5294$( "#test" )
5295 .on( "click", proxy );
5296</script>
5297
5298</body>
5299</html>
5300```
5301 */
5302 proxy<TContext,
5303 TReturn,
5304 A, B, C, D, E, F,
5305 T>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
5306 t: T) => TReturn,
5307 context: TContext,
5308 a: A, b: B, c: C, d: D, e: E, f: F): (t: T) => TReturn;
5309 /**
5310 * Takes a function and returns a new one that will always have a particular context.
5311 * @param funсtion The function whose context will be changed.
5312 * @param context The object to which the context (`this`) of the function should be set.
5313 * @param a An argument to be passed to the function referenced in the `function` argument.
5314 * @param b An argument to be passed to the function referenced in the `function` argument.
5315 * @param c An argument to be passed to the function referenced in the `function` argument.
5316 * @param d An argument to be passed to the function referenced in the `function` argument.
5317 * @param e An argument to be passed to the function referenced in the `function` argument.
5318 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5319 * @since 1.4
5320 * @since 1.6
5321 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5322 * @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.
5323```html
5324<!doctype html>
5325<html lang="en">
5326<head>
5327 <meta charset="utf-8">
5328 <title>jQuery.proxy demo</title>
5329 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5330</head>
5331<body>
5332
5333<p><button type="button" id="test">Test</button></p>
5334<div id="log"></div>
5335
5336<script>
5337var me = {
5338 type: "zombie",
5339 test: function( event ) {
5340 // Without proxy, `this` would refer to the event target
5341 // use event.target to reference that element.
5342 var element = event.target;
5343 $( element ).css( "background-color", "red" );
5344
5345 // With proxy, `this` refers to the me object encapsulating
5346 // this function.
5347 $( "#log" ).append( "Hello " + this.type + "<br>" );
5348 $( "#test" ).off( "click", this.test );
5349 }
5350};
5351
5352var you = {
5353 type: "person",
5354 test: function( event ) {
5355 $( "#log" ).append( this.type + " " );
5356 }
5357};
5358
5359// Execute you.test() in the context of the `you` object
5360// no matter where it is called
5361// i.e. the `this` keyword will refer to `you`
5362var youClick = $.proxy( you.test, you );
5363
5364// attach click handlers to #test
5365$( "#test" )
5366 // this === "zombie"; handler unbound after first click
5367 .on( "click", $.proxy( me.test, me ) )
5368
5369 // this === "person"
5370 .on( "click", youClick )
5371
5372 // this === "zombie"
5373 .on( "click", $.proxy( you.test, me ) )
5374
5375 // this === "<button> element"
5376 .on( "click", you.test );
5377</script>
5378
5379</body>
5380</html>
5381```
5382 * @example ​ ````Change the context of a function bound to the click handler,
5383```html
5384<!doctype html>
5385<html lang="en">
5386<head>
5387 <meta charset="utf-8">
5388 <title>jQuery.proxy demo</title>
5389 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5390</head>
5391<body>
5392
5393<p><button type="button" id="test">Test</button></p>
5394<div id="log"></div>
5395
5396<script>
5397var me = {
5398 // I'm a dog
5399 type: "dog",
5400
5401 // Note that event comes *after* one and two
5402 test: function( one, two, event ) {
5403 $( "#log" )
5404
5405 // `one` maps to `you`, the 1st additional
5406 // argument in the $.proxy function call
5407 .append( "<h3>Hello " + one.type + ":</h3>" )
5408
5409 // The `this` keyword refers to `me`
5410 // (the 2nd, context, argument of $.proxy)
5411 .append( "I am a " + this.type + ", " )
5412
5413 // `two` maps to `they`, the 2nd additional
5414 // argument in the $.proxy function call
5415 .append( "and they are " + two.type + ".<br>" )
5416
5417 // The event type is "click"
5418 .append( "Thanks for " + event.type + "ing." )
5419
5420 // The clicked element is `event.target`,
5421 // and its type is "button"
5422 .append( "the " + event.target.type + "." );
5423 }
5424};
5425
5426var you = { type: "cat" };
5427var they = { type: "fish" };
5428
5429// Set up handler to execute me.test() in the context
5430// of `me`, with `you` and `they` as additional arguments
5431var proxy = $.proxy( me.test, me, you, they );
5432
5433$( "#test" )
5434 .on( "click", proxy );
5435</script>
5436
5437</body>
5438</html>
5439```
5440 */
5441 proxy<TContext,
5442 TReturn,
5443 A, B, C, D, E,
5444 T>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
5445 t: T) => TReturn,
5446 context: TContext,
5447 a: A, b: B, c: C, d: D, e: E): (t: T) => TReturn;
5448 /**
5449 * Takes a function and returns a new one that will always have a particular context.
5450 * @param funсtion The function whose context will be changed.
5451 * @param context The object to which the context (`this`) of the function should be set.
5452 * @param a An argument to be passed to the function referenced in the `function` argument.
5453 * @param b An argument to be passed to the function referenced in the `function` argument.
5454 * @param c An argument to be passed to the function referenced in the `function` argument.
5455 * @param d An argument to be passed to the function referenced in the `function` argument.
5456 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5457 * @since 1.4
5458 * @since 1.6
5459 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5460 * @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.
5461```html
5462<!doctype html>
5463<html lang="en">
5464<head>
5465 <meta charset="utf-8">
5466 <title>jQuery.proxy demo</title>
5467 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5468</head>
5469<body>
5470
5471<p><button type="button" id="test">Test</button></p>
5472<div id="log"></div>
5473
5474<script>
5475var me = {
5476 type: "zombie",
5477 test: function( event ) {
5478 // Without proxy, `this` would refer to the event target
5479 // use event.target to reference that element.
5480 var element = event.target;
5481 $( element ).css( "background-color", "red" );
5482
5483 // With proxy, `this` refers to the me object encapsulating
5484 // this function.
5485 $( "#log" ).append( "Hello " + this.type + "<br>" );
5486 $( "#test" ).off( "click", this.test );
5487 }
5488};
5489
5490var you = {
5491 type: "person",
5492 test: function( event ) {
5493 $( "#log" ).append( this.type + " " );
5494 }
5495};
5496
5497// Execute you.test() in the context of the `you` object
5498// no matter where it is called
5499// i.e. the `this` keyword will refer to `you`
5500var youClick = $.proxy( you.test, you );
5501
5502// attach click handlers to #test
5503$( "#test" )
5504 // this === "zombie"; handler unbound after first click
5505 .on( "click", $.proxy( me.test, me ) )
5506
5507 // this === "person"
5508 .on( "click", youClick )
5509
5510 // this === "zombie"
5511 .on( "click", $.proxy( you.test, me ) )
5512
5513 // this === "<button> element"
5514 .on( "click", you.test );
5515</script>
5516
5517</body>
5518</html>
5519```
5520 * @example ​ ````Change the context of a function bound to the click handler,
5521```html
5522<!doctype html>
5523<html lang="en">
5524<head>
5525 <meta charset="utf-8">
5526 <title>jQuery.proxy demo</title>
5527 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5528</head>
5529<body>
5530
5531<p><button type="button" id="test">Test</button></p>
5532<div id="log"></div>
5533
5534<script>
5535var me = {
5536 // I'm a dog
5537 type: "dog",
5538
5539 // Note that event comes *after* one and two
5540 test: function( one, two, event ) {
5541 $( "#log" )
5542
5543 // `one` maps to `you`, the 1st additional
5544 // argument in the $.proxy function call
5545 .append( "<h3>Hello " + one.type + ":</h3>" )
5546
5547 // The `this` keyword refers to `me`
5548 // (the 2nd, context, argument of $.proxy)
5549 .append( "I am a " + this.type + ", " )
5550
5551 // `two` maps to `they`, the 2nd additional
5552 // argument in the $.proxy function call
5553 .append( "and they are " + two.type + ".<br>" )
5554
5555 // The event type is "click"
5556 .append( "Thanks for " + event.type + "ing." )
5557
5558 // The clicked element is `event.target`,
5559 // and its type is "button"
5560 .append( "the " + event.target.type + "." );
5561 }
5562};
5563
5564var you = { type: "cat" };
5565var they = { type: "fish" };
5566
5567// Set up handler to execute me.test() in the context
5568// of `me`, with `you` and `they` as additional arguments
5569var proxy = $.proxy( me.test, me, you, they );
5570
5571$( "#test" )
5572 .on( "click", proxy );
5573</script>
5574
5575</body>
5576</html>
5577```
5578 */
5579 proxy<TContext,
5580 TReturn,
5581 A, B, C, D,
5582 T>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
5583 t: T) => TReturn,
5584 context: TContext,
5585 a: A, b: B, c: C, d: D): (t: T) => TReturn;
5586 /**
5587 * Takes a function and returns a new one that will always have a particular context.
5588 * @param funсtion The function whose context will be changed.
5589 * @param context The object to which the context (`this`) of the function should be set.
5590 * @param a An argument to be passed to the function referenced in the `function` argument.
5591 * @param b An argument to be passed to the function referenced in the `function` argument.
5592 * @param c An argument to be passed to the function referenced in the `function` argument.
5593 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5594 * @since 1.4
5595 * @since 1.6
5596 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5597 * @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.
5598```html
5599<!doctype html>
5600<html lang="en">
5601<head>
5602 <meta charset="utf-8">
5603 <title>jQuery.proxy demo</title>
5604 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5605</head>
5606<body>
5607
5608<p><button type="button" id="test">Test</button></p>
5609<div id="log"></div>
5610
5611<script>
5612var me = {
5613 type: "zombie",
5614 test: function( event ) {
5615 // Without proxy, `this` would refer to the event target
5616 // use event.target to reference that element.
5617 var element = event.target;
5618 $( element ).css( "background-color", "red" );
5619
5620 // With proxy, `this` refers to the me object encapsulating
5621 // this function.
5622 $( "#log" ).append( "Hello " + this.type + "<br>" );
5623 $( "#test" ).off( "click", this.test );
5624 }
5625};
5626
5627var you = {
5628 type: "person",
5629 test: function( event ) {
5630 $( "#log" ).append( this.type + " " );
5631 }
5632};
5633
5634// Execute you.test() in the context of the `you` object
5635// no matter where it is called
5636// i.e. the `this` keyword will refer to `you`
5637var youClick = $.proxy( you.test, you );
5638
5639// attach click handlers to #test
5640$( "#test" )
5641 // this === "zombie"; handler unbound after first click
5642 .on( "click", $.proxy( me.test, me ) )
5643
5644 // this === "person"
5645 .on( "click", youClick )
5646
5647 // this === "zombie"
5648 .on( "click", $.proxy( you.test, me ) )
5649
5650 // this === "<button> element"
5651 .on( "click", you.test );
5652</script>
5653
5654</body>
5655</html>
5656```
5657 * @example ​ ````Change the context of a function bound to the click handler,
5658```html
5659<!doctype html>
5660<html lang="en">
5661<head>
5662 <meta charset="utf-8">
5663 <title>jQuery.proxy demo</title>
5664 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5665</head>
5666<body>
5667
5668<p><button type="button" id="test">Test</button></p>
5669<div id="log"></div>
5670
5671<script>
5672var me = {
5673 // I'm a dog
5674 type: "dog",
5675
5676 // Note that event comes *after* one and two
5677 test: function( one, two, event ) {
5678 $( "#log" )
5679
5680 // `one` maps to `you`, the 1st additional
5681 // argument in the $.proxy function call
5682 .append( "<h3>Hello " + one.type + ":</h3>" )
5683
5684 // The `this` keyword refers to `me`
5685 // (the 2nd, context, argument of $.proxy)
5686 .append( "I am a " + this.type + ", " )
5687
5688 // `two` maps to `they`, the 2nd additional
5689 // argument in the $.proxy function call
5690 .append( "and they are " + two.type + ".<br>" )
5691
5692 // The event type is "click"
5693 .append( "Thanks for " + event.type + "ing." )
5694
5695 // The clicked element is `event.target`,
5696 // and its type is "button"
5697 .append( "the " + event.target.type + "." );
5698 }
5699};
5700
5701var you = { type: "cat" };
5702var they = { type: "fish" };
5703
5704// Set up handler to execute me.test() in the context
5705// of `me`, with `you` and `they` as additional arguments
5706var proxy = $.proxy( me.test, me, you, they );
5707
5708$( "#test" )
5709 .on( "click", proxy );
5710</script>
5711
5712</body>
5713</html>
5714```
5715 */
5716 proxy<TContext,
5717 TReturn,
5718 A, B, C,
5719 T>(funсtion: (this: TContext, a: A, b: B, c: C,
5720 t: T) => TReturn,
5721 context: TContext,
5722 a: A, b: B, c: C): (t: T) => TReturn;
5723 /**
5724 * Takes a function and returns a new one that will always have a particular context.
5725 * @param funсtion The function whose context will be changed.
5726 * @param context The object to which the context (`this`) of the function should be set.
5727 * @param a An argument to be passed to the function referenced in the `function` argument.
5728 * @param b An argument to be passed to the function referenced in the `function` argument.
5729 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5730 * @since 1.4
5731 * @since 1.6
5732 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5733 * @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.
5734```html
5735<!doctype html>
5736<html lang="en">
5737<head>
5738 <meta charset="utf-8">
5739 <title>jQuery.proxy demo</title>
5740 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5741</head>
5742<body>
5743
5744<p><button type="button" id="test">Test</button></p>
5745<div id="log"></div>
5746
5747<script>
5748var me = {
5749 type: "zombie",
5750 test: function( event ) {
5751 // Without proxy, `this` would refer to the event target
5752 // use event.target to reference that element.
5753 var element = event.target;
5754 $( element ).css( "background-color", "red" );
5755
5756 // With proxy, `this` refers to the me object encapsulating
5757 // this function.
5758 $( "#log" ).append( "Hello " + this.type + "<br>" );
5759 $( "#test" ).off( "click", this.test );
5760 }
5761};
5762
5763var you = {
5764 type: "person",
5765 test: function( event ) {
5766 $( "#log" ).append( this.type + " " );
5767 }
5768};
5769
5770// Execute you.test() in the context of the `you` object
5771// no matter where it is called
5772// i.e. the `this` keyword will refer to `you`
5773var youClick = $.proxy( you.test, you );
5774
5775// attach click handlers to #test
5776$( "#test" )
5777 // this === "zombie"; handler unbound after first click
5778 .on( "click", $.proxy( me.test, me ) )
5779
5780 // this === "person"
5781 .on( "click", youClick )
5782
5783 // this === "zombie"
5784 .on( "click", $.proxy( you.test, me ) )
5785
5786 // this === "<button> element"
5787 .on( "click", you.test );
5788</script>
5789
5790</body>
5791</html>
5792```
5793 * @example ​ ````Change the context of a function bound to the click handler,
5794```html
5795<!doctype html>
5796<html lang="en">
5797<head>
5798 <meta charset="utf-8">
5799 <title>jQuery.proxy demo</title>
5800 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5801</head>
5802<body>
5803
5804<p><button type="button" id="test">Test</button></p>
5805<div id="log"></div>
5806
5807<script>
5808var me = {
5809 // I'm a dog
5810 type: "dog",
5811
5812 // Note that event comes *after* one and two
5813 test: function( one, two, event ) {
5814 $( "#log" )
5815
5816 // `one` maps to `you`, the 1st additional
5817 // argument in the $.proxy function call
5818 .append( "<h3>Hello " + one.type + ":</h3>" )
5819
5820 // The `this` keyword refers to `me`
5821 // (the 2nd, context, argument of $.proxy)
5822 .append( "I am a " + this.type + ", " )
5823
5824 // `two` maps to `they`, the 2nd additional
5825 // argument in the $.proxy function call
5826 .append( "and they are " + two.type + ".<br>" )
5827
5828 // The event type is "click"
5829 .append( "Thanks for " + event.type + "ing." )
5830
5831 // The clicked element is `event.target`,
5832 // and its type is "button"
5833 .append( "the " + event.target.type + "." );
5834 }
5835};
5836
5837var you = { type: "cat" };
5838var they = { type: "fish" };
5839
5840// Set up handler to execute me.test() in the context
5841// of `me`, with `you` and `they` as additional arguments
5842var proxy = $.proxy( me.test, me, you, they );
5843
5844$( "#test" )
5845 .on( "click", proxy );
5846</script>
5847
5848</body>
5849</html>
5850```
5851 */
5852 proxy<TContext,
5853 TReturn,
5854 A, B,
5855 T>(funсtion: (this: TContext, a: A, b: B,
5856 t: T) => TReturn,
5857 context: TContext,
5858 a: A, b: B): (t: T) => TReturn;
5859 /**
5860 * Takes a function and returns a new one that will always have a particular context.
5861 * @param funсtion The function whose context will be changed.
5862 * @param context The object to which the context (`this`) of the function should be set.
5863 * @param a An argument to be passed to the function referenced in the `function` argument.
5864 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5865 * @since 1.4
5866 * @since 1.6
5867 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
5868 * @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.
5869```html
5870<!doctype html>
5871<html lang="en">
5872<head>
5873 <meta charset="utf-8">
5874 <title>jQuery.proxy demo</title>
5875 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5876</head>
5877<body>
5878
5879<p><button type="button" id="test">Test</button></p>
5880<div id="log"></div>
5881
5882<script>
5883var me = {
5884 type: "zombie",
5885 test: function( event ) {
5886 // Without proxy, `this` would refer to the event target
5887 // use event.target to reference that element.
5888 var element = event.target;
5889 $( element ).css( "background-color", "red" );
5890
5891 // With proxy, `this` refers to the me object encapsulating
5892 // this function.
5893 $( "#log" ).append( "Hello " + this.type + "<br>" );
5894 $( "#test" ).off( "click", this.test );
5895 }
5896};
5897
5898var you = {
5899 type: "person",
5900 test: function( event ) {
5901 $( "#log" ).append( this.type + " " );
5902 }
5903};
5904
5905// Execute you.test() in the context of the `you` object
5906// no matter where it is called
5907// i.e. the `this` keyword will refer to `you`
5908var youClick = $.proxy( you.test, you );
5909
5910// attach click handlers to #test
5911$( "#test" )
5912 // this === "zombie"; handler unbound after first click
5913 .on( "click", $.proxy( me.test, me ) )
5914
5915 // this === "person"
5916 .on( "click", youClick )
5917
5918 // this === "zombie"
5919 .on( "click", $.proxy( you.test, me ) )
5920
5921 // this === "<button> element"
5922 .on( "click", you.test );
5923</script>
5924
5925</body>
5926</html>
5927```
5928 * @example ​ ````Change the context of a function bound to the click handler,
5929```html
5930<!doctype html>
5931<html lang="en">
5932<head>
5933 <meta charset="utf-8">
5934 <title>jQuery.proxy demo</title>
5935 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
5936</head>
5937<body>
5938
5939<p><button type="button" id="test">Test</button></p>
5940<div id="log"></div>
5941
5942<script>
5943var me = {
5944 // I'm a dog
5945 type: "dog",
5946
5947 // Note that event comes *after* one and two
5948 test: function( one, two, event ) {
5949 $( "#log" )
5950
5951 // `one` maps to `you`, the 1st additional
5952 // argument in the $.proxy function call
5953 .append( "<h3>Hello " + one.type + ":</h3>" )
5954
5955 // The `this` keyword refers to `me`
5956 // (the 2nd, context, argument of $.proxy)
5957 .append( "I am a " + this.type + ", " )
5958
5959 // `two` maps to `they`, the 2nd additional
5960 // argument in the $.proxy function call
5961 .append( "and they are " + two.type + ".<br>" )
5962
5963 // The event type is "click"
5964 .append( "Thanks for " + event.type + "ing." )
5965
5966 // The clicked element is `event.target`,
5967 // and its type is "button"
5968 .append( "the " + event.target.type + "." );
5969 }
5970};
5971
5972var you = { type: "cat" };
5973var they = { type: "fish" };
5974
5975// Set up handler to execute me.test() in the context
5976// of `me`, with `you` and `they` as additional arguments
5977var proxy = $.proxy( me.test, me, you, they );
5978
5979$( "#test" )
5980 .on( "click", proxy );
5981</script>
5982
5983</body>
5984</html>
5985```
5986 */
5987 proxy<TContext,
5988 TReturn,
5989 A,
5990 T>(funсtion: (this: TContext, a: A,
5991 t: T) => TReturn,
5992 context: TContext,
5993 a: A): (t: T) => TReturn;
5994 /**
5995 * Takes a function and returns a new one that will always have a particular context.
5996 * @param funсtion The function whose context will be changed.
5997 * @param context The object to which the context (`this`) of the function should be set.
5998 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
5999 * @since 1.4
6000 * @since 1.6
6001 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6002 * @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.
6003```html
6004<!doctype html>
6005<html lang="en">
6006<head>
6007 <meta charset="utf-8">
6008 <title>jQuery.proxy demo</title>
6009 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6010</head>
6011<body>
6012
6013<p><button type="button" id="test">Test</button></p>
6014<div id="log"></div>
6015
6016<script>
6017var me = {
6018 type: "zombie",
6019 test: function( event ) {
6020 // Without proxy, `this` would refer to the event target
6021 // use event.target to reference that element.
6022 var element = event.target;
6023 $( element ).css( "background-color", "red" );
6024
6025 // With proxy, `this` refers to the me object encapsulating
6026 // this function.
6027 $( "#log" ).append( "Hello " + this.type + "<br>" );
6028 $( "#test" ).off( "click", this.test );
6029 }
6030};
6031
6032var you = {
6033 type: "person",
6034 test: function( event ) {
6035 $( "#log" ).append( this.type + " " );
6036 }
6037};
6038
6039// Execute you.test() in the context of the `you` object
6040// no matter where it is called
6041// i.e. the `this` keyword will refer to `you`
6042var youClick = $.proxy( you.test, you );
6043
6044// attach click handlers to #test
6045$( "#test" )
6046 // this === "zombie"; handler unbound after first click
6047 .on( "click", $.proxy( me.test, me ) )
6048
6049 // this === "person"
6050 .on( "click", youClick )
6051
6052 // this === "zombie"
6053 .on( "click", $.proxy( you.test, me ) )
6054
6055 // this === "<button> element"
6056 .on( "click", you.test );
6057</script>
6058
6059</body>
6060</html>
6061```
6062 * @example ​ ````Change the context of a function bound to the click handler,
6063```html
6064<!doctype html>
6065<html lang="en">
6066<head>
6067 <meta charset="utf-8">
6068 <title>jQuery.proxy demo</title>
6069 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6070</head>
6071<body>
6072
6073<p><button type="button" id="test">Test</button></p>
6074<div id="log"></div>
6075
6076<script>
6077var me = {
6078 // I'm a dog
6079 type: "dog",
6080
6081 // Note that event comes *after* one and two
6082 test: function( one, two, event ) {
6083 $( "#log" )
6084
6085 // `one` maps to `you`, the 1st additional
6086 // argument in the $.proxy function call
6087 .append( "<h3>Hello " + one.type + ":</h3>" )
6088
6089 // The `this` keyword refers to `me`
6090 // (the 2nd, context, argument of $.proxy)
6091 .append( "I am a " + this.type + ", " )
6092
6093 // `two` maps to `they`, the 2nd additional
6094 // argument in the $.proxy function call
6095 .append( "and they are " + two.type + ".<br>" )
6096
6097 // The event type is "click"
6098 .append( "Thanks for " + event.type + "ing." )
6099
6100 // The clicked element is `event.target`,
6101 // and its type is "button"
6102 .append( "the " + event.target.type + "." );
6103 }
6104};
6105
6106var you = { type: "cat" };
6107var they = { type: "fish" };
6108
6109// Set up handler to execute me.test() in the context
6110// of `me`, with `you` and `they` as additional arguments
6111var proxy = $.proxy( me.test, me, you, they );
6112
6113$( "#test" )
6114 .on( "click", proxy );
6115</script>
6116
6117</body>
6118</html>
6119```
6120 */
6121 proxy<TContext,
6122 TReturn,
6123 T>(funсtion: (this: TContext, t: T) => TReturn,
6124 context: TContext): (t: T) => TReturn;
6125
6126 // #endregion
6127
6128 // region 2 parameters
6129 // #region 2 parameters
6130
6131 /**
6132 * Takes a function and returns a new one that will always have a particular context.
6133 * @param funсtion The function whose context will be changed.
6134 * @param context The object to which the context (`this`) of the function should be set.
6135 * @param a An argument to be passed to the function referenced in the `function` argument.
6136 * @param b An argument to be passed to the function referenced in the `function` argument.
6137 * @param c An argument to be passed to the function referenced in the `function` argument.
6138 * @param d An argument to be passed to the function referenced in the `function` argument.
6139 * @param e An argument to be passed to the function referenced in the `function` argument.
6140 * @param f An argument to be passed to the function referenced in the `function` argument.
6141 * @param g An argument to be passed to the function referenced in the `function` argument.
6142 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6143 * @since 1.4
6144 * @since 1.6
6145 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6146 * @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.
6147```html
6148<!doctype html>
6149<html lang="en">
6150<head>
6151 <meta charset="utf-8">
6152 <title>jQuery.proxy demo</title>
6153 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6154</head>
6155<body>
6156
6157<p><button type="button" id="test">Test</button></p>
6158<div id="log"></div>
6159
6160<script>
6161var me = {
6162 type: "zombie",
6163 test: function( event ) {
6164 // Without proxy, `this` would refer to the event target
6165 // use event.target to reference that element.
6166 var element = event.target;
6167 $( element ).css( "background-color", "red" );
6168
6169 // With proxy, `this` refers to the me object encapsulating
6170 // this function.
6171 $( "#log" ).append( "Hello " + this.type + "<br>" );
6172 $( "#test" ).off( "click", this.test );
6173 }
6174};
6175
6176var you = {
6177 type: "person",
6178 test: function( event ) {
6179 $( "#log" ).append( this.type + " " );
6180 }
6181};
6182
6183// Execute you.test() in the context of the `you` object
6184// no matter where it is called
6185// i.e. the `this` keyword will refer to `you`
6186var youClick = $.proxy( you.test, you );
6187
6188// attach click handlers to #test
6189$( "#test" )
6190 // this === "zombie"; handler unbound after first click
6191 .on( "click", $.proxy( me.test, me ) )
6192
6193 // this === "person"
6194 .on( "click", youClick )
6195
6196 // this === "zombie"
6197 .on( "click", $.proxy( you.test, me ) )
6198
6199 // this === "<button> element"
6200 .on( "click", you.test );
6201</script>
6202
6203</body>
6204</html>
6205```
6206 * @example ​ ````Change the context of a function bound to the click handler,
6207```html
6208<!doctype html>
6209<html lang="en">
6210<head>
6211 <meta charset="utf-8">
6212 <title>jQuery.proxy demo</title>
6213 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6214</head>
6215<body>
6216
6217<p><button type="button" id="test">Test</button></p>
6218<div id="log"></div>
6219
6220<script>
6221var me = {
6222 // I'm a dog
6223 type: "dog",
6224
6225 // Note that event comes *after* one and two
6226 test: function( one, two, event ) {
6227 $( "#log" )
6228
6229 // `one` maps to `you`, the 1st additional
6230 // argument in the $.proxy function call
6231 .append( "<h3>Hello " + one.type + ":</h3>" )
6232
6233 // The `this` keyword refers to `me`
6234 // (the 2nd, context, argument of $.proxy)
6235 .append( "I am a " + this.type + ", " )
6236
6237 // `two` maps to `they`, the 2nd additional
6238 // argument in the $.proxy function call
6239 .append( "and they are " + two.type + ".<br>" )
6240
6241 // The event type is "click"
6242 .append( "Thanks for " + event.type + "ing." )
6243
6244 // The clicked element is `event.target`,
6245 // and its type is "button"
6246 .append( "the " + event.target.type + "." );
6247 }
6248};
6249
6250var you = { type: "cat" };
6251var they = { type: "fish" };
6252
6253// Set up handler to execute me.test() in the context
6254// of `me`, with `you` and `they` as additional arguments
6255var proxy = $.proxy( me.test, me, you, they );
6256
6257$( "#test" )
6258 .on( "click", proxy );
6259</script>
6260
6261</body>
6262</html>
6263```
6264 */
6265 proxy<TContext,
6266 TReturn,
6267 A, B, C, D, E, F, G,
6268 T, U>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
6269 t: T, u: U) => TReturn,
6270 context: TContext,
6271 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U) => TReturn;
6272 /**
6273 * Takes a function and returns a new one that will always have a particular context.
6274 * @param funсtion The function whose context will be changed.
6275 * @param context The object to which the context (`this`) of the function should be set.
6276 * @param a An argument to be passed to the function referenced in the `function` argument.
6277 * @param b An argument to be passed to the function referenced in the `function` argument.
6278 * @param c An argument to be passed to the function referenced in the `function` argument.
6279 * @param d An argument to be passed to the function referenced in the `function` argument.
6280 * @param e An argument to be passed to the function referenced in the `function` argument.
6281 * @param f An argument to be passed to the function referenced in the `function` argument.
6282 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6283 * @since 1.4
6284 * @since 1.6
6285 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6286 * @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.
6287```html
6288<!doctype html>
6289<html lang="en">
6290<head>
6291 <meta charset="utf-8">
6292 <title>jQuery.proxy demo</title>
6293 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6294</head>
6295<body>
6296
6297<p><button type="button" id="test">Test</button></p>
6298<div id="log"></div>
6299
6300<script>
6301var me = {
6302 type: "zombie",
6303 test: function( event ) {
6304 // Without proxy, `this` would refer to the event target
6305 // use event.target to reference that element.
6306 var element = event.target;
6307 $( element ).css( "background-color", "red" );
6308
6309 // With proxy, `this` refers to the me object encapsulating
6310 // this function.
6311 $( "#log" ).append( "Hello " + this.type + "<br>" );
6312 $( "#test" ).off( "click", this.test );
6313 }
6314};
6315
6316var you = {
6317 type: "person",
6318 test: function( event ) {
6319 $( "#log" ).append( this.type + " " );
6320 }
6321};
6322
6323// Execute you.test() in the context of the `you` object
6324// no matter where it is called
6325// i.e. the `this` keyword will refer to `you`
6326var youClick = $.proxy( you.test, you );
6327
6328// attach click handlers to #test
6329$( "#test" )
6330 // this === "zombie"; handler unbound after first click
6331 .on( "click", $.proxy( me.test, me ) )
6332
6333 // this === "person"
6334 .on( "click", youClick )
6335
6336 // this === "zombie"
6337 .on( "click", $.proxy( you.test, me ) )
6338
6339 // this === "<button> element"
6340 .on( "click", you.test );
6341</script>
6342
6343</body>
6344</html>
6345```
6346 * @example ​ ````Change the context of a function bound to the click handler,
6347```html
6348<!doctype html>
6349<html lang="en">
6350<head>
6351 <meta charset="utf-8">
6352 <title>jQuery.proxy demo</title>
6353 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6354</head>
6355<body>
6356
6357<p><button type="button" id="test">Test</button></p>
6358<div id="log"></div>
6359
6360<script>
6361var me = {
6362 // I'm a dog
6363 type: "dog",
6364
6365 // Note that event comes *after* one and two
6366 test: function( one, two, event ) {
6367 $( "#log" )
6368
6369 // `one` maps to `you`, the 1st additional
6370 // argument in the $.proxy function call
6371 .append( "<h3>Hello " + one.type + ":</h3>" )
6372
6373 // The `this` keyword refers to `me`
6374 // (the 2nd, context, argument of $.proxy)
6375 .append( "I am a " + this.type + ", " )
6376
6377 // `two` maps to `they`, the 2nd additional
6378 // argument in the $.proxy function call
6379 .append( "and they are " + two.type + ".<br>" )
6380
6381 // The event type is "click"
6382 .append( "Thanks for " + event.type + "ing." )
6383
6384 // The clicked element is `event.target`,
6385 // and its type is "button"
6386 .append( "the " + event.target.type + "." );
6387 }
6388};
6389
6390var you = { type: "cat" };
6391var they = { type: "fish" };
6392
6393// Set up handler to execute me.test() in the context
6394// of `me`, with `you` and `they` as additional arguments
6395var proxy = $.proxy( me.test, me, you, they );
6396
6397$( "#test" )
6398 .on( "click", proxy );
6399</script>
6400
6401</body>
6402</html>
6403```
6404 */
6405 proxy<TContext,
6406 TReturn,
6407 A, B, C, D, E, F,
6408 T, U>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
6409 t: T, u: U) => TReturn,
6410 context: TContext,
6411 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U) => TReturn;
6412 /**
6413 * Takes a function and returns a new one that will always have a particular context.
6414 * @param funсtion The function whose context will be changed.
6415 * @param context The object to which the context (`this`) of the function should be set.
6416 * @param a An argument to be passed to the function referenced in the `function` argument.
6417 * @param b An argument to be passed to the function referenced in the `function` argument.
6418 * @param c An argument to be passed to the function referenced in the `function` argument.
6419 * @param d An argument to be passed to the function referenced in the `function` argument.
6420 * @param e An argument to be passed to the function referenced in the `function` argument.
6421 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6422 * @since 1.4
6423 * @since 1.6
6424 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6425 * @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.
6426```html
6427<!doctype html>
6428<html lang="en">
6429<head>
6430 <meta charset="utf-8">
6431 <title>jQuery.proxy demo</title>
6432 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6433</head>
6434<body>
6435
6436<p><button type="button" id="test">Test</button></p>
6437<div id="log"></div>
6438
6439<script>
6440var me = {
6441 type: "zombie",
6442 test: function( event ) {
6443 // Without proxy, `this` would refer to the event target
6444 // use event.target to reference that element.
6445 var element = event.target;
6446 $( element ).css( "background-color", "red" );
6447
6448 // With proxy, `this` refers to the me object encapsulating
6449 // this function.
6450 $( "#log" ).append( "Hello " + this.type + "<br>" );
6451 $( "#test" ).off( "click", this.test );
6452 }
6453};
6454
6455var you = {
6456 type: "person",
6457 test: function( event ) {
6458 $( "#log" ).append( this.type + " " );
6459 }
6460};
6461
6462// Execute you.test() in the context of the `you` object
6463// no matter where it is called
6464// i.e. the `this` keyword will refer to `you`
6465var youClick = $.proxy( you.test, you );
6466
6467// attach click handlers to #test
6468$( "#test" )
6469 // this === "zombie"; handler unbound after first click
6470 .on( "click", $.proxy( me.test, me ) )
6471
6472 // this === "person"
6473 .on( "click", youClick )
6474
6475 // this === "zombie"
6476 .on( "click", $.proxy( you.test, me ) )
6477
6478 // this === "<button> element"
6479 .on( "click", you.test );
6480</script>
6481
6482</body>
6483</html>
6484```
6485 * @example ​ ````Change the context of a function bound to the click handler,
6486```html
6487<!doctype html>
6488<html lang="en">
6489<head>
6490 <meta charset="utf-8">
6491 <title>jQuery.proxy demo</title>
6492 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6493</head>
6494<body>
6495
6496<p><button type="button" id="test">Test</button></p>
6497<div id="log"></div>
6498
6499<script>
6500var me = {
6501 // I'm a dog
6502 type: "dog",
6503
6504 // Note that event comes *after* one and two
6505 test: function( one, two, event ) {
6506 $( "#log" )
6507
6508 // `one` maps to `you`, the 1st additional
6509 // argument in the $.proxy function call
6510 .append( "<h3>Hello " + one.type + ":</h3>" )
6511
6512 // The `this` keyword refers to `me`
6513 // (the 2nd, context, argument of $.proxy)
6514 .append( "I am a " + this.type + ", " )
6515
6516 // `two` maps to `they`, the 2nd additional
6517 // argument in the $.proxy function call
6518 .append( "and they are " + two.type + ".<br>" )
6519
6520 // The event type is "click"
6521 .append( "Thanks for " + event.type + "ing." )
6522
6523 // The clicked element is `event.target`,
6524 // and its type is "button"
6525 .append( "the " + event.target.type + "." );
6526 }
6527};
6528
6529var you = { type: "cat" };
6530var they = { type: "fish" };
6531
6532// Set up handler to execute me.test() in the context
6533// of `me`, with `you` and `they` as additional arguments
6534var proxy = $.proxy( me.test, me, you, they );
6535
6536$( "#test" )
6537 .on( "click", proxy );
6538</script>
6539
6540</body>
6541</html>
6542```
6543 */
6544 proxy<TContext,
6545 TReturn,
6546 A, B, C, D, E,
6547 T, U>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
6548 t: T, u: U) => TReturn,
6549 context: TContext,
6550 a: A, b: B, c: C, d: D, e: E): (t: T, u: U) => TReturn;
6551 /**
6552 * Takes a function and returns a new one that will always have a particular context.
6553 * @param funсtion The function whose context will be changed.
6554 * @param context The object to which the context (`this`) of the function should be set.
6555 * @param a An argument to be passed to the function referenced in the `function` argument.
6556 * @param b An argument to be passed to the function referenced in the `function` argument.
6557 * @param c An argument to be passed to the function referenced in the `function` argument.
6558 * @param d An argument to be passed to the function referenced in the `function` argument.
6559 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6560 * @since 1.4
6561 * @since 1.6
6562 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6563 * @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.
6564```html
6565<!doctype html>
6566<html lang="en">
6567<head>
6568 <meta charset="utf-8">
6569 <title>jQuery.proxy demo</title>
6570 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6571</head>
6572<body>
6573
6574<p><button type="button" id="test">Test</button></p>
6575<div id="log"></div>
6576
6577<script>
6578var me = {
6579 type: "zombie",
6580 test: function( event ) {
6581 // Without proxy, `this` would refer to the event target
6582 // use event.target to reference that element.
6583 var element = event.target;
6584 $( element ).css( "background-color", "red" );
6585
6586 // With proxy, `this` refers to the me object encapsulating
6587 // this function.
6588 $( "#log" ).append( "Hello " + this.type + "<br>" );
6589 $( "#test" ).off( "click", this.test );
6590 }
6591};
6592
6593var you = {
6594 type: "person",
6595 test: function( event ) {
6596 $( "#log" ).append( this.type + " " );
6597 }
6598};
6599
6600// Execute you.test() in the context of the `you` object
6601// no matter where it is called
6602// i.e. the `this` keyword will refer to `you`
6603var youClick = $.proxy( you.test, you );
6604
6605// attach click handlers to #test
6606$( "#test" )
6607 // this === "zombie"; handler unbound after first click
6608 .on( "click", $.proxy( me.test, me ) )
6609
6610 // this === "person"
6611 .on( "click", youClick )
6612
6613 // this === "zombie"
6614 .on( "click", $.proxy( you.test, me ) )
6615
6616 // this === "<button> element"
6617 .on( "click", you.test );
6618</script>
6619
6620</body>
6621</html>
6622```
6623 * @example ​ ````Change the context of a function bound to the click handler,
6624```html
6625<!doctype html>
6626<html lang="en">
6627<head>
6628 <meta charset="utf-8">
6629 <title>jQuery.proxy demo</title>
6630 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6631</head>
6632<body>
6633
6634<p><button type="button" id="test">Test</button></p>
6635<div id="log"></div>
6636
6637<script>
6638var me = {
6639 // I'm a dog
6640 type: "dog",
6641
6642 // Note that event comes *after* one and two
6643 test: function( one, two, event ) {
6644 $( "#log" )
6645
6646 // `one` maps to `you`, the 1st additional
6647 // argument in the $.proxy function call
6648 .append( "<h3>Hello " + one.type + ":</h3>" )
6649
6650 // The `this` keyword refers to `me`
6651 // (the 2nd, context, argument of $.proxy)
6652 .append( "I am a " + this.type + ", " )
6653
6654 // `two` maps to `they`, the 2nd additional
6655 // argument in the $.proxy function call
6656 .append( "and they are " + two.type + ".<br>" )
6657
6658 // The event type is "click"
6659 .append( "Thanks for " + event.type + "ing." )
6660
6661 // The clicked element is `event.target`,
6662 // and its type is "button"
6663 .append( "the " + event.target.type + "." );
6664 }
6665};
6666
6667var you = { type: "cat" };
6668var they = { type: "fish" };
6669
6670// Set up handler to execute me.test() in the context
6671// of `me`, with `you` and `they` as additional arguments
6672var proxy = $.proxy( me.test, me, you, they );
6673
6674$( "#test" )
6675 .on( "click", proxy );
6676</script>
6677
6678</body>
6679</html>
6680```
6681 */
6682 proxy<TContext,
6683 TReturn,
6684 A, B, C, D,
6685 T, U>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
6686 t: T, u: U) => TReturn,
6687 context: TContext,
6688 a: A, b: B, c: C, d: D): (t: T, u: U) => TReturn;
6689 /**
6690 * Takes a function and returns a new one that will always have a particular context.
6691 * @param funсtion The function whose context will be changed.
6692 * @param context The object to which the context (`this`) of the function should be set.
6693 * @param a An argument to be passed to the function referenced in the `function` argument.
6694 * @param b An argument to be passed to the function referenced in the `function` argument.
6695 * @param c An argument to be passed to the function referenced in the `function` argument.
6696 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6697 * @since 1.4
6698 * @since 1.6
6699 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6700 * @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.
6701```html
6702<!doctype html>
6703<html lang="en">
6704<head>
6705 <meta charset="utf-8">
6706 <title>jQuery.proxy demo</title>
6707 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6708</head>
6709<body>
6710
6711<p><button type="button" id="test">Test</button></p>
6712<div id="log"></div>
6713
6714<script>
6715var me = {
6716 type: "zombie",
6717 test: function( event ) {
6718 // Without proxy, `this` would refer to the event target
6719 // use event.target to reference that element.
6720 var element = event.target;
6721 $( element ).css( "background-color", "red" );
6722
6723 // With proxy, `this` refers to the me object encapsulating
6724 // this function.
6725 $( "#log" ).append( "Hello " + this.type + "<br>" );
6726 $( "#test" ).off( "click", this.test );
6727 }
6728};
6729
6730var you = {
6731 type: "person",
6732 test: function( event ) {
6733 $( "#log" ).append( this.type + " " );
6734 }
6735};
6736
6737// Execute you.test() in the context of the `you` object
6738// no matter where it is called
6739// i.e. the `this` keyword will refer to `you`
6740var youClick = $.proxy( you.test, you );
6741
6742// attach click handlers to #test
6743$( "#test" )
6744 // this === "zombie"; handler unbound after first click
6745 .on( "click", $.proxy( me.test, me ) )
6746
6747 // this === "person"
6748 .on( "click", youClick )
6749
6750 // this === "zombie"
6751 .on( "click", $.proxy( you.test, me ) )
6752
6753 // this === "<button> element"
6754 .on( "click", you.test );
6755</script>
6756
6757</body>
6758</html>
6759```
6760 * @example ​ ````Change the context of a function bound to the click handler,
6761```html
6762<!doctype html>
6763<html lang="en">
6764<head>
6765 <meta charset="utf-8">
6766 <title>jQuery.proxy demo</title>
6767 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6768</head>
6769<body>
6770
6771<p><button type="button" id="test">Test</button></p>
6772<div id="log"></div>
6773
6774<script>
6775var me = {
6776 // I'm a dog
6777 type: "dog",
6778
6779 // Note that event comes *after* one and two
6780 test: function( one, two, event ) {
6781 $( "#log" )
6782
6783 // `one` maps to `you`, the 1st additional
6784 // argument in the $.proxy function call
6785 .append( "<h3>Hello " + one.type + ":</h3>" )
6786
6787 // The `this` keyword refers to `me`
6788 // (the 2nd, context, argument of $.proxy)
6789 .append( "I am a " + this.type + ", " )
6790
6791 // `two` maps to `they`, the 2nd additional
6792 // argument in the $.proxy function call
6793 .append( "and they are " + two.type + ".<br>" )
6794
6795 // The event type is "click"
6796 .append( "Thanks for " + event.type + "ing." )
6797
6798 // The clicked element is `event.target`,
6799 // and its type is "button"
6800 .append( "the " + event.target.type + "." );
6801 }
6802};
6803
6804var you = { type: "cat" };
6805var they = { type: "fish" };
6806
6807// Set up handler to execute me.test() in the context
6808// of `me`, with `you` and `they` as additional arguments
6809var proxy = $.proxy( me.test, me, you, they );
6810
6811$( "#test" )
6812 .on( "click", proxy );
6813</script>
6814
6815</body>
6816</html>
6817```
6818 */
6819 proxy<TContext,
6820 TReturn,
6821 A, B, C,
6822 T, U>(funсtion: (this: TContext, a: A, b: B, c: C,
6823 t: T, u: U) => TReturn,
6824 context: TContext,
6825 a: A, b: B, c: C): (t: T, u: U) => TReturn;
6826 /**
6827 * Takes a function and returns a new one that will always have a particular context.
6828 * @param funсtion The function whose context will be changed.
6829 * @param context The object to which the context (`this`) of the function should be set.
6830 * @param a An argument to be passed to the function referenced in the `function` argument.
6831 * @param b An argument to be passed to the function referenced in the `function` argument.
6832 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6833 * @since 1.4
6834 * @since 1.6
6835 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6836 * @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.
6837```html
6838<!doctype html>
6839<html lang="en">
6840<head>
6841 <meta charset="utf-8">
6842 <title>jQuery.proxy demo</title>
6843 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6844</head>
6845<body>
6846
6847<p><button type="button" id="test">Test</button></p>
6848<div id="log"></div>
6849
6850<script>
6851var me = {
6852 type: "zombie",
6853 test: function( event ) {
6854 // Without proxy, `this` would refer to the event target
6855 // use event.target to reference that element.
6856 var element = event.target;
6857 $( element ).css( "background-color", "red" );
6858
6859 // With proxy, `this` refers to the me object encapsulating
6860 // this function.
6861 $( "#log" ).append( "Hello " + this.type + "<br>" );
6862 $( "#test" ).off( "click", this.test );
6863 }
6864};
6865
6866var you = {
6867 type: "person",
6868 test: function( event ) {
6869 $( "#log" ).append( this.type + " " );
6870 }
6871};
6872
6873// Execute you.test() in the context of the `you` object
6874// no matter where it is called
6875// i.e. the `this` keyword will refer to `you`
6876var youClick = $.proxy( you.test, you );
6877
6878// attach click handlers to #test
6879$( "#test" )
6880 // this === "zombie"; handler unbound after first click
6881 .on( "click", $.proxy( me.test, me ) )
6882
6883 // this === "person"
6884 .on( "click", youClick )
6885
6886 // this === "zombie"
6887 .on( "click", $.proxy( you.test, me ) )
6888
6889 // this === "<button> element"
6890 .on( "click", you.test );
6891</script>
6892
6893</body>
6894</html>
6895```
6896 * @example ​ ````Change the context of a function bound to the click handler,
6897```html
6898<!doctype html>
6899<html lang="en">
6900<head>
6901 <meta charset="utf-8">
6902 <title>jQuery.proxy demo</title>
6903 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6904</head>
6905<body>
6906
6907<p><button type="button" id="test">Test</button></p>
6908<div id="log"></div>
6909
6910<script>
6911var me = {
6912 // I'm a dog
6913 type: "dog",
6914
6915 // Note that event comes *after* one and two
6916 test: function( one, two, event ) {
6917 $( "#log" )
6918
6919 // `one` maps to `you`, the 1st additional
6920 // argument in the $.proxy function call
6921 .append( "<h3>Hello " + one.type + ":</h3>" )
6922
6923 // The `this` keyword refers to `me`
6924 // (the 2nd, context, argument of $.proxy)
6925 .append( "I am a " + this.type + ", " )
6926
6927 // `two` maps to `they`, the 2nd additional
6928 // argument in the $.proxy function call
6929 .append( "and they are " + two.type + ".<br>" )
6930
6931 // The event type is "click"
6932 .append( "Thanks for " + event.type + "ing." )
6933
6934 // The clicked element is `event.target`,
6935 // and its type is "button"
6936 .append( "the " + event.target.type + "." );
6937 }
6938};
6939
6940var you = { type: "cat" };
6941var they = { type: "fish" };
6942
6943// Set up handler to execute me.test() in the context
6944// of `me`, with `you` and `they` as additional arguments
6945var proxy = $.proxy( me.test, me, you, they );
6946
6947$( "#test" )
6948 .on( "click", proxy );
6949</script>
6950
6951</body>
6952</html>
6953```
6954 */
6955 proxy<TContext,
6956 TReturn,
6957 A, B,
6958 T, U>(funсtion: (this: TContext, a: A, b: B,
6959 t: T, u: U) => TReturn,
6960 context: TContext,
6961 a: A, b: B): (t: T, u: U) => TReturn;
6962 /**
6963 * Takes a function and returns a new one that will always have a particular context.
6964 * @param funсtion The function whose context will be changed.
6965 * @param context The object to which the context (`this`) of the function should be set.
6966 * @param a An argument to be passed to the function referenced in the `function` argument.
6967 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
6968 * @since 1.4
6969 * @since 1.6
6970 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
6971 * @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.
6972```html
6973<!doctype html>
6974<html lang="en">
6975<head>
6976 <meta charset="utf-8">
6977 <title>jQuery.proxy demo</title>
6978 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
6979</head>
6980<body>
6981
6982<p><button type="button" id="test">Test</button></p>
6983<div id="log"></div>
6984
6985<script>
6986var me = {
6987 type: "zombie",
6988 test: function( event ) {
6989 // Without proxy, `this` would refer to the event target
6990 // use event.target to reference that element.
6991 var element = event.target;
6992 $( element ).css( "background-color", "red" );
6993
6994 // With proxy, `this` refers to the me object encapsulating
6995 // this function.
6996 $( "#log" ).append( "Hello " + this.type + "<br>" );
6997 $( "#test" ).off( "click", this.test );
6998 }
6999};
7000
7001var you = {
7002 type: "person",
7003 test: function( event ) {
7004 $( "#log" ).append( this.type + " " );
7005 }
7006};
7007
7008// Execute you.test() in the context of the `you` object
7009// no matter where it is called
7010// i.e. the `this` keyword will refer to `you`
7011var youClick = $.proxy( you.test, you );
7012
7013// attach click handlers to #test
7014$( "#test" )
7015 // this === "zombie"; handler unbound after first click
7016 .on( "click", $.proxy( me.test, me ) )
7017
7018 // this === "person"
7019 .on( "click", youClick )
7020
7021 // this === "zombie"
7022 .on( "click", $.proxy( you.test, me ) )
7023
7024 // this === "<button> element"
7025 .on( "click", you.test );
7026</script>
7027
7028</body>
7029</html>
7030```
7031 * @example ​ ````Change the context of a function bound to the click handler,
7032```html
7033<!doctype html>
7034<html lang="en">
7035<head>
7036 <meta charset="utf-8">
7037 <title>jQuery.proxy demo</title>
7038 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7039</head>
7040<body>
7041
7042<p><button type="button" id="test">Test</button></p>
7043<div id="log"></div>
7044
7045<script>
7046var me = {
7047 // I'm a dog
7048 type: "dog",
7049
7050 // Note that event comes *after* one and two
7051 test: function( one, two, event ) {
7052 $( "#log" )
7053
7054 // `one` maps to `you`, the 1st additional
7055 // argument in the $.proxy function call
7056 .append( "<h3>Hello " + one.type + ":</h3>" )
7057
7058 // The `this` keyword refers to `me`
7059 // (the 2nd, context, argument of $.proxy)
7060 .append( "I am a " + this.type + ", " )
7061
7062 // `two` maps to `they`, the 2nd additional
7063 // argument in the $.proxy function call
7064 .append( "and they are " + two.type + ".<br>" )
7065
7066 // The event type is "click"
7067 .append( "Thanks for " + event.type + "ing." )
7068
7069 // The clicked element is `event.target`,
7070 // and its type is "button"
7071 .append( "the " + event.target.type + "." );
7072 }
7073};
7074
7075var you = { type: "cat" };
7076var they = { type: "fish" };
7077
7078// Set up handler to execute me.test() in the context
7079// of `me`, with `you` and `they` as additional arguments
7080var proxy = $.proxy( me.test, me, you, they );
7081
7082$( "#test" )
7083 .on( "click", proxy );
7084</script>
7085
7086</body>
7087</html>
7088```
7089 */
7090 proxy<TContext,
7091 TReturn,
7092 A,
7093 T, U>(funсtion: (this: TContext, a: A,
7094 t: T, u: U) => TReturn,
7095 context: TContext,
7096 a: A): (t: T, u: U) => TReturn;
7097 /**
7098 * Takes a function and returns a new one that will always have a particular context.
7099 * @param funсtion The function whose context will be changed.
7100 * @param context The object to which the context (`this`) of the function should be set.
7101 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7102 * @since 1.4
7103 * @since 1.6
7104 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7105 * @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.
7106```html
7107<!doctype html>
7108<html lang="en">
7109<head>
7110 <meta charset="utf-8">
7111 <title>jQuery.proxy demo</title>
7112 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7113</head>
7114<body>
7115
7116<p><button type="button" id="test">Test</button></p>
7117<div id="log"></div>
7118
7119<script>
7120var me = {
7121 type: "zombie",
7122 test: function( event ) {
7123 // Without proxy, `this` would refer to the event target
7124 // use event.target to reference that element.
7125 var element = event.target;
7126 $( element ).css( "background-color", "red" );
7127
7128 // With proxy, `this` refers to the me object encapsulating
7129 // this function.
7130 $( "#log" ).append( "Hello " + this.type + "<br>" );
7131 $( "#test" ).off( "click", this.test );
7132 }
7133};
7134
7135var you = {
7136 type: "person",
7137 test: function( event ) {
7138 $( "#log" ).append( this.type + " " );
7139 }
7140};
7141
7142// Execute you.test() in the context of the `you` object
7143// no matter where it is called
7144// i.e. the `this` keyword will refer to `you`
7145var youClick = $.proxy( you.test, you );
7146
7147// attach click handlers to #test
7148$( "#test" )
7149 // this === "zombie"; handler unbound after first click
7150 .on( "click", $.proxy( me.test, me ) )
7151
7152 // this === "person"
7153 .on( "click", youClick )
7154
7155 // this === "zombie"
7156 .on( "click", $.proxy( you.test, me ) )
7157
7158 // this === "<button> element"
7159 .on( "click", you.test );
7160</script>
7161
7162</body>
7163</html>
7164```
7165 * @example ​ ````Change the context of a function bound to the click handler,
7166```html
7167<!doctype html>
7168<html lang="en">
7169<head>
7170 <meta charset="utf-8">
7171 <title>jQuery.proxy demo</title>
7172 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7173</head>
7174<body>
7175
7176<p><button type="button" id="test">Test</button></p>
7177<div id="log"></div>
7178
7179<script>
7180var me = {
7181 // I'm a dog
7182 type: "dog",
7183
7184 // Note that event comes *after* one and two
7185 test: function( one, two, event ) {
7186 $( "#log" )
7187
7188 // `one` maps to `you`, the 1st additional
7189 // argument in the $.proxy function call
7190 .append( "<h3>Hello " + one.type + ":</h3>" )
7191
7192 // The `this` keyword refers to `me`
7193 // (the 2nd, context, argument of $.proxy)
7194 .append( "I am a " + this.type + ", " )
7195
7196 // `two` maps to `they`, the 2nd additional
7197 // argument in the $.proxy function call
7198 .append( "and they are " + two.type + ".<br>" )
7199
7200 // The event type is "click"
7201 .append( "Thanks for " + event.type + "ing." )
7202
7203 // The clicked element is `event.target`,
7204 // and its type is "button"
7205 .append( "the " + event.target.type + "." );
7206 }
7207};
7208
7209var you = { type: "cat" };
7210var they = { type: "fish" };
7211
7212// Set up handler to execute me.test() in the context
7213// of `me`, with `you` and `they` as additional arguments
7214var proxy = $.proxy( me.test, me, you, they );
7215
7216$( "#test" )
7217 .on( "click", proxy );
7218</script>
7219
7220</body>
7221</html>
7222```
7223 */
7224 proxy<TContext,
7225 TReturn,
7226 T, U>(funсtion: (this: TContext, t: T, u: U) => TReturn,
7227 context: TContext): (t: T, u: U) => TReturn;
7228
7229 // #endregion
7230
7231 // region 3 parameters
7232 // #region 3 parameters
7233
7234 /**
7235 * Takes a function and returns a new one that will always have a particular context.
7236 * @param funсtion The function whose context will be changed.
7237 * @param context The object to which the context (`this`) of the function should be set.
7238 * @param a An argument to be passed to the function referenced in the `function` argument.
7239 * @param b An argument to be passed to the function referenced in the `function` argument.
7240 * @param c An argument to be passed to the function referenced in the `function` argument.
7241 * @param d An argument to be passed to the function referenced in the `function` argument.
7242 * @param e An argument to be passed to the function referenced in the `function` argument.
7243 * @param f An argument to be passed to the function referenced in the `function` argument.
7244 * @param g An argument to be passed to the function referenced in the `function` argument.
7245 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7246 * @since 1.4
7247 * @since 1.6
7248 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7249 * @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.
7250```html
7251<!doctype html>
7252<html lang="en">
7253<head>
7254 <meta charset="utf-8">
7255 <title>jQuery.proxy demo</title>
7256 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7257</head>
7258<body>
7259
7260<p><button type="button" id="test">Test</button></p>
7261<div id="log"></div>
7262
7263<script>
7264var me = {
7265 type: "zombie",
7266 test: function( event ) {
7267 // Without proxy, `this` would refer to the event target
7268 // use event.target to reference that element.
7269 var element = event.target;
7270 $( element ).css( "background-color", "red" );
7271
7272 // With proxy, `this` refers to the me object encapsulating
7273 // this function.
7274 $( "#log" ).append( "Hello " + this.type + "<br>" );
7275 $( "#test" ).off( "click", this.test );
7276 }
7277};
7278
7279var you = {
7280 type: "person",
7281 test: function( event ) {
7282 $( "#log" ).append( this.type + " " );
7283 }
7284};
7285
7286// Execute you.test() in the context of the `you` object
7287// no matter where it is called
7288// i.e. the `this` keyword will refer to `you`
7289var youClick = $.proxy( you.test, you );
7290
7291// attach click handlers to #test
7292$( "#test" )
7293 // this === "zombie"; handler unbound after first click
7294 .on( "click", $.proxy( me.test, me ) )
7295
7296 // this === "person"
7297 .on( "click", youClick )
7298
7299 // this === "zombie"
7300 .on( "click", $.proxy( you.test, me ) )
7301
7302 // this === "<button> element"
7303 .on( "click", you.test );
7304</script>
7305
7306</body>
7307</html>
7308```
7309 * @example ​ ````Change the context of a function bound to the click handler,
7310```html
7311<!doctype html>
7312<html lang="en">
7313<head>
7314 <meta charset="utf-8">
7315 <title>jQuery.proxy demo</title>
7316 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7317</head>
7318<body>
7319
7320<p><button type="button" id="test">Test</button></p>
7321<div id="log"></div>
7322
7323<script>
7324var me = {
7325 // I'm a dog
7326 type: "dog",
7327
7328 // Note that event comes *after* one and two
7329 test: function( one, two, event ) {
7330 $( "#log" )
7331
7332 // `one` maps to `you`, the 1st additional
7333 // argument in the $.proxy function call
7334 .append( "<h3>Hello " + one.type + ":</h3>" )
7335
7336 // The `this` keyword refers to `me`
7337 // (the 2nd, context, argument of $.proxy)
7338 .append( "I am a " + this.type + ", " )
7339
7340 // `two` maps to `they`, the 2nd additional
7341 // argument in the $.proxy function call
7342 .append( "and they are " + two.type + ".<br>" )
7343
7344 // The event type is "click"
7345 .append( "Thanks for " + event.type + "ing." )
7346
7347 // The clicked element is `event.target`,
7348 // and its type is "button"
7349 .append( "the " + event.target.type + "." );
7350 }
7351};
7352
7353var you = { type: "cat" };
7354var they = { type: "fish" };
7355
7356// Set up handler to execute me.test() in the context
7357// of `me`, with `you` and `they` as additional arguments
7358var proxy = $.proxy( me.test, me, you, they );
7359
7360$( "#test" )
7361 .on( "click", proxy );
7362</script>
7363
7364</body>
7365</html>
7366```
7367 */
7368 proxy<TContext,
7369 TReturn,
7370 A, B, C, D, E, F, G,
7371 T, U, V>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
7372 t: T, u: U, v: V) => TReturn,
7373 context: TContext,
7374 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V) => TReturn;
7375 /**
7376 * Takes a function and returns a new one that will always have a particular context.
7377 * @param funсtion The function whose context will be changed.
7378 * @param context The object to which the context (`this`) of the function should be set.
7379 * @param a An argument to be passed to the function referenced in the `function` argument.
7380 * @param b An argument to be passed to the function referenced in the `function` argument.
7381 * @param c An argument to be passed to the function referenced in the `function` argument.
7382 * @param d An argument to be passed to the function referenced in the `function` argument.
7383 * @param e An argument to be passed to the function referenced in the `function` argument.
7384 * @param f An argument to be passed to the function referenced in the `function` argument.
7385 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7386 * @since 1.4
7387 * @since 1.6
7388 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7389 * @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.
7390```html
7391<!doctype html>
7392<html lang="en">
7393<head>
7394 <meta charset="utf-8">
7395 <title>jQuery.proxy demo</title>
7396 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7397</head>
7398<body>
7399
7400<p><button type="button" id="test">Test</button></p>
7401<div id="log"></div>
7402
7403<script>
7404var me = {
7405 type: "zombie",
7406 test: function( event ) {
7407 // Without proxy, `this` would refer to the event target
7408 // use event.target to reference that element.
7409 var element = event.target;
7410 $( element ).css( "background-color", "red" );
7411
7412 // With proxy, `this` refers to the me object encapsulating
7413 // this function.
7414 $( "#log" ).append( "Hello " + this.type + "<br>" );
7415 $( "#test" ).off( "click", this.test );
7416 }
7417};
7418
7419var you = {
7420 type: "person",
7421 test: function( event ) {
7422 $( "#log" ).append( this.type + " " );
7423 }
7424};
7425
7426// Execute you.test() in the context of the `you` object
7427// no matter where it is called
7428// i.e. the `this` keyword will refer to `you`
7429var youClick = $.proxy( you.test, you );
7430
7431// attach click handlers to #test
7432$( "#test" )
7433 // this === "zombie"; handler unbound after first click
7434 .on( "click", $.proxy( me.test, me ) )
7435
7436 // this === "person"
7437 .on( "click", youClick )
7438
7439 // this === "zombie"
7440 .on( "click", $.proxy( you.test, me ) )
7441
7442 // this === "<button> element"
7443 .on( "click", you.test );
7444</script>
7445
7446</body>
7447</html>
7448```
7449 * @example ​ ````Change the context of a function bound to the click handler,
7450```html
7451<!doctype html>
7452<html lang="en">
7453<head>
7454 <meta charset="utf-8">
7455 <title>jQuery.proxy demo</title>
7456 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7457</head>
7458<body>
7459
7460<p><button type="button" id="test">Test</button></p>
7461<div id="log"></div>
7462
7463<script>
7464var me = {
7465 // I'm a dog
7466 type: "dog",
7467
7468 // Note that event comes *after* one and two
7469 test: function( one, two, event ) {
7470 $( "#log" )
7471
7472 // `one` maps to `you`, the 1st additional
7473 // argument in the $.proxy function call
7474 .append( "<h3>Hello " + one.type + ":</h3>" )
7475
7476 // The `this` keyword refers to `me`
7477 // (the 2nd, context, argument of $.proxy)
7478 .append( "I am a " + this.type + ", " )
7479
7480 // `two` maps to `they`, the 2nd additional
7481 // argument in the $.proxy function call
7482 .append( "and they are " + two.type + ".<br>" )
7483
7484 // The event type is "click"
7485 .append( "Thanks for " + event.type + "ing." )
7486
7487 // The clicked element is `event.target`,
7488 // and its type is "button"
7489 .append( "the " + event.target.type + "." );
7490 }
7491};
7492
7493var you = { type: "cat" };
7494var they = { type: "fish" };
7495
7496// Set up handler to execute me.test() in the context
7497// of `me`, with `you` and `they` as additional arguments
7498var proxy = $.proxy( me.test, me, you, they );
7499
7500$( "#test" )
7501 .on( "click", proxy );
7502</script>
7503
7504</body>
7505</html>
7506```
7507 */
7508 proxy<TContext,
7509 TReturn,
7510 A, B, C, D, E, F,
7511 T, U, V>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
7512 t: T, u: U, v: V) => TReturn,
7513 context: TContext,
7514 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V) => TReturn;
7515 /**
7516 * Takes a function and returns a new one that will always have a particular context.
7517 * @param funсtion The function whose context will be changed.
7518 * @param context The object to which the context (`this`) of the function should be set.
7519 * @param a An argument to be passed to the function referenced in the `function` argument.
7520 * @param b An argument to be passed to the function referenced in the `function` argument.
7521 * @param c An argument to be passed to the function referenced in the `function` argument.
7522 * @param d An argument to be passed to the function referenced in the `function` argument.
7523 * @param e An argument to be passed to the function referenced in the `function` argument.
7524 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7525 * @since 1.4
7526 * @since 1.6
7527 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7528 * @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.
7529```html
7530<!doctype html>
7531<html lang="en">
7532<head>
7533 <meta charset="utf-8">
7534 <title>jQuery.proxy demo</title>
7535 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7536</head>
7537<body>
7538
7539<p><button type="button" id="test">Test</button></p>
7540<div id="log"></div>
7541
7542<script>
7543var me = {
7544 type: "zombie",
7545 test: function( event ) {
7546 // Without proxy, `this` would refer to the event target
7547 // use event.target to reference that element.
7548 var element = event.target;
7549 $( element ).css( "background-color", "red" );
7550
7551 // With proxy, `this` refers to the me object encapsulating
7552 // this function.
7553 $( "#log" ).append( "Hello " + this.type + "<br>" );
7554 $( "#test" ).off( "click", this.test );
7555 }
7556};
7557
7558var you = {
7559 type: "person",
7560 test: function( event ) {
7561 $( "#log" ).append( this.type + " " );
7562 }
7563};
7564
7565// Execute you.test() in the context of the `you` object
7566// no matter where it is called
7567// i.e. the `this` keyword will refer to `you`
7568var youClick = $.proxy( you.test, you );
7569
7570// attach click handlers to #test
7571$( "#test" )
7572 // this === "zombie"; handler unbound after first click
7573 .on( "click", $.proxy( me.test, me ) )
7574
7575 // this === "person"
7576 .on( "click", youClick )
7577
7578 // this === "zombie"
7579 .on( "click", $.proxy( you.test, me ) )
7580
7581 // this === "<button> element"
7582 .on( "click", you.test );
7583</script>
7584
7585</body>
7586</html>
7587```
7588 * @example ​ ````Change the context of a function bound to the click handler,
7589```html
7590<!doctype html>
7591<html lang="en">
7592<head>
7593 <meta charset="utf-8">
7594 <title>jQuery.proxy demo</title>
7595 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7596</head>
7597<body>
7598
7599<p><button type="button" id="test">Test</button></p>
7600<div id="log"></div>
7601
7602<script>
7603var me = {
7604 // I'm a dog
7605 type: "dog",
7606
7607 // Note that event comes *after* one and two
7608 test: function( one, two, event ) {
7609 $( "#log" )
7610
7611 // `one` maps to `you`, the 1st additional
7612 // argument in the $.proxy function call
7613 .append( "<h3>Hello " + one.type + ":</h3>" )
7614
7615 // The `this` keyword refers to `me`
7616 // (the 2nd, context, argument of $.proxy)
7617 .append( "I am a " + this.type + ", " )
7618
7619 // `two` maps to `they`, the 2nd additional
7620 // argument in the $.proxy function call
7621 .append( "and they are " + two.type + ".<br>" )
7622
7623 // The event type is "click"
7624 .append( "Thanks for " + event.type + "ing." )
7625
7626 // The clicked element is `event.target`,
7627 // and its type is "button"
7628 .append( "the " + event.target.type + "." );
7629 }
7630};
7631
7632var you = { type: "cat" };
7633var they = { type: "fish" };
7634
7635// Set up handler to execute me.test() in the context
7636// of `me`, with `you` and `they` as additional arguments
7637var proxy = $.proxy( me.test, me, you, they );
7638
7639$( "#test" )
7640 .on( "click", proxy );
7641</script>
7642
7643</body>
7644</html>
7645```
7646 */
7647 proxy<TContext,
7648 TReturn,
7649 A, B, C, D, E,
7650 T, U, V>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
7651 t: T, u: U, v: V) => TReturn,
7652 context: TContext,
7653 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V) => TReturn;
7654 /**
7655 * Takes a function and returns a new one that will always have a particular context.
7656 * @param funсtion The function whose context will be changed.
7657 * @param context The object to which the context (`this`) of the function should be set.
7658 * @param a An argument to be passed to the function referenced in the `function` argument.
7659 * @param b An argument to be passed to the function referenced in the `function` argument.
7660 * @param c An argument to be passed to the function referenced in the `function` argument.
7661 * @param d An argument to be passed to the function referenced in the `function` argument.
7662 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7663 * @since 1.4
7664 * @since 1.6
7665 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7666 * @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.
7667```html
7668<!doctype html>
7669<html lang="en">
7670<head>
7671 <meta charset="utf-8">
7672 <title>jQuery.proxy demo</title>
7673 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7674</head>
7675<body>
7676
7677<p><button type="button" id="test">Test</button></p>
7678<div id="log"></div>
7679
7680<script>
7681var me = {
7682 type: "zombie",
7683 test: function( event ) {
7684 // Without proxy, `this` would refer to the event target
7685 // use event.target to reference that element.
7686 var element = event.target;
7687 $( element ).css( "background-color", "red" );
7688
7689 // With proxy, `this` refers to the me object encapsulating
7690 // this function.
7691 $( "#log" ).append( "Hello " + this.type + "<br>" );
7692 $( "#test" ).off( "click", this.test );
7693 }
7694};
7695
7696var you = {
7697 type: "person",
7698 test: function( event ) {
7699 $( "#log" ).append( this.type + " " );
7700 }
7701};
7702
7703// Execute you.test() in the context of the `you` object
7704// no matter where it is called
7705// i.e. the `this` keyword will refer to `you`
7706var youClick = $.proxy( you.test, you );
7707
7708// attach click handlers to #test
7709$( "#test" )
7710 // this === "zombie"; handler unbound after first click
7711 .on( "click", $.proxy( me.test, me ) )
7712
7713 // this === "person"
7714 .on( "click", youClick )
7715
7716 // this === "zombie"
7717 .on( "click", $.proxy( you.test, me ) )
7718
7719 // this === "<button> element"
7720 .on( "click", you.test );
7721</script>
7722
7723</body>
7724</html>
7725```
7726 * @example ​ ````Change the context of a function bound to the click handler,
7727```html
7728<!doctype html>
7729<html lang="en">
7730<head>
7731 <meta charset="utf-8">
7732 <title>jQuery.proxy demo</title>
7733 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7734</head>
7735<body>
7736
7737<p><button type="button" id="test">Test</button></p>
7738<div id="log"></div>
7739
7740<script>
7741var me = {
7742 // I'm a dog
7743 type: "dog",
7744
7745 // Note that event comes *after* one and two
7746 test: function( one, two, event ) {
7747 $( "#log" )
7748
7749 // `one` maps to `you`, the 1st additional
7750 // argument in the $.proxy function call
7751 .append( "<h3>Hello " + one.type + ":</h3>" )
7752
7753 // The `this` keyword refers to `me`
7754 // (the 2nd, context, argument of $.proxy)
7755 .append( "I am a " + this.type + ", " )
7756
7757 // `two` maps to `they`, the 2nd additional
7758 // argument in the $.proxy function call
7759 .append( "and they are " + two.type + ".<br>" )
7760
7761 // The event type is "click"
7762 .append( "Thanks for " + event.type + "ing." )
7763
7764 // The clicked element is `event.target`,
7765 // and its type is "button"
7766 .append( "the " + event.target.type + "." );
7767 }
7768};
7769
7770var you = { type: "cat" };
7771var they = { type: "fish" };
7772
7773// Set up handler to execute me.test() in the context
7774// of `me`, with `you` and `they` as additional arguments
7775var proxy = $.proxy( me.test, me, you, they );
7776
7777$( "#test" )
7778 .on( "click", proxy );
7779</script>
7780
7781</body>
7782</html>
7783```
7784 */
7785 proxy<TContext,
7786 TReturn,
7787 A, B, C, D,
7788 T, U, V>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
7789 t: T, u: U, v: V) => TReturn,
7790 context: TContext,
7791 a: A, b: B, c: C, d: D): (t: T, u: U, v: V) => TReturn;
7792 /**
7793 * Takes a function and returns a new one that will always have a particular context.
7794 * @param funсtion The function whose context will be changed.
7795 * @param context The object to which the context (`this`) of the function should be set.
7796 * @param a An argument to be passed to the function referenced in the `function` argument.
7797 * @param b An argument to be passed to the function referenced in the `function` argument.
7798 * @param c An argument to be passed to the function referenced in the `function` argument.
7799 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7800 * @since 1.4
7801 * @since 1.6
7802 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7803 * @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.
7804```html
7805<!doctype html>
7806<html lang="en">
7807<head>
7808 <meta charset="utf-8">
7809 <title>jQuery.proxy demo</title>
7810 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7811</head>
7812<body>
7813
7814<p><button type="button" id="test">Test</button></p>
7815<div id="log"></div>
7816
7817<script>
7818var me = {
7819 type: "zombie",
7820 test: function( event ) {
7821 // Without proxy, `this` would refer to the event target
7822 // use event.target to reference that element.
7823 var element = event.target;
7824 $( element ).css( "background-color", "red" );
7825
7826 // With proxy, `this` refers to the me object encapsulating
7827 // this function.
7828 $( "#log" ).append( "Hello " + this.type + "<br>" );
7829 $( "#test" ).off( "click", this.test );
7830 }
7831};
7832
7833var you = {
7834 type: "person",
7835 test: function( event ) {
7836 $( "#log" ).append( this.type + " " );
7837 }
7838};
7839
7840// Execute you.test() in the context of the `you` object
7841// no matter where it is called
7842// i.e. the `this` keyword will refer to `you`
7843var youClick = $.proxy( you.test, you );
7844
7845// attach click handlers to #test
7846$( "#test" )
7847 // this === "zombie"; handler unbound after first click
7848 .on( "click", $.proxy( me.test, me ) )
7849
7850 // this === "person"
7851 .on( "click", youClick )
7852
7853 // this === "zombie"
7854 .on( "click", $.proxy( you.test, me ) )
7855
7856 // this === "<button> element"
7857 .on( "click", you.test );
7858</script>
7859
7860</body>
7861</html>
7862```
7863 * @example ​ ````Change the context of a function bound to the click handler,
7864```html
7865<!doctype html>
7866<html lang="en">
7867<head>
7868 <meta charset="utf-8">
7869 <title>jQuery.proxy demo</title>
7870 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7871</head>
7872<body>
7873
7874<p><button type="button" id="test">Test</button></p>
7875<div id="log"></div>
7876
7877<script>
7878var me = {
7879 // I'm a dog
7880 type: "dog",
7881
7882 // Note that event comes *after* one and two
7883 test: function( one, two, event ) {
7884 $( "#log" )
7885
7886 // `one` maps to `you`, the 1st additional
7887 // argument in the $.proxy function call
7888 .append( "<h3>Hello " + one.type + ":</h3>" )
7889
7890 // The `this` keyword refers to `me`
7891 // (the 2nd, context, argument of $.proxy)
7892 .append( "I am a " + this.type + ", " )
7893
7894 // `two` maps to `they`, the 2nd additional
7895 // argument in the $.proxy function call
7896 .append( "and they are " + two.type + ".<br>" )
7897
7898 // The event type is "click"
7899 .append( "Thanks for " + event.type + "ing." )
7900
7901 // The clicked element is `event.target`,
7902 // and its type is "button"
7903 .append( "the " + event.target.type + "." );
7904 }
7905};
7906
7907var you = { type: "cat" };
7908var they = { type: "fish" };
7909
7910// Set up handler to execute me.test() in the context
7911// of `me`, with `you` and `they` as additional arguments
7912var proxy = $.proxy( me.test, me, you, they );
7913
7914$( "#test" )
7915 .on( "click", proxy );
7916</script>
7917
7918</body>
7919</html>
7920```
7921 */
7922 proxy<TContext,
7923 TReturn,
7924 A, B, C,
7925 T, U, V>(funсtion: (this: TContext, a: A, b: B, c: C,
7926 t: T, u: U, v: V) => TReturn,
7927 context: TContext,
7928 a: A, b: B, c: C): (t: T, u: U, v: V) => TReturn;
7929 /**
7930 * Takes a function and returns a new one that will always have a particular context.
7931 * @param funсtion The function whose context will be changed.
7932 * @param context The object to which the context (`this`) of the function should be set.
7933 * @param a An argument to be passed to the function referenced in the `function` argument.
7934 * @param b An argument to be passed to the function referenced in the `function` argument.
7935 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
7936 * @since 1.4
7937 * @since 1.6
7938 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
7939 * @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.
7940```html
7941<!doctype html>
7942<html lang="en">
7943<head>
7944 <meta charset="utf-8">
7945 <title>jQuery.proxy demo</title>
7946 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
7947</head>
7948<body>
7949
7950<p><button type="button" id="test">Test</button></p>
7951<div id="log"></div>
7952
7953<script>
7954var me = {
7955 type: "zombie",
7956 test: function( event ) {
7957 // Without proxy, `this` would refer to the event target
7958 // use event.target to reference that element.
7959 var element = event.target;
7960 $( element ).css( "background-color", "red" );
7961
7962 // With proxy, `this` refers to the me object encapsulating
7963 // this function.
7964 $( "#log" ).append( "Hello " + this.type + "<br>" );
7965 $( "#test" ).off( "click", this.test );
7966 }
7967};
7968
7969var you = {
7970 type: "person",
7971 test: function( event ) {
7972 $( "#log" ).append( this.type + " " );
7973 }
7974};
7975
7976// Execute you.test() in the context of the `you` object
7977// no matter where it is called
7978// i.e. the `this` keyword will refer to `you`
7979var youClick = $.proxy( you.test, you );
7980
7981// attach click handlers to #test
7982$( "#test" )
7983 // this === "zombie"; handler unbound after first click
7984 .on( "click", $.proxy( me.test, me ) )
7985
7986 // this === "person"
7987 .on( "click", youClick )
7988
7989 // this === "zombie"
7990 .on( "click", $.proxy( you.test, me ) )
7991
7992 // this === "<button> element"
7993 .on( "click", you.test );
7994</script>
7995
7996</body>
7997</html>
7998```
7999 * @example ​ ````Change the context of a function bound to the click handler,
8000```html
8001<!doctype html>
8002<html lang="en">
8003<head>
8004 <meta charset="utf-8">
8005 <title>jQuery.proxy demo</title>
8006 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8007</head>
8008<body>
8009
8010<p><button type="button" id="test">Test</button></p>
8011<div id="log"></div>
8012
8013<script>
8014var me = {
8015 // I'm a dog
8016 type: "dog",
8017
8018 // Note that event comes *after* one and two
8019 test: function( one, two, event ) {
8020 $( "#log" )
8021
8022 // `one` maps to `you`, the 1st additional
8023 // argument in the $.proxy function call
8024 .append( "<h3>Hello " + one.type + ":</h3>" )
8025
8026 // The `this` keyword refers to `me`
8027 // (the 2nd, context, argument of $.proxy)
8028 .append( "I am a " + this.type + ", " )
8029
8030 // `two` maps to `they`, the 2nd additional
8031 // argument in the $.proxy function call
8032 .append( "and they are " + two.type + ".<br>" )
8033
8034 // The event type is "click"
8035 .append( "Thanks for " + event.type + "ing." )
8036
8037 // The clicked element is `event.target`,
8038 // and its type is "button"
8039 .append( "the " + event.target.type + "." );
8040 }
8041};
8042
8043var you = { type: "cat" };
8044var they = { type: "fish" };
8045
8046// Set up handler to execute me.test() in the context
8047// of `me`, with `you` and `they` as additional arguments
8048var proxy = $.proxy( me.test, me, you, they );
8049
8050$( "#test" )
8051 .on( "click", proxy );
8052</script>
8053
8054</body>
8055</html>
8056```
8057 */
8058 proxy<TContext,
8059 TReturn,
8060 A, B,
8061 T, U, V>(funсtion: (this: TContext, a: A, b: B,
8062 t: T, u: U, v: V) => TReturn,
8063 context: TContext,
8064 a: A, b: B): (t: T, u: U, v: V) => TReturn;
8065 /**
8066 * Takes a function and returns a new one that will always have a particular context.
8067 * @param funсtion The function whose context will be changed.
8068 * @param context The object to which the context (`this`) of the function should be set.
8069 * @param a An argument to be passed to the function referenced in the `function` argument.
8070 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8071 * @since 1.4
8072 * @since 1.6
8073 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8074 * @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.
8075```html
8076<!doctype html>
8077<html lang="en">
8078<head>
8079 <meta charset="utf-8">
8080 <title>jQuery.proxy demo</title>
8081 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8082</head>
8083<body>
8084
8085<p><button type="button" id="test">Test</button></p>
8086<div id="log"></div>
8087
8088<script>
8089var me = {
8090 type: "zombie",
8091 test: function( event ) {
8092 // Without proxy, `this` would refer to the event target
8093 // use event.target to reference that element.
8094 var element = event.target;
8095 $( element ).css( "background-color", "red" );
8096
8097 // With proxy, `this` refers to the me object encapsulating
8098 // this function.
8099 $( "#log" ).append( "Hello " + this.type + "<br>" );
8100 $( "#test" ).off( "click", this.test );
8101 }
8102};
8103
8104var you = {
8105 type: "person",
8106 test: function( event ) {
8107 $( "#log" ).append( this.type + " " );
8108 }
8109};
8110
8111// Execute you.test() in the context of the `you` object
8112// no matter where it is called
8113// i.e. the `this` keyword will refer to `you`
8114var youClick = $.proxy( you.test, you );
8115
8116// attach click handlers to #test
8117$( "#test" )
8118 // this === "zombie"; handler unbound after first click
8119 .on( "click", $.proxy( me.test, me ) )
8120
8121 // this === "person"
8122 .on( "click", youClick )
8123
8124 // this === "zombie"
8125 .on( "click", $.proxy( you.test, me ) )
8126
8127 // this === "<button> element"
8128 .on( "click", you.test );
8129</script>
8130
8131</body>
8132</html>
8133```
8134 * @example ​ ````Change the context of a function bound to the click handler,
8135```html
8136<!doctype html>
8137<html lang="en">
8138<head>
8139 <meta charset="utf-8">
8140 <title>jQuery.proxy demo</title>
8141 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8142</head>
8143<body>
8144
8145<p><button type="button" id="test">Test</button></p>
8146<div id="log"></div>
8147
8148<script>
8149var me = {
8150 // I'm a dog
8151 type: "dog",
8152
8153 // Note that event comes *after* one and two
8154 test: function( one, two, event ) {
8155 $( "#log" )
8156
8157 // `one` maps to `you`, the 1st additional
8158 // argument in the $.proxy function call
8159 .append( "<h3>Hello " + one.type + ":</h3>" )
8160
8161 // The `this` keyword refers to `me`
8162 // (the 2nd, context, argument of $.proxy)
8163 .append( "I am a " + this.type + ", " )
8164
8165 // `two` maps to `they`, the 2nd additional
8166 // argument in the $.proxy function call
8167 .append( "and they are " + two.type + ".<br>" )
8168
8169 // The event type is "click"
8170 .append( "Thanks for " + event.type + "ing." )
8171
8172 // The clicked element is `event.target`,
8173 // and its type is "button"
8174 .append( "the " + event.target.type + "." );
8175 }
8176};
8177
8178var you = { type: "cat" };
8179var they = { type: "fish" };
8180
8181// Set up handler to execute me.test() in the context
8182// of `me`, with `you` and `they` as additional arguments
8183var proxy = $.proxy( me.test, me, you, they );
8184
8185$( "#test" )
8186 .on( "click", proxy );
8187</script>
8188
8189</body>
8190</html>
8191```
8192 */
8193 proxy<TContext,
8194 TReturn,
8195 A,
8196 T, U, V>(funсtion: (this: TContext, a: A,
8197 t: T, u: U, v: V) => TReturn,
8198 context: TContext,
8199 a: A): (t: T, u: U, v: V) => TReturn;
8200 /**
8201 * Takes a function and returns a new one that will always have a particular context.
8202 * @param funсtion The function whose context will be changed.
8203 * @param context The object to which the context (`this`) of the function should be set.
8204 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8205 * @since 1.4
8206 * @since 1.6
8207 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8208 * @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.
8209```html
8210<!doctype html>
8211<html lang="en">
8212<head>
8213 <meta charset="utf-8">
8214 <title>jQuery.proxy demo</title>
8215 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8216</head>
8217<body>
8218
8219<p><button type="button" id="test">Test</button></p>
8220<div id="log"></div>
8221
8222<script>
8223var me = {
8224 type: "zombie",
8225 test: function( event ) {
8226 // Without proxy, `this` would refer to the event target
8227 // use event.target to reference that element.
8228 var element = event.target;
8229 $( element ).css( "background-color", "red" );
8230
8231 // With proxy, `this` refers to the me object encapsulating
8232 // this function.
8233 $( "#log" ).append( "Hello " + this.type + "<br>" );
8234 $( "#test" ).off( "click", this.test );
8235 }
8236};
8237
8238var you = {
8239 type: "person",
8240 test: function( event ) {
8241 $( "#log" ).append( this.type + " " );
8242 }
8243};
8244
8245// Execute you.test() in the context of the `you` object
8246// no matter where it is called
8247// i.e. the `this` keyword will refer to `you`
8248var youClick = $.proxy( you.test, you );
8249
8250// attach click handlers to #test
8251$( "#test" )
8252 // this === "zombie"; handler unbound after first click
8253 .on( "click", $.proxy( me.test, me ) )
8254
8255 // this === "person"
8256 .on( "click", youClick )
8257
8258 // this === "zombie"
8259 .on( "click", $.proxy( you.test, me ) )
8260
8261 // this === "<button> element"
8262 .on( "click", you.test );
8263</script>
8264
8265</body>
8266</html>
8267```
8268 * @example ​ ````Change the context of a function bound to the click handler,
8269```html
8270<!doctype html>
8271<html lang="en">
8272<head>
8273 <meta charset="utf-8">
8274 <title>jQuery.proxy demo</title>
8275 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8276</head>
8277<body>
8278
8279<p><button type="button" id="test">Test</button></p>
8280<div id="log"></div>
8281
8282<script>
8283var me = {
8284 // I'm a dog
8285 type: "dog",
8286
8287 // Note that event comes *after* one and two
8288 test: function( one, two, event ) {
8289 $( "#log" )
8290
8291 // `one` maps to `you`, the 1st additional
8292 // argument in the $.proxy function call
8293 .append( "<h3>Hello " + one.type + ":</h3>" )
8294
8295 // The `this` keyword refers to `me`
8296 // (the 2nd, context, argument of $.proxy)
8297 .append( "I am a " + this.type + ", " )
8298
8299 // `two` maps to `they`, the 2nd additional
8300 // argument in the $.proxy function call
8301 .append( "and they are " + two.type + ".<br>" )
8302
8303 // The event type is "click"
8304 .append( "Thanks for " + event.type + "ing." )
8305
8306 // The clicked element is `event.target`,
8307 // and its type is "button"
8308 .append( "the " + event.target.type + "." );
8309 }
8310};
8311
8312var you = { type: "cat" };
8313var they = { type: "fish" };
8314
8315// Set up handler to execute me.test() in the context
8316// of `me`, with `you` and `they` as additional arguments
8317var proxy = $.proxy( me.test, me, you, they );
8318
8319$( "#test" )
8320 .on( "click", proxy );
8321</script>
8322
8323</body>
8324</html>
8325```
8326 */
8327 proxy<TContext,
8328 TReturn,
8329 T, U, V>(funсtion: (this: TContext, t: T, u: U, v: V) => TReturn,
8330 context: TContext): (t: T, u: U, v: V) => TReturn;
8331
8332 // #endregion
8333
8334 // region 4 parameters
8335 // #region 4 parameters
8336
8337 /**
8338 * Takes a function and returns a new one that will always have a particular context.
8339 * @param funсtion The function whose context will be changed.
8340 * @param context The object to which the context (`this`) of the function should be set.
8341 * @param a An argument to be passed to the function referenced in the `function` argument.
8342 * @param b An argument to be passed to the function referenced in the `function` argument.
8343 * @param c An argument to be passed to the function referenced in the `function` argument.
8344 * @param d An argument to be passed to the function referenced in the `function` argument.
8345 * @param e An argument to be passed to the function referenced in the `function` argument.
8346 * @param f An argument to be passed to the function referenced in the `function` argument.
8347 * @param g An argument to be passed to the function referenced in the `function` argument.
8348 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8349 * @since 1.4
8350 * @since 1.6
8351 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8352 * @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.
8353```html
8354<!doctype html>
8355<html lang="en">
8356<head>
8357 <meta charset="utf-8">
8358 <title>jQuery.proxy demo</title>
8359 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8360</head>
8361<body>
8362
8363<p><button type="button" id="test">Test</button></p>
8364<div id="log"></div>
8365
8366<script>
8367var me = {
8368 type: "zombie",
8369 test: function( event ) {
8370 // Without proxy, `this` would refer to the event target
8371 // use event.target to reference that element.
8372 var element = event.target;
8373 $( element ).css( "background-color", "red" );
8374
8375 // With proxy, `this` refers to the me object encapsulating
8376 // this function.
8377 $( "#log" ).append( "Hello " + this.type + "<br>" );
8378 $( "#test" ).off( "click", this.test );
8379 }
8380};
8381
8382var you = {
8383 type: "person",
8384 test: function( event ) {
8385 $( "#log" ).append( this.type + " " );
8386 }
8387};
8388
8389// Execute you.test() in the context of the `you` object
8390// no matter where it is called
8391// i.e. the `this` keyword will refer to `you`
8392var youClick = $.proxy( you.test, you );
8393
8394// attach click handlers to #test
8395$( "#test" )
8396 // this === "zombie"; handler unbound after first click
8397 .on( "click", $.proxy( me.test, me ) )
8398
8399 // this === "person"
8400 .on( "click", youClick )
8401
8402 // this === "zombie"
8403 .on( "click", $.proxy( you.test, me ) )
8404
8405 // this === "<button> element"
8406 .on( "click", you.test );
8407</script>
8408
8409</body>
8410</html>
8411```
8412 * @example ​ ````Change the context of a function bound to the click handler,
8413```html
8414<!doctype html>
8415<html lang="en">
8416<head>
8417 <meta charset="utf-8">
8418 <title>jQuery.proxy demo</title>
8419 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8420</head>
8421<body>
8422
8423<p><button type="button" id="test">Test</button></p>
8424<div id="log"></div>
8425
8426<script>
8427var me = {
8428 // I'm a dog
8429 type: "dog",
8430
8431 // Note that event comes *after* one and two
8432 test: function( one, two, event ) {
8433 $( "#log" )
8434
8435 // `one` maps to `you`, the 1st additional
8436 // argument in the $.proxy function call
8437 .append( "<h3>Hello " + one.type + ":</h3>" )
8438
8439 // The `this` keyword refers to `me`
8440 // (the 2nd, context, argument of $.proxy)
8441 .append( "I am a " + this.type + ", " )
8442
8443 // `two` maps to `they`, the 2nd additional
8444 // argument in the $.proxy function call
8445 .append( "and they are " + two.type + ".<br>" )
8446
8447 // The event type is "click"
8448 .append( "Thanks for " + event.type + "ing." )
8449
8450 // The clicked element is `event.target`,
8451 // and its type is "button"
8452 .append( "the " + event.target.type + "." );
8453 }
8454};
8455
8456var you = { type: "cat" };
8457var they = { type: "fish" };
8458
8459// Set up handler to execute me.test() in the context
8460// of `me`, with `you` and `they` as additional arguments
8461var proxy = $.proxy( me.test, me, you, they );
8462
8463$( "#test" )
8464 .on( "click", proxy );
8465</script>
8466
8467</body>
8468</html>
8469```
8470 */
8471 proxy<TContext,
8472 TReturn,
8473 A, B, C, D, E, F, G,
8474 T, U, V, W>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
8475 t: T, u: U, v: V, w: W) => TReturn,
8476 context: TContext,
8477 a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T, u: U, v: V, w: W) => TReturn;
8478 /**
8479 * Takes a function and returns a new one that will always have a particular context.
8480 * @param funсtion The function whose context will be changed.
8481 * @param context The object to which the context (`this`) of the function should be set.
8482 * @param a An argument to be passed to the function referenced in the `function` argument.
8483 * @param b An argument to be passed to the function referenced in the `function` argument.
8484 * @param c An argument to be passed to the function referenced in the `function` argument.
8485 * @param d An argument to be passed to the function referenced in the `function` argument.
8486 * @param e An argument to be passed to the function referenced in the `function` argument.
8487 * @param f An argument to be passed to the function referenced in the `function` argument.
8488 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8489 * @since 1.4
8490 * @since 1.6
8491 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8492 * @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.
8493```html
8494<!doctype html>
8495<html lang="en">
8496<head>
8497 <meta charset="utf-8">
8498 <title>jQuery.proxy demo</title>
8499 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8500</head>
8501<body>
8502
8503<p><button type="button" id="test">Test</button></p>
8504<div id="log"></div>
8505
8506<script>
8507var me = {
8508 type: "zombie",
8509 test: function( event ) {
8510 // Without proxy, `this` would refer to the event target
8511 // use event.target to reference that element.
8512 var element = event.target;
8513 $( element ).css( "background-color", "red" );
8514
8515 // With proxy, `this` refers to the me object encapsulating
8516 // this function.
8517 $( "#log" ).append( "Hello " + this.type + "<br>" );
8518 $( "#test" ).off( "click", this.test );
8519 }
8520};
8521
8522var you = {
8523 type: "person",
8524 test: function( event ) {
8525 $( "#log" ).append( this.type + " " );
8526 }
8527};
8528
8529// Execute you.test() in the context of the `you` object
8530// no matter where it is called
8531// i.e. the `this` keyword will refer to `you`
8532var youClick = $.proxy( you.test, you );
8533
8534// attach click handlers to #test
8535$( "#test" )
8536 // this === "zombie"; handler unbound after first click
8537 .on( "click", $.proxy( me.test, me ) )
8538
8539 // this === "person"
8540 .on( "click", youClick )
8541
8542 // this === "zombie"
8543 .on( "click", $.proxy( you.test, me ) )
8544
8545 // this === "<button> element"
8546 .on( "click", you.test );
8547</script>
8548
8549</body>
8550</html>
8551```
8552 * @example ​ ````Change the context of a function bound to the click handler,
8553```html
8554<!doctype html>
8555<html lang="en">
8556<head>
8557 <meta charset="utf-8">
8558 <title>jQuery.proxy demo</title>
8559 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8560</head>
8561<body>
8562
8563<p><button type="button" id="test">Test</button></p>
8564<div id="log"></div>
8565
8566<script>
8567var me = {
8568 // I'm a dog
8569 type: "dog",
8570
8571 // Note that event comes *after* one and two
8572 test: function( one, two, event ) {
8573 $( "#log" )
8574
8575 // `one` maps to `you`, the 1st additional
8576 // argument in the $.proxy function call
8577 .append( "<h3>Hello " + one.type + ":</h3>" )
8578
8579 // The `this` keyword refers to `me`
8580 // (the 2nd, context, argument of $.proxy)
8581 .append( "I am a " + this.type + ", " )
8582
8583 // `two` maps to `they`, the 2nd additional
8584 // argument in the $.proxy function call
8585 .append( "and they are " + two.type + ".<br>" )
8586
8587 // The event type is "click"
8588 .append( "Thanks for " + event.type + "ing." )
8589
8590 // The clicked element is `event.target`,
8591 // and its type is "button"
8592 .append( "the " + event.target.type + "." );
8593 }
8594};
8595
8596var you = { type: "cat" };
8597var they = { type: "fish" };
8598
8599// Set up handler to execute me.test() in the context
8600// of `me`, with `you` and `they` as additional arguments
8601var proxy = $.proxy( me.test, me, you, they );
8602
8603$( "#test" )
8604 .on( "click", proxy );
8605</script>
8606
8607</body>
8608</html>
8609```
8610 */
8611 proxy<TContext,
8612 TReturn,
8613 A, B, C, D, E, F,
8614 T, U, V, W>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
8615 t: T, u: U, v: V, w: W) => TReturn,
8616 context: TContext,
8617 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W) => TReturn;
8618 /**
8619 * Takes a function and returns a new one that will always have a particular context.
8620 * @param funсtion The function whose context will be changed.
8621 * @param context The object to which the context (`this`) of the function should be set.
8622 * @param a An argument to be passed to the function referenced in the `function` argument.
8623 * @param b An argument to be passed to the function referenced in the `function` argument.
8624 * @param c An argument to be passed to the function referenced in the `function` argument.
8625 * @param d An argument to be passed to the function referenced in the `function` argument.
8626 * @param e An argument to be passed to the function referenced in the `function` argument.
8627 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8628 * @since 1.4
8629 * @since 1.6
8630 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8631 * @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.
8632```html
8633<!doctype html>
8634<html lang="en">
8635<head>
8636 <meta charset="utf-8">
8637 <title>jQuery.proxy demo</title>
8638 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8639</head>
8640<body>
8641
8642<p><button type="button" id="test">Test</button></p>
8643<div id="log"></div>
8644
8645<script>
8646var me = {
8647 type: "zombie",
8648 test: function( event ) {
8649 // Without proxy, `this` would refer to the event target
8650 // use event.target to reference that element.
8651 var element = event.target;
8652 $( element ).css( "background-color", "red" );
8653
8654 // With proxy, `this` refers to the me object encapsulating
8655 // this function.
8656 $( "#log" ).append( "Hello " + this.type + "<br>" );
8657 $( "#test" ).off( "click", this.test );
8658 }
8659};
8660
8661var you = {
8662 type: "person",
8663 test: function( event ) {
8664 $( "#log" ).append( this.type + " " );
8665 }
8666};
8667
8668// Execute you.test() in the context of the `you` object
8669// no matter where it is called
8670// i.e. the `this` keyword will refer to `you`
8671var youClick = $.proxy( you.test, you );
8672
8673// attach click handlers to #test
8674$( "#test" )
8675 // this === "zombie"; handler unbound after first click
8676 .on( "click", $.proxy( me.test, me ) )
8677
8678 // this === "person"
8679 .on( "click", youClick )
8680
8681 // this === "zombie"
8682 .on( "click", $.proxy( you.test, me ) )
8683
8684 // this === "<button> element"
8685 .on( "click", you.test );
8686</script>
8687
8688</body>
8689</html>
8690```
8691 * @example ​ ````Change the context of a function bound to the click handler,
8692```html
8693<!doctype html>
8694<html lang="en">
8695<head>
8696 <meta charset="utf-8">
8697 <title>jQuery.proxy demo</title>
8698 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8699</head>
8700<body>
8701
8702<p><button type="button" id="test">Test</button></p>
8703<div id="log"></div>
8704
8705<script>
8706var me = {
8707 // I'm a dog
8708 type: "dog",
8709
8710 // Note that event comes *after* one and two
8711 test: function( one, two, event ) {
8712 $( "#log" )
8713
8714 // `one` maps to `you`, the 1st additional
8715 // argument in the $.proxy function call
8716 .append( "<h3>Hello " + one.type + ":</h3>" )
8717
8718 // The `this` keyword refers to `me`
8719 // (the 2nd, context, argument of $.proxy)
8720 .append( "I am a " + this.type + ", " )
8721
8722 // `two` maps to `they`, the 2nd additional
8723 // argument in the $.proxy function call
8724 .append( "and they are " + two.type + ".<br>" )
8725
8726 // The event type is "click"
8727 .append( "Thanks for " + event.type + "ing." )
8728
8729 // The clicked element is `event.target`,
8730 // and its type is "button"
8731 .append( "the " + event.target.type + "." );
8732 }
8733};
8734
8735var you = { type: "cat" };
8736var they = { type: "fish" };
8737
8738// Set up handler to execute me.test() in the context
8739// of `me`, with `you` and `they` as additional arguments
8740var proxy = $.proxy( me.test, me, you, they );
8741
8742$( "#test" )
8743 .on( "click", proxy );
8744</script>
8745
8746</body>
8747</html>
8748```
8749 */
8750 proxy<TContext,
8751 TReturn,
8752 A, B, C, D, E,
8753 T, U, V, W>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
8754 t: T, u: U, v: V, w: W) => TReturn,
8755 context: TContext,
8756 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W) => TReturn;
8757 /**
8758 * Takes a function and returns a new one that will always have a particular context.
8759 * @param funсtion The function whose context will be changed.
8760 * @param context The object to which the context (`this`) of the function should be set.
8761 * @param a An argument to be passed to the function referenced in the `function` argument.
8762 * @param b An argument to be passed to the function referenced in the `function` argument.
8763 * @param c An argument to be passed to the function referenced in the `function` argument.
8764 * @param d An argument to be passed to the function referenced in the `function` argument.
8765 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8766 * @since 1.4
8767 * @since 1.6
8768 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8769 * @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.
8770```html
8771<!doctype html>
8772<html lang="en">
8773<head>
8774 <meta charset="utf-8">
8775 <title>jQuery.proxy demo</title>
8776 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8777</head>
8778<body>
8779
8780<p><button type="button" id="test">Test</button></p>
8781<div id="log"></div>
8782
8783<script>
8784var me = {
8785 type: "zombie",
8786 test: function( event ) {
8787 // Without proxy, `this` would refer to the event target
8788 // use event.target to reference that element.
8789 var element = event.target;
8790 $( element ).css( "background-color", "red" );
8791
8792 // With proxy, `this` refers to the me object encapsulating
8793 // this function.
8794 $( "#log" ).append( "Hello " + this.type + "<br>" );
8795 $( "#test" ).off( "click", this.test );
8796 }
8797};
8798
8799var you = {
8800 type: "person",
8801 test: function( event ) {
8802 $( "#log" ).append( this.type + " " );
8803 }
8804};
8805
8806// Execute you.test() in the context of the `you` object
8807// no matter where it is called
8808// i.e. the `this` keyword will refer to `you`
8809var youClick = $.proxy( you.test, you );
8810
8811// attach click handlers to #test
8812$( "#test" )
8813 // this === "zombie"; handler unbound after first click
8814 .on( "click", $.proxy( me.test, me ) )
8815
8816 // this === "person"
8817 .on( "click", youClick )
8818
8819 // this === "zombie"
8820 .on( "click", $.proxy( you.test, me ) )
8821
8822 // this === "<button> element"
8823 .on( "click", you.test );
8824</script>
8825
8826</body>
8827</html>
8828```
8829 * @example ​ ````Change the context of a function bound to the click handler,
8830```html
8831<!doctype html>
8832<html lang="en">
8833<head>
8834 <meta charset="utf-8">
8835 <title>jQuery.proxy demo</title>
8836 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8837</head>
8838<body>
8839
8840<p><button type="button" id="test">Test</button></p>
8841<div id="log"></div>
8842
8843<script>
8844var me = {
8845 // I'm a dog
8846 type: "dog",
8847
8848 // Note that event comes *after* one and two
8849 test: function( one, two, event ) {
8850 $( "#log" )
8851
8852 // `one` maps to `you`, the 1st additional
8853 // argument in the $.proxy function call
8854 .append( "<h3>Hello " + one.type + ":</h3>" )
8855
8856 // The `this` keyword refers to `me`
8857 // (the 2nd, context, argument of $.proxy)
8858 .append( "I am a " + this.type + ", " )
8859
8860 // `two` maps to `they`, the 2nd additional
8861 // argument in the $.proxy function call
8862 .append( "and they are " + two.type + ".<br>" )
8863
8864 // The event type is "click"
8865 .append( "Thanks for " + event.type + "ing." )
8866
8867 // The clicked element is `event.target`,
8868 // and its type is "button"
8869 .append( "the " + event.target.type + "." );
8870 }
8871};
8872
8873var you = { type: "cat" };
8874var they = { type: "fish" };
8875
8876// Set up handler to execute me.test() in the context
8877// of `me`, with `you` and `they` as additional arguments
8878var proxy = $.proxy( me.test, me, you, they );
8879
8880$( "#test" )
8881 .on( "click", proxy );
8882</script>
8883
8884</body>
8885</html>
8886```
8887 */
8888 proxy<TContext,
8889 TReturn,
8890 A, B, C, D,
8891 T, U, V, W>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
8892 t: T, u: U, v: V, w: W) => TReturn,
8893 context: TContext,
8894 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W) => TReturn;
8895 /**
8896 * Takes a function and returns a new one that will always have a particular context.
8897 * @param funсtion The function whose context will be changed.
8898 * @param context The object to which the context (`this`) of the function should be set.
8899 * @param a An argument to be passed to the function referenced in the `function` argument.
8900 * @param b An argument to be passed to the function referenced in the `function` argument.
8901 * @param c An argument to be passed to the function referenced in the `function` argument.
8902 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
8903 * @since 1.4
8904 * @since 1.6
8905 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
8906 * @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.
8907```html
8908<!doctype html>
8909<html lang="en">
8910<head>
8911 <meta charset="utf-8">
8912 <title>jQuery.proxy demo</title>
8913 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8914</head>
8915<body>
8916
8917<p><button type="button" id="test">Test</button></p>
8918<div id="log"></div>
8919
8920<script>
8921var me = {
8922 type: "zombie",
8923 test: function( event ) {
8924 // Without proxy, `this` would refer to the event target
8925 // use event.target to reference that element.
8926 var element = event.target;
8927 $( element ).css( "background-color", "red" );
8928
8929 // With proxy, `this` refers to the me object encapsulating
8930 // this function.
8931 $( "#log" ).append( "Hello " + this.type + "<br>" );
8932 $( "#test" ).off( "click", this.test );
8933 }
8934};
8935
8936var you = {
8937 type: "person",
8938 test: function( event ) {
8939 $( "#log" ).append( this.type + " " );
8940 }
8941};
8942
8943// Execute you.test() in the context of the `you` object
8944// no matter where it is called
8945// i.e. the `this` keyword will refer to `you`
8946var youClick = $.proxy( you.test, you );
8947
8948// attach click handlers to #test
8949$( "#test" )
8950 // this === "zombie"; handler unbound after first click
8951 .on( "click", $.proxy( me.test, me ) )
8952
8953 // this === "person"
8954 .on( "click", youClick )
8955
8956 // this === "zombie"
8957 .on( "click", $.proxy( you.test, me ) )
8958
8959 // this === "<button> element"
8960 .on( "click", you.test );
8961</script>
8962
8963</body>
8964</html>
8965```
8966 * @example ​ ````Change the context of a function bound to the click handler,
8967```html
8968<!doctype html>
8969<html lang="en">
8970<head>
8971 <meta charset="utf-8">
8972 <title>jQuery.proxy demo</title>
8973 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
8974</head>
8975<body>
8976
8977<p><button type="button" id="test">Test</button></p>
8978<div id="log"></div>
8979
8980<script>
8981var me = {
8982 // I'm a dog
8983 type: "dog",
8984
8985 // Note that event comes *after* one and two
8986 test: function( one, two, event ) {
8987 $( "#log" )
8988
8989 // `one` maps to `you`, the 1st additional
8990 // argument in the $.proxy function call
8991 .append( "<h3>Hello " + one.type + ":</h3>" )
8992
8993 // The `this` keyword refers to `me`
8994 // (the 2nd, context, argument of $.proxy)
8995 .append( "I am a " + this.type + ", " )
8996
8997 // `two` maps to `they`, the 2nd additional
8998 // argument in the $.proxy function call
8999 .append( "and they are " + two.type + ".<br>" )
9000
9001 // The event type is "click"
9002 .append( "Thanks for " + event.type + "ing." )
9003
9004 // The clicked element is `event.target`,
9005 // and its type is "button"
9006 .append( "the " + event.target.type + "." );
9007 }
9008};
9009
9010var you = { type: "cat" };
9011var they = { type: "fish" };
9012
9013// Set up handler to execute me.test() in the context
9014// of `me`, with `you` and `they` as additional arguments
9015var proxy = $.proxy( me.test, me, you, they );
9016
9017$( "#test" )
9018 .on( "click", proxy );
9019</script>
9020
9021</body>
9022</html>
9023```
9024 */
9025 proxy<TContext,
9026 TReturn,
9027 A, B, C,
9028 T, U, V, W>(funсtion: (this: TContext, a: A, b: B, c: C,
9029 t: T, u: U, v: V, w: W) => TReturn,
9030 context: TContext,
9031 a: A, b: B, c: C): (t: T, u: U, v: V, w: W) => TReturn;
9032 /**
9033 * Takes a function and returns a new one that will always have a particular context.
9034 * @param funсtion The function whose context will be changed.
9035 * @param context The object to which the context (`this`) of the function should be set.
9036 * @param a An argument to be passed to the function referenced in the `function` argument.
9037 * @param b An argument to be passed to the function referenced in the `function` argument.
9038 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9039 * @since 1.4
9040 * @since 1.6
9041 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9042 * @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.
9043```html
9044<!doctype html>
9045<html lang="en">
9046<head>
9047 <meta charset="utf-8">
9048 <title>jQuery.proxy demo</title>
9049 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9050</head>
9051<body>
9052
9053<p><button type="button" id="test">Test</button></p>
9054<div id="log"></div>
9055
9056<script>
9057var me = {
9058 type: "zombie",
9059 test: function( event ) {
9060 // Without proxy, `this` would refer to the event target
9061 // use event.target to reference that element.
9062 var element = event.target;
9063 $( element ).css( "background-color", "red" );
9064
9065 // With proxy, `this` refers to the me object encapsulating
9066 // this function.
9067 $( "#log" ).append( "Hello " + this.type + "<br>" );
9068 $( "#test" ).off( "click", this.test );
9069 }
9070};
9071
9072var you = {
9073 type: "person",
9074 test: function( event ) {
9075 $( "#log" ).append( this.type + " " );
9076 }
9077};
9078
9079// Execute you.test() in the context of the `you` object
9080// no matter where it is called
9081// i.e. the `this` keyword will refer to `you`
9082var youClick = $.proxy( you.test, you );
9083
9084// attach click handlers to #test
9085$( "#test" )
9086 // this === "zombie"; handler unbound after first click
9087 .on( "click", $.proxy( me.test, me ) )
9088
9089 // this === "person"
9090 .on( "click", youClick )
9091
9092 // this === "zombie"
9093 .on( "click", $.proxy( you.test, me ) )
9094
9095 // this === "<button> element"
9096 .on( "click", you.test );
9097</script>
9098
9099</body>
9100</html>
9101```
9102 * @example ​ ````Change the context of a function bound to the click handler,
9103```html
9104<!doctype html>
9105<html lang="en">
9106<head>
9107 <meta charset="utf-8">
9108 <title>jQuery.proxy demo</title>
9109 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9110</head>
9111<body>
9112
9113<p><button type="button" id="test">Test</button></p>
9114<div id="log"></div>
9115
9116<script>
9117var me = {
9118 // I'm a dog
9119 type: "dog",
9120
9121 // Note that event comes *after* one and two
9122 test: function( one, two, event ) {
9123 $( "#log" )
9124
9125 // `one` maps to `you`, the 1st additional
9126 // argument in the $.proxy function call
9127 .append( "<h3>Hello " + one.type + ":</h3>" )
9128
9129 // The `this` keyword refers to `me`
9130 // (the 2nd, context, argument of $.proxy)
9131 .append( "I am a " + this.type + ", " )
9132
9133 // `two` maps to `they`, the 2nd additional
9134 // argument in the $.proxy function call
9135 .append( "and they are " + two.type + ".<br>" )
9136
9137 // The event type is "click"
9138 .append( "Thanks for " + event.type + "ing." )
9139
9140 // The clicked element is `event.target`,
9141 // and its type is "button"
9142 .append( "the " + event.target.type + "." );
9143 }
9144};
9145
9146var you = { type: "cat" };
9147var they = { type: "fish" };
9148
9149// Set up handler to execute me.test() in the context
9150// of `me`, with `you` and `they` as additional arguments
9151var proxy = $.proxy( me.test, me, you, they );
9152
9153$( "#test" )
9154 .on( "click", proxy );
9155</script>
9156
9157</body>
9158</html>
9159```
9160 */
9161 proxy<TContext,
9162 TReturn,
9163 A, B,
9164 T, U, V, W>(funсtion: (this: TContext, a: A, b: B,
9165 t: T, u: U, v: V, w: W) => TReturn,
9166 context: TContext,
9167 a: A, b: B): (t: T, u: U, v: V, w: W) => TReturn;
9168 /**
9169 * Takes a function and returns a new one that will always have a particular context.
9170 * @param funсtion The function whose context will be changed.
9171 * @param context The object to which the context (`this`) of the function should be set.
9172 * @param a An argument to be passed to the function referenced in the `function` argument.
9173 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9174 * @since 1.4
9175 * @since 1.6
9176 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9177 * @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.
9178```html
9179<!doctype html>
9180<html lang="en">
9181<head>
9182 <meta charset="utf-8">
9183 <title>jQuery.proxy demo</title>
9184 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9185</head>
9186<body>
9187
9188<p><button type="button" id="test">Test</button></p>
9189<div id="log"></div>
9190
9191<script>
9192var me = {
9193 type: "zombie",
9194 test: function( event ) {
9195 // Without proxy, `this` would refer to the event target
9196 // use event.target to reference that element.
9197 var element = event.target;
9198 $( element ).css( "background-color", "red" );
9199
9200 // With proxy, `this` refers to the me object encapsulating
9201 // this function.
9202 $( "#log" ).append( "Hello " + this.type + "<br>" );
9203 $( "#test" ).off( "click", this.test );
9204 }
9205};
9206
9207var you = {
9208 type: "person",
9209 test: function( event ) {
9210 $( "#log" ).append( this.type + " " );
9211 }
9212};
9213
9214// Execute you.test() in the context of the `you` object
9215// no matter where it is called
9216// i.e. the `this` keyword will refer to `you`
9217var youClick = $.proxy( you.test, you );
9218
9219// attach click handlers to #test
9220$( "#test" )
9221 // this === "zombie"; handler unbound after first click
9222 .on( "click", $.proxy( me.test, me ) )
9223
9224 // this === "person"
9225 .on( "click", youClick )
9226
9227 // this === "zombie"
9228 .on( "click", $.proxy( you.test, me ) )
9229
9230 // this === "<button> element"
9231 .on( "click", you.test );
9232</script>
9233
9234</body>
9235</html>
9236```
9237 * @example ​ ````Change the context of a function bound to the click handler,
9238```html
9239<!doctype html>
9240<html lang="en">
9241<head>
9242 <meta charset="utf-8">
9243 <title>jQuery.proxy demo</title>
9244 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9245</head>
9246<body>
9247
9248<p><button type="button" id="test">Test</button></p>
9249<div id="log"></div>
9250
9251<script>
9252var me = {
9253 // I'm a dog
9254 type: "dog",
9255
9256 // Note that event comes *after* one and two
9257 test: function( one, two, event ) {
9258 $( "#log" )
9259
9260 // `one` maps to `you`, the 1st additional
9261 // argument in the $.proxy function call
9262 .append( "<h3>Hello " + one.type + ":</h3>" )
9263
9264 // The `this` keyword refers to `me`
9265 // (the 2nd, context, argument of $.proxy)
9266 .append( "I am a " + this.type + ", " )
9267
9268 // `two` maps to `they`, the 2nd additional
9269 // argument in the $.proxy function call
9270 .append( "and they are " + two.type + ".<br>" )
9271
9272 // The event type is "click"
9273 .append( "Thanks for " + event.type + "ing." )
9274
9275 // The clicked element is `event.target`,
9276 // and its type is "button"
9277 .append( "the " + event.target.type + "." );
9278 }
9279};
9280
9281var you = { type: "cat" };
9282var they = { type: "fish" };
9283
9284// Set up handler to execute me.test() in the context
9285// of `me`, with `you` and `they` as additional arguments
9286var proxy = $.proxy( me.test, me, you, they );
9287
9288$( "#test" )
9289 .on( "click", proxy );
9290</script>
9291
9292</body>
9293</html>
9294```
9295 */
9296 proxy<TContext,
9297 TReturn,
9298 A,
9299 T, U, V, W>(funсtion: (this: TContext, a: A,
9300 t: T, u: U, v: V, w: W) => TReturn,
9301 context: TContext,
9302 a: A): (t: T, u: U, v: V, w: W) => TReturn;
9303 /**
9304 * Takes a function and returns a new one that will always have a particular context.
9305 * @param funсtion The function whose context will be changed.
9306 * @param context The object to which the context (`this`) of the function should be set.
9307 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9308 * @since 1.4
9309 * @since 1.6
9310 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9311 * @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.
9312```html
9313<!doctype html>
9314<html lang="en">
9315<head>
9316 <meta charset="utf-8">
9317 <title>jQuery.proxy demo</title>
9318 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9319</head>
9320<body>
9321
9322<p><button type="button" id="test">Test</button></p>
9323<div id="log"></div>
9324
9325<script>
9326var me = {
9327 type: "zombie",
9328 test: function( event ) {
9329 // Without proxy, `this` would refer to the event target
9330 // use event.target to reference that element.
9331 var element = event.target;
9332 $( element ).css( "background-color", "red" );
9333
9334 // With proxy, `this` refers to the me object encapsulating
9335 // this function.
9336 $( "#log" ).append( "Hello " + this.type + "<br>" );
9337 $( "#test" ).off( "click", this.test );
9338 }
9339};
9340
9341var you = {
9342 type: "person",
9343 test: function( event ) {
9344 $( "#log" ).append( this.type + " " );
9345 }
9346};
9347
9348// Execute you.test() in the context of the `you` object
9349// no matter where it is called
9350// i.e. the `this` keyword will refer to `you`
9351var youClick = $.proxy( you.test, you );
9352
9353// attach click handlers to #test
9354$( "#test" )
9355 // this === "zombie"; handler unbound after first click
9356 .on( "click", $.proxy( me.test, me ) )
9357
9358 // this === "person"
9359 .on( "click", youClick )
9360
9361 // this === "zombie"
9362 .on( "click", $.proxy( you.test, me ) )
9363
9364 // this === "<button> element"
9365 .on( "click", you.test );
9366</script>
9367
9368</body>
9369</html>
9370```
9371 * @example ​ ````Change the context of a function bound to the click handler,
9372```html
9373<!doctype html>
9374<html lang="en">
9375<head>
9376 <meta charset="utf-8">
9377 <title>jQuery.proxy demo</title>
9378 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9379</head>
9380<body>
9381
9382<p><button type="button" id="test">Test</button></p>
9383<div id="log"></div>
9384
9385<script>
9386var me = {
9387 // I'm a dog
9388 type: "dog",
9389
9390 // Note that event comes *after* one and two
9391 test: function( one, two, event ) {
9392 $( "#log" )
9393
9394 // `one` maps to `you`, the 1st additional
9395 // argument in the $.proxy function call
9396 .append( "<h3>Hello " + one.type + ":</h3>" )
9397
9398 // The `this` keyword refers to `me`
9399 // (the 2nd, context, argument of $.proxy)
9400 .append( "I am a " + this.type + ", " )
9401
9402 // `two` maps to `they`, the 2nd additional
9403 // argument in the $.proxy function call
9404 .append( "and they are " + two.type + ".<br>" )
9405
9406 // The event type is "click"
9407 .append( "Thanks for " + event.type + "ing." )
9408
9409 // The clicked element is `event.target`,
9410 // and its type is "button"
9411 .append( "the " + event.target.type + "." );
9412 }
9413};
9414
9415var you = { type: "cat" };
9416var they = { type: "fish" };
9417
9418// Set up handler to execute me.test() in the context
9419// of `me`, with `you` and `they` as additional arguments
9420var proxy = $.proxy( me.test, me, you, they );
9421
9422$( "#test" )
9423 .on( "click", proxy );
9424</script>
9425
9426</body>
9427</html>
9428```
9429 */
9430 proxy<TContext,
9431 TReturn,
9432 T, U, V, W>(funсtion: (this: TContext, t: T, u: U, v: V, w: W) => TReturn,
9433 context: TContext): (t: T, u: U, v: V, w: W) => TReturn;
9434
9435 // #endregion
9436
9437 // region 5 parameters
9438 // #region 5 parameters
9439
9440 /**
9441 * Takes a function and returns a new one that will always have a particular context.
9442 * @param funсtion The function whose context will be changed.
9443 * @param context The object to which the context (`this`) of the function should be set.
9444 * @param a An argument to be passed to the function referenced in the `function` argument.
9445 * @param b An argument to be passed to the function referenced in the `function` argument.
9446 * @param c An argument to be passed to the function referenced in the `function` argument.
9447 * @param d An argument to be passed to the function referenced in the `function` argument.
9448 * @param e An argument to be passed to the function referenced in the `function` argument.
9449 * @param f An argument to be passed to the function referenced in the `function` argument.
9450 * @param g An argument to be passed to the function referenced in the `function` argument.
9451 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9452 * @since 1.4
9453 * @since 1.6
9454 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9455 * @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.
9456```html
9457<!doctype html>
9458<html lang="en">
9459<head>
9460 <meta charset="utf-8">
9461 <title>jQuery.proxy demo</title>
9462 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9463</head>
9464<body>
9465
9466<p><button type="button" id="test">Test</button></p>
9467<div id="log"></div>
9468
9469<script>
9470var me = {
9471 type: "zombie",
9472 test: function( event ) {
9473 // Without proxy, `this` would refer to the event target
9474 // use event.target to reference that element.
9475 var element = event.target;
9476 $( element ).css( "background-color", "red" );
9477
9478 // With proxy, `this` refers to the me object encapsulating
9479 // this function.
9480 $( "#log" ).append( "Hello " + this.type + "<br>" );
9481 $( "#test" ).off( "click", this.test );
9482 }
9483};
9484
9485var you = {
9486 type: "person",
9487 test: function( event ) {
9488 $( "#log" ).append( this.type + " " );
9489 }
9490};
9491
9492// Execute you.test() in the context of the `you` object
9493// no matter where it is called
9494// i.e. the `this` keyword will refer to `you`
9495var youClick = $.proxy( you.test, you );
9496
9497// attach click handlers to #test
9498$( "#test" )
9499 // this === "zombie"; handler unbound after first click
9500 .on( "click", $.proxy( me.test, me ) )
9501
9502 // this === "person"
9503 .on( "click", youClick )
9504
9505 // this === "zombie"
9506 .on( "click", $.proxy( you.test, me ) )
9507
9508 // this === "<button> element"
9509 .on( "click", you.test );
9510</script>
9511
9512</body>
9513</html>
9514```
9515 * @example ​ ````Change the context of a function bound to the click handler,
9516```html
9517<!doctype html>
9518<html lang="en">
9519<head>
9520 <meta charset="utf-8">
9521 <title>jQuery.proxy demo</title>
9522 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9523</head>
9524<body>
9525
9526<p><button type="button" id="test">Test</button></p>
9527<div id="log"></div>
9528
9529<script>
9530var me = {
9531 // I'm a dog
9532 type: "dog",
9533
9534 // Note that event comes *after* one and two
9535 test: function( one, two, event ) {
9536 $( "#log" )
9537
9538 // `one` maps to `you`, the 1st additional
9539 // argument in the $.proxy function call
9540 .append( "<h3>Hello " + one.type + ":</h3>" )
9541
9542 // The `this` keyword refers to `me`
9543 // (the 2nd, context, argument of $.proxy)
9544 .append( "I am a " + this.type + ", " )
9545
9546 // `two` maps to `they`, the 2nd additional
9547 // argument in the $.proxy function call
9548 .append( "and they are " + two.type + ".<br>" )
9549
9550 // The event type is "click"
9551 .append( "Thanks for " + event.type + "ing." )
9552
9553 // The clicked element is `event.target`,
9554 // and its type is "button"
9555 .append( "the " + event.target.type + "." );
9556 }
9557};
9558
9559var you = { type: "cat" };
9560var they = { type: "fish" };
9561
9562// Set up handler to execute me.test() in the context
9563// of `me`, with `you` and `they` as additional arguments
9564var proxy = $.proxy( me.test, me, you, they );
9565
9566$( "#test" )
9567 .on( "click", proxy );
9568</script>
9569
9570</body>
9571</html>
9572```
9573 */
9574 proxy<TContext,
9575 TReturn,
9576 A, B, C, D, E, F, G,
9577 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
9578 t: T, u: U, v: V, w: W, x: X) => TReturn,
9579 context: TContext,
9580 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;
9581 /**
9582 * Takes a function and returns a new one that will always have a particular context.
9583 * @param funсtion The function whose context will be changed.
9584 * @param context The object to which the context (`this`) of the function should be set.
9585 * @param a An argument to be passed to the function referenced in the `function` argument.
9586 * @param b An argument to be passed to the function referenced in the `function` argument.
9587 * @param c An argument to be passed to the function referenced in the `function` argument.
9588 * @param d An argument to be passed to the function referenced in the `function` argument.
9589 * @param e An argument to be passed to the function referenced in the `function` argument.
9590 * @param f An argument to be passed to the function referenced in the `function` argument.
9591 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9592 * @since 1.4
9593 * @since 1.6
9594 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9595 * @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.
9596```html
9597<!doctype html>
9598<html lang="en">
9599<head>
9600 <meta charset="utf-8">
9601 <title>jQuery.proxy demo</title>
9602 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9603</head>
9604<body>
9605
9606<p><button type="button" id="test">Test</button></p>
9607<div id="log"></div>
9608
9609<script>
9610var me = {
9611 type: "zombie",
9612 test: function( event ) {
9613 // Without proxy, `this` would refer to the event target
9614 // use event.target to reference that element.
9615 var element = event.target;
9616 $( element ).css( "background-color", "red" );
9617
9618 // With proxy, `this` refers to the me object encapsulating
9619 // this function.
9620 $( "#log" ).append( "Hello " + this.type + "<br>" );
9621 $( "#test" ).off( "click", this.test );
9622 }
9623};
9624
9625var you = {
9626 type: "person",
9627 test: function( event ) {
9628 $( "#log" ).append( this.type + " " );
9629 }
9630};
9631
9632// Execute you.test() in the context of the `you` object
9633// no matter where it is called
9634// i.e. the `this` keyword will refer to `you`
9635var youClick = $.proxy( you.test, you );
9636
9637// attach click handlers to #test
9638$( "#test" )
9639 // this === "zombie"; handler unbound after first click
9640 .on( "click", $.proxy( me.test, me ) )
9641
9642 // this === "person"
9643 .on( "click", youClick )
9644
9645 // this === "zombie"
9646 .on( "click", $.proxy( you.test, me ) )
9647
9648 // this === "<button> element"
9649 .on( "click", you.test );
9650</script>
9651
9652</body>
9653</html>
9654```
9655 * @example ​ ````Change the context of a function bound to the click handler,
9656```html
9657<!doctype html>
9658<html lang="en">
9659<head>
9660 <meta charset="utf-8">
9661 <title>jQuery.proxy demo</title>
9662 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9663</head>
9664<body>
9665
9666<p><button type="button" id="test">Test</button></p>
9667<div id="log"></div>
9668
9669<script>
9670var me = {
9671 // I'm a dog
9672 type: "dog",
9673
9674 // Note that event comes *after* one and two
9675 test: function( one, two, event ) {
9676 $( "#log" )
9677
9678 // `one` maps to `you`, the 1st additional
9679 // argument in the $.proxy function call
9680 .append( "<h3>Hello " + one.type + ":</h3>" )
9681
9682 // The `this` keyword refers to `me`
9683 // (the 2nd, context, argument of $.proxy)
9684 .append( "I am a " + this.type + ", " )
9685
9686 // `two` maps to `they`, the 2nd additional
9687 // argument in the $.proxy function call
9688 .append( "and they are " + two.type + ".<br>" )
9689
9690 // The event type is "click"
9691 .append( "Thanks for " + event.type + "ing." )
9692
9693 // The clicked element is `event.target`,
9694 // and its type is "button"
9695 .append( "the " + event.target.type + "." );
9696 }
9697};
9698
9699var you = { type: "cat" };
9700var they = { type: "fish" };
9701
9702// Set up handler to execute me.test() in the context
9703// of `me`, with `you` and `they` as additional arguments
9704var proxy = $.proxy( me.test, me, you, they );
9705
9706$( "#test" )
9707 .on( "click", proxy );
9708</script>
9709
9710</body>
9711</html>
9712```
9713 */
9714 proxy<TContext,
9715 TReturn,
9716 A, B, C, D, E, F,
9717 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
9718 t: T, u: U, v: V, w: W, x: X) => TReturn,
9719 context: TContext,
9720 a: A, b: B, c: C, d: D, e: E, f: F): (t: T, u: U, v: V, w: W, x: X) => TReturn;
9721 /**
9722 * Takes a function and returns a new one that will always have a particular context.
9723 * @param funсtion The function whose context will be changed.
9724 * @param context The object to which the context (`this`) of the function should be set.
9725 * @param a An argument to be passed to the function referenced in the `function` argument.
9726 * @param b An argument to be passed to the function referenced in the `function` argument.
9727 * @param c An argument to be passed to the function referenced in the `function` argument.
9728 * @param d An argument to be passed to the function referenced in the `function` argument.
9729 * @param e An argument to be passed to the function referenced in the `function` argument.
9730 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9731 * @since 1.4
9732 * @since 1.6
9733 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9734 * @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.
9735```html
9736<!doctype html>
9737<html lang="en">
9738<head>
9739 <meta charset="utf-8">
9740 <title>jQuery.proxy demo</title>
9741 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9742</head>
9743<body>
9744
9745<p><button type="button" id="test">Test</button></p>
9746<div id="log"></div>
9747
9748<script>
9749var me = {
9750 type: "zombie",
9751 test: function( event ) {
9752 // Without proxy, `this` would refer to the event target
9753 // use event.target to reference that element.
9754 var element = event.target;
9755 $( element ).css( "background-color", "red" );
9756
9757 // With proxy, `this` refers to the me object encapsulating
9758 // this function.
9759 $( "#log" ).append( "Hello " + this.type + "<br>" );
9760 $( "#test" ).off( "click", this.test );
9761 }
9762};
9763
9764var you = {
9765 type: "person",
9766 test: function( event ) {
9767 $( "#log" ).append( this.type + " " );
9768 }
9769};
9770
9771// Execute you.test() in the context of the `you` object
9772// no matter where it is called
9773// i.e. the `this` keyword will refer to `you`
9774var youClick = $.proxy( you.test, you );
9775
9776// attach click handlers to #test
9777$( "#test" )
9778 // this === "zombie"; handler unbound after first click
9779 .on( "click", $.proxy( me.test, me ) )
9780
9781 // this === "person"
9782 .on( "click", youClick )
9783
9784 // this === "zombie"
9785 .on( "click", $.proxy( you.test, me ) )
9786
9787 // this === "<button> element"
9788 .on( "click", you.test );
9789</script>
9790
9791</body>
9792</html>
9793```
9794 * @example ​ ````Change the context of a function bound to the click handler,
9795```html
9796<!doctype html>
9797<html lang="en">
9798<head>
9799 <meta charset="utf-8">
9800 <title>jQuery.proxy demo</title>
9801 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9802</head>
9803<body>
9804
9805<p><button type="button" id="test">Test</button></p>
9806<div id="log"></div>
9807
9808<script>
9809var me = {
9810 // I'm a dog
9811 type: "dog",
9812
9813 // Note that event comes *after* one and two
9814 test: function( one, two, event ) {
9815 $( "#log" )
9816
9817 // `one` maps to `you`, the 1st additional
9818 // argument in the $.proxy function call
9819 .append( "<h3>Hello " + one.type + ":</h3>" )
9820
9821 // The `this` keyword refers to `me`
9822 // (the 2nd, context, argument of $.proxy)
9823 .append( "I am a " + this.type + ", " )
9824
9825 // `two` maps to `they`, the 2nd additional
9826 // argument in the $.proxy function call
9827 .append( "and they are " + two.type + ".<br>" )
9828
9829 // The event type is "click"
9830 .append( "Thanks for " + event.type + "ing." )
9831
9832 // The clicked element is `event.target`,
9833 // and its type is "button"
9834 .append( "the " + event.target.type + "." );
9835 }
9836};
9837
9838var you = { type: "cat" };
9839var they = { type: "fish" };
9840
9841// Set up handler to execute me.test() in the context
9842// of `me`, with `you` and `they` as additional arguments
9843var proxy = $.proxy( me.test, me, you, they );
9844
9845$( "#test" )
9846 .on( "click", proxy );
9847</script>
9848
9849</body>
9850</html>
9851```
9852 */
9853 proxy<TContext,
9854 TReturn,
9855 A, B, C, D, E,
9856 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
9857 t: T, u: U, v: V, w: W, x: X) => TReturn,
9858 context: TContext,
9859 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X) => TReturn;
9860 /**
9861 * Takes a function and returns a new one that will always have a particular context.
9862 * @param funсtion The function whose context will be changed.
9863 * @param context The object to which the context (`this`) of the function should be set.
9864 * @param a An argument to be passed to the function referenced in the `function` argument.
9865 * @param b An argument to be passed to the function referenced in the `function` argument.
9866 * @param c An argument to be passed to the function referenced in the `function` argument.
9867 * @param d An argument to be passed to the function referenced in the `function` argument.
9868 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
9869 * @since 1.4
9870 * @since 1.6
9871 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
9872 * @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.
9873```html
9874<!doctype html>
9875<html lang="en">
9876<head>
9877 <meta charset="utf-8">
9878 <title>jQuery.proxy demo</title>
9879 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9880</head>
9881<body>
9882
9883<p><button type="button" id="test">Test</button></p>
9884<div id="log"></div>
9885
9886<script>
9887var me = {
9888 type: "zombie",
9889 test: function( event ) {
9890 // Without proxy, `this` would refer to the event target
9891 // use event.target to reference that element.
9892 var element = event.target;
9893 $( element ).css( "background-color", "red" );
9894
9895 // With proxy, `this` refers to the me object encapsulating
9896 // this function.
9897 $( "#log" ).append( "Hello " + this.type + "<br>" );
9898 $( "#test" ).off( "click", this.test );
9899 }
9900};
9901
9902var you = {
9903 type: "person",
9904 test: function( event ) {
9905 $( "#log" ).append( this.type + " " );
9906 }
9907};
9908
9909// Execute you.test() in the context of the `you` object
9910// no matter where it is called
9911// i.e. the `this` keyword will refer to `you`
9912var youClick = $.proxy( you.test, you );
9913
9914// attach click handlers to #test
9915$( "#test" )
9916 // this === "zombie"; handler unbound after first click
9917 .on( "click", $.proxy( me.test, me ) )
9918
9919 // this === "person"
9920 .on( "click", youClick )
9921
9922 // this === "zombie"
9923 .on( "click", $.proxy( you.test, me ) )
9924
9925 // this === "<button> element"
9926 .on( "click", you.test );
9927</script>
9928
9929</body>
9930</html>
9931```
9932 * @example ​ ````Change the context of a function bound to the click handler,
9933```html
9934<!doctype html>
9935<html lang="en">
9936<head>
9937 <meta charset="utf-8">
9938 <title>jQuery.proxy demo</title>
9939 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
9940</head>
9941<body>
9942
9943<p><button type="button" id="test">Test</button></p>
9944<div id="log"></div>
9945
9946<script>
9947var me = {
9948 // I'm a dog
9949 type: "dog",
9950
9951 // Note that event comes *after* one and two
9952 test: function( one, two, event ) {
9953 $( "#log" )
9954
9955 // `one` maps to `you`, the 1st additional
9956 // argument in the $.proxy function call
9957 .append( "<h3>Hello " + one.type + ":</h3>" )
9958
9959 // The `this` keyword refers to `me`
9960 // (the 2nd, context, argument of $.proxy)
9961 .append( "I am a " + this.type + ", " )
9962
9963 // `two` maps to `they`, the 2nd additional
9964 // argument in the $.proxy function call
9965 .append( "and they are " + two.type + ".<br>" )
9966
9967 // The event type is "click"
9968 .append( "Thanks for " + event.type + "ing." )
9969
9970 // The clicked element is `event.target`,
9971 // and its type is "button"
9972 .append( "the " + event.target.type + "." );
9973 }
9974};
9975
9976var you = { type: "cat" };
9977var they = { type: "fish" };
9978
9979// Set up handler to execute me.test() in the context
9980// of `me`, with `you` and `they` as additional arguments
9981var proxy = $.proxy( me.test, me, you, they );
9982
9983$( "#test" )
9984 .on( "click", proxy );
9985</script>
9986
9987</body>
9988</html>
9989```
9990 */
9991 proxy<TContext,
9992 TReturn,
9993 A, B, C, D,
9994 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
9995 t: T, u: U, v: V, w: W, x: X) => TReturn,
9996 context: TContext,
9997 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X) => TReturn;
9998 /**
9999 * Takes a function and returns a new one that will always have a particular context.
10000 * @param funсtion The function whose context will be changed.
10001 * @param context The object to which the context (`this`) of the function should be set.
10002 * @param a An argument to be passed to the function referenced in the `function` argument.
10003 * @param b An argument to be passed to the function referenced in the `function` argument.
10004 * @param c An argument to be passed to the function referenced in the `function` argument.
10005 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10006 * @since 1.4
10007 * @since 1.6
10008 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10009 * @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.
10010```html
10011<!doctype html>
10012<html lang="en">
10013<head>
10014 <meta charset="utf-8">
10015 <title>jQuery.proxy demo</title>
10016 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10017</head>
10018<body>
10019
10020<p><button type="button" id="test">Test</button></p>
10021<div id="log"></div>
10022
10023<script>
10024var me = {
10025 type: "zombie",
10026 test: function( event ) {
10027 // Without proxy, `this` would refer to the event target
10028 // use event.target to reference that element.
10029 var element = event.target;
10030 $( element ).css( "background-color", "red" );
10031
10032 // With proxy, `this` refers to the me object encapsulating
10033 // this function.
10034 $( "#log" ).append( "Hello " + this.type + "<br>" );
10035 $( "#test" ).off( "click", this.test );
10036 }
10037};
10038
10039var you = {
10040 type: "person",
10041 test: function( event ) {
10042 $( "#log" ).append( this.type + " " );
10043 }
10044};
10045
10046// Execute you.test() in the context of the `you` object
10047// no matter where it is called
10048// i.e. the `this` keyword will refer to `you`
10049var youClick = $.proxy( you.test, you );
10050
10051// attach click handlers to #test
10052$( "#test" )
10053 // this === "zombie"; handler unbound after first click
10054 .on( "click", $.proxy( me.test, me ) )
10055
10056 // this === "person"
10057 .on( "click", youClick )
10058
10059 // this === "zombie"
10060 .on( "click", $.proxy( you.test, me ) )
10061
10062 // this === "<button> element"
10063 .on( "click", you.test );
10064</script>
10065
10066</body>
10067</html>
10068```
10069 * @example ​ ````Change the context of a function bound to the click handler,
10070```html
10071<!doctype html>
10072<html lang="en">
10073<head>
10074 <meta charset="utf-8">
10075 <title>jQuery.proxy demo</title>
10076 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10077</head>
10078<body>
10079
10080<p><button type="button" id="test">Test</button></p>
10081<div id="log"></div>
10082
10083<script>
10084var me = {
10085 // I'm a dog
10086 type: "dog",
10087
10088 // Note that event comes *after* one and two
10089 test: function( one, two, event ) {
10090 $( "#log" )
10091
10092 // `one` maps to `you`, the 1st additional
10093 // argument in the $.proxy function call
10094 .append( "<h3>Hello " + one.type + ":</h3>" )
10095
10096 // The `this` keyword refers to `me`
10097 // (the 2nd, context, argument of $.proxy)
10098 .append( "I am a " + this.type + ", " )
10099
10100 // `two` maps to `they`, the 2nd additional
10101 // argument in the $.proxy function call
10102 .append( "and they are " + two.type + ".<br>" )
10103
10104 // The event type is "click"
10105 .append( "Thanks for " + event.type + "ing." )
10106
10107 // The clicked element is `event.target`,
10108 // and its type is "button"
10109 .append( "the " + event.target.type + "." );
10110 }
10111};
10112
10113var you = { type: "cat" };
10114var they = { type: "fish" };
10115
10116// Set up handler to execute me.test() in the context
10117// of `me`, with `you` and `they` as additional arguments
10118var proxy = $.proxy( me.test, me, you, they );
10119
10120$( "#test" )
10121 .on( "click", proxy );
10122</script>
10123
10124</body>
10125</html>
10126```
10127 */
10128 proxy<TContext,
10129 TReturn,
10130 A, B, C,
10131 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B, c: C,
10132 t: T, u: U, v: V, w: W, x: X) => TReturn,
10133 context: TContext,
10134 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X) => TReturn;
10135 /**
10136 * Takes a function and returns a new one that will always have a particular context.
10137 * @param funсtion The function whose context will be changed.
10138 * @param context The object to which the context (`this`) of the function should be set.
10139 * @param a An argument to be passed to the function referenced in the `function` argument.
10140 * @param b An argument to be passed to the function referenced in the `function` argument.
10141 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10142 * @since 1.4
10143 * @since 1.6
10144 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10145 * @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.
10146```html
10147<!doctype html>
10148<html lang="en">
10149<head>
10150 <meta charset="utf-8">
10151 <title>jQuery.proxy demo</title>
10152 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10153</head>
10154<body>
10155
10156<p><button type="button" id="test">Test</button></p>
10157<div id="log"></div>
10158
10159<script>
10160var me = {
10161 type: "zombie",
10162 test: function( event ) {
10163 // Without proxy, `this` would refer to the event target
10164 // use event.target to reference that element.
10165 var element = event.target;
10166 $( element ).css( "background-color", "red" );
10167
10168 // With proxy, `this` refers to the me object encapsulating
10169 // this function.
10170 $( "#log" ).append( "Hello " + this.type + "<br>" );
10171 $( "#test" ).off( "click", this.test );
10172 }
10173};
10174
10175var you = {
10176 type: "person",
10177 test: function( event ) {
10178 $( "#log" ).append( this.type + " " );
10179 }
10180};
10181
10182// Execute you.test() in the context of the `you` object
10183// no matter where it is called
10184// i.e. the `this` keyword will refer to `you`
10185var youClick = $.proxy( you.test, you );
10186
10187// attach click handlers to #test
10188$( "#test" )
10189 // this === "zombie"; handler unbound after first click
10190 .on( "click", $.proxy( me.test, me ) )
10191
10192 // this === "person"
10193 .on( "click", youClick )
10194
10195 // this === "zombie"
10196 .on( "click", $.proxy( you.test, me ) )
10197
10198 // this === "<button> element"
10199 .on( "click", you.test );
10200</script>
10201
10202</body>
10203</html>
10204```
10205 * @example ​ ````Change the context of a function bound to the click handler,
10206```html
10207<!doctype html>
10208<html lang="en">
10209<head>
10210 <meta charset="utf-8">
10211 <title>jQuery.proxy demo</title>
10212 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10213</head>
10214<body>
10215
10216<p><button type="button" id="test">Test</button></p>
10217<div id="log"></div>
10218
10219<script>
10220var me = {
10221 // I'm a dog
10222 type: "dog",
10223
10224 // Note that event comes *after* one and two
10225 test: function( one, two, event ) {
10226 $( "#log" )
10227
10228 // `one` maps to `you`, the 1st additional
10229 // argument in the $.proxy function call
10230 .append( "<h3>Hello " + one.type + ":</h3>" )
10231
10232 // The `this` keyword refers to `me`
10233 // (the 2nd, context, argument of $.proxy)
10234 .append( "I am a " + this.type + ", " )
10235
10236 // `two` maps to `they`, the 2nd additional
10237 // argument in the $.proxy function call
10238 .append( "and they are " + two.type + ".<br>" )
10239
10240 // The event type is "click"
10241 .append( "Thanks for " + event.type + "ing." )
10242
10243 // The clicked element is `event.target`,
10244 // and its type is "button"
10245 .append( "the " + event.target.type + "." );
10246 }
10247};
10248
10249var you = { type: "cat" };
10250var they = { type: "fish" };
10251
10252// Set up handler to execute me.test() in the context
10253// of `me`, with `you` and `they` as additional arguments
10254var proxy = $.proxy( me.test, me, you, they );
10255
10256$( "#test" )
10257 .on( "click", proxy );
10258</script>
10259
10260</body>
10261</html>
10262```
10263 */
10264 proxy<TContext,
10265 TReturn,
10266 A, B,
10267 T, U, V, W, X>(funсtion: (this: TContext, a: A, b: B,
10268 t: T, u: U, v: V, w: W, x: X) => TReturn,
10269 context: TContext,
10270 a: A, b: B): (t: T, u: U, v: V, w: W, x: X) => TReturn;
10271 /**
10272 * Takes a function and returns a new one that will always have a particular context.
10273 * @param funсtion The function whose context will be changed.
10274 * @param context The object to which the context (`this`) of the function should be set.
10275 * @param a An argument to be passed to the function referenced in the `function` argument.
10276 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10277 * @since 1.4
10278 * @since 1.6
10279 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10280 * @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.
10281```html
10282<!doctype html>
10283<html lang="en">
10284<head>
10285 <meta charset="utf-8">
10286 <title>jQuery.proxy demo</title>
10287 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10288</head>
10289<body>
10290
10291<p><button type="button" id="test">Test</button></p>
10292<div id="log"></div>
10293
10294<script>
10295var me = {
10296 type: "zombie",
10297 test: function( event ) {
10298 // Without proxy, `this` would refer to the event target
10299 // use event.target to reference that element.
10300 var element = event.target;
10301 $( element ).css( "background-color", "red" );
10302
10303 // With proxy, `this` refers to the me object encapsulating
10304 // this function.
10305 $( "#log" ).append( "Hello " + this.type + "<br>" );
10306 $( "#test" ).off( "click", this.test );
10307 }
10308};
10309
10310var you = {
10311 type: "person",
10312 test: function( event ) {
10313 $( "#log" ).append( this.type + " " );
10314 }
10315};
10316
10317// Execute you.test() in the context of the `you` object
10318// no matter where it is called
10319// i.e. the `this` keyword will refer to `you`
10320var youClick = $.proxy( you.test, you );
10321
10322// attach click handlers to #test
10323$( "#test" )
10324 // this === "zombie"; handler unbound after first click
10325 .on( "click", $.proxy( me.test, me ) )
10326
10327 // this === "person"
10328 .on( "click", youClick )
10329
10330 // this === "zombie"
10331 .on( "click", $.proxy( you.test, me ) )
10332
10333 // this === "<button> element"
10334 .on( "click", you.test );
10335</script>
10336
10337</body>
10338</html>
10339```
10340 * @example ​ ````Change the context of a function bound to the click handler,
10341```html
10342<!doctype html>
10343<html lang="en">
10344<head>
10345 <meta charset="utf-8">
10346 <title>jQuery.proxy demo</title>
10347 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10348</head>
10349<body>
10350
10351<p><button type="button" id="test">Test</button></p>
10352<div id="log"></div>
10353
10354<script>
10355var me = {
10356 // I'm a dog
10357 type: "dog",
10358
10359 // Note that event comes *after* one and two
10360 test: function( one, two, event ) {
10361 $( "#log" )
10362
10363 // `one` maps to `you`, the 1st additional
10364 // argument in the $.proxy function call
10365 .append( "<h3>Hello " + one.type + ":</h3>" )
10366
10367 // The `this` keyword refers to `me`
10368 // (the 2nd, context, argument of $.proxy)
10369 .append( "I am a " + this.type + ", " )
10370
10371 // `two` maps to `they`, the 2nd additional
10372 // argument in the $.proxy function call
10373 .append( "and they are " + two.type + ".<br>" )
10374
10375 // The event type is "click"
10376 .append( "Thanks for " + event.type + "ing." )
10377
10378 // The clicked element is `event.target`,
10379 // and its type is "button"
10380 .append( "the " + event.target.type + "." );
10381 }
10382};
10383
10384var you = { type: "cat" };
10385var they = { type: "fish" };
10386
10387// Set up handler to execute me.test() in the context
10388// of `me`, with `you` and `they` as additional arguments
10389var proxy = $.proxy( me.test, me, you, they );
10390
10391$( "#test" )
10392 .on( "click", proxy );
10393</script>
10394
10395</body>
10396</html>
10397```
10398 */
10399 proxy<TContext,
10400 TReturn,
10401 A,
10402 T, U, V, W, X>(funсtion: (this: TContext, a: A,
10403 t: T, u: U, v: V, w: W, x: X) => TReturn,
10404 context: TContext,
10405 a: A): (t: T, u: U, v: V, w: W, x: X) => TReturn;
10406 /**
10407 * Takes a function and returns a new one that will always have a particular context.
10408 * @param funсtion The function whose context will be changed.
10409 * @param context The object to which the context (`this`) of the function should be set.
10410 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10411 * @since 1.4
10412 * @since 1.6
10413 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10414 * @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.
10415```html
10416<!doctype html>
10417<html lang="en">
10418<head>
10419 <meta charset="utf-8">
10420 <title>jQuery.proxy demo</title>
10421 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10422</head>
10423<body>
10424
10425<p><button type="button" id="test">Test</button></p>
10426<div id="log"></div>
10427
10428<script>
10429var me = {
10430 type: "zombie",
10431 test: function( event ) {
10432 // Without proxy, `this` would refer to the event target
10433 // use event.target to reference that element.
10434 var element = event.target;
10435 $( element ).css( "background-color", "red" );
10436
10437 // With proxy, `this` refers to the me object encapsulating
10438 // this function.
10439 $( "#log" ).append( "Hello " + this.type + "<br>" );
10440 $( "#test" ).off( "click", this.test );
10441 }
10442};
10443
10444var you = {
10445 type: "person",
10446 test: function( event ) {
10447 $( "#log" ).append( this.type + " " );
10448 }
10449};
10450
10451// Execute you.test() in the context of the `you` object
10452// no matter where it is called
10453// i.e. the `this` keyword will refer to `you`
10454var youClick = $.proxy( you.test, you );
10455
10456// attach click handlers to #test
10457$( "#test" )
10458 // this === "zombie"; handler unbound after first click
10459 .on( "click", $.proxy( me.test, me ) )
10460
10461 // this === "person"
10462 .on( "click", youClick )
10463
10464 // this === "zombie"
10465 .on( "click", $.proxy( you.test, me ) )
10466
10467 // this === "<button> element"
10468 .on( "click", you.test );
10469</script>
10470
10471</body>
10472</html>
10473```
10474 * @example ​ ````Change the context of a function bound to the click handler,
10475```html
10476<!doctype html>
10477<html lang="en">
10478<head>
10479 <meta charset="utf-8">
10480 <title>jQuery.proxy demo</title>
10481 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10482</head>
10483<body>
10484
10485<p><button type="button" id="test">Test</button></p>
10486<div id="log"></div>
10487
10488<script>
10489var me = {
10490 // I'm a dog
10491 type: "dog",
10492
10493 // Note that event comes *after* one and two
10494 test: function( one, two, event ) {
10495 $( "#log" )
10496
10497 // `one` maps to `you`, the 1st additional
10498 // argument in the $.proxy function call
10499 .append( "<h3>Hello " + one.type + ":</h3>" )
10500
10501 // The `this` keyword refers to `me`
10502 // (the 2nd, context, argument of $.proxy)
10503 .append( "I am a " + this.type + ", " )
10504
10505 // `two` maps to `they`, the 2nd additional
10506 // argument in the $.proxy function call
10507 .append( "and they are " + two.type + ".<br>" )
10508
10509 // The event type is "click"
10510 .append( "Thanks for " + event.type + "ing." )
10511
10512 // The clicked element is `event.target`,
10513 // and its type is "button"
10514 .append( "the " + event.target.type + "." );
10515 }
10516};
10517
10518var you = { type: "cat" };
10519var they = { type: "fish" };
10520
10521// Set up handler to execute me.test() in the context
10522// of `me`, with `you` and `they` as additional arguments
10523var proxy = $.proxy( me.test, me, you, they );
10524
10525$( "#test" )
10526 .on( "click", proxy );
10527</script>
10528
10529</body>
10530</html>
10531```
10532 */
10533 proxy<TContext,
10534 TReturn,
10535 T, U, V, W, X>(funсtion: (this: TContext, t: T, u: U, v: V, w: W, x: X) => TReturn,
10536 context: TContext): (t: T, u: U, v: V, w: W, x: X) => TReturn;
10537
10538 // #endregion
10539
10540 // region 6 parameters
10541 // #region 6 parameters
10542
10543 /**
10544 * Takes a function and returns a new one that will always have a particular context.
10545 * @param funсtion The function whose context will be changed.
10546 * @param context The object to which the context (`this`) of the function should be set.
10547 * @param a An argument to be passed to the function referenced in the `function` argument.
10548 * @param b An argument to be passed to the function referenced in the `function` argument.
10549 * @param c An argument to be passed to the function referenced in the `function` argument.
10550 * @param d An argument to be passed to the function referenced in the `function` argument.
10551 * @param e An argument to be passed to the function referenced in the `function` argument.
10552 * @param f An argument to be passed to the function referenced in the `function` argument.
10553 * @param g An argument to be passed to the function referenced in the `function` argument.
10554 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10555 * @since 1.4
10556 * @since 1.6
10557 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10558 * @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.
10559```html
10560<!doctype html>
10561<html lang="en">
10562<head>
10563 <meta charset="utf-8">
10564 <title>jQuery.proxy demo</title>
10565 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10566</head>
10567<body>
10568
10569<p><button type="button" id="test">Test</button></p>
10570<div id="log"></div>
10571
10572<script>
10573var me = {
10574 type: "zombie",
10575 test: function( event ) {
10576 // Without proxy, `this` would refer to the event target
10577 // use event.target to reference that element.
10578 var element = event.target;
10579 $( element ).css( "background-color", "red" );
10580
10581 // With proxy, `this` refers to the me object encapsulating
10582 // this function.
10583 $( "#log" ).append( "Hello " + this.type + "<br>" );
10584 $( "#test" ).off( "click", this.test );
10585 }
10586};
10587
10588var you = {
10589 type: "person",
10590 test: function( event ) {
10591 $( "#log" ).append( this.type + " " );
10592 }
10593};
10594
10595// Execute you.test() in the context of the `you` object
10596// no matter where it is called
10597// i.e. the `this` keyword will refer to `you`
10598var youClick = $.proxy( you.test, you );
10599
10600// attach click handlers to #test
10601$( "#test" )
10602 // this === "zombie"; handler unbound after first click
10603 .on( "click", $.proxy( me.test, me ) )
10604
10605 // this === "person"
10606 .on( "click", youClick )
10607
10608 // this === "zombie"
10609 .on( "click", $.proxy( you.test, me ) )
10610
10611 // this === "<button> element"
10612 .on( "click", you.test );
10613</script>
10614
10615</body>
10616</html>
10617```
10618 * @example ​ ````Change the context of a function bound to the click handler,
10619```html
10620<!doctype html>
10621<html lang="en">
10622<head>
10623 <meta charset="utf-8">
10624 <title>jQuery.proxy demo</title>
10625 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10626</head>
10627<body>
10628
10629<p><button type="button" id="test">Test</button></p>
10630<div id="log"></div>
10631
10632<script>
10633var me = {
10634 // I'm a dog
10635 type: "dog",
10636
10637 // Note that event comes *after* one and two
10638 test: function( one, two, event ) {
10639 $( "#log" )
10640
10641 // `one` maps to `you`, the 1st additional
10642 // argument in the $.proxy function call
10643 .append( "<h3>Hello " + one.type + ":</h3>" )
10644
10645 // The `this` keyword refers to `me`
10646 // (the 2nd, context, argument of $.proxy)
10647 .append( "I am a " + this.type + ", " )
10648
10649 // `two` maps to `they`, the 2nd additional
10650 // argument in the $.proxy function call
10651 .append( "and they are " + two.type + ".<br>" )
10652
10653 // The event type is "click"
10654 .append( "Thanks for " + event.type + "ing." )
10655
10656 // The clicked element is `event.target`,
10657 // and its type is "button"
10658 .append( "the " + event.target.type + "." );
10659 }
10660};
10661
10662var you = { type: "cat" };
10663var they = { type: "fish" };
10664
10665// Set up handler to execute me.test() in the context
10666// of `me`, with `you` and `they` as additional arguments
10667var proxy = $.proxy( me.test, me, you, they );
10668
10669$( "#test" )
10670 .on( "click", proxy );
10671</script>
10672
10673</body>
10674</html>
10675```
10676 */
10677 proxy<TContext,
10678 TReturn,
10679 A, B, C, D, E, F, G,
10680 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F, g: G,
10681 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
10682 context: TContext,
10683 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;
10684 /**
10685 * Takes a function and returns a new one that will always have a particular context.
10686 * @param funсtion The function whose context will be changed.
10687 * @param context The object to which the context (`this`) of the function should be set.
10688 * @param a An argument to be passed to the function referenced in the `function` argument.
10689 * @param b An argument to be passed to the function referenced in the `function` argument.
10690 * @param c An argument to be passed to the function referenced in the `function` argument.
10691 * @param d An argument to be passed to the function referenced in the `function` argument.
10692 * @param e An argument to be passed to the function referenced in the `function` argument.
10693 * @param f An argument to be passed to the function referenced in the `function` argument.
10694 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10695 * @since 1.4
10696 * @since 1.6
10697 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10698 * @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.
10699```html
10700<!doctype html>
10701<html lang="en">
10702<head>
10703 <meta charset="utf-8">
10704 <title>jQuery.proxy demo</title>
10705 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10706</head>
10707<body>
10708
10709<p><button type="button" id="test">Test</button></p>
10710<div id="log"></div>
10711
10712<script>
10713var me = {
10714 type: "zombie",
10715 test: function( event ) {
10716 // Without proxy, `this` would refer to the event target
10717 // use event.target to reference that element.
10718 var element = event.target;
10719 $( element ).css( "background-color", "red" );
10720
10721 // With proxy, `this` refers to the me object encapsulating
10722 // this function.
10723 $( "#log" ).append( "Hello " + this.type + "<br>" );
10724 $( "#test" ).off( "click", this.test );
10725 }
10726};
10727
10728var you = {
10729 type: "person",
10730 test: function( event ) {
10731 $( "#log" ).append( this.type + " " );
10732 }
10733};
10734
10735// Execute you.test() in the context of the `you` object
10736// no matter where it is called
10737// i.e. the `this` keyword will refer to `you`
10738var youClick = $.proxy( you.test, you );
10739
10740// attach click handlers to #test
10741$( "#test" )
10742 // this === "zombie"; handler unbound after first click
10743 .on( "click", $.proxy( me.test, me ) )
10744
10745 // this === "person"
10746 .on( "click", youClick )
10747
10748 // this === "zombie"
10749 .on( "click", $.proxy( you.test, me ) )
10750
10751 // this === "<button> element"
10752 .on( "click", you.test );
10753</script>
10754
10755</body>
10756</html>
10757```
10758 * @example ​ ````Change the context of a function bound to the click handler,
10759```html
10760<!doctype html>
10761<html lang="en">
10762<head>
10763 <meta charset="utf-8">
10764 <title>jQuery.proxy demo</title>
10765 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10766</head>
10767<body>
10768
10769<p><button type="button" id="test">Test</button></p>
10770<div id="log"></div>
10771
10772<script>
10773var me = {
10774 // I'm a dog
10775 type: "dog",
10776
10777 // Note that event comes *after* one and two
10778 test: function( one, two, event ) {
10779 $( "#log" )
10780
10781 // `one` maps to `you`, the 1st additional
10782 // argument in the $.proxy function call
10783 .append( "<h3>Hello " + one.type + ":</h3>" )
10784
10785 // The `this` keyword refers to `me`
10786 // (the 2nd, context, argument of $.proxy)
10787 .append( "I am a " + this.type + ", " )
10788
10789 // `two` maps to `they`, the 2nd additional
10790 // argument in the $.proxy function call
10791 .append( "and they are " + two.type + ".<br>" )
10792
10793 // The event type is "click"
10794 .append( "Thanks for " + event.type + "ing." )
10795
10796 // The clicked element is `event.target`,
10797 // and its type is "button"
10798 .append( "the " + event.target.type + "." );
10799 }
10800};
10801
10802var you = { type: "cat" };
10803var they = { type: "fish" };
10804
10805// Set up handler to execute me.test() in the context
10806// of `me`, with `you` and `they` as additional arguments
10807var proxy = $.proxy( me.test, me, you, they );
10808
10809$( "#test" )
10810 .on( "click", proxy );
10811</script>
10812
10813</body>
10814</html>
10815```
10816 */
10817 proxy<TContext,
10818 TReturn,
10819 A, B, C, D, E, F,
10820 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
10821 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
10822 context: TContext,
10823 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;
10824 /**
10825 * Takes a function and returns a new one that will always have a particular context.
10826 * @param funсtion The function whose context will be changed.
10827 * @param context The object to which the context (`this`) of the function should be set.
10828 * @param a An argument to be passed to the function referenced in the `function` argument.
10829 * @param b An argument to be passed to the function referenced in the `function` argument.
10830 * @param c An argument to be passed to the function referenced in the `function` argument.
10831 * @param d An argument to be passed to the function referenced in the `function` argument.
10832 * @param e An argument to be passed to the function referenced in the `function` argument.
10833 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10834 * @since 1.4
10835 * @since 1.6
10836 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10837 * @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.
10838```html
10839<!doctype html>
10840<html lang="en">
10841<head>
10842 <meta charset="utf-8">
10843 <title>jQuery.proxy demo</title>
10844 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10845</head>
10846<body>
10847
10848<p><button type="button" id="test">Test</button></p>
10849<div id="log"></div>
10850
10851<script>
10852var me = {
10853 type: "zombie",
10854 test: function( event ) {
10855 // Without proxy, `this` would refer to the event target
10856 // use event.target to reference that element.
10857 var element = event.target;
10858 $( element ).css( "background-color", "red" );
10859
10860 // With proxy, `this` refers to the me object encapsulating
10861 // this function.
10862 $( "#log" ).append( "Hello " + this.type + "<br>" );
10863 $( "#test" ).off( "click", this.test );
10864 }
10865};
10866
10867var you = {
10868 type: "person",
10869 test: function( event ) {
10870 $( "#log" ).append( this.type + " " );
10871 }
10872};
10873
10874// Execute you.test() in the context of the `you` object
10875// no matter where it is called
10876// i.e. the `this` keyword will refer to `you`
10877var youClick = $.proxy( you.test, you );
10878
10879// attach click handlers to #test
10880$( "#test" )
10881 // this === "zombie"; handler unbound after first click
10882 .on( "click", $.proxy( me.test, me ) )
10883
10884 // this === "person"
10885 .on( "click", youClick )
10886
10887 // this === "zombie"
10888 .on( "click", $.proxy( you.test, me ) )
10889
10890 // this === "<button> element"
10891 .on( "click", you.test );
10892</script>
10893
10894</body>
10895</html>
10896```
10897 * @example ​ ````Change the context of a function bound to the click handler,
10898```html
10899<!doctype html>
10900<html lang="en">
10901<head>
10902 <meta charset="utf-8">
10903 <title>jQuery.proxy demo</title>
10904 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10905</head>
10906<body>
10907
10908<p><button type="button" id="test">Test</button></p>
10909<div id="log"></div>
10910
10911<script>
10912var me = {
10913 // I'm a dog
10914 type: "dog",
10915
10916 // Note that event comes *after* one and two
10917 test: function( one, two, event ) {
10918 $( "#log" )
10919
10920 // `one` maps to `you`, the 1st additional
10921 // argument in the $.proxy function call
10922 .append( "<h3>Hello " + one.type + ":</h3>" )
10923
10924 // The `this` keyword refers to `me`
10925 // (the 2nd, context, argument of $.proxy)
10926 .append( "I am a " + this.type + ", " )
10927
10928 // `two` maps to `they`, the 2nd additional
10929 // argument in the $.proxy function call
10930 .append( "and they are " + two.type + ".<br>" )
10931
10932 // The event type is "click"
10933 .append( "Thanks for " + event.type + "ing." )
10934
10935 // The clicked element is `event.target`,
10936 // and its type is "button"
10937 .append( "the " + event.target.type + "." );
10938 }
10939};
10940
10941var you = { type: "cat" };
10942var they = { type: "fish" };
10943
10944// Set up handler to execute me.test() in the context
10945// of `me`, with `you` and `they` as additional arguments
10946var proxy = $.proxy( me.test, me, you, they );
10947
10948$( "#test" )
10949 .on( "click", proxy );
10950</script>
10951
10952</body>
10953</html>
10954```
10955 */
10956 proxy<TContext,
10957 TReturn,
10958 A, B, C, D, E,
10959 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
10960 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
10961 context: TContext,
10962 a: A, b: B, c: C, d: D, e: E): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
10963 /**
10964 * Takes a function and returns a new one that will always have a particular context.
10965 * @param funсtion The function whose context will be changed.
10966 * @param context The object to which the context (`this`) of the function should be set.
10967 * @param a An argument to be passed to the function referenced in the `function` argument.
10968 * @param b An argument to be passed to the function referenced in the `function` argument.
10969 * @param c An argument to be passed to the function referenced in the `function` argument.
10970 * @param d An argument to be passed to the function referenced in the `function` argument.
10971 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
10972 * @since 1.4
10973 * @since 1.6
10974 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
10975 * @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.
10976```html
10977<!doctype html>
10978<html lang="en">
10979<head>
10980 <meta charset="utf-8">
10981 <title>jQuery.proxy demo</title>
10982 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
10983</head>
10984<body>
10985
10986<p><button type="button" id="test">Test</button></p>
10987<div id="log"></div>
10988
10989<script>
10990var me = {
10991 type: "zombie",
10992 test: function( event ) {
10993 // Without proxy, `this` would refer to the event target
10994 // use event.target to reference that element.
10995 var element = event.target;
10996 $( element ).css( "background-color", "red" );
10997
10998 // With proxy, `this` refers to the me object encapsulating
10999 // this function.
11000 $( "#log" ).append( "Hello " + this.type + "<br>" );
11001 $( "#test" ).off( "click", this.test );
11002 }
11003};
11004
11005var you = {
11006 type: "person",
11007 test: function( event ) {
11008 $( "#log" ).append( this.type + " " );
11009 }
11010};
11011
11012// Execute you.test() in the context of the `you` object
11013// no matter where it is called
11014// i.e. the `this` keyword will refer to `you`
11015var youClick = $.proxy( you.test, you );
11016
11017// attach click handlers to #test
11018$( "#test" )
11019 // this === "zombie"; handler unbound after first click
11020 .on( "click", $.proxy( me.test, me ) )
11021
11022 // this === "person"
11023 .on( "click", youClick )
11024
11025 // this === "zombie"
11026 .on( "click", $.proxy( you.test, me ) )
11027
11028 // this === "<button> element"
11029 .on( "click", you.test );
11030</script>
11031
11032</body>
11033</html>
11034```
11035 * @example ​ ````Change the context of a function bound to the click handler,
11036```html
11037<!doctype html>
11038<html lang="en">
11039<head>
11040 <meta charset="utf-8">
11041 <title>jQuery.proxy demo</title>
11042 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11043</head>
11044<body>
11045
11046<p><button type="button" id="test">Test</button></p>
11047<div id="log"></div>
11048
11049<script>
11050var me = {
11051 // I'm a dog
11052 type: "dog",
11053
11054 // Note that event comes *after* one and two
11055 test: function( one, two, event ) {
11056 $( "#log" )
11057
11058 // `one` maps to `you`, the 1st additional
11059 // argument in the $.proxy function call
11060 .append( "<h3>Hello " + one.type + ":</h3>" )
11061
11062 // The `this` keyword refers to `me`
11063 // (the 2nd, context, argument of $.proxy)
11064 .append( "I am a " + this.type + ", " )
11065
11066 // `two` maps to `they`, the 2nd additional
11067 // argument in the $.proxy function call
11068 .append( "and they are " + two.type + ".<br>" )
11069
11070 // The event type is "click"
11071 .append( "Thanks for " + event.type + "ing." )
11072
11073 // The clicked element is `event.target`,
11074 // and its type is "button"
11075 .append( "the " + event.target.type + "." );
11076 }
11077};
11078
11079var you = { type: "cat" };
11080var they = { type: "fish" };
11081
11082// Set up handler to execute me.test() in the context
11083// of `me`, with `you` and `they` as additional arguments
11084var proxy = $.proxy( me.test, me, you, they );
11085
11086$( "#test" )
11087 .on( "click", proxy );
11088</script>
11089
11090</body>
11091</html>
11092```
11093 */
11094 proxy<TContext,
11095 TReturn,
11096 A, B, C, D,
11097 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
11098 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
11099 context: TContext,
11100 a: A, b: B, c: C, d: D): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
11101 /**
11102 * Takes a function and returns a new one that will always have a particular context.
11103 * @param funсtion The function whose context will be changed.
11104 * @param context The object to which the context (`this`) of the function should be set.
11105 * @param a An argument to be passed to the function referenced in the `function` argument.
11106 * @param b An argument to be passed to the function referenced in the `function` argument.
11107 * @param c An argument to be passed to the function referenced in the `function` argument.
11108 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11109 * @since 1.4
11110 * @since 1.6
11111 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11112 * @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.
11113```html
11114<!doctype html>
11115<html lang="en">
11116<head>
11117 <meta charset="utf-8">
11118 <title>jQuery.proxy demo</title>
11119 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11120</head>
11121<body>
11122
11123<p><button type="button" id="test">Test</button></p>
11124<div id="log"></div>
11125
11126<script>
11127var me = {
11128 type: "zombie",
11129 test: function( event ) {
11130 // Without proxy, `this` would refer to the event target
11131 // use event.target to reference that element.
11132 var element = event.target;
11133 $( element ).css( "background-color", "red" );
11134
11135 // With proxy, `this` refers to the me object encapsulating
11136 // this function.
11137 $( "#log" ).append( "Hello " + this.type + "<br>" );
11138 $( "#test" ).off( "click", this.test );
11139 }
11140};
11141
11142var you = {
11143 type: "person",
11144 test: function( event ) {
11145 $( "#log" ).append( this.type + " " );
11146 }
11147};
11148
11149// Execute you.test() in the context of the `you` object
11150// no matter where it is called
11151// i.e. the `this` keyword will refer to `you`
11152var youClick = $.proxy( you.test, you );
11153
11154// attach click handlers to #test
11155$( "#test" )
11156 // this === "zombie"; handler unbound after first click
11157 .on( "click", $.proxy( me.test, me ) )
11158
11159 // this === "person"
11160 .on( "click", youClick )
11161
11162 // this === "zombie"
11163 .on( "click", $.proxy( you.test, me ) )
11164
11165 // this === "<button> element"
11166 .on( "click", you.test );
11167</script>
11168
11169</body>
11170</html>
11171```
11172 * @example ​ ````Change the context of a function bound to the click handler,
11173```html
11174<!doctype html>
11175<html lang="en">
11176<head>
11177 <meta charset="utf-8">
11178 <title>jQuery.proxy demo</title>
11179 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11180</head>
11181<body>
11182
11183<p><button type="button" id="test">Test</button></p>
11184<div id="log"></div>
11185
11186<script>
11187var me = {
11188 // I'm a dog
11189 type: "dog",
11190
11191 // Note that event comes *after* one and two
11192 test: function( one, two, event ) {
11193 $( "#log" )
11194
11195 // `one` maps to `you`, the 1st additional
11196 // argument in the $.proxy function call
11197 .append( "<h3>Hello " + one.type + ":</h3>" )
11198
11199 // The `this` keyword refers to `me`
11200 // (the 2nd, context, argument of $.proxy)
11201 .append( "I am a " + this.type + ", " )
11202
11203 // `two` maps to `they`, the 2nd additional
11204 // argument in the $.proxy function call
11205 .append( "and they are " + two.type + ".<br>" )
11206
11207 // The event type is "click"
11208 .append( "Thanks for " + event.type + "ing." )
11209
11210 // The clicked element is `event.target`,
11211 // and its type is "button"
11212 .append( "the " + event.target.type + "." );
11213 }
11214};
11215
11216var you = { type: "cat" };
11217var they = { type: "fish" };
11218
11219// Set up handler to execute me.test() in the context
11220// of `me`, with `you` and `they` as additional arguments
11221var proxy = $.proxy( me.test, me, you, they );
11222
11223$( "#test" )
11224 .on( "click", proxy );
11225</script>
11226
11227</body>
11228</html>
11229```
11230 */
11231 proxy<TContext,
11232 TReturn,
11233 A, B, C,
11234 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B, c: C,
11235 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
11236 context: TContext,
11237 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
11238 /**
11239 * Takes a function and returns a new one that will always have a particular context.
11240 * @param funсtion The function whose context will be changed.
11241 * @param context The object to which the context (`this`) of the function should be set.
11242 * @param a An argument to be passed to the function referenced in the `function` argument.
11243 * @param b An argument to be passed to the function referenced in the `function` argument.
11244 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11245 * @since 1.4
11246 * @since 1.6
11247 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11248 * @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.
11249```html
11250<!doctype html>
11251<html lang="en">
11252<head>
11253 <meta charset="utf-8">
11254 <title>jQuery.proxy demo</title>
11255 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11256</head>
11257<body>
11258
11259<p><button type="button" id="test">Test</button></p>
11260<div id="log"></div>
11261
11262<script>
11263var me = {
11264 type: "zombie",
11265 test: function( event ) {
11266 // Without proxy, `this` would refer to the event target
11267 // use event.target to reference that element.
11268 var element = event.target;
11269 $( element ).css( "background-color", "red" );
11270
11271 // With proxy, `this` refers to the me object encapsulating
11272 // this function.
11273 $( "#log" ).append( "Hello " + this.type + "<br>" );
11274 $( "#test" ).off( "click", this.test );
11275 }
11276};
11277
11278var you = {
11279 type: "person",
11280 test: function( event ) {
11281 $( "#log" ).append( this.type + " " );
11282 }
11283};
11284
11285// Execute you.test() in the context of the `you` object
11286// no matter where it is called
11287// i.e. the `this` keyword will refer to `you`
11288var youClick = $.proxy( you.test, you );
11289
11290// attach click handlers to #test
11291$( "#test" )
11292 // this === "zombie"; handler unbound after first click
11293 .on( "click", $.proxy( me.test, me ) )
11294
11295 // this === "person"
11296 .on( "click", youClick )
11297
11298 // this === "zombie"
11299 .on( "click", $.proxy( you.test, me ) )
11300
11301 // this === "<button> element"
11302 .on( "click", you.test );
11303</script>
11304
11305</body>
11306</html>
11307```
11308 * @example ​ ````Change the context of a function bound to the click handler,
11309```html
11310<!doctype html>
11311<html lang="en">
11312<head>
11313 <meta charset="utf-8">
11314 <title>jQuery.proxy demo</title>
11315 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11316</head>
11317<body>
11318
11319<p><button type="button" id="test">Test</button></p>
11320<div id="log"></div>
11321
11322<script>
11323var me = {
11324 // I'm a dog
11325 type: "dog",
11326
11327 // Note that event comes *after* one and two
11328 test: function( one, two, event ) {
11329 $( "#log" )
11330
11331 // `one` maps to `you`, the 1st additional
11332 // argument in the $.proxy function call
11333 .append( "<h3>Hello " + one.type + ":</h3>" )
11334
11335 // The `this` keyword refers to `me`
11336 // (the 2nd, context, argument of $.proxy)
11337 .append( "I am a " + this.type + ", " )
11338
11339 // `two` maps to `they`, the 2nd additional
11340 // argument in the $.proxy function call
11341 .append( "and they are " + two.type + ".<br>" )
11342
11343 // The event type is "click"
11344 .append( "Thanks for " + event.type + "ing." )
11345
11346 // The clicked element is `event.target`,
11347 // and its type is "button"
11348 .append( "the " + event.target.type + "." );
11349 }
11350};
11351
11352var you = { type: "cat" };
11353var they = { type: "fish" };
11354
11355// Set up handler to execute me.test() in the context
11356// of `me`, with `you` and `they` as additional arguments
11357var proxy = $.proxy( me.test, me, you, they );
11358
11359$( "#test" )
11360 .on( "click", proxy );
11361</script>
11362
11363</body>
11364</html>
11365```
11366 */
11367 proxy<TContext,
11368 TReturn,
11369 A, B,
11370 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A, b: B,
11371 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
11372 context: TContext,
11373 a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
11374 /**
11375 * Takes a function and returns a new one that will always have a particular context.
11376 * @param funсtion The function whose context will be changed.
11377 * @param context The object to which the context (`this`) of the function should be set.
11378 * @param a An argument to be passed to the function referenced in the `function` argument.
11379 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11380 * @since 1.4
11381 * @since 1.6
11382 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11383 * @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.
11384```html
11385<!doctype html>
11386<html lang="en">
11387<head>
11388 <meta charset="utf-8">
11389 <title>jQuery.proxy demo</title>
11390 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11391</head>
11392<body>
11393
11394<p><button type="button" id="test">Test</button></p>
11395<div id="log"></div>
11396
11397<script>
11398var me = {
11399 type: "zombie",
11400 test: function( event ) {
11401 // Without proxy, `this` would refer to the event target
11402 // use event.target to reference that element.
11403 var element = event.target;
11404 $( element ).css( "background-color", "red" );
11405
11406 // With proxy, `this` refers to the me object encapsulating
11407 // this function.
11408 $( "#log" ).append( "Hello " + this.type + "<br>" );
11409 $( "#test" ).off( "click", this.test );
11410 }
11411};
11412
11413var you = {
11414 type: "person",
11415 test: function( event ) {
11416 $( "#log" ).append( this.type + " " );
11417 }
11418};
11419
11420// Execute you.test() in the context of the `you` object
11421// no matter where it is called
11422// i.e. the `this` keyword will refer to `you`
11423var youClick = $.proxy( you.test, you );
11424
11425// attach click handlers to #test
11426$( "#test" )
11427 // this === "zombie"; handler unbound after first click
11428 .on( "click", $.proxy( me.test, me ) )
11429
11430 // this === "person"
11431 .on( "click", youClick )
11432
11433 // this === "zombie"
11434 .on( "click", $.proxy( you.test, me ) )
11435
11436 // this === "<button> element"
11437 .on( "click", you.test );
11438</script>
11439
11440</body>
11441</html>
11442```
11443 * @example ​ ````Change the context of a function bound to the click handler,
11444```html
11445<!doctype html>
11446<html lang="en">
11447<head>
11448 <meta charset="utf-8">
11449 <title>jQuery.proxy demo</title>
11450 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11451</head>
11452<body>
11453
11454<p><button type="button" id="test">Test</button></p>
11455<div id="log"></div>
11456
11457<script>
11458var me = {
11459 // I'm a dog
11460 type: "dog",
11461
11462 // Note that event comes *after* one and two
11463 test: function( one, two, event ) {
11464 $( "#log" )
11465
11466 // `one` maps to `you`, the 1st additional
11467 // argument in the $.proxy function call
11468 .append( "<h3>Hello " + one.type + ":</h3>" )
11469
11470 // The `this` keyword refers to `me`
11471 // (the 2nd, context, argument of $.proxy)
11472 .append( "I am a " + this.type + ", " )
11473
11474 // `two` maps to `they`, the 2nd additional
11475 // argument in the $.proxy function call
11476 .append( "and they are " + two.type + ".<br>" )
11477
11478 // The event type is "click"
11479 .append( "Thanks for " + event.type + "ing." )
11480
11481 // The clicked element is `event.target`,
11482 // and its type is "button"
11483 .append( "the " + event.target.type + "." );
11484 }
11485};
11486
11487var you = { type: "cat" };
11488var they = { type: "fish" };
11489
11490// Set up handler to execute me.test() in the context
11491// of `me`, with `you` and `they` as additional arguments
11492var proxy = $.proxy( me.test, me, you, they );
11493
11494$( "#test" )
11495 .on( "click", proxy );
11496</script>
11497
11498</body>
11499</html>
11500```
11501 */
11502 proxy<TContext,
11503 TReturn,
11504 A,
11505 T, U, V, W, X, Y>(funсtion: (this: TContext, a: A,
11506 t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
11507 context: TContext,
11508 a: A): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
11509 /**
11510 * Takes a function and returns a new one that will always have a particular context.
11511 * @param funсtion The function whose context will be changed.
11512 * @param context The object to which the context (`this`) of the function should be set.
11513 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11514 * @since 1.4
11515 * @since 1.6
11516 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11517 * @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.
11518```html
11519<!doctype html>
11520<html lang="en">
11521<head>
11522 <meta charset="utf-8">
11523 <title>jQuery.proxy demo</title>
11524 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11525</head>
11526<body>
11527
11528<p><button type="button" id="test">Test</button></p>
11529<div id="log"></div>
11530
11531<script>
11532var me = {
11533 type: "zombie",
11534 test: function( event ) {
11535 // Without proxy, `this` would refer to the event target
11536 // use event.target to reference that element.
11537 var element = event.target;
11538 $( element ).css( "background-color", "red" );
11539
11540 // With proxy, `this` refers to the me object encapsulating
11541 // this function.
11542 $( "#log" ).append( "Hello " + this.type + "<br>" );
11543 $( "#test" ).off( "click", this.test );
11544 }
11545};
11546
11547var you = {
11548 type: "person",
11549 test: function( event ) {
11550 $( "#log" ).append( this.type + " " );
11551 }
11552};
11553
11554// Execute you.test() in the context of the `you` object
11555// no matter where it is called
11556// i.e. the `this` keyword will refer to `you`
11557var youClick = $.proxy( you.test, you );
11558
11559// attach click handlers to #test
11560$( "#test" )
11561 // this === "zombie"; handler unbound after first click
11562 .on( "click", $.proxy( me.test, me ) )
11563
11564 // this === "person"
11565 .on( "click", youClick )
11566
11567 // this === "zombie"
11568 .on( "click", $.proxy( you.test, me ) )
11569
11570 // this === "<button> element"
11571 .on( "click", you.test );
11572</script>
11573
11574</body>
11575</html>
11576```
11577 * @example ​ ````Change the context of a function bound to the click handler,
11578```html
11579<!doctype html>
11580<html lang="en">
11581<head>
11582 <meta charset="utf-8">
11583 <title>jQuery.proxy demo</title>
11584 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11585</head>
11586<body>
11587
11588<p><button type="button" id="test">Test</button></p>
11589<div id="log"></div>
11590
11591<script>
11592var me = {
11593 // I'm a dog
11594 type: "dog",
11595
11596 // Note that event comes *after* one and two
11597 test: function( one, two, event ) {
11598 $( "#log" )
11599
11600 // `one` maps to `you`, the 1st additional
11601 // argument in the $.proxy function call
11602 .append( "<h3>Hello " + one.type + ":</h3>" )
11603
11604 // The `this` keyword refers to `me`
11605 // (the 2nd, context, argument of $.proxy)
11606 .append( "I am a " + this.type + ", " )
11607
11608 // `two` maps to `they`, the 2nd additional
11609 // argument in the $.proxy function call
11610 .append( "and they are " + two.type + ".<br>" )
11611
11612 // The event type is "click"
11613 .append( "Thanks for " + event.type + "ing." )
11614
11615 // The clicked element is `event.target`,
11616 // and its type is "button"
11617 .append( "the " + event.target.type + "." );
11618 }
11619};
11620
11621var you = { type: "cat" };
11622var they = { type: "fish" };
11623
11624// Set up handler to execute me.test() in the context
11625// of `me`, with `you` and `they` as additional arguments
11626var proxy = $.proxy( me.test, me, you, they );
11627
11628$( "#test" )
11629 .on( "click", proxy );
11630</script>
11631
11632</body>
11633</html>
11634```
11635 */
11636 proxy<TContext,
11637 TReturn,
11638 T, U, V, W, X, Y>(funсtion: (this: TContext, t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn,
11639 context: TContext): (t: T, u: U, v: V, w: W, x: X, y: Y) => TReturn;
11640
11641 // #endregion
11642
11643 // region 7+ parameters
11644 // #region 7+ parameters
11645
11646 /**
11647 * Takes a function and returns a new one that will always have a particular context.
11648 * @param funсtion The function whose context will be changed.
11649 * @param context The object to which the context (`this`) of the function should be set.
11650 * @param a An argument to be passed to the function referenced in the `function` argument.
11651 * @param b An argument to be passed to the function referenced in the `function` argument.
11652 * @param c An argument to be passed to the function referenced in the `function` argument.
11653 * @param d An argument to be passed to the function referenced in the `function` argument.
11654 * @param e An argument to be passed to the function referenced in the `function` argument.
11655 * @param f An argument to be passed to the function referenced in the `function` argument.
11656 * @param g An argument to be passed to the function referenced in the `function` argument.
11657 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11658 * @since 1.4
11659 * @since 1.6
11660 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11661 * @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.
11662```html
11663<!doctype html>
11664<html lang="en">
11665<head>
11666 <meta charset="utf-8">
11667 <title>jQuery.proxy demo</title>
11668 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11669</head>
11670<body>
11671
11672<p><button type="button" id="test">Test</button></p>
11673<div id="log"></div>
11674
11675<script>
11676var me = {
11677 type: "zombie",
11678 test: function( event ) {
11679 // Without proxy, `this` would refer to the event target
11680 // use event.target to reference that element.
11681 var element = event.target;
11682 $( element ).css( "background-color", "red" );
11683
11684 // With proxy, `this` refers to the me object encapsulating
11685 // this function.
11686 $( "#log" ).append( "Hello " + this.type + "<br>" );
11687 $( "#test" ).off( "click", this.test );
11688 }
11689};
11690
11691var you = {
11692 type: "person",
11693 test: function( event ) {
11694 $( "#log" ).append( this.type + " " );
11695 }
11696};
11697
11698// Execute you.test() in the context of the `you` object
11699// no matter where it is called
11700// i.e. the `this` keyword will refer to `you`
11701var youClick = $.proxy( you.test, you );
11702
11703// attach click handlers to #test
11704$( "#test" )
11705 // this === "zombie"; handler unbound after first click
11706 .on( "click", $.proxy( me.test, me ) )
11707
11708 // this === "person"
11709 .on( "click", youClick )
11710
11711 // this === "zombie"
11712 .on( "click", $.proxy( you.test, me ) )
11713
11714 // this === "<button> element"
11715 .on( "click", you.test );
11716</script>
11717
11718</body>
11719</html>
11720```
11721 * @example ​ ````Change the context of a function bound to the click handler,
11722```html
11723<!doctype html>
11724<html lang="en">
11725<head>
11726 <meta charset="utf-8">
11727 <title>jQuery.proxy demo</title>
11728 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11729</head>
11730<body>
11731
11732<p><button type="button" id="test">Test</button></p>
11733<div id="log"></div>
11734
11735<script>
11736var me = {
11737 // I'm a dog
11738 type: "dog",
11739
11740 // Note that event comes *after* one and two
11741 test: function( one, two, event ) {
11742 $( "#log" )
11743
11744 // `one` maps to `you`, the 1st additional
11745 // argument in the $.proxy function call
11746 .append( "<h3>Hello " + one.type + ":</h3>" )
11747
11748 // The `this` keyword refers to `me`
11749 // (the 2nd, context, argument of $.proxy)
11750 .append( "I am a " + this.type + ", " )
11751
11752 // `two` maps to `they`, the 2nd additional
11753 // argument in the $.proxy function call
11754 .append( "and they are " + two.type + ".<br>" )
11755
11756 // The event type is "click"
11757 .append( "Thanks for " + event.type + "ing." )
11758
11759 // The clicked element is `event.target`,
11760 // and its type is "button"
11761 .append( "the " + event.target.type + "." );
11762 }
11763};
11764
11765var you = { type: "cat" };
11766var they = { type: "fish" };
11767
11768// Set up handler to execute me.test() in the context
11769// of `me`, with `you` and `they` as additional arguments
11770var proxy = $.proxy( me.test, me, you, they );
11771
11772$( "#test" )
11773 .on( "click", proxy );
11774</script>
11775
11776</body>
11777</html>
11778```
11779 */
11780 proxy<TContext,
11781 TReturn,
11782 A, B, C, D, E, F, G,
11783 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,
11784 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
11785 context: TContext,
11786 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;
11787 /**
11788 * Takes a function and returns a new one that will always have a particular context.
11789 * @param funсtion The function whose context will be changed.
11790 * @param context The object to which the context (`this`) of the function should be set.
11791 * @param a An argument to be passed to the function referenced in the `function` argument.
11792 * @param b An argument to be passed to the function referenced in the `function` argument.
11793 * @param c An argument to be passed to the function referenced in the `function` argument.
11794 * @param d An argument to be passed to the function referenced in the `function` argument.
11795 * @param e An argument to be passed to the function referenced in the `function` argument.
11796 * @param f An argument to be passed to the function referenced in the `function` argument.
11797 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11798 * @since 1.4
11799 * @since 1.6
11800 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11801 * @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.
11802```html
11803<!doctype html>
11804<html lang="en">
11805<head>
11806 <meta charset="utf-8">
11807 <title>jQuery.proxy demo</title>
11808 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11809</head>
11810<body>
11811
11812<p><button type="button" id="test">Test</button></p>
11813<div id="log"></div>
11814
11815<script>
11816var me = {
11817 type: "zombie",
11818 test: function( event ) {
11819 // Without proxy, `this` would refer to the event target
11820 // use event.target to reference that element.
11821 var element = event.target;
11822 $( element ).css( "background-color", "red" );
11823
11824 // With proxy, `this` refers to the me object encapsulating
11825 // this function.
11826 $( "#log" ).append( "Hello " + this.type + "<br>" );
11827 $( "#test" ).off( "click", this.test );
11828 }
11829};
11830
11831var you = {
11832 type: "person",
11833 test: function( event ) {
11834 $( "#log" ).append( this.type + " " );
11835 }
11836};
11837
11838// Execute you.test() in the context of the `you` object
11839// no matter where it is called
11840// i.e. the `this` keyword will refer to `you`
11841var youClick = $.proxy( you.test, you );
11842
11843// attach click handlers to #test
11844$( "#test" )
11845 // this === "zombie"; handler unbound after first click
11846 .on( "click", $.proxy( me.test, me ) )
11847
11848 // this === "person"
11849 .on( "click", youClick )
11850
11851 // this === "zombie"
11852 .on( "click", $.proxy( you.test, me ) )
11853
11854 // this === "<button> element"
11855 .on( "click", you.test );
11856</script>
11857
11858</body>
11859</html>
11860```
11861 * @example ​ ````Change the context of a function bound to the click handler,
11862```html
11863<!doctype html>
11864<html lang="en">
11865<head>
11866 <meta charset="utf-8">
11867 <title>jQuery.proxy demo</title>
11868 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11869</head>
11870<body>
11871
11872<p><button type="button" id="test">Test</button></p>
11873<div id="log"></div>
11874
11875<script>
11876var me = {
11877 // I'm a dog
11878 type: "dog",
11879
11880 // Note that event comes *after* one and two
11881 test: function( one, two, event ) {
11882 $( "#log" )
11883
11884 // `one` maps to `you`, the 1st additional
11885 // argument in the $.proxy function call
11886 .append( "<h3>Hello " + one.type + ":</h3>" )
11887
11888 // The `this` keyword refers to `me`
11889 // (the 2nd, context, argument of $.proxy)
11890 .append( "I am a " + this.type + ", " )
11891
11892 // `two` maps to `they`, the 2nd additional
11893 // argument in the $.proxy function call
11894 .append( "and they are " + two.type + ".<br>" )
11895
11896 // The event type is "click"
11897 .append( "Thanks for " + event.type + "ing." )
11898
11899 // The clicked element is `event.target`,
11900 // and its type is "button"
11901 .append( "the " + event.target.type + "." );
11902 }
11903};
11904
11905var you = { type: "cat" };
11906var they = { type: "fish" };
11907
11908// Set up handler to execute me.test() in the context
11909// of `me`, with `you` and `they` as additional arguments
11910var proxy = $.proxy( me.test, me, you, they );
11911
11912$( "#test" )
11913 .on( "click", proxy );
11914</script>
11915
11916</body>
11917</html>
11918```
11919 */
11920 proxy<TContext,
11921 TReturn,
11922 A, B, C, D, E, F,
11923 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E, f: F,
11924 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
11925 context: TContext,
11926 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;
11927 /**
11928 * Takes a function and returns a new one that will always have a particular context.
11929 * @param funсtion The function whose context will be changed.
11930 * @param context The object to which the context (`this`) of the function should be set.
11931 * @param a An argument to be passed to the function referenced in the `function` argument.
11932 * @param b An argument to be passed to the function referenced in the `function` argument.
11933 * @param c An argument to be passed to the function referenced in the `function` argument.
11934 * @param d An argument to be passed to the function referenced in the `function` argument.
11935 * @param e An argument to be passed to the function referenced in the `function` argument.
11936 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
11937 * @since 1.4
11938 * @since 1.6
11939 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
11940 * @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.
11941```html
11942<!doctype html>
11943<html lang="en">
11944<head>
11945 <meta charset="utf-8">
11946 <title>jQuery.proxy demo</title>
11947 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
11948</head>
11949<body>
11950
11951<p><button type="button" id="test">Test</button></p>
11952<div id="log"></div>
11953
11954<script>
11955var me = {
11956 type: "zombie",
11957 test: function( event ) {
11958 // Without proxy, `this` would refer to the event target
11959 // use event.target to reference that element.
11960 var element = event.target;
11961 $( element ).css( "background-color", "red" );
11962
11963 // With proxy, `this` refers to the me object encapsulating
11964 // this function.
11965 $( "#log" ).append( "Hello " + this.type + "<br>" );
11966 $( "#test" ).off( "click", this.test );
11967 }
11968};
11969
11970var you = {
11971 type: "person",
11972 test: function( event ) {
11973 $( "#log" ).append( this.type + " " );
11974 }
11975};
11976
11977// Execute you.test() in the context of the `you` object
11978// no matter where it is called
11979// i.e. the `this` keyword will refer to `you`
11980var youClick = $.proxy( you.test, you );
11981
11982// attach click handlers to #test
11983$( "#test" )
11984 // this === "zombie"; handler unbound after first click
11985 .on( "click", $.proxy( me.test, me ) )
11986
11987 // this === "person"
11988 .on( "click", youClick )
11989
11990 // this === "zombie"
11991 .on( "click", $.proxy( you.test, me ) )
11992
11993 // this === "<button> element"
11994 .on( "click", you.test );
11995</script>
11996
11997</body>
11998</html>
11999```
12000 * @example ​ ````Change the context of a function bound to the click handler,
12001```html
12002<!doctype html>
12003<html lang="en">
12004<head>
12005 <meta charset="utf-8">
12006 <title>jQuery.proxy demo</title>
12007 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12008</head>
12009<body>
12010
12011<p><button type="button" id="test">Test</button></p>
12012<div id="log"></div>
12013
12014<script>
12015var me = {
12016 // I'm a dog
12017 type: "dog",
12018
12019 // Note that event comes *after* one and two
12020 test: function( one, two, event ) {
12021 $( "#log" )
12022
12023 // `one` maps to `you`, the 1st additional
12024 // argument in the $.proxy function call
12025 .append( "<h3>Hello " + one.type + ":</h3>" )
12026
12027 // The `this` keyword refers to `me`
12028 // (the 2nd, context, argument of $.proxy)
12029 .append( "I am a " + this.type + ", " )
12030
12031 // `two` maps to `they`, the 2nd additional
12032 // argument in the $.proxy function call
12033 .append( "and they are " + two.type + ".<br>" )
12034
12035 // The event type is "click"
12036 .append( "Thanks for " + event.type + "ing." )
12037
12038 // The clicked element is `event.target`,
12039 // and its type is "button"
12040 .append( "the " + event.target.type + "." );
12041 }
12042};
12043
12044var you = { type: "cat" };
12045var they = { type: "fish" };
12046
12047// Set up handler to execute me.test() in the context
12048// of `me`, with `you` and `they` as additional arguments
12049var proxy = $.proxy( me.test, me, you, they );
12050
12051$( "#test" )
12052 .on( "click", proxy );
12053</script>
12054
12055</body>
12056</html>
12057```
12058 */
12059 proxy<TContext,
12060 TReturn,
12061 A, B, C, D, E,
12062 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A, b: B, c: C, d: D, e: E,
12063 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
12064 context: TContext,
12065 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;
12066 /**
12067 * Takes a function and returns a new one that will always have a particular context.
12068 * @param funсtion The function whose context will be changed.
12069 * @param context The object to which the context (`this`) of the function should be set.
12070 * @param a An argument to be passed to the function referenced in the `function` argument.
12071 * @param b An argument to be passed to the function referenced in the `function` argument.
12072 * @param c An argument to be passed to the function referenced in the `function` argument.
12073 * @param d An argument to be passed to the function referenced in the `function` argument.
12074 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12075 * @since 1.4
12076 * @since 1.6
12077 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12078 * @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.
12079```html
12080<!doctype html>
12081<html lang="en">
12082<head>
12083 <meta charset="utf-8">
12084 <title>jQuery.proxy demo</title>
12085 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12086</head>
12087<body>
12088
12089<p><button type="button" id="test">Test</button></p>
12090<div id="log"></div>
12091
12092<script>
12093var me = {
12094 type: "zombie",
12095 test: function( event ) {
12096 // Without proxy, `this` would refer to the event target
12097 // use event.target to reference that element.
12098 var element = event.target;
12099 $( element ).css( "background-color", "red" );
12100
12101 // With proxy, `this` refers to the me object encapsulating
12102 // this function.
12103 $( "#log" ).append( "Hello " + this.type + "<br>" );
12104 $( "#test" ).off( "click", this.test );
12105 }
12106};
12107
12108var you = {
12109 type: "person",
12110 test: function( event ) {
12111 $( "#log" ).append( this.type + " " );
12112 }
12113};
12114
12115// Execute you.test() in the context of the `you` object
12116// no matter where it is called
12117// i.e. the `this` keyword will refer to `you`
12118var youClick = $.proxy( you.test, you );
12119
12120// attach click handlers to #test
12121$( "#test" )
12122 // this === "zombie"; handler unbound after first click
12123 .on( "click", $.proxy( me.test, me ) )
12124
12125 // this === "person"
12126 .on( "click", youClick )
12127
12128 // this === "zombie"
12129 .on( "click", $.proxy( you.test, me ) )
12130
12131 // this === "<button> element"
12132 .on( "click", you.test );
12133</script>
12134
12135</body>
12136</html>
12137```
12138 * @example ​ ````Change the context of a function bound to the click handler,
12139```html
12140<!doctype html>
12141<html lang="en">
12142<head>
12143 <meta charset="utf-8">
12144 <title>jQuery.proxy demo</title>
12145 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12146</head>
12147<body>
12148
12149<p><button type="button" id="test">Test</button></p>
12150<div id="log"></div>
12151
12152<script>
12153var me = {
12154 // I'm a dog
12155 type: "dog",
12156
12157 // Note that event comes *after* one and two
12158 test: function( one, two, event ) {
12159 $( "#log" )
12160
12161 // `one` maps to `you`, the 1st additional
12162 // argument in the $.proxy function call
12163 .append( "<h3>Hello " + one.type + ":</h3>" )
12164
12165 // The `this` keyword refers to `me`
12166 // (the 2nd, context, argument of $.proxy)
12167 .append( "I am a " + this.type + ", " )
12168
12169 // `two` maps to `they`, the 2nd additional
12170 // argument in the $.proxy function call
12171 .append( "and they are " + two.type + ".<br>" )
12172
12173 // The event type is "click"
12174 .append( "Thanks for " + event.type + "ing." )
12175
12176 // The clicked element is `event.target`,
12177 // and its type is "button"
12178 .append( "the " + event.target.type + "." );
12179 }
12180};
12181
12182var you = { type: "cat" };
12183var they = { type: "fish" };
12184
12185// Set up handler to execute me.test() in the context
12186// of `me`, with `you` and `they` as additional arguments
12187var proxy = $.proxy( me.test, me, you, they );
12188
12189$( "#test" )
12190 .on( "click", proxy );
12191</script>
12192
12193</body>
12194</html>
12195```
12196 */
12197 proxy<TContext,
12198 TReturn,
12199 A, B, C, D,
12200 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A, b: B, c: C, d: D,
12201 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
12202 context: TContext,
12203 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;
12204 /**
12205 * Takes a function and returns a new one that will always have a particular context.
12206 * @param funсtion The function whose context will be changed.
12207 * @param context The object to which the context (`this`) of the function should be set.
12208 * @param a An argument to be passed to the function referenced in the `function` argument.
12209 * @param b An argument to be passed to the function referenced in the `function` argument.
12210 * @param c An argument to be passed to the function referenced in the `function` argument.
12211 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12212 * @since 1.4
12213 * @since 1.6
12214 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12215 * @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.
12216```html
12217<!doctype html>
12218<html lang="en">
12219<head>
12220 <meta charset="utf-8">
12221 <title>jQuery.proxy demo</title>
12222 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12223</head>
12224<body>
12225
12226<p><button type="button" id="test">Test</button></p>
12227<div id="log"></div>
12228
12229<script>
12230var me = {
12231 type: "zombie",
12232 test: function( event ) {
12233 // Without proxy, `this` would refer to the event target
12234 // use event.target to reference that element.
12235 var element = event.target;
12236 $( element ).css( "background-color", "red" );
12237
12238 // With proxy, `this` refers to the me object encapsulating
12239 // this function.
12240 $( "#log" ).append( "Hello " + this.type + "<br>" );
12241 $( "#test" ).off( "click", this.test );
12242 }
12243};
12244
12245var you = {
12246 type: "person",
12247 test: function( event ) {
12248 $( "#log" ).append( this.type + " " );
12249 }
12250};
12251
12252// Execute you.test() in the context of the `you` object
12253// no matter where it is called
12254// i.e. the `this` keyword will refer to `you`
12255var youClick = $.proxy( you.test, you );
12256
12257// attach click handlers to #test
12258$( "#test" )
12259 // this === "zombie"; handler unbound after first click
12260 .on( "click", $.proxy( me.test, me ) )
12261
12262 // this === "person"
12263 .on( "click", youClick )
12264
12265 // this === "zombie"
12266 .on( "click", $.proxy( you.test, me ) )
12267
12268 // this === "<button> element"
12269 .on( "click", you.test );
12270</script>
12271
12272</body>
12273</html>
12274```
12275 * @example ​ ````Change the context of a function bound to the click handler,
12276```html
12277<!doctype html>
12278<html lang="en">
12279<head>
12280 <meta charset="utf-8">
12281 <title>jQuery.proxy demo</title>
12282 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12283</head>
12284<body>
12285
12286<p><button type="button" id="test">Test</button></p>
12287<div id="log"></div>
12288
12289<script>
12290var me = {
12291 // I'm a dog
12292 type: "dog",
12293
12294 // Note that event comes *after* one and two
12295 test: function( one, two, event ) {
12296 $( "#log" )
12297
12298 // `one` maps to `you`, the 1st additional
12299 // argument in the $.proxy function call
12300 .append( "<h3>Hello " + one.type + ":</h3>" )
12301
12302 // The `this` keyword refers to `me`
12303 // (the 2nd, context, argument of $.proxy)
12304 .append( "I am a " + this.type + ", " )
12305
12306 // `two` maps to `they`, the 2nd additional
12307 // argument in the $.proxy function call
12308 .append( "and they are " + two.type + ".<br>" )
12309
12310 // The event type is "click"
12311 .append( "Thanks for " + event.type + "ing." )
12312
12313 // The clicked element is `event.target`,
12314 // and its type is "button"
12315 .append( "the " + event.target.type + "." );
12316 }
12317};
12318
12319var you = { type: "cat" };
12320var they = { type: "fish" };
12321
12322// Set up handler to execute me.test() in the context
12323// of `me`, with `you` and `they` as additional arguments
12324var proxy = $.proxy( me.test, me, you, they );
12325
12326$( "#test" )
12327 .on( "click", proxy );
12328</script>
12329
12330</body>
12331</html>
12332```
12333 */
12334 proxy<TContext,
12335 TReturn,
12336 A, B, C,
12337 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A, b: B, c: C,
12338 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
12339 context: TContext,
12340 a: A, b: B, c: C): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
12341 /**
12342 * Takes a function and returns a new one that will always have a particular context.
12343 * @param funсtion The function whose context will be changed.
12344 * @param context The object to which the context (`this`) of the function should be set.
12345 * @param a An argument to be passed to the function referenced in the `function` argument.
12346 * @param b An argument to be passed to the function referenced in the `function` argument.
12347 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12348 * @since 1.4
12349 * @since 1.6
12350 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12351 * @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.
12352```html
12353<!doctype html>
12354<html lang="en">
12355<head>
12356 <meta charset="utf-8">
12357 <title>jQuery.proxy demo</title>
12358 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12359</head>
12360<body>
12361
12362<p><button type="button" id="test">Test</button></p>
12363<div id="log"></div>
12364
12365<script>
12366var me = {
12367 type: "zombie",
12368 test: function( event ) {
12369 // Without proxy, `this` would refer to the event target
12370 // use event.target to reference that element.
12371 var element = event.target;
12372 $( element ).css( "background-color", "red" );
12373
12374 // With proxy, `this` refers to the me object encapsulating
12375 // this function.
12376 $( "#log" ).append( "Hello " + this.type + "<br>" );
12377 $( "#test" ).off( "click", this.test );
12378 }
12379};
12380
12381var you = {
12382 type: "person",
12383 test: function( event ) {
12384 $( "#log" ).append( this.type + " " );
12385 }
12386};
12387
12388// Execute you.test() in the context of the `you` object
12389// no matter where it is called
12390// i.e. the `this` keyword will refer to `you`
12391var youClick = $.proxy( you.test, you );
12392
12393// attach click handlers to #test
12394$( "#test" )
12395 // this === "zombie"; handler unbound after first click
12396 .on( "click", $.proxy( me.test, me ) )
12397
12398 // this === "person"
12399 .on( "click", youClick )
12400
12401 // this === "zombie"
12402 .on( "click", $.proxy( you.test, me ) )
12403
12404 // this === "<button> element"
12405 .on( "click", you.test );
12406</script>
12407
12408</body>
12409</html>
12410```
12411 * @example ​ ````Change the context of a function bound to the click handler,
12412```html
12413<!doctype html>
12414<html lang="en">
12415<head>
12416 <meta charset="utf-8">
12417 <title>jQuery.proxy demo</title>
12418 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12419</head>
12420<body>
12421
12422<p><button type="button" id="test">Test</button></p>
12423<div id="log"></div>
12424
12425<script>
12426var me = {
12427 // I'm a dog
12428 type: "dog",
12429
12430 // Note that event comes *after* one and two
12431 test: function( one, two, event ) {
12432 $( "#log" )
12433
12434 // `one` maps to `you`, the 1st additional
12435 // argument in the $.proxy function call
12436 .append( "<h3>Hello " + one.type + ":</h3>" )
12437
12438 // The `this` keyword refers to `me`
12439 // (the 2nd, context, argument of $.proxy)
12440 .append( "I am a " + this.type + ", " )
12441
12442 // `two` maps to `they`, the 2nd additional
12443 // argument in the $.proxy function call
12444 .append( "and they are " + two.type + ".<br>" )
12445
12446 // The event type is "click"
12447 .append( "Thanks for " + event.type + "ing." )
12448
12449 // The clicked element is `event.target`,
12450 // and its type is "button"
12451 .append( "the " + event.target.type + "." );
12452 }
12453};
12454
12455var you = { type: "cat" };
12456var they = { type: "fish" };
12457
12458// Set up handler to execute me.test() in the context
12459// of `me`, with `you` and `they` as additional arguments
12460var proxy = $.proxy( me.test, me, you, they );
12461
12462$( "#test" )
12463 .on( "click", proxy );
12464</script>
12465
12466</body>
12467</html>
12468```
12469 */
12470 proxy<TContext,
12471 TReturn,
12472 A, B,
12473 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A, b: B,
12474 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
12475 context: TContext,
12476 a: A, b: B): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
12477 /**
12478 * Takes a function and returns a new one that will always have a particular context.
12479 * @param funсtion The function whose context will be changed.
12480 * @param context The object to which the context (`this`) of the function should be set.
12481 * @param a An argument to be passed to the function referenced in the `function` argument.
12482 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12483 * @since 1.4
12484 * @since 1.6
12485 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12486 * @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.
12487```html
12488<!doctype html>
12489<html lang="en">
12490<head>
12491 <meta charset="utf-8">
12492 <title>jQuery.proxy demo</title>
12493 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12494</head>
12495<body>
12496
12497<p><button type="button" id="test">Test</button></p>
12498<div id="log"></div>
12499
12500<script>
12501var me = {
12502 type: "zombie",
12503 test: function( event ) {
12504 // Without proxy, `this` would refer to the event target
12505 // use event.target to reference that element.
12506 var element = event.target;
12507 $( element ).css( "background-color", "red" );
12508
12509 // With proxy, `this` refers to the me object encapsulating
12510 // this function.
12511 $( "#log" ).append( "Hello " + this.type + "<br>" );
12512 $( "#test" ).off( "click", this.test );
12513 }
12514};
12515
12516var you = {
12517 type: "person",
12518 test: function( event ) {
12519 $( "#log" ).append( this.type + " " );
12520 }
12521};
12522
12523// Execute you.test() in the context of the `you` object
12524// no matter where it is called
12525// i.e. the `this` keyword will refer to `you`
12526var youClick = $.proxy( you.test, you );
12527
12528// attach click handlers to #test
12529$( "#test" )
12530 // this === "zombie"; handler unbound after first click
12531 .on( "click", $.proxy( me.test, me ) )
12532
12533 // this === "person"
12534 .on( "click", youClick )
12535
12536 // this === "zombie"
12537 .on( "click", $.proxy( you.test, me ) )
12538
12539 // this === "<button> element"
12540 .on( "click", you.test );
12541</script>
12542
12543</body>
12544</html>
12545```
12546 * @example ​ ````Change the context of a function bound to the click handler,
12547```html
12548<!doctype html>
12549<html lang="en">
12550<head>
12551 <meta charset="utf-8">
12552 <title>jQuery.proxy demo</title>
12553 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12554</head>
12555<body>
12556
12557<p><button type="button" id="test">Test</button></p>
12558<div id="log"></div>
12559
12560<script>
12561var me = {
12562 // I'm a dog
12563 type: "dog",
12564
12565 // Note that event comes *after* one and two
12566 test: function( one, two, event ) {
12567 $( "#log" )
12568
12569 // `one` maps to `you`, the 1st additional
12570 // argument in the $.proxy function call
12571 .append( "<h3>Hello " + one.type + ":</h3>" )
12572
12573 // The `this` keyword refers to `me`
12574 // (the 2nd, context, argument of $.proxy)
12575 .append( "I am a " + this.type + ", " )
12576
12577 // `two` maps to `they`, the 2nd additional
12578 // argument in the $.proxy function call
12579 .append( "and they are " + two.type + ".<br>" )
12580
12581 // The event type is "click"
12582 .append( "Thanks for " + event.type + "ing." )
12583
12584 // The clicked element is `event.target`,
12585 // and its type is "button"
12586 .append( "the " + event.target.type + "." );
12587 }
12588};
12589
12590var you = { type: "cat" };
12591var they = { type: "fish" };
12592
12593// Set up handler to execute me.test() in the context
12594// of `me`, with `you` and `they` as additional arguments
12595var proxy = $.proxy( me.test, me, you, they );
12596
12597$( "#test" )
12598 .on( "click", proxy );
12599</script>
12600
12601</body>
12602</html>
12603```
12604 */
12605 proxy<TContext,
12606 TReturn,
12607 A,
12608 T, U, V, W, X, Y, Z>(funсtion: (this: TContext, a: A,
12609 t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn,
12610 context: TContext,
12611 a: A): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
12612 /**
12613 * Takes a function and returns a new one that will always have a particular context.
12614 * @param funсtion The function whose context will be changed.
12615 * @param context The object to which the context (`this`) of the function should be set.
12616 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12617 * @since 1.4
12618 * @since 1.6
12619 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12620 * @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.
12621```html
12622<!doctype html>
12623<html lang="en">
12624<head>
12625 <meta charset="utf-8">
12626 <title>jQuery.proxy demo</title>
12627 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12628</head>
12629<body>
12630
12631<p><button type="button" id="test">Test</button></p>
12632<div id="log"></div>
12633
12634<script>
12635var me = {
12636 type: "zombie",
12637 test: function( event ) {
12638 // Without proxy, `this` would refer to the event target
12639 // use event.target to reference that element.
12640 var element = event.target;
12641 $( element ).css( "background-color", "red" );
12642
12643 // With proxy, `this` refers to the me object encapsulating
12644 // this function.
12645 $( "#log" ).append( "Hello " + this.type + "<br>" );
12646 $( "#test" ).off( "click", this.test );
12647 }
12648};
12649
12650var you = {
12651 type: "person",
12652 test: function( event ) {
12653 $( "#log" ).append( this.type + " " );
12654 }
12655};
12656
12657// Execute you.test() in the context of the `you` object
12658// no matter where it is called
12659// i.e. the `this` keyword will refer to `you`
12660var youClick = $.proxy( you.test, you );
12661
12662// attach click handlers to #test
12663$( "#test" )
12664 // this === "zombie"; handler unbound after first click
12665 .on( "click", $.proxy( me.test, me ) )
12666
12667 // this === "person"
12668 .on( "click", youClick )
12669
12670 // this === "zombie"
12671 .on( "click", $.proxy( you.test, me ) )
12672
12673 // this === "<button> element"
12674 .on( "click", you.test );
12675</script>
12676
12677</body>
12678</html>
12679```
12680 * @example ​ ````Change the context of a function bound to the click handler,
12681```html
12682<!doctype html>
12683<html lang="en">
12684<head>
12685 <meta charset="utf-8">
12686 <title>jQuery.proxy demo</title>
12687 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12688</head>
12689<body>
12690
12691<p><button type="button" id="test">Test</button></p>
12692<div id="log"></div>
12693
12694<script>
12695var me = {
12696 // I'm a dog
12697 type: "dog",
12698
12699 // Note that event comes *after* one and two
12700 test: function( one, two, event ) {
12701 $( "#log" )
12702
12703 // `one` maps to `you`, the 1st additional
12704 // argument in the $.proxy function call
12705 .append( "<h3>Hello " + one.type + ":</h3>" )
12706
12707 // The `this` keyword refers to `me`
12708 // (the 2nd, context, argument of $.proxy)
12709 .append( "I am a " + this.type + ", " )
12710
12711 // `two` maps to `they`, the 2nd additional
12712 // argument in the $.proxy function call
12713 .append( "and they are " + two.type + ".<br>" )
12714
12715 // The event type is "click"
12716 .append( "Thanks for " + event.type + "ing." )
12717
12718 // The clicked element is `event.target`,
12719 // and its type is "button"
12720 .append( "the " + event.target.type + "." );
12721 }
12722};
12723
12724var you = { type: "cat" };
12725var they = { type: "fish" };
12726
12727// Set up handler to execute me.test() in the context
12728// of `me`, with `you` and `they` as additional arguments
12729var proxy = $.proxy( me.test, me, you, they );
12730
12731$( "#test" )
12732 .on( "click", proxy );
12733</script>
12734
12735</body>
12736</html>
12737```
12738 */
12739 proxy<TContext,
12740 TReturn,
12741 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,
12742 context: TContext): (t: T, u: U, v: V, w: W, x: X, y: Y, z: Z, ...args: any[]) => TReturn;
12743
12744 // #endregion
12745
12746 // #endregion
12747
12748 // region 8+ additional arguments
12749 // #region 8+ additional arguments
12750
12751 /**
12752 * Takes a function and returns a new one that will always have a particular context.
12753 * @param funсtion The function whose context will be changed.
12754 * @param context The object to which the context (`this`) of the function should be set.
12755 * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument.
12756 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12757 * @since 1.4
12758 * @since 1.6
12759 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12760 * @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.
12761```html
12762<!doctype html>
12763<html lang="en">
12764<head>
12765 <meta charset="utf-8">
12766 <title>jQuery.proxy demo</title>
12767 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12768</head>
12769<body>
12770
12771<p><button type="button" id="test">Test</button></p>
12772<div id="log"></div>
12773
12774<script>
12775var me = {
12776 type: "zombie",
12777 test: function( event ) {
12778 // Without proxy, `this` would refer to the event target
12779 // use event.target to reference that element.
12780 var element = event.target;
12781 $( element ).css( "background-color", "red" );
12782
12783 // With proxy, `this` refers to the me object encapsulating
12784 // this function.
12785 $( "#log" ).append( "Hello " + this.type + "<br>" );
12786 $( "#test" ).off( "click", this.test );
12787 }
12788};
12789
12790var you = {
12791 type: "person",
12792 test: function( event ) {
12793 $( "#log" ).append( this.type + " " );
12794 }
12795};
12796
12797// Execute you.test() in the context of the `you` object
12798// no matter where it is called
12799// i.e. the `this` keyword will refer to `you`
12800var youClick = $.proxy( you.test, you );
12801
12802// attach click handlers to #test
12803$( "#test" )
12804 // this === "zombie"; handler unbound after first click
12805 .on( "click", $.proxy( me.test, me ) )
12806
12807 // this === "person"
12808 .on( "click", youClick )
12809
12810 // this === "zombie"
12811 .on( "click", $.proxy( you.test, me ) )
12812
12813 // this === "<button> element"
12814 .on( "click", you.test );
12815</script>
12816
12817</body>
12818</html>
12819```
12820 * @example ​ ````Change the context of a function bound to the click handler,
12821```html
12822<!doctype html>
12823<html lang="en">
12824<head>
12825 <meta charset="utf-8">
12826 <title>jQuery.proxy demo</title>
12827 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12828</head>
12829<body>
12830
12831<p><button type="button" id="test">Test</button></p>
12832<div id="log"></div>
12833
12834<script>
12835var me = {
12836 // I'm a dog
12837 type: "dog",
12838
12839 // Note that event comes *after* one and two
12840 test: function( one, two, event ) {
12841 $( "#log" )
12842
12843 // `one` maps to `you`, the 1st additional
12844 // argument in the $.proxy function call
12845 .append( "<h3>Hello " + one.type + ":</h3>" )
12846
12847 // The `this` keyword refers to `me`
12848 // (the 2nd, context, argument of $.proxy)
12849 .append( "I am a " + this.type + ", " )
12850
12851 // `two` maps to `they`, the 2nd additional
12852 // argument in the $.proxy function call
12853 .append( "and they are " + two.type + ".<br>" )
12854
12855 // The event type is "click"
12856 .append( "Thanks for " + event.type + "ing." )
12857
12858 // The clicked element is `event.target`,
12859 // and its type is "button"
12860 .append( "the " + event.target.type + "." );
12861 }
12862};
12863
12864var you = { type: "cat" };
12865var they = { type: "fish" };
12866
12867// Set up handler to execute me.test() in the context
12868// of `me`, with `you` and `they` as additional arguments
12869var proxy = $.proxy( me.test, me, you, they );
12870
12871$( "#test" )
12872 .on( "click", proxy );
12873</script>
12874
12875</body>
12876</html>
12877```
12878 */
12879 proxy<TContext,
12880 TReturn>(funсtion: (this: TContext, ...args: any[]) => TReturn,
12881 context: TContext,
12882 ...additionalArguments: any[]): (...args: any[]) => TReturn;
12883
12884 // #endregion
12885
12886 // #endregion
12887
12888 // region (context, name)
12889 // #region (context, name)
12890
12891 /**
12892 * Takes a function and returns a new one that will always have a particular context.
12893 * @param context The object to which the context of the function should be set.
12894 * @param name The name of the function whose context will be changed (should be a property of the context object).
12895 * @param additionalArguments Any number of arguments to be passed to the function named in the name argument.
12896 * @see \`{@link https://api.jquery.com/jQuery.proxy/ }\`
12897 * @since 1.4
12898 * @since 1.6
12899 * @deprecated ​ Deprecated since 3.3. Use \`{@link Function#bind }\`.
12900 * @example ​ ````Enforce the context of the function using the &quot;context, function name&quot; signature. Unbind the handler after first click.
12901```html
12902<!doctype html>
12903<html lang="en">
12904<head>
12905 <meta charset="utf-8">
12906 <title>jQuery.proxy demo</title>
12907 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12908</head>
12909<body>
12910
12911 <p><button id="test">Test</button></p>
12912 <p id="log"></p>
12913
12914<script>
12915var obj = {
12916 name: "John",
12917 test: function() {
12918 $( "#log" ).append( this.name );
12919 $( "#test" ).off( "click", obj.test );
12920 }
12921};
12922$( "#test" ).on( "click", jQuery.proxy( obj, "test" ) );
12923</script>
12924
12925</body>
12926</html>
12927```
12928 */
12929 proxy<TContext>(context: TContext,
12930 name: keyof TContext,
12931 ...additionalArguments: any[]): (...args: any[]) => any;
12932
12933 // #endregion
12934
12935 // #endregion
12936
12937 /**
12938 * Manipulate the queue of functions to be executed on the matched element.
12939 * @param element A DOM element where the array of queued functions is attached.
12940 * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
12941 * @param newQueue The new function to add to the queue.
12942 * An array of functions to replace the current queue contents.
12943 * @see \`{@link https://api.jquery.com/jQuery.queue/ }\`
12944 * @since 1.3
12945 * @example ​ ````Show the length of the queue.
12946```html
12947<!doctype html>
12948<html lang="en">
12949<head>
12950 <meta charset="utf-8">
12951 <title>jQuery.queue demo</title>
12952 <style>
12953 div {
12954 margin: 3px;
12955 width: 40px;
12956 height: 40px;
12957 position: absolute;
12958 left: 0px;
12959 top: 30px;
12960 background: green;
12961 display: none;
12962 }
12963 div.newcolor {
12964 background: blue;
12965 }
12966 span {
12967 color: red;
12968 }
12969 </style>
12970 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
12971</head>
12972<body>
12973
12974<button id="show">Show Length of Queue</button>
12975<span></span>
12976<div></div>
12977
12978<script>
12979$( "#show" ).click(function() {
12980 var n = jQuery.queue( $( "div" )[ 0 ], "fx" );
12981 $( "span" ).text( "Queue length is: " + n.length );
12982});
12983
12984function runIt() {
12985 $( "div" )
12986 .show( "slow" )
12987 .animate({
12988 left: "+=200"
12989 }, 2000 )
12990 .slideToggle( 1000 )
12991 .slideToggle( "fast" )
12992 .animate({
12993 left: "-=200"
12994 }, 1500 )
12995 .hide( "slow" )
12996 .show( 1200 )
12997 .slideUp( "normal", runIt );
12998}
12999
13000runIt();
13001</script>
13002
13003</body>
13004</html>
13005```
13006 * @example ​ ````Queue a custom function.
13007```html
13008<!doctype html>
13009<html lang="en">
13010<head>
13011 <meta charset="utf-8">
13012 <title>jQuery.queue demo</title>
13013 <style>
13014 div {
13015 margin: 3px;
13016 width: 40px;
13017 height: 40px;
13018 position: absolute;
13019 left: 0px;
13020 top: 30px;
13021 background: green;
13022 display: none;
13023 }
13024 div.newcolor {
13025 background: blue;
13026 }
13027 </style>
13028 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13029</head>
13030<body>
13031
13032Click here...
13033<div></div>
13034
13035<script>
13036$( document.body ).click(function() {
13037 var divs = $( "div" )
13038 .show( "slow" )
13039 .animate({ left: "+=200" }, 2000 );
13040 jQuery.queue( divs[ 0 ], "fx", function() {
13041 $( this ).addClass( "newcolor" );
13042 jQuery.dequeue( this );
13043 });
13044 divs.animate({ left: "-=200" }, 500 );
13045 jQuery.queue( divs[ 0 ], "fx", function() {
13046 $( this ).removeClass( "newcolor" );
13047 jQuery.dequeue( this );
13048 });
13049 divs.slideUp();
13050});
13051</script>
13052
13053</body>
13054</html>
13055```
13056 * @example ​ ````Set a queue array to delete the queue.
13057```html
13058<!doctype html>
13059<html lang="en">
13060<head>
13061 <meta charset="utf-8">
13062 <title>jQuery.queue demo</title>
13063 <style>
13064 div {
13065 margin: 3px;
13066 width: 40px;
13067 height: 40px;
13068 position: absolute;
13069 left: 0px;
13070 top: 30px;
13071 background: green;
13072 display: none;
13073 }
13074 div.newcolor {
13075 background: blue;
13076 }
13077 </style>
13078 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13079</head>
13080<body>
13081
13082<button id="start">Start</button>
13083<button id="stop">Stop</button>
13084<div></div>
13085
13086<script>
13087$( "#start" ).click(function() {
13088 var divs = $( "div" )
13089 .show( "slow" )
13090 .animate({ left: "+=200" }, 5000 );
13091 jQuery.queue( divs[ 0 ], "fx", function() {
13092 $( this ).addClass( "newcolor" );
13093 jQuery.dequeue( this );
13094 });
13095 divs.animate({ left: "-=200" }, 1500 );
13096 jQuery.queue( divs[ 0 ], "fx", function() {
13097 $( this ).removeClass( "newcolor" );
13098 jQuery.dequeue( this );
13099 });
13100 divs.slideUp();
13101});
13102$( "#stop" ).click(function() {
13103 jQuery.queue( $( "div" )[ 0 ], "fx", [] );
13104 $( "div" ).stop();
13105});
13106</script>
13107
13108</body>
13109</html>
13110```
13111 */
13112 queue<T extends Element>(element: T, queueName?: string, newQueue?: JQuery.TypeOrArray<JQuery.QueueFunction<T>>): JQuery.Queue<T>;
13113 /**
13114 * Handles errors thrown synchronously in functions wrapped in jQuery().
13115 * @param error An error thrown in the function wrapped in jQuery().
13116 * @see \`{@link https://api.jquery.com/jQuery.readyException/ }\`
13117 * @since 3.1
13118 * @example ​ ````Pass the received error to console.error.
13119```javascript
13120jQuery.readyException = function( error ) {
13121 console.error( error );
13122};
13123```
13124 */
13125 readyException(error: Error): any;
13126 /**
13127 * Remove a previously-stored piece of data.
13128 * @param element A DOM element from which to remove data.
13129 * @param name A string naming the piece of data to remove.
13130 * @see \`{@link https://api.jquery.com/jQuery.removeData/ }\`
13131 * @since 1.2.3
13132 * @example ​ ````Set a data store for 2 names then remove one of them.
13133```html
13134<!doctype html>
13135<html lang="en">
13136<head>
13137 <meta charset="utf-8">
13138 <title>jQuery.removeData demo</title>
13139 <style>
13140 div {
13141 margin: 2px;
13142 color: blue;
13143 }
13144 span {
13145 color: red;
13146 }
13147 </style>
13148 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13149</head>
13150<body>
13151
13152<div>value1 before creation: <span></span></div>
13153<div>value1 after creation: <span></span></div>
13154<div>value1 after removal: <span></span></div>
13155<div>value2 after removal: <span></span></div>
13156
13157<script>
13158var div = $( "div" )[ 0 ];
13159$( "span:eq(0)" ).text( "" + $( "div" ).data( "test1" ) );
13160jQuery.data( div, "test1", "VALUE-1" );
13161jQuery.data( div, "test2", "VALUE-2" );
13162$( "span:eq(1)" ).text( "" + jQuery.data( div, "test1" ) );
13163jQuery.removeData( div, "test1" );
13164$( "span:eq(2)" ).text( "" + jQuery.data( div, "test1" ) );
13165$( "span:eq(3)" ).text( "" + jQuery.data( div, "test2" ) );
13166</script>
13167
13168</body>
13169</html>
13170```
13171 */
13172 removeData(element: Element | Document | Window | JQuery.PlainObject, name?: string): void;
13173 /**
13174 * Creates an object containing a set of properties ready to be used in the definition of custom animations.
13175 * @param duration A string or number determining how long the animation will run.
13176 * @param easing A string indicating which easing function to use for the transition.
13177 * @param complete A function to call once the animation is complete, called once per matched element.
13178 * @see \`{@link https://api.jquery.com/jQuery.speed/ }\`
13179 * @since 1.1
13180 */
13181 speed<TElement extends Element = HTMLElement>(duration: JQuery.Duration, easing: string, complete: (this: TElement) => void): JQuery.EffectsOptions<TElement>;
13182 /**
13183 * Creates an object containing a set of properties ready to be used in the definition of custom animations.
13184 * @param duration A string or number determining how long the animation will run.
13185 * @param easing_complete _&#x40;param_ `easing_complete`
13186 * <br>
13187 * * `easing` — A string indicating which easing function to use for the transition. <br>
13188 * * `complete` — A function to call once the animation is complete, called once per matched element.
13189 * @see \`{@link https://api.jquery.com/jQuery.speed/ }\`
13190 * @since 1.0
13191 * @since 1.1
13192 */
13193 speed<TElement extends Element = HTMLElement>(duration: JQuery.Duration,
13194 easing_complete: string | ((this: TElement) => void)): JQuery.EffectsOptions<TElement>;
13195 /**
13196 * Creates an object containing a set of properties ready to be used in the definition of custom animations.
13197 * @param duration_complete_settings _&#x40;param_ `duration_complete_settings`
13198 * <br>
13199 * * `duration` — A string or number determining how long the animation will run. <br>
13200 * * `complete` — A function to call once the animation is complete, called once per matched element. <br>
13201 * * `settings` —
13202 * @see \`{@link https://api.jquery.com/jQuery.speed/ }\`
13203 * @since 1.0
13204 * @since 1.1
13205 */
13206 speed<TElement extends Element = HTMLElement>(duration_complete_settings?: JQuery.Duration | ((this: TElement) => void) | JQuery.SpeedSettings<TElement>): JQuery.EffectsOptions<TElement>;
13207 /**
13208 * Remove the whitespace from the beginning and end of a string.
13209 * @param str The string to trim.
13210 * @see \`{@link https://api.jquery.com/jQuery.trim/ }\`
13211 * @since 1.0
13212 * @deprecatedDeprecated since 3.5. Use \`{@link String.prototype.trim String.prototype.trim}\`.
13213 * @example ​ ````Remove the white spaces at the start and at the end of the string.
13214```html
13215<!doctype html>
13216<html lang="en">
13217<head>
13218 <meta charset="utf-8">
13219 <title>jQuery.trim demo</title>
13220 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13221</head>
13222<body>
13223
13224<pre id="original"></pre>
13225<pre id="trimmed"></pre>
13226
13227<script>
13228var str = " lots of spaces before and after ";
13229$( "#original" ).html( "Original String: '" + str + "'" );
13230$( "#trimmed" ).html( "$.trim()'ed: '" + $.trim(str) + "'" );
13231</script>
13232
13233</body>
13234</html>
13235```
13236 * @example ​ ````Remove the white spaces at the start and at the end of the string.
13237```javascript
13238$.trim(" hello, how are you? ");
13239```
13240 * @example ​ ````Remove the white spaces at the start and at the end of the string.
13241```javascript
13242$.trim(" hello, how are you? ");
13243```
13244 */
13245 trim(str: string): string;
13246 /**
13247 * Determine the internal JavaScript [[Class]] of an object.
13248 * @param obj Object to get the internal JavaScript [[Class]] of.
13249 * @see \`{@link https://api.jquery.com/jQuery.type/ }\`
13250 * @since 1.4.3
13251 * @deprecatedDeprecated since 3.3. See \`{@link https://github.com/jquery/jquery/issues/3605 }\`.
13252 * @example ​ ````Find out if the parameter is a RegExp.
13253```html
13254<!doctype html>
13255<html lang="en">
13256<head>
13257 <meta charset="utf-8">
13258 <title>jQuery.type demo</title>
13259 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13260</head>
13261<body>
13262
13263Is it a RegExp? <b></b>
13264
13265<script>
13266$( "b" ).append( "" + jQuery.type( /test/ ) );
13267</script>
13268
13269</body>
13270</html>
13271```
13272 */
13273 type(obj: any): 'array' | 'boolean' | 'date' | 'error' | 'function' | 'null' | 'number' | 'object' | 'regexp' | 'string' | 'symbol' | 'undefined';
13274 /**
13275 * 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.
13276 * @param array The Array of DOM elements.
13277 * @see \`{@link https://api.jquery.com/jQuery.unique/ }\`
13278 * @since 1.1.3
13279 * @deprecatedDeprecated since 3.0. Use \`{@link uniqueSort }\`.
13280 *
13281 * **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.
13282 *
13283 * **Solution**: Replace all uses of `jQuery.unique` with `jQuery.uniqueSort` which is the same function with a better name.
13284 * @example ​ ````Removes any duplicate elements from the array of divs.
13285```html
13286<!doctype html>
13287<html lang="en">
13288<head>
13289 <meta charset="utf-8">
13290 <title>jQuery.unique demo</title>
13291 <style>
13292 div {
13293 color: blue;
13294 }
13295 </style>
13296 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13297</head>
13298<body>
13299
13300<div>There are 6 divs in this document.</div>
13301<div></div>
13302<div class="dup"></div>
13303<div class="dup"></div>
13304<div class="dup"></div>
13305<div></div>
13306
13307<script>
13308// unique() must take a native array
13309var divs = $( "div" ).get();
13310
13311// Add 3 elements of class dup too (they are divs)
13312divs = divs.concat( $( ".dup" ).get() );
13313$( "div:eq(1)" ).text( "Pre-unique there are " + divs.length + " elements." );
13314
13315divs = jQuery.unique( divs );
13316$( "div:eq(2)" ).text( "Post-unique there are " + divs.length + " elements." )
13317 .css( "color", "red" );
13318</script>
13319
13320</body>
13321</html>
13322```
13323 */
13324 unique<T extends Element>(array: T[]): T[];
13325 /**
13326 * 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.
13327 * @param array The Array of DOM elements.
13328 * @see \`{@link https://api.jquery.com/jQuery.uniqueSort/ }\`
13329 * @since 1.12
13330 * @since 2.2
13331 * @example ​ ````Removes any duplicate elements from the array of divs.
13332```html
13333<!doctype html>
13334<html lang="en">
13335<head>
13336 <meta charset="utf-8">
13337 <title>jQuery.uniqueSort demo</title>
13338 <style>
13339 div {
13340 color: blue;
13341 }
13342 </style>
13343 <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
13344</head>
13345<body>
13346
13347<div>There are 6 divs in this document.</div>
13348<div></div>
13349<div class="dup"></div>
13350<div class="dup"></div>
13351<div class="dup"></div>
13352<div></div>
13353
13354<script>
13355// unique() must take a native array
13356var divs = $( "div" ).get();
13357
13358// Add 3 elements of class dup too (they are divs)
13359divs = divs.concat( $( ".dup" ).get() );
13360$( "div:eq(1)" ).text( "Pre-unique there are " + divs.length + " elements." );
13361
13362divs = jQuery.uniqueSort( divs );
13363$( "div:eq(2)" ).text( "Post-unique there are " + divs.length + " elements." )
13364 .css( "color", "red" );
13365</script>
13366
13367</body>
13368</html>
13369```
13370 */
13371 uniqueSort<T extends Element>(array: T[]): T[];
13372 /**
13373 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13374 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13375 * @since 1.5
13376 * @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).
13377```javascript
13378$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13379 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13380 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13381 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13382 if ( /Whip It/.test( data ) ) {
13383 alert( "We got what we came for!" );
13384 }
13385});
13386```
13387 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13388```javascript
13389$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13390 .then( myFunc, myFailure );
13391```
13392 */
13393 when<TR1, UR1, VR1,
13394 TJ1 = any, UJ1 = any, VJ1 = any>(
13395 deferredT: JQuery.Promise<TR1, TJ1> | JQuery.Thenable<TR1> | TR1,
13396 deferredU: JQuery.Promise<UR1, UJ1> | JQuery.Thenable<UR1> | UR1,
13397 deferredV: JQuery.Promise<VR1, VJ1> | JQuery.Thenable<VR1> | VR1,
13398 ): JQuery.Promise3<
13399 TR1, TJ1, never,
13400 UR1, UJ1, never,
13401 VR1, VJ1, never>;
13402 /**
13403 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13404 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13405 * @since 1.5
13406 * @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).
13407```javascript
13408$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13409 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13410 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13411 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13412 if ( /Whip It/.test( data ) ) {
13413 alert( "We got what we came for!" );
13414 }
13415});
13416```
13417 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13418```javascript
13419$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13420 .then( myFunc, myFailure );
13421```
13422 */
13423 when<TR1, UR1,
13424 TJ1 = any, UJ1 = any>(
13425 deferredT: JQuery.Promise<TR1, TJ1> | JQuery.Thenable<TR1> | TR1,
13426 deferredU: JQuery.Promise<UR1, UJ1> | JQuery.Thenable<UR1> | UR1,
13427 ): JQuery.Promise2<
13428 TR1, TJ1, never,
13429 UR1, UJ1, never>;
13430 /**
13431 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13432 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13433 * @since 1.5
13434 * @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).
13435```javascript
13436$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13437 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13438 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13439 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13440 if ( /Whip It/.test( data ) ) {
13441 alert( "We got what we came for!" );
13442 }
13443});
13444```
13445 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13446```javascript
13447$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13448 .then( myFunc, myFailure );
13449```
13450 */
13451 when<TR1, TJ1,
13452 TR2, TJ2,
13453 TR3 = never, TJ3 = never>(
13454 deferredT: JQuery.Promise3<TR1, TJ1, any, TR2, TJ2, any, TR3, TJ3, any> |
13455 JQuery.Promise2<TR1, TJ1, any, TR2, TJ2, any>
13456 ): JQuery.Promise3<
13457 TR1, TJ1, never,
13458 TR2, TJ2, never,
13459 TR3, TJ3, never>;
13460 /**
13461 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13462 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13463 * @since 1.5
13464 * @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).
13465```javascript
13466$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13467 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13468 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13469 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13470 if ( /Whip It/.test( data ) ) {
13471 alert( "We got what we came for!" );
13472 }
13473});
13474```
13475 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13476```javascript
13477$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13478 .then( myFunc, myFailure );
13479```
13480 */
13481 when<TR1, TJ1 = any>(deferred: JQuery.Promise<TR1, TJ1> | JQuery.Thenable<TR1> | TR1): JQuery.Promise<TR1, TJ1, never>;
13482 /**
13483 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13484 * @param deferreds Zero or more Thenable objects.
13485 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13486 * @since 1.5
13487 * @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).
13488```javascript
13489$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13490 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13491 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13492 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13493 if ( /Whip It/.test( data ) ) {
13494 alert( "We got what we came for!" );
13495 }
13496});
13497```
13498 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13499```javascript
13500$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13501 .then( myFunc, myFailure );
13502```
13503 */
13504 when<TR1 = never, TJ1 = never>(...deferreds: Array<JQuery.Promise<TR1, TJ1> | JQuery.Thenable<TR1> | TR1>): JQuery.Promise<TR1, TJ1, never>;
13505 /**
13506 * Provides a way to execute callback functions based on zero or more Thenable objects, usually Deferred objects that represent asynchronous events.
13507 * @param deferreds Zero or more Thenable objects.
13508 * @see \`{@link https://api.jquery.com/jQuery.when/ }\`
13509 * @since 1.5
13510 * @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).
13511```javascript
13512$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) ).done(function( a1, a2 ) {
13513 // a1 and a2 are arguments resolved for the page1 and page2 ajax requests, respectively.
13514 // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
13515 var data = a1[ 0 ] + a2[ 0 ]; // a1[ 0 ] = "Whip", a2[ 0 ] = " It"
13516 if ( /Whip It/.test( data ) ) {
13517 alert( "We got what we came for!" );
13518 }
13519});
13520```
13521 * @example ​ ````Execute the function myFunc when both ajax requests are successful, or myFailure if either one has an error.
13522```javascript
13523$.when( $.ajax( "/page1.php" ), $.ajax( "/page2.php" ) )
13524 .then( myFunc, myFailure );
13525```
13526 */
13527 when(...deferreds: any[]): JQuery.Promise<any, any, never>;
13528}
13529
\No newline at end of file