@types/react-dom 17.0.4 → 17.0.8
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/README.md +2 -2
- react-dom/experimental.d.ts +1 -26
- react-dom/index.d.ts +14 -7
- react-dom/next.d.ts +63 -0
- react-dom/package.json +9 -3
react-dom/README.md
CHANGED
@@ -8,9 +8,9 @@ This package contains type definitions for React (react-dom) (https://reactjs.or
|
|
8
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: Fri, 18 Jun 2021 06:01:13 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),
|
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), and [Sebastian Silbermann](https://github.com/eps1lon).
|
react-dom/experimental.d.ts
CHANGED
@@ -29,36 +29,11 @@
|
|
29
29
|
// flagged experimental or not. Experimental APIs will be tagged with `__EXPERIMENTAL__`.
|
30
30
|
|
31
31
|
import React = require('react');
|
32
|
-
import ReactDOM = require('
|
32
|
+
import ReactDOM = require('./next');
|
33
33
|
|
34
34
|
export {};
|
35
35
|
|
36
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 Concurrent Mode.
|
57
|
-
*
|
58
|
-
* @see https://reactjs.org/docs/concurrent-mode-reference.html#createroot
|
59
|
-
*/
|
60
|
-
function unstable_createRoot(container: Element | Document | DocumentFragment | Comment, options?: RootOptions): Root;
|
61
|
-
|
62
37
|
function unstable_flushControlled(callback: () => void): void;
|
63
38
|
|
64
39
|
// enableSelectiveHydration feature
|
react-dom/index.d.ts
CHANGED
@@ -6,9 +6,14 @@
|
|
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>
|
9
10
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
10
11
|
// TypeScript Version: 2.8
|
11
12
|
|
13
|
+
// NOTE: Users of the upcoming React 18 release should add a reference
|
14
|
+
// to 'react-dom/next' in their project. See next.d.ts's top comment
|
15
|
+
// for reference and documentation on how exactly to do it.
|
16
|
+
|
12
17
|
// NOTE: Users of the `experimental` builds of React should add a reference
|
13
18
|
// to 'react-dom/experimental' in their project. See experimental.d.ts's top comment
|
14
19
|
// for reference and documentation on how exactly to do it.
|
@@ -53,49 +58,51 @@ export function unstable_renderSubtreeIntoContainer<P>(
|
|
53
58
|
container: Element,
|
54
59
|
callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
|
55
60
|
|
61
|
+
export type Container = Element | Document | DocumentFragment;
|
62
|
+
|
56
63
|
export interface Renderer {
|
57
64
|
// Deprecated(render): The return value is deprecated.
|
58
65
|
// In future releases the render function's return type will be void.
|
59
66
|
|
60
67
|
<T extends Element>(
|
61
68
|
element: DOMElement<DOMAttributes<T>, T>,
|
62
|
-
container:
|
69
|
+
container: Container| null,
|
63
70
|
callback?: () => void
|
64
71
|
): T;
|
65
72
|
|
66
73
|
(
|
67
74
|
element: Array<DOMElement<DOMAttributes<any>, any>>,
|
68
|
-
container:
|
75
|
+
container: Container| null,
|
69
76
|
callback?: () => void
|
70
77
|
): Element;
|
71
78
|
|
72
79
|
(
|
73
80
|
element: SFCElement<any> | Array<SFCElement<any>>,
|
74
|
-
container:
|
81
|
+
container: Container| null,
|
75
82
|
callback?: () => void
|
76
83
|
): void;
|
77
84
|
|
78
85
|
<P, T extends Component<P, ComponentState>>(
|
79
86
|
element: CElement<P, T>,
|
80
|
-
container:
|
87
|
+
container: Container| null,
|
81
88
|
callback?: () => void
|
82
89
|
): T;
|
83
90
|
|
84
91
|
(
|
85
92
|
element: Array<CElement<any, Component<any, ComponentState>>>,
|
86
|
-
container:
|
93
|
+
container: Container| null,
|
87
94
|
callback?: () => void
|
88
95
|
): Component<any, ComponentState>;
|
89
96
|
|
90
97
|
<P>(
|
91
98
|
element: ReactElement<P>,
|
92
|
-
container:
|
99
|
+
container: Container| null,
|
93
100
|
callback?: () => void
|
94
101
|
): Component<P, ComponentState> | Element | void;
|
95
102
|
|
96
103
|
(
|
97
104
|
element: ReactElement[],
|
98
|
-
container:
|
105
|
+
container: Container| null,
|
99
106
|
callback?: () => void
|
100
107
|
): Component<any, ComponentState> | Element | void;
|
101
108
|
}
|
react-dom/next.d.ts
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
/**
|
2
|
+
* These are types for things that are present in the upcoming React 18 release.
|
3
|
+
*
|
4
|
+
* Once React 18 is released they can just be moved to the main index file.
|
5
|
+
*
|
6
|
+
* To load the types declared here in an actual project, there are three ways. The easiest one,
|
7
|
+
* if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
|
8
|
+
* is to add `"react-dom/next"` to the `"types"` array.
|
9
|
+
*
|
10
|
+
* Alternatively, a specific import syntax can to be used from a typescript file.
|
11
|
+
* This module does not exist in reality, which is why the {} is important:
|
12
|
+
*
|
13
|
+
* ```ts
|
14
|
+
* import {} from 'react-dom/next'
|
15
|
+
* ```
|
16
|
+
*
|
17
|
+
* It is also possible to include it through a triple-slash reference:
|
18
|
+
*
|
19
|
+
* ```ts
|
20
|
+
* /// <reference types="react-dom/next" />
|
21
|
+
* ```
|
22
|
+
*
|
23
|
+
* Either the import or the reference only needs to appear once, anywhere in the project.
|
24
|
+
*/
|
25
|
+
|
26
|
+
// See https://github.com/facebook/react/blob/master/packages/react-dom/src/client/ReactDOM.js to see how the exports are declared,
|
27
|
+
|
28
|
+
import React = require('react');
|
29
|
+
import ReactDOM = require('.');
|
30
|
+
|
31
|
+
export {};
|
32
|
+
|
33
|
+
declare module '.' {
|
34
|
+
interface HydrationOptions {
|
35
|
+
onHydrated?(suspenseInstance: Comment): void;
|
36
|
+
onDeleted?(suspenseInstance: Comment): void;
|
37
|
+
}
|
38
|
+
|
39
|
+
interface RootOptions {
|
40
|
+
/**
|
41
|
+
* @deprecated Use `hydrateRoot(container)` instead
|
42
|
+
*/
|
43
|
+
hydrate?: boolean;
|
44
|
+
/**
|
45
|
+
* @deprecated Use `hydrateRoot(container, hydrateOptions)` instead
|
46
|
+
*/
|
47
|
+
hydrationOptions?: HydrationOptions;
|
48
|
+
}
|
49
|
+
|
50
|
+
interface Root {
|
51
|
+
render(children: React.ReactChild | React.ReactNodeArray): void;
|
52
|
+
unmount(): void;
|
53
|
+
}
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Replaces `ReactDOM.render` when the `.render` method is called and enables Concurrent Mode.
|
57
|
+
*
|
58
|
+
* @see https://reactjs.org/docs/concurrent-mode-reference.html#createroot
|
59
|
+
*/
|
60
|
+
function createRoot(container: Element | Document | DocumentFragment | Comment, options?: RootOptions): Root;
|
61
|
+
|
62
|
+
function hydrateRoot(container: Element | Document | DocumentFragment | Comment, options?: HydrationOptions): Root;
|
63
|
+
}
|
react-dom/package.json
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react-dom",
|
3
|
-
"version": "17.0.
|
3
|
+
"version": "17.0.8",
|
4
4
|
"description": "TypeScript definitions for React (react-dom)",
|
5
|
+
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom",
|
5
6
|
"license": "MIT",
|
6
7
|
"contributors": [
|
7
8
|
{
|
@@ -30,6 +31,11 @@
|
|
30
31
|
"name": "Jessica Franco",
|
31
32
|
"url": "https://github.com/Jessidhia",
|
32
33
|
"githubUsername": "Jessidhia"
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"name": "Sebastian Silbermann",
|
37
|
+
"url": "https://github.com/eps1lon",
|
38
|
+
"githubUsername": "eps1lon"
|
33
39
|
}
|
34
40
|
],
|
35
41
|
"main": "",
|
@@ -43,6 +49,6 @@
|
|
43
49
|
"dependencies": {
|
44
50
|
"@types/react": "*"
|
45
51
|
},
|
46
|
-
"typesPublisherContentHash": "
|
47
|
-
"typeScriptVersion": "3.
|
52
|
+
"typesPublisherContentHash": "4cc8842db00c8a8ee4a599dde279d26456cf4f53e7c086e2b7ce575e9286f620",
|
53
|
+
"typeScriptVersion": "3.6"
|
48
54
|
}
|