-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.d.ts
executable file
·8209 lines (8038 loc) · 370 KB
/
jquery.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Type definitions for jquery 3.3
// Project: https://jquery.com
// Definitions by: Leonard Thieu <https://github.com/leonard-thieu>
// Boris Yankov <https://github.com/borisyankov>
// Christian Hoffmeister <https://github.com/choffmeister>
// Steve Fenton <https://github.com/Steve-Fenton>
// Diullei Gomes <https://github.com/Diullei>
// Tass Iliopoulos <https://github.com/tasoili>
// Jason Swearingen <https://github.com/jasons-novaleaf>
// Sean Hill <https://github.com/seanski>
// Guus Goossens <https://github.com/Guuz>
// Kelly Summerlin <https://github.com/ksummerlin>
// Basarat Ali Syed <https://github.com/basarat>
// Nicholas Wolverson <https://github.com/nwolverson>
// Derek Cicerone <https://github.com/derekcicerone>
// Andrew Gaspar <https://github.com/AndrewGaspar>
// Seikichi Kondo <https://github.com/seikichi>
// Benjamin Jackman <https://github.com/benjaminjackman>
// Poul Sorensen <https://github.com/s093294>
// Josh Strobl <https://github.com/JoshStrobl>
// John Reilly <https://github.com/johnnyreilly>
// Dick van den Brink <https://github.com/DickvdBrink>
// Thomas Schulz <https://github.com/King2500>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
declare const jQuery: JQueryStatic;
declare const $: JQueryStatic;
// Used by JQuery.Event
type _Event = Event;
// Used by JQuery.Promise3 and JQuery.Promise
type _Promise<T> = Promise<T>;
interface JQueryStatic<TElement extends Node = HTMLElement> {
/**
* @see {@link http://api.jquery.com/jquery.ajax/#jQuery-ajax1}
* @deprecated Use jQuery.ajaxSetup(options)
*/
ajaxSettings: JQuery.AjaxSettings;
/**
* A factory function that returns a chainable utility object with methods to register multiple
* callbacks into callback queues, invoke callback queues, and relay the success or failure state of
* any synchronous or asynchronous function.
*
* @param beforeStart A function that is called just before the constructor returns.
* @see {@link https://api.jquery.com/jQuery.Deferred/}
* @since 1.5
*/
Deferred: JQuery.DeferredStatic;
Event: JQuery.EventStatic<TElement>;
/**
* Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize
* CSS property naming, or create custom properties.
*
* @see {@link https://api.jquery.com/jQuery.cssHooks/}
* @since 1.4.3
*/
cssHooks: JQuery.PlainObject<JQuery.CSSHook<TElement>>;
/**
* 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.
*
* @see {@link https://api.jquery.com/jQuery.cssNumber/}
* @since 1.4.3
*/
cssNumber: JQuery.PlainObject<boolean>;
readonly fn: JQuery<TElement>;
fx: {
/**
* The rate (in milliseconds) at which animations fire.
*
* @see {@link https://api.jquery.com/jQuery.fx.interval/}
* @since 1.4.3
* @deprecated 3.0
*/
interval: number;
/**
* Globally disable all animations.
*
* @see {@link https://api.jquery.com/jQuery.fx.off/}
* @since 1.3
*/
off: boolean;
step: JQuery.PlainObject<JQuery.AnimationHook<Node>>;
};
/**
* A Promise-like object (or "thenable") that resolves when the document is ready.
*
* @see {@link https://api.jquery.com/jQuery.ready/}
* @since 1.8
*/
ready: JQuery.Thenable<JQueryStatic<TElement>>;
/**
* 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.
*
* @see {@link https://api.jquery.com/jQuery.support/}
* @since 1.3
* @deprecated 1.9
*/
support: JQuery.PlainObject;
valHooks: JQuery.PlainObject<JQuery.ValHook<TElement>>;
/**
* Creates DOM elements on the fly from the provided string of raw HTML.
*
* @param html A string of HTML to create on the fly. Note that this parses HTML, not XML.
* A string defining a single, standalone, HTML element (e.g. <div/> or <div></div>).
* @param ownerDocument_attributes A document in which the new elements will be created.
* An object of attributes, events, and methods to call on the newly-created element.
* @see {@link https://api.jquery.com/jQuery/}
* @since 1.0
* @since 1.4
*/
(html: JQuery.htmlString, ownerDocument_attributes: Document | JQuery.PlainObject): JQuery<TElement>;
/**
* Accepts a string containing a CSS selector which is then used to match a set of elements.
*
* @param selector A string containing a selector expression
* @param context A DOM Element, Document, or jQuery to use as context
* @see {@link https://api.jquery.com/jQuery/}
* @since 1.0
*/
(selector: JQuery.Selector, context: Element | Document | JQuery | undefined): JQuery<TElement>;
// HACK: This is the factory function returned when importing jQuery without a DOM. Declaring it separately breaks using the type parameter on JQueryStatic.
// HACK: The discriminator parameter handles the edge case of passing a Window object to JQueryStatic. It doesn't actually exist on the factory function.
<FElement extends Node = HTMLElement>(window: Window, discriminator: boolean): JQueryStatic<FElement>;
/**
* Creates DOM elements on the fly from the provided string of raw HTML.
*
* Binds a function to be executed when the DOM has finished loading.
*
* @param selector_object_callback A string containing a selector expression
* A DOM element to wrap in a jQuery object.
* An array containing a set of DOM elements to wrap in a jQuery object.
* A plain object to wrap in a jQuery object.
* An existing jQuery object to clone.
* The function to execute when the DOM is ready.
* @see {@link https://api.jquery.com/jQuery/}
* @since 1.0
* @since 1.4
*/
(selector_object_callback?: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray<Element> | JQuery |
JQuery.PlainObject |
((this: Document, $: JQueryStatic<TElement>) => void)): JQuery<TElement>;
/**
* A multi-purpose callbacks list object that provides a powerful way to manage callback lists.
*
* @param flags An optional list of space-separated flags that change how the callback list behaves.
* @see {@link https://api.jquery.com/jQuery.Callbacks/}
* @since 1.7
*/
Callbacks<T extends Function>(flags?: string): JQuery.Callbacks<T>;
/**
* Perform an asynchronous HTTP (Ajax) request.
*
* @param url A string containing the URL to which the request is sent.
* @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can
* be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings.
* @see {@link https://api.jquery.com/jQuery.ajax/}
* @since 1.5
*/
ajax(url: string, settings?: JQuery.AjaxSettings): JQuery.jqXHR;
/**
* Perform an asynchronous HTTP (Ajax) request.
*
* @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can
* be set for any option with $.ajaxSetup().
* @see {@link https://api.jquery.com/jQuery.ajax/}
* @since 1.0
*/
ajax(settings?: JQuery.AjaxSettings): JQuery.jqXHR;
/**
* Handle custom Ajax options or modify existing options before each request is sent and before they
* are processed by $.ajax().
*
* @param dataTypes An optional string containing one or more space-separated dataTypes
* @param handler A handler to set default values for future Ajax requests.
* @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/}
* @since 1.5
*/
ajaxPrefilter(dataTypes: string,
handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void;
/**
* Handle custom Ajax options or modify existing options before each request is sent and before they
* are processed by $.ajax().
*
* @param handler A handler to set default values for future Ajax requests.
* @see {@link https://api.jquery.com/jQuery.ajaxPrefilter/}
* @since 1.5
*/
ajaxPrefilter(handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => string | void): void;
/**
* Set default values for future Ajax requests. Its use is not recommended.
*
* @param options A set of key/value pairs that configure the default Ajax request. All options are optional.
* @see {@link https://api.jquery.com/jQuery.ajaxSetup/}
* @since 1.1
*/
ajaxSetup(options: JQuery.AjaxSettings): JQuery.AjaxSettings;
/**
* Creates an object that handles the actual transmission of Ajax data.
*
* @param dataType A string identifying the data type to use
* @param handler A handler to return the new transport object to use with the data type provided in the first argument.
* @see {@link https://api.jquery.com/jQuery.ajaxTransport/}
* @since 1.5
*/
ajaxTransport(dataType: string,
handler: (options: JQuery.AjaxSettings, originalOptions: JQuery.AjaxSettings, jqXHR: JQuery.jqXHR) => JQuery.Transport | void): void;
/**
* @deprecated 3.3
*/
camelCase(value: string): string;
/**
* Check to see if a DOM element is a descendant of another DOM element.
*
* @param container The DOM element that may contain the other element.
* @param contained The DOM element that may be contained by (a descendant of) the other element.
* @see {@link https://api.jquery.com/jQuery.contains/}
* @since 1.4
*/
contains(container: Element, contained: Element): boolean;
css(elem: Element, unknown: any): any;
/**
* 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.
*
* @param element The DOM element to query for the data.
* @param key Name of the data stored.
* @see {@link https://api.jquery.com/jQuery.data/}
* @since 1.2.3
*/
data(element: Element, key: string, undefined: undefined): any; // tslint:disable-line:unified-signatures
/**
* Store arbitrary data associated with the specified element. Returns the value that was set.
*
* @param element The DOM element to associate with the data.
* @param key A string naming the piece of data to set.
* @param value The new data value; this can be any Javascript type except undefined.
* @see {@link https://api.jquery.com/jQuery.data/}
* @since 1.2.3
*/
data<T>(element: Element, key: string, value: T): T;
/**
* 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.
*
* @param element The DOM element to query for the data.
* @param key Name of the data stored.
* @see {@link https://api.jquery.com/jQuery.data/}
* @since 1.2.3
* @since 1.4
*/
data(element: Element, key?: string): any;
/**
* Execute the next function on the queue for the matched element.
*
* @param element A DOM element from which to remove and execute a queued function.
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
* @see {@link https://api.jquery.com/jQuery.dequeue/}
* @since 1.3
*/
dequeue(element: Element, queueName?: string): void;
/**
* 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.
*
* @param array The array to iterate over.
* @param callback The function that will be executed on every object.
* @see {@link https://api.jquery.com/jQuery.each/}
* @since 1.0
*/
each<T>(array: ArrayLike<T>, callback: (this: T, indexInArray: number, value: T) => false | any): ArrayLike<T>;
/**
* 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.
*
* @param obj The object to iterate over.
* @param callback The function that will be executed on every object.
* @see {@link https://api.jquery.com/jQuery.each/}
* @since 1.0
*/
each<T, K extends keyof T>(obj: T, callback: (this: T[K], propertyName: K, valueOfProperty: T[K]) => false | any): T;
/**
* Takes a string and throws an exception containing it.
*
* @param message The message to send out.
* @see {@link https://api.jquery.com/jQuery.error/}
* @since 1.4.1
*/
error(message: string): any;
/**
* Escapes any character that has a special meaning in a CSS selector.
*
* @param selector A string containing a selector expression to escape.
* @see {@link https://api.jquery.com/jQuery.escapeSelector/}
* @since 3.0
*/
escapeSelector(selector: JQuery.Selector): JQuery.Selector;
/**
* Merge the contents of two or more objects together into the first object.
*
* @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
* @param target The object to extend. It will receive the new properties.
* @see {@link https://api.jquery.com/jQuery.extend/}
* @since 1.1.4
*/
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;
/**
* Merge the contents of two or more objects together into the first object.
*
* @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
* @param target The object to extend. It will receive the new properties.
* @see {@link https://api.jquery.com/jQuery.extend/}
* @since 1.1.4
*/
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;
/**
* Merge the contents of two or more objects together into the first object.
*
* @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
* @param target The object to extend. It will receive the new properties.
* @see {@link https://api.jquery.com/jQuery.extend/}
* @since 1.1.4
*/
extend<T, U, V, W, X>(deep: true, target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X;
/**
* Merge the contents of two or more objects together into the first object.
*
* @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
* @param target The object to extend. It will receive the new properties.
* @see {@link https://api.jquery.com/jQuery.extend/}
* @since 1.1.4
*/
extend<T, U, V, W>(deep: true, target: T, object1: U, object2: V, object3: W): T & U & V & W;
/**
* Merge the contents of two or more objects together into the first object.
*
* @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
* @param target The object to extend. It will receive the new properties.
* @see {@link https://api.jquery.com/jQuery.extend/}
* @since 1.1.4
*/
extend<T, U, V>(deep: true, target: T, object1: U, object2: V): T & U & V;
/**
* Merge the contents of two or more objects together into the first object.
*
* @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
* @param target The object to extend. It will receive the new properties.
* @see {@link https://api.jquery.com/jQuery.extend/}
* @since 1.1.4
*/
extend<T, U>(deep: true, target: T, object1: U): T & U;
/**
* Merge the contents of two or more objects together into the first object.
*
* @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
* @param target The object to extend. It will receive the new properties.
* @see {@link https://api.jquery.com/jQuery.extend/}
* @since 1.1.4
*/
extend(deep: true, target: any, object1: any, ...objects: any[]): any;
/**
* Merge the contents of two or more objects together into the first object.
*
* @param target An object that will receive the new properties if additional objects are passed in or that will
* extend the jQuery namespace if it is the sole argument.
* @see {@link https://api.jquery.com/jQuery.extend/}
* @since 1.0
*/
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;
/**
* Merge the contents of two or more objects together into the first object.
*
* @param target An object that will receive the new properties if additional objects are passed in or that will
* extend the jQuery namespace if it is the sole argument.
* @see {@link https://api.jquery.com/jQuery.extend/}
* @since 1.0
*/
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;
/**
* Merge the contents of two or more objects together into the first object.
*
* @param target An object that will receive the new properties if additional objects are passed in or that will
* extend the jQuery namespace if it is the sole argument.
* @see {@link https://api.jquery.com/jQuery.extend/}
* @since 1.0
*/
extend<T, U, V, W, X>(target: T, object1: U, object2: V, object3: W, object4: X): T & U & V & W & X;
/**
* Merge the contents of two or more objects together into the first object.
*
* @param target An object that will receive the new properties if additional objects are passed in or that will
* extend the jQuery namespace if it is the sole argument.
* @see {@link https://api.jquery.com/jQuery.extend/}
* @since 1.0
*/
extend<T, U, V, W>(target: T, object1: U, object2: V, object3: W): T & U & V & W;
/**
* Merge the contents of two or more objects together into the first object.
*
* @param target An object that will receive the new properties if additional objects are passed in or that will
* extend the jQuery namespace if it is the sole argument.
* @see {@link https://api.jquery.com/jQuery.extend/}
* @since 1.0
*/
extend<T, U, V>(target: T, object1: U, object2: V): T & U & V;
/**
* Merge the contents of two or more objects together into the first object.
*
* @param target An object that will receive the new properties if additional objects are passed in or that will
* extend the jQuery namespace if it is the sole argument.
* @see {@link https://api.jquery.com/jQuery.extend/}
* @since 1.0
*/
extend<T, U>(target: T, object1: U): T & U;
/**
* Merge the contents of two or more objects together into the first object.
*
* @param target An object that will receive the new properties if additional objects are passed in or that will
* extend the jQuery namespace if it is the sole argument.
* @see {@link https://api.jquery.com/jQuery.extend/}
* @since 1.0
*/
extend(target: any, object1: any, ...objects: any[]): any;
/**
* Load data from the server using a HTTP GET request.
*
* @param url A string containing the URL to which the request is sent.
* @param data A plain object or string that is sent to the server with the request.
* @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but
* you can use null or jQuery.noop as a placeholder.
* @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
* @see {@link https://api.jquery.com/jQuery.get/}
* @since 1.0
*/
get(url: string,
data: JQuery.PlainObject | string,
success: JQuery.jqXHR.DoneCallback | null,
dataType?: string): JQuery.jqXHR;
/**
* Load data from the server using a HTTP GET request.
*
* @param url A string containing the URL to which the request is sent.
* @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but
* you can use null or jQuery.noop as a placeholder.
* @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
* @see {@link https://api.jquery.com/jQuery.get/}
* @since 1.0
*/
get(url: string,
success: JQuery.jqXHR.DoneCallback | null,
dataType: string): JQuery.jqXHR;
/**
* Load data from the server using a HTTP GET request.
*
* @param url A string containing the URL to which the request is sent.
* @param success_data A callback function that is executed if the request succeeds. Required if dataType is provided, but
* you can use null or jQuery.noop as a placeholder.
* A plain object or string that is sent to the server with the request.
* @see {@link https://api.jquery.com/jQuery.get/}
* @since 1.0
*/
get(url: string,
success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR;
/**
* Load data from the server using a HTTP GET request.
*
* @param url_settings A string containing the URL to which the request is sent.
* A set of key/value pairs that configure the Ajax request. All properties except for url are
* optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a
* complete list of all settings. The type option will automatically be set to GET.
* @see {@link https://api.jquery.com/jQuery.get/}
* @since 1.0
* @since 1.12
* @since 2.2
*/
get(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR;
/**
* Load JSON-encoded data from the server using a GET HTTP request.
*
* @param url A string containing the URL to which the request is sent.
* @param data A plain object or string that is sent to the server with the request.
* @param success A callback function that is executed if the request succeeds.
* @see {@link https://api.jquery.com/jQuery.getJSON/}
* @since 1.0
*/
getJSON(url: string,
data: JQuery.PlainObject | string,
success: JQuery.jqXHR.DoneCallback): JQuery.jqXHR;
/**
* Load JSON-encoded data from the server using a GET HTTP request.
*
* @param url A string containing the URL to which the request is sent.
* @param success_data A callback function that is executed if the request succeeds.
* A plain object or string that is sent to the server with the request.
* @see {@link https://api.jquery.com/jQuery.getJSON/}
* @since 1.0
*/
getJSON(url: string,
success_data?: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR;
/**
* Load a JavaScript file from the server using a GET HTTP request, then execute it.
*
* @param url A string containing the URL to which the request is sent.
* @param success A callback function that is executed if the request succeeds.
* @see {@link https://api.jquery.com/jQuery.getScript/}
* @since 1.0
*/
getScript(url: string,
success?: JQuery.jqXHR.DoneCallback<string | undefined>): JQuery.jqXHR<string | undefined>;
/**
* Execute some JavaScript code globally.
*
* @param code The JavaScript code to execute.
* @see {@link https://api.jquery.com/jQuery.globalEval/}
* @since 1.0.4
*/
globalEval(code: string): void;
/**
* Finds the elements of an array which satisfy a filter function. The original array is not affected.
*
* @param array The array-like object to search through.
* @param fn The function to process each item against. The first argument to the function is the item, and the
* second argument is the index. The function should return a Boolean value. this will be the global window object.
* @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements
* for which "callback" returns true. If "invert" is true, then the function returns an array
* consisting of all elements for which "callback" returns false.
* @see {@link https://api.jquery.com/jQuery.grep/}
* @since 1.0
*/
grep<T>(array: ArrayLike<T>,
fn: (elementOfArray: T, indexInArray: number) => boolean,
invert?: boolean): T[];
/**
* Determine whether an element has any jQuery data associated with it.
*
* @param element A DOM element to be checked for data.
* @see {@link https://api.jquery.com/jQuery.hasData/}
* @since 1.5
*/
hasData(element: Element): boolean;
/**
* Holds or releases the execution of jQuery's ready event.
*
* @param hold Indicates whether the ready hold is being requested or released
* @see {@link https://api.jquery.com/jQuery.holdReady/}
* @since 1.6
* @deprecated 3.2
*/
holdReady(hold: boolean): void;
/**
* Modify and filter HTML strings passed through jQuery manipulation methods.
*
* @param html The HTML string on which to operate.
* @see {@link https://api.jquery.com/jQuery.htmlPrefilter/}
* @since 1.12/2.2
*/
htmlPrefilter(html: JQuery.htmlString): JQuery.htmlString;
/**
* Search for a specified value within an array and return its index (or -1 if not found).
*
* @param value The value to search for.
* @param array An array through which to search.
* @param fromIndex The index of the array at which to begin the search. The default is 0, which will search the whole array.
* @see {@link https://api.jquery.com/jQuery.inArray/}
* @since 1.2
*/
inArray<T>(value: T, array: T[], fromIndex?: number): number;
/**
* Determine whether the argument is an array.
*
* @param obj Object to test whether or not it is an array.
* @see {@link https://api.jquery.com/jQuery.isArray/}
* @since 1.3
* @deprecated 3.2
*/
isArray(obj: any): obj is any[];
/**
* Check to see if an object is empty (contains no enumerable properties).
*
* @param obj The object that will be checked to see if it's empty.
* @see {@link https://api.jquery.com/jQuery.isEmptyObject/}
* @since 1.4
*/
isEmptyObject(obj: any): boolean;
/**
* Determine if the argument passed is a JavaScript function object.
*
* @param obj Object to test whether or not it is a function.
* @see {@link https://api.jquery.com/jQuery.isFunction/}
* @since 1.2
* @deprecated 3.3
*/
isFunction(obj: any): obj is Function;
/**
* Determines whether its argument represents a JavaScript number.
*
* @param value The value to be tested.
* @see {@link https://api.jquery.com/jQuery.isNumeric/}
* @since 1.7
* @deprecated 3.3
*/
isNumeric(value: any): value is number;
/**
* Check to see if an object is a plain object (created using "{}" or "new Object").
*
* @param obj The object that will be checked to see if it's a plain object.
* @see {@link https://api.jquery.com/jQuery.isPlainObject/}
* @since 1.4
*/
isPlainObject(obj: any): obj is JQuery.PlainObject;
/**
* Determine whether the argument is a window.
*
* @param obj Object to test whether or not it is a window.
* @see {@link https://api.jquery.com/jQuery.isWindow/}
* @since 1.4.3
* @deprecated 3.3
*/
isWindow(obj: any): obj is Window;
/**
* Check to see if a DOM node is within an XML document (or is an XML document).
*
* @param node The DOM node that will be checked to see if it's in an XML document.
* @see {@link https://api.jquery.com/jQuery.isXMLDoc/}
* @since 1.1.4
*/
isXMLDoc(node: Node): boolean;
/**
* Convert an array-like object into a true JavaScript array.
*
* @param obj Any object to turn into a native Array.
* @see {@link https://api.jquery.com/jQuery.makeArray/}
* @since 1.2
*/
makeArray<T>(obj: ArrayLike<T>): T[];
/**
* Translate all items in an array or object to new array of items.
*
* @param array The Array to translate.
* @param callback The function to process each item against. The first argument to the function is the array item, the
* second argument is the index in array The function can return any value. A returned array will be
* flattened into the resulting array. Within the function, this refers to the global (window) object.
* @see {@link https://api.jquery.com/jQuery.map/}
* @since 1.0
*/
map<T, R>(array: T[], callback: (elementOfArray: T, indexInArray: number) => R): R[];
/**
* Translate all items in an array or object to new array of items.
*
* @param obj The Object to translate.
* @param callback The function to process each item against. The first argument to the function is the value; the
* second argument is the key of the object property. The function can return any value to add to the
* array. A returned array will be flattened into the resulting array. Within the function, this refers
* to the global (window) object.
* @see {@link https://api.jquery.com/jQuery.map/}
* @since 1.6
*/
map<T, K extends keyof T, R>(obj: T, callback: (propertyOfObject: T[K], key: K) => R): R[];
/**
* Merge the contents of two arrays together into the first array.
*
* @param first The first array-like object to merge, the elements of second added.
* @param second The second array-like object to merge into the first, unaltered.
* @see {@link https://api.jquery.com/jQuery.merge/}
* @since 1.0
*/
merge<T, U>(first: ArrayLike<T>, second: ArrayLike<U>): Array<T | U>;
/**
* Relinquish jQuery's control of the $ variable.
*
* @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).
* @see {@link https://api.jquery.com/jQuery.noConflict/}
* @since 1.0
*/
noConflict(removeAll?: boolean): this;
/**
* An empty function.
*
* @see {@link https://api.jquery.com/jQuery.noop/}
* @since 1.4
*/
noop(): undefined;
/**
* Return a number representing the current time.
*
* @see {@link https://api.jquery.com/jQuery.now/}
* @since 1.4.3
* @deprecated 3.3 Use Date.now().
*/
now(): number;
/**
* 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.
*
* @param obj An array, a plain object, or a jQuery object to serialize.
* @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization.
* @see {@link https://api.jquery.com/jQuery.param/}
* @since 1.2
* @since 1.4
*/
param(obj: any[] | JQuery.PlainObject | JQuery, traditional?: boolean): string;
/**
* Parses a string into an array of DOM nodes.
*
* @param data HTML string to be parsed
* @param context Document element to serve as the context in which the HTML fragment will be created
* @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
* @see {@link https://api.jquery.com/jQuery.parseHTML/}
* @since 1.8
*/
parseHTML(data: string, context: Document | null | undefined, keepScripts: boolean): JQuery.Node[];
/**
* Parses a string into an array of DOM nodes.
*
* @param data HTML string to be parsed
* @param context_keepScripts Document element to serve as the context in which the HTML fragment will be created
* A Boolean indicating whether to include scripts passed in the HTML string
* @see {@link https://api.jquery.com/jQuery.parseHTML/}
* @since 1.8
*/
parseHTML(data: string, context_keepScripts?: Document | null | boolean): JQuery.Node[];
/**
* Takes a well-formed JSON string and returns the resulting JavaScript value.
*
* @param json The JSON string to parse.
* @see {@link https://api.jquery.com/jQuery.parseJSON/}
* @since 1.4.1
* @deprecated 3.0
*/
parseJSON(json: string): any;
/**
* Parses a string into an XML document.
*
* @param data a well-formed XML string to be parsed
* @see {@link https://api.jquery.com/jQuery.parseXML/}
* @since 1.5
*/
parseXML(data: string): XMLDocument;
/**
* Load data from the server using a HTTP POST request.
*
* @param url A string containing the URL to which the request is sent.
* @param data A plain object or string that is sent to the server with the request.
* @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but
* can be null in that case.
* @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
* @see {@link https://api.jquery.com/jQuery.post/}
* @since 1.0
*/
post(url: string,
data: JQuery.PlainObject | string,
success: JQuery.jqXHR.DoneCallback | null,
dataType?: string): JQuery.jqXHR;
/**
* Load data from the server using a HTTP POST request.
*
* @param url A string containing the URL to which the request is sent.
* @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but
* can be null in that case.
* @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
* @see {@link https://api.jquery.com/jQuery.post/}
* @since 1.0
*/
post(url: string,
success: JQuery.jqXHR.DoneCallback | null,
dataType: string): JQuery.jqXHR;
/**
* Load data from the server using a HTTP POST request.
*
* @param url A string containing the URL to which the request is sent.
* @param success_data A callback function that is executed if the request succeeds. Required if dataType is provided, but
* can be null in that case.
* A plain object or string that is sent to the server with the request.
* @see {@link https://api.jquery.com/jQuery.post/}
* @since 1.0
*/
post(url: string,
success_data: JQuery.jqXHR.DoneCallback | JQuery.PlainObject | string): JQuery.jqXHR;
/**
* Load data from the server using a HTTP POST request.
*
* @param url_settings A string containing the URL to which the request is sent.
* A set of key/value pairs that configure the Ajax request. All properties except for url are
* optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) for a
* complete list of all settings. Type will automatically be set to POST.
* @see {@link https://api.jquery.com/jQuery.post/}
* @since 1.0
* @since 1.12
* @since 2.2
*/
post(url_settings?: string | JQuery.UrlAjaxSettings): JQuery.jqXHR;
// region proxy
// region (fn, null | undefined)
// region 0 to 7 arguments
// region 0 parameters
/**
* Takes a function and returns a new one that will always have a particular context.
*
* @param fn The function whose context will be changed.
* @param context The object to which the context (this) of the function should be set.
* @see {@link https://api.jquery.com/jQuery.proxy/}
* @since 1.9
* @deprecated 3.3 Use Function#bind.
*/
proxy<TReturn,
A, B, C, D, E, F, G>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => TReturn,
context: null | undefined,
a: A, b: B, c: C, d: D, e: E, f: F, g: G): () => TReturn;
/**
* Takes a function and returns a new one that will always have a particular context.
*
* @param fn The function whose context will be changed.
* @param context The object to which the context (this) of the function should be set.
* @see {@link https://api.jquery.com/jQuery.proxy/}
* @since 1.9
* @deprecated 3.3 Use Function#bind.
*/
proxy<TReturn,
A, B, C, D, E, F>(fn: (a: A, b: B, c: C, d: D, e: E, f: F) => TReturn,
context: null | undefined,
a: A, b: B, c: C, d: D, e: E, f: F): () => TReturn;
/**
* Takes a function and returns a new one that will always have a particular context.
*
* @param fn The function whose context will be changed.
* @param context The object to which the context (this) of the function should be set.
* @see {@link https://api.jquery.com/jQuery.proxy/}
* @since 1.9
* @deprecated 3.3 Use Function#bind.
*/
proxy<TReturn,
A, B, C, D, E>(fn: (a: A, b: B, c: C, d: D, e: E) => TReturn,
context: null | undefined,
a: A, b: B, c: C, d: D, e: E): () => TReturn;
/**
* Takes a function and returns a new one that will always have a particular context.
*
* @param fn The function whose context will be changed.
* @param context The object to which the context (this) of the function should be set.
* @see {@link https://api.jquery.com/jQuery.proxy/}
* @since 1.9
* @deprecated 3.3 Use Function#bind.
*/
proxy<TReturn,
A, B, C, D>(fn: (a: A, b: B, c: C, d: D) => TReturn,
context: null | undefined,
a: A, b: B, c: C, d: D): () => TReturn;
/**
* Takes a function and returns a new one that will always have a particular context.
*
* @param fn The function whose context will be changed.
* @param context The object to which the context (this) of the function should be set.
* @see {@link https://api.jquery.com/jQuery.proxy/}
* @since 1.9
* @deprecated 3.3 Use Function#bind.
*/
proxy<TReturn,
A, B, C>(fn: (a: A, b: B, c: C) => TReturn,
context: null | undefined,
a: A, b: B, c: C): () => TReturn;
/**
* Takes a function and returns a new one that will always have a particular context.
*
* @param fn The function whose context will be changed.
* @param context The object to which the context (this) of the function should be set.
* @see {@link https://api.jquery.com/jQuery.proxy/}
* @since 1.9
* @deprecated 3.3 Use Function#bind.
*/
proxy<TReturn,
A, B>(fn: (a: A, b: B) => TReturn,
context: null | undefined,
a: A, b: B): () => TReturn;
/**
* Takes a function and returns a new one that will always have a particular context.
*
* @param fn The function whose context will be changed.
* @param context The object to which the context (this) of the function should be set.
* @see {@link https://api.jquery.com/jQuery.proxy/}
* @since 1.4`
* @since 1.6
* @deprecated 3.3 Use Function#bind.
*/
proxy<TReturn,
A>(fn: (a: A) => TReturn,
context: null | undefined,
a: A): () => TReturn;
/**
* Takes a function and returns a new one that will always have a particular context.
*
* @param fn The function whose context will be changed.
* @param context The object to which the context (this) of the function should be set.
* @see {@link https://api.jquery.com/jQuery.proxy/}
* @since 1.9
* @deprecated 3.3 Use Function#bind.
*/
proxy<TReturn>(fn: () => TReturn,
context: null | undefined): () => TReturn;
// endregion
// region 1 parameters
/**
* Takes a function and returns a new one that will always have a particular context.
*
* @param fn The function whose context will be changed.
* @param context The object to which the context (this) of the function should be set.
* @see {@link https://api.jquery.com/jQuery.proxy/}
* @since 1.9
* @deprecated 3.3 Use Function#bind.
*/
proxy<TReturn,
A, B, C, D, E, F, G,
T>(fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G,
t: T) => TReturn,
context: null | undefined,
a: A, b: B, c: C, d: D, e: E, f: F, g: G): (t: T) => TReturn;
/**
* Takes a function and returns a new one that will always have a particular context.
*
* @param fn The function whose context will be changed.
* @param context The object to which the context (this) of the function should be set.
* @see {@link https://api.jquery.com/jQuery.proxy/}
* @since 1.9
* @deprecated 3.3 Use Function#bind.
*/
proxy<TReturn,
A, B, C, D, E, F,
T>(fn: (a: A, b: B, c: C, d: D, e: E, f: F,
t: T) => TReturn,
context: null | undefined,
a: A, b: B, c: C, d: D, e: E, f: F): (t: T) => TReturn;
/**
* Takes a function and returns a new one that will always have a particular context.
*
* @param fn The function whose context will be changed.
* @param context The object to which the context (this) of the function should be set.
* @see {@link https://api.jquery.com/jQuery.proxy/}
* @since 1.9
* @deprecated 3.3 Use Function#bind.
*/
proxy<TReturn,
A, B, C, D, E,
T>(fn: (a: A, b: B, c: C, d: D, e: E,
t: T) => TReturn,
context: null | undefined,
a: A, b: B, c: C, d: D, e: E): (t: T) => TReturn;
/**
* Takes a function and returns a new one that will always have a particular context.
*
* @param fn The function whose context will be changed.
* @param context The object to which the context (this) of the function should be set.
* @see {@link https://api.jquery.com/jQuery.proxy/}
* @since 1.9
* @deprecated 3.3 Use Function#bind.
*/
proxy<TReturn,
A, B, C, D,
T>(fn: (a: A, b: B, c: C, d: D,
t: T) => TReturn,
context: null | undefined,
a: A, b: B, c: C, d: D): (t: T) => TReturn;
/**
* Takes a function and returns a new one that will always have a particular context.
*
* @param fn The function whose context will be changed.
* @param context The object to which the context (this) of the function should be set.
* @see {@link https://api.jquery.com/jQuery.proxy/}
* @since 1.9
* @deprecated 3.3 Use Function#bind.
*/
proxy<TReturn,
A, B, C,
T>(fn: (a: A, b: B, c: C,
t: T) => TReturn,
context: null | undefined,
a: A, b: B, c: C): (t: T) => TReturn;
/**
* Takes a function and returns a new one that will always have a particular context.
*
* @param fn The function whose context will be changed.
* @param context The object to which the context (this) of the function should be set.
* @see {@link https://api.jquery.com/jQuery.proxy/}
* @since 1.9
* @deprecated 3.3 Use Function#bind.