@types/react-dom 15.5.17 → 15.5.18

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.
react-dom v15.5/LICENSE CHANGED
File without changes
@@ -8,7 +8,7 @@ This package contains type definitions for React (react-dom) (http://facebook.gi
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom/v15.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Tue, 25 Apr 2023 20:32:50 GMT
11
+ * Last updated: Wed, 27 Sep 2023 07:12:04 GMT
12
12
  * Dependencies: [@types/react](https://npmjs.com/package/@types/react)
13
13
  * Global values: `ReactDOM`, `ReactDOMServer`
14
14
 
@@ -10,10 +10,15 @@
10
10
  export as namespace ReactDOM;
11
11
 
12
12
  import {
13
- ReactInstance, Component, ComponentState,
14
- ReactElement, SFCElement, CElement,
15
- DOMAttributes, DOMElement
16
- } from 'react';
13
+ CElement,
14
+ Component,
15
+ ComponentState,
16
+ DOMAttributes,
17
+ DOMElement,
18
+ ReactElement,
19
+ ReactInstance,
20
+ SFCElement,
21
+ } from "react";
17
22
 
18
23
  export function findDOMNode<E extends Element>(instance: ReactInstance | null | undefined): E;
19
24
  export function findDOMNode(instance: ReactInstance): Element;
@@ -21,28 +26,28 @@ export function findDOMNode(instance: ReactInstance): Element;
21
26
  export function render<P extends DOMAttributes<T>, T extends Element>(
22
27
  element: DOMElement<P, T>,
23
28
  container: Element | null,
24
- callback?: (element: T) => any
29
+ callback?: (element: T) => any,
25
30
  ): T;
26
31
  export function render<P>(
27
32
  element: SFCElement<P>,
28
33
  container: Element | null,
29
- callback?: () => any
34
+ callback?: () => any,
30
35
  ): void;
31
36
  export function render<P, T extends Component<P, ComponentState>>(
32
37
  element: CElement<P, T>,
33
38
  container: Element | null,
34
- callback?: (component: T) => any
39
+ callback?: (component: T) => any,
35
40
  ): T;
36
41
  export function render<P>(
37
42
  element: ReactElement<P>,
38
43
  container: Element | null,
39
- callback?: (component?: Component<P, ComponentState> | Element) => any
44
+ callback?: (component?: Component<P, ComponentState> | Element) => any,
40
45
  ): Component<P, ComponentState> | Element | void;
41
46
  export function render<P>(
42
47
  parentComponent: Component<any>,
43
48
  element: SFCElement<P>,
44
49
  container: Element,
45
- callback?: () => any
50
+ callback?: () => any,
46
51
  ): void;
47
52
 
48
53
  export function unmountComponentAtNode(container: Element): boolean;
@@ -56,14 +61,17 @@ export function unstable_renderSubtreeIntoContainer<P extends DOMAttributes<T>,
56
61
  parentComponent: Component<any>,
57
62
  element: DOMElement<P, T>,
58
63
  container: Element,
59
- callback?: (element: T) => any): T;
64
+ callback?: (element: T) => any,
65
+ ): T;
60
66
  export function unstable_renderSubtreeIntoContainer<P, T extends Component<P, ComponentState>>(
61
67
  parentComponent: Component<any>,
62
68
  element: CElement<P, T>,
63
69
  container: Element,
64
- callback?: (component: T) => any): T;
70
+ callback?: (component: T) => any,
71
+ ): T;
65
72
  export function unstable_renderSubtreeIntoContainer<P>(
66
73
  parentComponent: Component<any>,
67
74
  element: ReactElement<P>,
68
75
  container: Element,
69
- callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
76
+ callback?: (component?: Component<P, ComponentState> | Element) => any,
77
+ ): Component<P, ComponentState> | Element | void;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react-dom",
3
- "version": "15.5.17",
3
+ "version": "15.5.18",
4
4
  "description": "TypeScript definitions for React (react-dom)",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom",
6
6
  "license": "MIT",
@@ -34,6 +34,6 @@
34
34
  "dependencies": {
35
35
  "@types/react": "^15"
36
36
  },
37
- "typesPublisherContentHash": "6be91342035e54d969c41e7361ae22cd7e620f39754cf913387e269533d43ded",
38
- "typeScriptVersion": "4.3"
37
+ "typesPublisherContentHash": "44eef8218ba9c80a7d8816a3803b21687ab73402979313457930cd65010f33a2",
38
+ "typeScriptVersion": "4.5"
39
39
  }
@@ -1,4 +1,4 @@
1
- import { ReactElement } from 'react';
1
+ import { ReactElement } from "react";
2
2
 
