@types/jquery 3.3.25 → 3.3.29

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.
jquery/JQuery.d.ts CHANGED
@@ -83,6 +83,7 @@ $( document.body )
83
83
  * @since 1.4
84
84
  */
85
85
  add(selector: JQuery.Selector, context: Element): this;
86
+ // TODO: The return type should reflect newly selected types.
86
87
  /**
87
88
  * Create a new jQuery object with elements added to the set of matched elements.
88
89
  * @param selector_elements_html_selection _@param_ `selector_elements_html_selection`
@@ -226,7 +227,7 @@ collection.css( "background", "yellow" );
226
227
  </html>
227
228
  ```
228
229
  */
229
- add(selector_elements_html_selection: JQuery.Selector | JQuery.TypeOrArray<Element> | JQuery.htmlString | JQuery): this;
230
+ add(selector_elements_html_selection: JQuery.Selector | JQuery.TypeOrArray<Element> | JQuery.htmlString | JQuery | JQuery.Node): this;
230
231
  /**
231
232
  * Add the previous set of elements on the stack to the current set, optionally filtered by a selector.
232
233
  * @param selector A string containing a selector expression to match the current set of elements against.
@@ -5141,7 +5142,9 @@ $( "div b" )
5141
5142
  </html>
5142
5143
  ```
5143
5144
  */
5144
- html(htmlString_function: JQuery.htmlString | ((this: TElement, index: number, oldhtml: JQuery.htmlString) => JQuery.htmlString)): this;
5145
+ html(htmlString_function: JQuery.htmlString |
5146
+ JQuery.Node |
5147
+ ((this: TElement, index: number, oldhtml: JQuery.htmlString) => JQuery.htmlString | JQuery.Node)): this;
5145
5148
  /**
5146
5149
  * Get the HTML contents of the first element in the set of matched elements.
5147
5150
  * @see \`{@link https://api.jquery.com/html/ }\`
@@ -7304,10 +7307,12 @@ $( "body" ).on( "click", "p", foo );
7304
7307
  $( "body" ).off( "click", "p", foo );
7305
7308
  ```
7306
7309
  */
7307
- off(events: string,
7310
+ off<TType extends string>(
7311
+ events: TType,
7308
7312
  selector: JQuery.Selector,
7309
- handler: JQuery.TypeEventHandler<TElement, any, any, any, string> |
7310
- false): this;
7313
+ handler: JQuery.TypeEventHandler<TElement, any, any, any, TType> |
7314
+ false
7315
+ ): this;
7311
7316
  /**
7312
7317
  * Remove an event handler.
7313
7318
  * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as
@@ -7337,10 +7342,12 @@ $( "form" ).on( "keypress.validator", "input[type='text']", validate );
7337
7342
  $( "form" ).off( ".validator" );
7338
7343
  ```
7339
7344
  */
7340
- off(events: string,
7345
+ off<TType extends string>(
7346
+ events: TType,
7341
7347
  selector_handler?: JQuery.Selector |
7342
- JQuery.TypeEventHandler<TElement, any, any, any, string> |
7343
- false): this;
7348
+ JQuery.TypeEventHandler<TElement, any, any, any, TType> |
7349
+ false
7350
+ ): this;
7344
7351
  /**
7345
7352
  * Remove an event handler.
7346
7353
  * @param events An object where the string keys represent one or more space-separated event types and optional
@@ -9986,7 +9993,14 @@ $( "button" ).on( "click", function() {
9986
9993
  </html>
9987
9994
  ```
9988
9995
  */
9989
- replaceWith(newContent_function: JQuery.htmlString | JQuery | JQuery.TypeOrArray<Element> | ((this: TElement) => any)): this;
9996
+ replaceWith(newContent_function: JQuery.htmlString |
9997
+ JQuery<JQuery.Node> |
9998
+ JQuery.TypeOrArray<Element> |
9999
+ JQuery.Node |
10000
+ ((this: TElement, index: number, oldhtml: JQuery.htmlString) => JQuery.htmlString |
10001
+ JQuery<JQuery.Node> |
10002
+ JQuery.TypeOrArray<Element> |
10003
+ JQuery.Node)): this;
9990
10004
  /**
9991
10005
  * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element.
9992
10006
  * @param eventData An object containing data that will be passed to the event handler.
@@ -11968,9 +11982,10 @@ $( "p" ).bind( "click", foo ); // ... Now foo will be called when paragraphs are
11968
11982
  $( "p" ).unbind( "click", foo ); // ... foo will no longer be called.
11969
11983
  ```
11970
11984
  */
