@types/jquery 3.5.30 → 3.5.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. jquery/JQuery.d.ts +83 -15
  2. jquery/README.md +1 -1
  3. jquery/package.json +3 -3
jquery/JQuery.d.ts CHANGED
@@ -1850,7 +1850,8 @@ $( "div" ).children( ".selected" ).css( "color", "blue" );
1850
1850
  */
1851
1851
  children<K extends keyof HTMLElementTagNameMap>(selector: K): JQuery<HTMLElementTagNameMap[K]>;
1852
1852
  children<K extends keyof SVGElementTagNameMap>(selector: K): JQuery<SVGElementTagNameMap[K]>;
1853
- children(selector?: JQuery.Selector): JQuery;
1853
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
1854
+ children<E extends Element = HTMLElement>(selector?: JQuery.Selector): JQuery<E>;
1854
1855
  /**
1855
1856
  * Remove from the queue all items that have not yet been run.
1856
1857
  * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
@@ -2032,7 +2033,10 @@ $( "b" ).clone().prependTo( "p" );
2032
2033
  * @see \`{@link https://api.jquery.com/closest/ }\`
2033
2034
  * @since 1.4
2034
2035
  */
2035
- closest(selector: JQuery.Selector, context: Element): this;
2036
+ closest<K extends keyof HTMLElementTagNameMap>(selector: K, context: Element): JQuery<HTMLElementTagNameMap[K]>;
2037
+ closest<K extends keyof SVGElementTagNameMap>(selector: K, context: Element): JQuery<SVGElementTagNameMap[K]>;
2038
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
2039
+ closest<E extends Element = HTMLElement>(selector: JQuery.Selector, context: Element): JQuery<E>;
2036
2040
  /**
2037
2041
  * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
2038
2042
  * @param selector_selection_element _&#x40;param_ `selector_selection_element`
@@ -2115,7 +2119,15 @@ $( document ).on( "click", function( event ) {
2115
2119
  </html>
2116
2120
  ```
2117
2121
  */
2118
- closest(selector_selection_element: JQuery.Selector | Element | JQuery): this;
2122
+ closest<K extends keyof HTMLElementTagNameMap>(
2123
+ selector_selection_element: K | JQuery<K>,
2124
+ ): JQuery<HTMLElementTagNameMap[K]>;
2125
+ closest<K extends keyof SVGElementTagNameMap>(
2126
+ selector_selection_element: K | JQuery<K>,
2127
+ ): JQuery<SVGElementTagNameMap[K]>;
2128
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
2129
+ closest<E extends Element = HTMLElement>(selector_selection_element: JQuery.Selector): JQuery<E>;
2130
+ closest<E extends Element = HTMLElement>(selector_selection_element: E | JQuery<E>): JQuery<E>;
2119
2131
  /**
2120
2132
  * Get the children of each element in the set of matched elements, including text and comment nodes.
2121
2133
  * @see \`{@link https://api.jquery.com/contents/ }\`
@@ -4249,7 +4261,9 @@ $( "p" )
4249
4261
  */
4250
4262
  find<K extends keyof HTMLElementTagNameMap>(selector_element: K | JQuery<K>): JQuery<HTMLElementTagNameMap[K]>;
4251
4263
  find<K extends keyof SVGElementTagNameMap>(selector_element: K | JQuery<K>): JQuery<SVGElementTagNameMap[K]>;
4252
- find<E extends HTMLElement>(selector_element: JQuery.Selector | Element | E | JQuery<E>): JQuery<E>;
4264
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
4265
+ find<E extends Element = HTMLElement>(selector_element: JQuery.Selector): JQuery<E>;
4266
+ find<E extends Element = HTMLElement>(selector_element: E | JQuery<E>): JQuery<E>;
4253
4267
  /**
4254
4268
  * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements.
4255
4269
  * @param queue The name of the queue in which to stop animations.
@@ -7333,7 +7347,10 @@ $( "p" ).next( ".selected" ).css( "background", "yellow" );
7333
7347
  </html>
7334
7348
  ```
7335
7349
  */
7336
- next(selector?: JQuery.Selector): this;
7350
+ next<K extends keyof HTMLElementTagNameMap>(selector: K): JQuery<HTMLElementTagNameMap[K]>;
7351
+ next<K extends keyof SVGElementTagNameMap>(selector: K): JQuery<SVGElementTagNameMap[K]>;
7352
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
7353
+ next<E extends Element = HTMLElement>(selector?: JQuery.Selector): JQuery<E>;
7337
7354
  /**
7338
7355
  * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.
7339
7356
  * @param selector A string containing a selector expression to match elements against.
@@ -7414,7 +7431,10 @@ $( ":nth-child(1)" ).nextAll( "p" ).addClass( "after" );
7414
7431
  </html>
7415
7432
  ```
7416
7433
  */