3
3
  /**
4
4
  * Render a React element to its initial HTML. This should only be used on the server.
@@ -1,9 +1,17 @@
1
1
  import {
2
- AbstractView, Component, ComponentClass,
3
- ReactElement, ReactInstance, ClassType,
4
- DOMElement, SFCElement, CElement,
5
- ReactHTMLElement, DOMAttributes, SFC
6
- } from 'react';
2
+ AbstractView,
3
+ CElement,
4
+ ClassType,
5
+ Component,
6
+ ComponentClass,
7
+ DOMAttributes,
8
+ DOMElement,
9
+ ReactElement,
10
+ ReactHTMLElement,
11
+ ReactInstance,
12
+ SFC,
13
+ SFCElement,
14
+ } from "react";
7
15
 
8
16
  import * as ReactTestUtils from ".";
9
17
 
@@ -22,7 +30,21 @@ export interface OptionalEventProperties {
22
30
  type?: string | undefined;
23
31
  }
24
32
 
25
- export type ModifierKey = "Alt" | "AltGraph" | "CapsLock" | "Control" | "Fn" | "FnLock" | "Hyper" | "Meta" | "NumLock" | "ScrollLock" | "Shift" | "Super" | "Symbol" | "SymbolLock";
33
+ export type ModifierKey =
34
+ | "Alt"
35
+ | "AltGraph"
36
+ | "CapsLock"
37
+ | "Control"
38
+ | "Fn"
39
+ | "FnLock"
40
+ | "Hyper"
41
+ | "Meta"
42
+ | "NumLock"
43
+ | "ScrollLock"
44
+ | "Shift"
45
+ | "Super"
46
+ | "Symbol"
47
+ | "SymbolLock";
26
48
 
27
49
  export interface SyntheticEventData extends OptionalEventProperties {
28
50
  altKey?: boolean | undefined;
@@ -61,7 +83,7 @@ export interface SyntheticEventData extends OptionalEventProperties {
61
83
  export type EventSimulator = (element: Element | Component<any>, eventData?: SyntheticEventData) => void;
62
84
 
63
85
  export interface MockedComponentClass {
64
- new (): any;
86
+ new(): any;
65
87
  }
66
88
 
67
89
  export interface ShallowRenderer {
@@ -171,17 +193,21 @@ export namespace Simulate {
171
193
  * Render a React element into a detached DOM node in the document. __This function requires a DOM__.
172
194
  */
173
195
  export function renderIntoDocument<T extends Element>(
174
- element: DOMElement<any, T>): T;
196
+ element: DOMElement<any, T>,
197
+ ): T;
175
198
  export function renderIntoDocument(
176
- element: SFCElement<any>): void;
199
+ element: SFCElement<any>,
200
+ ): void;
177
201
  // If we replace `P` with `any` in this overload, then some tests fail because
178
202
  // calls to `renderIntoDocument` choose the last overload on the
179
203
  // subtype-relation pass and get an undesirably broad return type. Using `P`
180
204
  // allows this overload to match on the subtype-relation pass.
181
205
  export function renderIntoDocument<P, T extends Component<P>>(
182
- element: CElement<P, T>): T;
206
+ element: CElement<P, T>,
207
+ ): T;
183
208
  export function renderIntoDocument<P>(
184
- element: ReactElement<P>): Component<P> | Element | void;
209
+ element: ReactElement<P>,
210
+ ): Component<P> | Element | void;
185
211
 
186
212
  /**
187
213
  * Pass a mocked component module to this method to augment it with useful methods that allow it to
@@ -189,7 +215,9 @@ export function renderIntoDocument<P>(
189
215
  * a simple `<div>` (or other tag if `mockTagName` is provided) containing any provided children.
190
216
  */
191
217
  export function mockComponent(
192
- mocked: MockedComponentClass, mockTagName?: string): typeof ReactTestUtils;
218
+ mocked: MockedComponentClass,
219
+ mockTagName?: string,
220
+ ): typeof ReactTestUtils;
193
221
 
194
222
  /**
195
223
  * Returns `true` if `element` is any React element.
@@ -200,22 +228,30 @@ export function isElement(element: any): boolean;
200
228
  * Returns `true` if `element` is a React element whose type is of a React `componentClass`.
201
229
  */
202
230
  export function isElementOfType<T extends HTMLElement>(
203
- element: ReactElement, type: string): element is ReactHTMLElement<T>;
231
+ element: ReactElement,
232
+ type: string,
233
+ ): element is ReactHTMLElement<T>;
204
234
  /**
205
235
  * Returns `true` if `element` is a React element whose type is of a React `componentClass`.
206
236
  */