11971
- unbind(event: string,
11972
- handler: JQuery.TypeEventHandler<TElement, any, TElement, TElement, string> |
11973
- false
11985
+ unbind<TType extends string>(
11986
+ event: TType,
11987
+ handler: JQuery.TypeEventHandler<TElement, any, TElement, TElement, TType> |
11988
+ false
11974
11989
  ): this;
11975
11990
  /**
11976
11991
  * Remove a previously-attached event handler from the elements.
@@ -12062,10 +12077,11 @@ $( "body" ).delegate( "p", "click", foo );
12062
12077
  $( "body" ).undelegate( "p", "click", foo );
12063
12078
  ```
12064
12079
  */
12065
- undelegate(selector: JQuery.Selector,
12066
- eventType: string,
12067
- handler: JQuery.TypeEventHandler<TElement, any, any, any, string> |
12068
- false
12080
+ undelegate<TType extends string>(
12081
+ selector: JQuery.Selector,
12082
+ eventType: TType,
12083
+ handler: JQuery.TypeEventHandler<TElement, any, any, any, TType> |
12084
+ false
12069
12085
  ): this;
12070
12086
  /**
12071
12087
  * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
jquery/JQueryStatic.d.ts CHANGED
@@ -148,21 +148,26 @@ $( "div", xml.responseXML );
148
148
  $( document.body ).css( "background", "black" );
149
149
  ```
150
150
  */
151
- // Using a unified signature is not possible due to a TypeScript 2.4 bug (DefinitelyTyped#27810)
152
- <T extends Element>(element: T): JQuery<T>;
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
153
  /**
154
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 elementArray An array containing a set of DOM elements to wrap in a jQuery object.
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.
156
159
  * @see \`{@link https://api.jquery.com/jQuery/ }\`
157
160
  * @since 1.0
161
+ * @example ​ ````Set the background color of the page to black.
162
+ ```javascript
163
+ $( document.body ).css( "background", "black" );
164
+ ```
158
165
  * @example ​ ````Hide all the input elements within a form.
159
166
  ```javascript
160
167
  $( myForm.elements ).hide();
161
168
  ```
162
169
  */
163
- // Using a unified signature is not possible due to a TypeScript 2.4 bug (DefinitelyTyped#27810)
164
- // tslint:disable-next-line:unified-signatures
165
- <T extends Element>(elementArray: T[]): JQuery<T>;
170
+ <T extends Element>(element_elementArray: T | ArrayLike<T>): JQuery<T>;
166
171
  /**
167
172
  * Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string.
168
173
  * @param selection An existing jQuery object to clone.
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: Wed, 12 Dec 2018 19:18:24 GMT
11
+ * Last updated: Tue, 25 Dec 2018 21:10:47 GMT
12
12
  * Dependencies: @types/sizzle
13
13
  * Global values: $, Symbol, jQuery
14
14
 
jquery/legacy.d.ts CHANGED
@@ -167,9 +167,12 @@ interface JQueryMouseEventObject extends JQueryInputEventObject {
167
167
  * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\`.
168
168
  */
169
169
  interface JQueryKeyEventObject extends JQueryInputEventObject {
170
- char: any;
170
+ /** @deprecated */
171
+ char: string;
172
+ /** @deprecated */
171
173
  charCode: number;
172
- key: any;
174
+ key: string;
175
+ /** @deprecated */
173
176
  keyCode: number;
174
177
  }
175
178
  /**
jquery/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/jquery",
3
- "version": "3.3.25",
3
+ "version": "3.3.29",
4
4
  "description": "TypeScript definitions for jquery",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -125,6 +125,6 @@
125
125
  "dependencies": {
126
126
  "@types/sizzle": "*"
127
127
  },
128
- "typesPublisherContentHash": "7340622fce8a87ca0c1d3cd123432ce7be12f0b3c79c67ce4b38b0ae57bfb1d5",
128
+ "typesPublisherContentHash": "071233c6e9934a76dcae8dca364b8a702492270644476df618bccad27a3c7af1",
129
129
  "typeScriptVersion": "2.3"
130
130
  }