@types/react-dom 15.5.16 → 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 +0 -0
- react-dom v15.5/README.md +1 -1
- react-dom v15.5/index.d.ts +20 -12
- react-dom v15.5/package.json +3 -3
- react-dom v15.5/server/index.d.ts +1 -1
- react-dom v15.5/test-utils/index.d.ts +85 -24
react-dom v15.5/LICENSE
CHANGED
File without changes
|
react-dom v15.5/README.md
CHANGED
@@ -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: Wed,
|
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
|
|
react-dom v15.5/index.d.ts
CHANGED
@@ -10,10 +10,15 @@
|
|
10
10
|
export as namespace ReactDOM;
|
11
11
|
|
12
12
|
import {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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
|
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
|
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
|
76
|
+
callback?: (component?: Component<P, ComponentState> | Element) => any,
|
77
|
+
): Component<P, ComponentState> | Element | void;
|
react-dom v15.5/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react-dom",
|
3
|
-
"version": "15.5.
|
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": "
|
38
|
-
"typeScriptVersion": "4.
|
37
|
+
"typesPublisherContentHash": "44eef8218ba9c80a7d8816a3803b21687ab73402979313457930cd65010f33a2",
|
38
|
+
"typeScriptVersion": "4.5"
|
39
39
|
}
|
@@ -1,9 +1,17 @@
|
|
1
1
|
import {
|
2
|
-
AbstractView,
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
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 =
|
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
|
86
|
+
new(): any;
|
65
87
|
}
|
66
88
|
|
67
89
|
export interface ShallowRenderer {
|
@@ -86,16 +108,19 @@ export namespace Simulate {
|
|
86
108
|
const animationIteration: EventSimulator;
|
87
109
|
const animationStart: EventSimulator;
|
88
110
|
const blur: EventSimulator;
|
111
|
+
const cancel: EventSimulator;
|
89
112
|
const canPlay: EventSimulator;
|
90
113
|
const canPlayThrough: EventSimulator;
|
91
114
|
const change: EventSimulator;
|
92
115
|
const click: EventSimulator;
|
116
|
+
const close: EventSimulator;
|
93
117
|
const compositionEnd: EventSimulator;
|
94
118
|
const compositionStart: EventSimulator;
|
95
119
|
const compositionUpdate: EventSimulator;
|
96
120
|
const contextMenu: EventSimulator;
|
97
121
|
const copy: EventSimulator;
|
98
122
|
const cut: EventSimulator;
|
123
|
+
const auxClick: EventSimulator;
|
99
124
|
const doubleClick: EventSimulator;
|
100
125
|
const drag: EventSimulator;
|
101
126
|
const dragEnd: EventSimulator;
|
@@ -132,11 +157,24 @@ export namespace Simulate {
|
|
132
157
|
const play: EventSimulator;
|
133
158
|
const playing: EventSimulator;
|
134
159
|
const progress: EventSimulator;
|
160
|
+
const pointerCancel: EventSimulator;
|
161
|
+
const pointerDown: EventSimulator;
|
162
|
+
const pointerUp: EventSimulator;
|
163
|
+
const pointerMove: EventSimulator;
|
164
|
+
const pointerOut: EventSimulator;
|
165
|
+
const pointerOver: EventSimulator;
|
166
|
+
const pointerEnter: EventSimulator;
|
167
|
+
const pointerLeave: EventSimulator;
|
168
|
+
const gotPointerCapture: EventSimulator;
|
169
|
+
const lostPointerCapture: EventSimulator;
|
135
170
|
const rateChange: EventSimulator;
|
171
|
+
const reset: EventSimulator;
|
136
172
|
const scroll: EventSimulator;
|
173
|
+
const toggle: EventSimulator;
|
137
174
|
const seeked: EventSimulator;
|
138
175
|
const seeking: EventSimulator;
|
139
176
|
const select: EventSimulator;
|
177
|
+
const beforeInput: EventSimulator;
|
140
178
|
const stalled: EventSimulator;
|
141
179
|
const submit: EventSimulator;
|
142
180
|
const suspend: EventSimulator;
|
@@ -155,17 +193,21 @@ export namespace Simulate {
|
|
155
193
|
* Render a React element into a detached DOM node in the document. __This function requires a DOM__.
|
156
194
|
*/
|
157
195
|
export function renderIntoDocument<T extends Element>(
|
158
|
-
element: DOMElement<any, T
|
196
|
+
element: DOMElement<any, T>,
|
197
|
+
): T;
|
159
198
|
export function renderIntoDocument(
|
160
|
-
element: SFCElement<any
|
199
|
+
element: SFCElement<any>,
|
200
|
+
): void;
|
161
201
|
// If we replace `P` with `any` in this overload, then some tests fail because
|
162
202
|
// calls to `renderIntoDocument` choose the last overload on the
|
163
203
|
// subtype-relation pass and get an undesirably broad return type. Using `P`
|
164
204
|
// allows this overload to match on the subtype-relation pass.
|
165
205
|
export function renderIntoDocument<P, T extends Component<P>>(
|
166
|
-
element: CElement<P, T
|
206
|
+
element: CElement<P, T>,
|
207
|
+
): T;
|
167
208
|
export function renderIntoDocument<P>(
|
168
|
-
element: ReactElement<P
|
209
|
+
element: ReactElement<P>,
|
210
|
+
): Component<P> | Element | void;
|
169
211
|
|
170
212
|
/**
|
171
213
|
* Pass a mocked component module to this method to augment it with useful methods that allow it to
|
@@ -173,7 +215,9 @@ export function renderIntoDocument<P>(
|
|
173
215
|
* a simple `<div>` (or other tag if `mockTagName` is provided) containing any provided children.
|
174
216
|
*/
|
175
217
|
export function mockComponent(
|
176
|
-
mocked: MockedComponentClass,
|
218
|
+
mocked: MockedComponentClass,
|
219
|
+
mockTagName?: string,
|
220
|
+
): typeof ReactTestUtils;
|
177
221
|
|
178
222
|
/**
|
179
223
|
* Returns `true` if `element` is any React element.
|
@@ -184,22 +228,30 @@ export function isElement(element: any): boolean;
|
|
184
228
|
* Returns `true` if `element` is a React element whose type is of a React `componentClass`.
|
185
229
|
*/
|
186
230
|
export function isElementOfType<T extends HTMLElement>(
|
187
|
-
element: ReactElement,
|
231
|
+
element: ReactElement,
|
232
|
+
type: string,
|
233
|
+
): element is ReactHTMLElement<T>;
|
188
234
|
/**
|
189
235
|
* Returns `true` if `element` is a React element whose type is of a React `componentClass`.
|
190
236
|
*/
|
191
237
|
export function isElementOfType<P extends DOMAttributes<{}>, T extends Element>(
|
192
|
-
element: ReactElement,
|
238
|
+
element: ReactElement,
|
239
|
+
type: string,
|
240
|
+
): element is DOMElement<P, T>;
|
193
241
|
/**
|
194
242
|
* Returns `true` if `element` is a React element whose type is of a React `componentClass`.
|
195
243
|
*/
|
196
244
|
export function isElementOfType<P>(
|
197
|
-
element: ReactElement,
|
245
|
+
element: ReactElement,
|
246
|
+
type: SFC<P>,
|
247
|
+
): element is SFCElement<P>;
|
198
248
|
/**
|
199
249
|
* Returns `true` if `element` is a React element whose type is of a React `componentClass`.
|
200
250
|
*/
|
201
251
|
export function isElementOfType<P, T extends Component<P>, C extends ComponentClass<P>>(
|
202
|
-
element: ReactElement,
|
252
|
+
element: ReactElement,
|
253
|
+
type: ClassType<P, T, C>,
|
254
|
+
): element is CElement<P, T>;
|
203
255
|
|
204
256
|
/**
|
205
257
|
* Returns `true` if `instance` is a DOM component (such as a `<div>` or `<span>`).
|
@@ -213,7 +265,9 @@ export function isCompositeComponent(instance: ReactInstance): instance is Compo
|
|
213
265
|
* Returns `true` if `instance` is a component whose type is of a React `componentClass`.
|
214
266
|
*/
|
215
267
|
export function isCompositeComponentWithType<T extends Component<any>, C extends ComponentClass<any>>(
|
216
|
-
instance: ReactInstance,
|
268
|
+
instance: ReactInstance,
|
269
|
+
type: ClassType<any, T, C>,
|
270
|
+
): boolean;
|
217
271
|
|
218
272
|
/**
|
219
273
|
* Traverse all components in `tree` and accumulate all components where
|
@@ -222,7 +276,8 @@ export function isCompositeComponentWithType<T extends Component<any>, C extends
|
|
222
276
|
*/
|
223
277
|
export function findAllInRenderedTree(
|
224
278
|
root: Component<any>,
|
225
|
-
fn: (i: ReactInstance) => boolean
|
279
|
+
fn: (i: ReactInstance) => boolean,
|
280
|
+
): ReactInstance[];
|
226
281
|
|
227
282
|
/**
|
228
283
|
* Finds all DOM elements of components in the rendered tree that are
|
@@ -230,7 +285,8 @@ export function findAllInRenderedTree(
|
|
230
285
|
*/
|
231
286
|
export function scryRenderedDOMComponentsWithClass(
|
232
287
|
root: Component<any>,
|
233
|
-
className: string
|
288
|
+
className: string,
|
289
|
+
): Element[];
|
234
290
|
/**
|
235
291
|
* Like `scryRenderedDOMComponentsWithClass()` but expects there to be one result,
|
236
292
|
* and returns that one result, or throws exception if there is any other
|
@@ -238,7 +294,8 @@ export function scryRenderedDOMComponentsWithClass(
|
|
238
294
|
*/
|
239
295
|
export function findRenderedDOMComponentWithClass(
|
240
296
|
root: Component<any>,
|
241
|
-
className: string
|
297
|
+
className: string,
|
298
|
+
): Element;
|
242
299
|
|
243
300
|
/**
|
244
301
|
* Finds all DOM elements of components in the rendered tree that are
|
@@ -246,7 +303,8 @@ export function findRenderedDOMComponentWithClass(
|
|
246
303
|
*/
|
247
304
|
export function scryRenderedDOMComponentsWithTag(
|
248
305
|
root: Component<any>,
|
249
|
-
tagName: string
|
306
|
+
tagName: string,
|
307
|
+
): Element[];
|
250
308
|
/**
|
251
309
|
* Like `scryRenderedDOMComponentsWithTag()` but expects there to be one result,
|
252
310
|
* and returns that one result, or throws exception if there is any other
|
@@ -254,14 +312,16 @@ export function scryRenderedDOMComponentsWithTag(
|
|
254
312
|
*/
|
255
313
|
export function findRenderedDOMComponentWithTag(
|
256
314
|
root: Component<any>,
|
257
|
-
tagName: string
|
315
|
+
tagName: string,
|
316
|
+
): Element;
|
258
317
|
|
259
318
|
/**
|
260
319
|
* Finds all instances of components with type equal to `componentClass`.
|
261
320
|
*/
|
262
321
|
export function scryRenderedComponentsWithType<T extends Component, C extends ComponentClass>(
|
263
322
|
root: Component<any>,
|
264
|
-
type: ClassType<any, T, C
|
323
|
+
type: ClassType<any, T, C>,
|
324
|
+
): T[];
|
265
325
|
|
266
326
|
/**
|
267
327
|
* Same as `scryRenderedComponentsWithType()` but expects there to be one result
|
@@ -270,7 +330,8 @@ export function scryRenderedComponentsWithType<T extends Component, C extends Co
|
|
270
330
|
*/
|
271
331
|
export function findRenderedComponentWithType<T extends Component, C extends ComponentClass>(
|
272
332
|
root: Component<any>,
|
273
|
-
type: ClassType<any, T, C
|
333
|
+
type: ClassType<any, T, C>,
|
334
|
+
): T;
|
274
335
|
|
275
336
|
/**
|
276
337
|
* Call this in your tests to create a shallow renderer.
|