207
237
  export function isElementOfType<P extends DOMAttributes<{}>, T extends Element>(
208
- element: ReactElement, type: string): element is DOMElement<P, T>;
238
+ element: ReactElement,
239
+ type: string,
240
+ ): element is DOMElement<P, T>;
209
241
  /**
210
242
  * Returns `true` if `element` is a React element whose type is of a React `componentClass`.
211
243
  */
212
244
  export function isElementOfType<P>(
213
- element: ReactElement, type: SFC<P>): element is SFCElement<P>;
245
+ element: ReactElement,
246
+ type: SFC<P>,
247
+ ): element is SFCElement<P>;
214
248
  /**
215
249
  * Returns `true` if `element` is a React element whose type is of a React `componentClass`.
216
250
  */
217
251
  export function isElementOfType<P, T extends Component<P>, C extends ComponentClass<P>>(
218
- element: ReactElement, type: ClassType<P, T, C>): element is CElement<P, T>;
252
+ element: ReactElement,
253
+ type: ClassType<P, T, C>,
254
+ ): element is CElement<P, T>;
219
255
 
220
256
  /**
221
257
  * Returns `true` if `instance` is a DOM component (such as a `<div>` or `<span>`).
@@ -229,7 +265,9 @@ export function isCompositeComponent(instance: ReactInstance): instance is Compo
229
265
  * Returns `true` if `instance` is a component whose type is of a React `componentClass`.
230
266
  */
231
267
  export function isCompositeComponentWithType<T extends Component<any>, C extends ComponentClass<any>>(
232
- instance: ReactInstance, type: ClassType<any, T, C>): boolean;
268
+ instance: ReactInstance,
269
+ type: ClassType<any, T, C>,
270
+ ): boolean;
233
271
 
234
272
  /**
235
273
  * Traverse all components in `tree` and accumulate all components where
@@ -238,7 +276,8 @@ export function isCompositeComponentWithType<T extends Component<any>, C extends
238
276
  */
239
277
  export function findAllInRenderedTree(
240
278
  root: Component<any>,
241
- fn: (i: ReactInstance) => boolean): ReactInstance[];
279
+ fn: (i: ReactInstance) => boolean,
280
+ ): ReactInstance[];
242
281
 
243
282
  /**
244
283
  * Finds all DOM elements of components in the rendered tree that are
@@ -246,7 +285,8 @@ export function findAllInRenderedTree(
246
285
  */
247
286
  export function scryRenderedDOMComponentsWithClass(
248
287
  root: Component<any>,
249
- className: string): Element[];
288
+ className: string,
289
+ ): Element[];
250
290
  /**
251
291
  * Like `scryRenderedDOMComponentsWithClass()` but expects there to be one result,
252
292
  * and returns that one result, or throws exception if there is any other
@@ -254,7 +294,8 @@ export function scryRenderedDOMComponentsWithClass(
254
294
  */
255
295
  export function findRenderedDOMComponentWithClass(
256
296
  root: Component<any>,
257
- className: string): Element;
297
+ className: string,
298
+ ): Element;
258
299
 
259
300
  /**
260
301
  * Finds all DOM elements of components in the rendered tree that are
@@ -262,7 +303,8 @@ export function findRenderedDOMComponentWithClass(
262
303
  */
263
304
  export function scryRenderedDOMComponentsWithTag(
264
305
  root: Component<any>,
265
- tagName: string): Element[];
306
+ tagName: string,
307
+ ): Element[];
266
308
  /**
267
309
  * Like `scryRenderedDOMComponentsWithTag()` but expects there to be one result,
268
310
  * and returns that one result, or throws exception if there is any other
@@ -270,14 +312,16 @@ export function scryRenderedDOMComponentsWithTag(
270
312
  */
271
313
  export function findRenderedDOMComponentWithTag(
272
314
  root: Component<any>,
273
- tagName: string): Element;
315
+ tagName: string,
316
+ ): Element;
274
317
 
275
318
  /**
276
319
  * Finds all instances of components with type equal to `componentClass`.
277
320
  */
278
321
  export function scryRenderedComponentsWithType<T extends Component, C extends ComponentClass>(
279
322
  root: Component<any>,
280
- type: ClassType<any, T, C>): T[];
323
+ type: ClassType<any, T, C>,
324
+ ): T[];
281
325
 
282
326
  /**
283
327
  * Same as `scryRenderedComponentsWithType()` but expects there to be one result
@@ -286,7 +330,8 @@ export function scryRenderedComponentsWithType<T extends Component, C extends Co
286
330
  */
287
331
  export function findRenderedComponentWithType<T extends Component, C extends ComponentClass>(
288
332
  root: Component<any>,
289
- type: ClassType<any, T, C>): T;
333
+ type: ClassType<any, T, C>,
334
+ ): T;
290
335
 
291
336
  /**
292
337
  * Call this in your tests to create a shallow renderer.