@types/react-dom 16.9.14 → 17.0.3
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 v16.9 → react-dom}/LICENSE +0 -0
- react-dom v16.9/README.md → react-dom/README.md +3 -3
- react-dom/experimental.d.ts +87 -0
- react-dom v16.9/index.d.ts → react-dom/index.d.ts +8 -11
- {react-dom v16.9 → react-dom}/node-stream/index.d.ts +0 -0
- react-dom v16.9/package.json → react-dom/package.json +4 -10
- react-dom v16.9/server/index.d.ts → react-dom/server.d.ts +0 -0
- react-dom v16.9/test-utils/index.d.ts → react-dom/test-utils/index.d.ts +42 -41
File without changes
|
@@ -5,12 +5,12 @@
|
|
5
5
|
This package contains type definitions for React (react-dom) (https://reactjs.org).
|
6
6
|
|
7
7
|
# Details
|
8
|
-
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom
|
8
|
+
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Tue, 23 Mar 2021 00:35:10 GMT
|
12
12
|
* Dependencies: [@types/react](https://npmjs.com/package/@types/react)
|
13
13
|
* Global values: `ReactDOM`, `ReactDOMNodeStream`, `ReactDOMServer`
|
14
14
|
|
15
15
|
# Credits
|
16
|
-
These definitions were written by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com), [MartynasZilinskas](https://github.com/MartynasZilinskas), [Josh Rutherford](https://github.com/theruther4d), [Jessica Franco](https://github.com/Jessidhia)
|
16
|
+
These definitions were written by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com), [MartynasZilinskas](https://github.com/MartynasZilinskas), [Josh Rutherford](https://github.com/theruther4d), and [Jessica Franco](https://github.com/Jessidhia).
|
@@ -0,0 +1,87 @@
|
|
1
|
+
/**
|
2
|
+
* These are types for things that are present in the `experimental` builds of React but not yet
|
3
|
+
* on a stable build.
|
4
|
+
*
|
5
|
+
* Once they are promoted to stable they can just be moved to the main index file.
|
6
|
+
*
|
7
|
+
* To load the types declared here in an actual project, there are three ways. The easiest one,
|
8
|
+
* if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
|
9
|
+
* is to add `"react-dom/experimental"` to the `"types"` array.
|
10
|
+
*
|
11
|
+
* Alternatively, a specific import syntax can to be used from a typescript file.
|
12
|
+
* This module does not exist in reality, which is why the {} is important:
|
13
|
+
*
|
14
|
+
* ```ts
|
15
|
+
* import {} from 'react-dom/experimental'
|
16
|
+
* ```
|
17
|
+
*
|
18
|
+
* It is also possible to include it through a triple-slash reference:
|
19
|
+
*
|
20
|
+
* ```ts
|
21
|
+
* /// <reference types="react-dom/experimental" />
|
22
|
+
* ```
|
23
|
+
*
|
24
|
+
* Either the import or the reference only needs to appear once, anywhere in the project.
|
25
|
+
*/
|
26
|
+
|
27
|
+
// See https://github.com/facebook/react/blob/master/packages/react-dom/src/client/ReactDOM.js to see how the exports are declared,
|
28
|
+
// and https://github.com/facebook/react/blob/master/packages/shared/ReactFeatureFlags.js to verify which APIs are
|
29
|
+
// flagged experimental or not. Experimental APIs will be tagged with `__EXPERIMENTAL__`.
|
30
|
+
|
31
|
+
import React = require('react');
|
32
|
+
import ReactDOM = require('.');
|
33
|
+
|
34
|
+
export {};
|
35
|
+
|
36
|
+
declare module '.' {
|
37
|
+
// enableSuspenseServerRenderer feature
|
38
|
+
interface HydrationOptions {
|
39
|
+
onHydrated?(suspenseInstance: Comment): void;
|
40
|
+
onDeleted?(suspenseInstance: Comment): void;
|
41
|
+
}
|
42
|
+
|
43
|
+
// exposeConcurrentModeAPIs features
|
44
|
+
|
45
|
+
interface RootOptions {
|
46
|
+
hydrate?: boolean;
|
47
|
+
hydrationOptions?: HydrationOptions;
|
48
|
+
}
|
49
|
+
|
50
|
+
interface Root {
|
51
|
+
render(children: React.ReactChild | React.ReactNodeArray, callback?: () => void): void;
|
52
|
+
unmount(callback?: () => void): void;
|
53
|
+
}
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Replaces `ReactDOM.render` when the `.render` method is called and enables Blocking Mode.
|
57
|
+
*
|
58
|
+
* Opting into Concurrent Mode introduces semantic changes to how React works.
|
59
|
+
* This means that you can’t use Concurrent Mode in just a few components.
|
60
|
+
* Because of this, some apps may not be able to migrate directly to Concurrent Mode.
|
61
|
+
* Blocking Mode only contains a small subset of Concurrent Mode features and is intended
|
62
|
+
* as an intermediary migration step for apps that are unable to migrate directly.
|
63
|
+
*
|
64
|
+
* @see https://reactjs.org/docs/concurrent-mode-adoption.html#migration-step-blocking-mode
|
65
|
+
* @see https://reactjs.org/docs/concurrent-mode-reference.html#createblockingroot
|
66
|
+
*/
|
67
|
+
function unstable_createBlockingRoot(
|
68
|
+
container: Element | Document | DocumentFragment | Comment,
|
69
|
+
options?: RootOptions,
|
70
|
+
): Root;
|
71
|
+
|
72
|
+
/**
|
73
|
+
* Replaces `ReactDOM.render` when the `.render` method is called and enables Concurrent Mode.
|
74
|
+
*
|
75
|
+
* @see https://reactjs.org/docs/concurrent-mode-reference.html#createroot
|
76
|
+
*/
|
77
|
+
function unstable_createRoot(container: Element | Document | DocumentFragment | Comment, options?: RootOptions): Root;
|
78
|
+
|
79
|
+
function unstable_flushControlled(callback: () => void): void;
|
80
|
+
|
81
|
+
// enableSelectiveHydration feature
|
82
|
+
|
83
|
+
/**
|
84
|
+
* @see https://github.com/facebook/react/commit/3a2b5f148d450c69aab67f055fc441d294c23518
|
85
|
+
*/
|
86
|
+
function unstable_scheduleHydration(target: Element | Document | DocumentFragment | Comment): void;
|
87
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// Type definitions for React (react-dom)
|
1
|
+
// Type definitions for React (react-dom) 17.0
|
2
2
|
// Project: https://reactjs.org
|
3
3
|
// Definitions by: Asana <https://asana.com>
|
4
4
|
// AssureSign <http://www.assuresign.com>
|
@@ -6,7 +6,6 @@
|
|
6
6
|
// MartynasZilinskas <https://github.com/MartynasZilinskas>
|
7
7
|
// Josh Rutherford <https://github.com/theruther4d>
|
8
8
|
// Jessica Franco <https://github.com/Jessidhia>
|
9
|
-
// Sebastian Silbermann <https://github.com/eps1lon>
|
10
9
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
11
10
|
// TypeScript Version: 2.8
|
12
11
|
|
@@ -54,51 +53,49 @@ export function unstable_renderSubtreeIntoContainer<P>(
|
|
54
53
|
container: Element,
|
55
54
|
callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
|
56
55
|
|
57
|
-
export type Container = Element | Document | DocumentFragment;
|
58
|
-
|
59
56
|
export interface Renderer {
|
60
57
|
// Deprecated(render): The return value is deprecated.
|
61
58
|
// In future releases the render function's return type will be void.
|
62
59
|
|
63
60
|
<T extends Element>(
|
64
61
|
element: DOMElement<DOMAttributes<T>, T>,
|
65
|
-
container:
|
62
|
+
container: Element | DocumentFragment | null,
|
66
63
|
callback?: () => void
|
67
64
|
): T;
|
68
65
|
|
69
66
|
(
|
70
67
|
element: Array<DOMElement<DOMAttributes<any>, any>>,
|
71
|
-
container:
|
68
|
+
container: Element | DocumentFragment | null,
|
72
69
|
callback?: () => void
|
73
70
|
): Element;
|
74
71
|
|
75
72
|
(
|
76
73
|
element: SFCElement<any> | Array<SFCElement<any>>,
|
77
|
-
container:
|
74
|
+
container: Element | DocumentFragment | null,
|
78
75
|
callback?: () => void
|
79
76
|
): void;
|
80
77
|
|
81
78
|
<P, T extends Component<P, ComponentState>>(
|
82
79
|
element: CElement<P, T>,
|
83
|
-
container:
|
80
|
+
container: Element | DocumentFragment | null,
|
84
81
|
callback?: () => void
|
85
82
|
): T;
|
86
83
|
|
87
84
|
(
|
88
85
|
element: Array<CElement<any, Component<any, ComponentState>>>,
|
89
|
-
container:
|
86
|
+
container: Element | DocumentFragment | null,
|
90
87
|
callback?: () => void
|
91
88
|
): Component<any, ComponentState>;
|
92
89
|
|
93
90
|
<P>(
|
94
91
|
element: ReactElement<P>,
|
95
|
-
container:
|
92
|
+
container: Element | DocumentFragment | null,
|
96
93
|
callback?: () => void
|
97
94
|
): Component<P, ComponentState> | Element | void;
|
98
95
|
|
99
96
|
(
|
100
97
|
element: ReactElement[],
|
101
|
-
container:
|
98
|
+
container: Element | DocumentFragment | null,
|
102
99
|
callback?: () => void
|
103
100
|
): Component<any, ComponentState> | Element | void;
|
104
101
|
}
|
File without changes
|
@@ -1,8 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react-dom",
|
3
|
-
"version": "
|
3
|
+
"version": "17.0.3",
|
4
4
|
"description": "TypeScript definitions for React (react-dom)",
|
5
|
-
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom",
|
6
5
|
"license": "MIT",
|
7
6
|
"contributors": [
|
8
7
|
{
|
@@ -31,11 +30,6 @@
|
|
31
30
|
"name": "Jessica Franco",
|
32
31
|
"url": "https://github.com/Jessidhia",
|
33
32
|
"githubUsername": "Jessidhia"
|
34
|
-
},
|
35
|
-
{
|
36
|
-
"name": "Sebastian Silbermann",
|
37
|
-
"url": "https://github.com/eps1lon",
|
38
|
-
"githubUsername": "eps1lon"
|
39
33
|
}
|
40
34
|
],
|
41
35
|
"main": "",
|
@@ -47,8 +41,8 @@
|
|
47
41
|
},
|
48
42
|
"scripts": {},
|
49
43
|
"dependencies": {
|
50
|
-
"@types/react": "
|
44
|
+
"@types/react": "*"
|
51
45
|
},
|
52
|
-
"typesPublisherContentHash": "
|
53
|
-
"typeScriptVersion": "3.
|
46
|
+
"typesPublisherContentHash": "c4673aa779a5ebe4d5bafd06ad394d3ddbec0f835d8f5ff2c3c6b51f5c26ba7a",
|
47
|
+
"typeScriptVersion": "3.5"
|
54
48
|
}
|
File without changes
|
@@ -8,53 +8,54 @@ import {
|
|
8
8
|
import * as ReactTestUtils from ".";
|
9
9
|
|
10
10
|
export {};
|
11
|
+
|
11
12
|
export interface OptionalEventProperties {
|
12
|
-
bubbles?: boolean
|
13
|
-
cancelable?: boolean
|
14
|
-
currentTarget?: EventTarget
|
15
|
-
defaultPrevented?: boolean
|
16
|
-
eventPhase?: number
|
17
|
-
isTrusted?: boolean
|
18
|
-
nativeEvent?: Event
|
13
|
+
bubbles?: boolean;
|
14
|
+
cancelable?: boolean;
|
15
|
+
currentTarget?: EventTarget;
|
16
|
+
defaultPrevented?: boolean;
|
17
|
+
eventPhase?: number;
|
18
|
+
isTrusted?: boolean;
|
19
|
+
nativeEvent?: Event;
|
19
20
|
preventDefault?(): void;
|
20
21
|
stopPropagation?(): void;
|
21
|
-
target?: EventTarget
|
22
|
-
timeStamp?: Date
|
23
|
-
type?: string
|
22
|
+
target?: EventTarget;
|
23
|
+
timeStamp?: Date;
|
24
|
+
type?: string;
|
24
25
|
}
|
25
26
|
|
26
27
|
export interface SyntheticEventData extends OptionalEventProperties {
|
27
|
-
altKey?: boolean
|
28
|
-
button?: number
|
29
|
-
buttons?: number
|
30
|
-
clientX?: number
|
31
|
-
clientY?: number
|
32
|
-
changedTouches?: TouchList
|
33
|
-
charCode?: number
|
34
|
-
clipboardData?: DataTransfer
|
35
|
-
ctrlKey?: boolean
|
36
|
-
deltaMode?: number
|
37
|
-
deltaX?: number
|
38
|
-
deltaY?: number
|
39
|
-
deltaZ?: number
|
40
|
-
detail?: number
|
28
|
+
altKey?: boolean;
|
29
|
+
button?: number;
|
30
|
+
buttons?: number;
|
31
|
+
clientX?: number;
|
32
|
+
clientY?: number;
|
33
|
+
changedTouches?: TouchList;
|
34
|
+
charCode?: number;
|
35
|
+
clipboardData?: DataTransfer;
|
36
|
+
ctrlKey?: boolean;
|
37
|
+
deltaMode?: number;
|
38
|
+
deltaX?: number;
|
39
|
+
deltaY?: number;
|
40
|
+
deltaZ?: number;
|
41
|
+
detail?: number;
|
41
42
|
getModifierState?(key: string): boolean;
|
42
|
-
key?: string
|
43
|
-
keyCode?: number
|
44
|
-
locale?: string
|
45
|
-
location?: number
|
46
|
-
metaKey?: boolean
|
47
|
-
pageX?: number
|
48
|
-
pageY?: number
|
49
|
-
relatedTarget?: EventTarget
|
50
|
-
repeat?: boolean
|
51
|
-
screenX?: number
|
52
|
-
screenY?: number
|
53
|
-
shiftKey?: boolean
|
54
|
-
targetTouches?: TouchList
|
55
|
-
touches?: TouchList
|
56
|
-
view?: AbstractView
|
57
|
-
which?: number
|
43
|
+
key?: string;
|
44
|
+
keyCode?: number;
|
45
|
+
locale?: string;
|
46
|
+
location?: number;
|
47
|
+
metaKey?: boolean;
|
48
|
+
pageX?: number;
|
49
|
+
pageY?: number;
|
50
|
+
relatedTarget?: EventTarget;
|
51
|
+
repeat?: boolean;
|
52
|
+
screenX?: number;
|
53
|
+
screenY?: number;
|
54
|
+
shiftKey?: boolean;
|
55
|
+
targetTouches?: TouchList;
|
56
|
+
touches?: TouchList;
|
57
|
+
view?: AbstractView;
|
58
|
+
which?: number;
|
58
59
|
}
|
59
60
|
|
60
61
|
export type EventSimulator = (element: Element | Component<any>, eventData?: SyntheticEventData) => void;
|
@@ -295,7 +296,7 @@ export function createRenderer(): ShallowRenderer;
|
|
295
296
|
declare const UNDEFINED_VOID_ONLY: unique symbol;
|
296
297
|
// tslint:disable-next-line: void-return
|
297
298
|
type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
|
298
|
-
export function act(callback: () => Promise<
|
299
|
+
export function act(callback: () => Promise<void>): Promise<undefined>;
|
299
300
|
export function act(callback: () => VoidOrUndefinedOnly): void;
|
300
301
|
|
301
302
|
// Intentionally doesn't extend PromiseLike<never>.
|