7417
- nextAll(selector?: string): this;
7434
+ nextAll<K extends keyof HTMLElementTagNameMap>(selector: K): JQuery<HTMLElementTagNameMap[K]>;
7435
+ nextAll<K extends keyof SVGElementTagNameMap>(selector: K): JQuery<SVGElementTagNameMap[K]>;
7436
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
7437
+ nextAll<E extends Element = HTMLElement>(selector?: JQuery.Selector): JQuery<E>;
7418
7438
  /**
7419
7439
  * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
7420
7440
  * @param selector_element _&#x40;param_ `selector_element`
@@ -7465,7 +7485,19 @@ $( "#term-1" )
7465
7485
  </html>
7466
7486
  ```
7467
7487
  */
7468
- nextUntil(selector_element?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this;
7488
+ nextUntil<K extends keyof HTMLElementTagNameMap>(
7489
+ selector_element: JQuery.Selector | Element | JQuery,
7490
+ filter: K,
7491
+ ): JQuery<HTMLElementTagNameMap[K]>;
7492
+ nextUntil<K extends keyof SVGElementTagNameMap>(
7493
+ selector_element: JQuery.Selector | Element | JQuery,
7494
+ filter: K,
7495
+ ): JQuery<SVGElementTagNameMap[K]>;
7496
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
7497
+ nextUntil<E extends Element = HTMLElement>(
7498
+ selector_element?: JQuery.Selector | Element | JQuery,
7499
+ filter?: JQuery.Selector,
7500
+ ): JQuery<E>;
7469
7501
  /**
7470
7502
  * Remove elements from the set of matched elements.
7471
7503
  * @param selector_function_selection _&#x40;param_ `selector_function_selection`
@@ -7839,7 +7871,7 @@ $( "*", document.body ).click(function( event ) {
7839
7871
  </html>
7840
7872
  ```
7841
7873
  */
7842
- offsetParent(): this;
7874
+ offsetParent(): JQuery;
7843
7875
  /**
7844
7876
  * Attach an event handler function for one or more events to the selected elements.
7845
7877
  * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
@@ -8819,7 +8851,10 @@ $( "p" ).parent( ".selected" ).css( "background", "yellow" );
8819
8851
  </html>
8820
8852
  ```
8821
8853
  */
8822
- parent(selector?: JQuery.Selector): this;
8854
+ parent<K extends keyof HTMLElementTagNameMap>(selector: K): JQuery<HTMLElementTagNameMap[K]>;
8855
+ parent<K extends keyof SVGElementTagNameMap>(selector: K): JQuery<SVGElementTagNameMap[K]>;
8856
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
8857
+ parent<E extends Element = HTMLElement>(selector?: JQuery.Selector): JQuery<E>;
8823
8858
  /**
8824
8859
  * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.
8825
8860
  * @param selector A string containing a selector expression to match elements against.
@@ -8934,7 +8969,7 @@ $( "span" ).click(function() {
8934
8969
  parents<K extends keyof HTMLElementTagNameMap>(selector: K | JQuery<K>): JQuery<HTMLElementTagNameMap[K]>;
8935
8970
  parents<K extends keyof SVGElementTagNameMap>(selector: K | JQuery<K>): JQuery<SVGElementTagNameMap[K]>;
8936
8971
  // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
8937
- parents<E extends HTMLElement>(selector?: JQuery.Selector): JQuery<E>;
8972
+ parents<E extends Element = HTMLElement>(selector?: JQuery.Selector): JQuery<E>;
8938
8973
  /**
8939
8974
  * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
8940
8975
  * @param selector_element _&#x40;param_ `selector_element`
@@ -8988,7 +9023,19 @@ $( "li.item-2" )
8988
9023
  </html>
8989
9024
  ```
8990
9025
  */
8991
- parentsUntil(selector_element?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this;
9026
+ parentsUntil<K extends keyof HTMLElementTagNameMap>(
9027
+ selector_element: JQuery.Selector | Element | JQuery,
9028
+ filter: K,
9029
+ ): JQuery<HTMLElementTagNameMap[K]>;
9030
+ parentsUntil<K extends keyof SVGElementTagNameMap>(
9031
+ selector_element: JQuery.Selector | Element | JQuery,
9032
+ filter: K,
9033
+ ): JQuery<SVGElementTagNameMap[K]>;
9034
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
9035
+ parentsUntil<E extends Element = HTMLElement>(
9036
+ selector_element?: JQuery.Selector | Element | JQuery,
9037
+ filter?: JQuery.Selector,
9038
+ ): JQuery<E>;
8992
9039
  /**
8993
9040
  * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
8994
9041
  * @see \`{@link https://api.jquery.com/position/ }\`
@@ -9244,7 +9291,10 @@ $( "p" ).prev( ".selected" ).css( "background", "yellow" );
9244
9291
  </html>
9245
9292
  ```
9246
9293
  */
9247
- prev(selector?: JQuery.Selector): this;
9294
+ prev<K extends keyof HTMLElementTagNameMap>(selector: K): JQuery<HTMLElementTagNameMap[K]>;
9295
+ prev<K extends keyof SVGElementTagNameMap>(selector: K): JQuery<SVGElementTagNameMap[K]>;
9296
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
9297
+ prev<E extends Element = HTMLElement>(selector?: JQuery.Selector): JQuery<E>;
9248
9298
  /**
9249
9299
  * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.
9250
9300
  * @param selector A string containing a selector expression to match elements against.
@@ -9287,7 +9337,10 @@ $( "div:last" ).prevAll().addClass( "before" );
9287
9337
  </html>
9288
9338
  ```
9289
9339
  */
9290
- prevAll(selector?: JQuery.Selector): this;
9340
+ prevAll<K extends keyof HTMLElementTagNameMap>(selector: K): JQuery<HTMLElementTagNameMap[K]>;
9341
+ prevAll<K extends keyof SVGElementTagNameMap>(selector: K): JQuery<SVGElementTagNameMap[K]>;
9342
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
9343
+ prevAll<E extends Element = HTMLElement>(selector?: JQuery.Selector): JQuery<E>;
9291
9344
  /**
9292
9345
  * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
9293
9346
  * @param selector_element _&#x40;param_ `selector_element`
@@ -9339,7 +9392,19 @@ $( "#term-3" ).prevUntil( term1, "dd" )
9339
9392
  </html>
9340
9393
  ```
9341
9394
  */
9342
- prevUntil(selector_element?: JQuery.Selector | Element | JQuery, filter?: JQuery.Selector): this;
9395
+ prevUntil<K extends keyof HTMLElementTagNameMap>(
9396
+ selector_element: JQuery.Selector | Element | JQuery,
9397
+ filter: K,
9398
+ ): JQuery<HTMLElementTagNameMap[K]>;
9399
+ prevUntil<K extends keyof SVGElementTagNameMap>(
9400
+ selector_element: JQuery.Selector | Element | JQuery,
9401
+ filter: K,
9402
+ ): JQuery<SVGElementTagNameMap[K]>;
9403
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
9404
+ prevUntil<E extends Element = HTMLElement>(
9405
+ selector_element?: JQuery.Selector | Element | JQuery,
9406
+ filter?: JQuery.Selector,
9407
+ ): JQuery<E>;
9343
9408
  /**
9344
9409
  * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.
9345
9410
  * @param type The type of queue that needs to be observed.
@@ -11068,7 +11133,10 @@ $( "p" ).siblings( ".selected" ).css( "background", "yellow" );
11068
11133
  </html>
11069
11134
  ```
11070
11135
  */
11071
- siblings(selector?: JQuery.Selector): this;
11136
+ siblings<K extends keyof HTMLElementTagNameMap>(selector: K): JQuery<HTMLElementTagNameMap[K]>;
11137
+ siblings<K extends keyof SVGElementTagNameMap>(selector: K): JQuery<SVGElementTagNameMap[K]>;
11138
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
11139
+ siblings<E extends Element = HTMLElement>(selector?: JQuery.Selector): JQuery<E>;
11072
11140
  /**
11073
11141
  * Reduce the set of matched elements to a subset specified by a range of indices.
11074
11142
  * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative,
jquery/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for jquery (https://jquery.com).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jquery.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Tue, 07 May 2024 20:08:04 GMT
11
+ * Last updated: Wed, 25 Sep 2024 19:19:36 GMT
12
12
  * Dependencies: [@types/sizzle](https://npmjs.com/package/@types/sizzle)
13
13
 
14
14
  # Credits
jquery/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/jquery",
3
- "version": "3.5.30",
3
+ "version": "3.5.31",
4
4
  "description": "TypeScript definitions for jquery",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jquery",
6
6
  "license": "MIT",
@@ -127,6 +127,6 @@
127
127
  "dependencies": {
128
128
  "@types/sizzle": "*"
129
129
  },
130
- "typesPublisherContentHash": "c2bbe4aa3b1a237fb7a313340ed457216078c5c41341aa08f63c958d7e6df555",
131
- "typeScriptVersion": "4.7"
130
+ "typesPublisherContentHash": "6cfdf9b26cfe360ba66dfb7ed330168ae7a66b3ab3cc613ee135d7a5f424f09b",
131
+ "typeScriptVersion": "4.8"
132
132
  }