@types/react-dom 17.0.6 → 17.0.10
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 +1 -1
- react-dom/experimental.d.ts +1 -26
- react-dom/index.d.ts +6 -2
- react-dom/next.d.ts +63 -0
- react-dom/package.json +3 -3
- react-dom/test-utils/index.d.ts +43 -43
react-dom/README.md
CHANGED
@@ -8,7 +8,7 @@ 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: Wed,
|
11
|
+
* Last updated: Wed, 20 Oct 2021 09:31:23 GMT
|
12
12
|
* Dependencies: [@types/react](https://npmjs.com/package/@types/react)
|
13
13
|
* Global values: `ReactDOM`, `ReactDOMNodeStream`, `ReactDOMServer`
|
14
14
|
|
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 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
@@ -10,6 +10,10 @@
|
|
10
10
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
11
11
|
// TypeScript Version: 2.8
|
12
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
|
+
|
13
17
|
// NOTE: Users of the `experimental` builds of React should add a reference
|
14
18
|
// to 'react-dom/experimental' in their project. See experimental.d.ts's top comment
|
15
19
|
// for reference and documentation on how exactly to do it.
|
@@ -18,7 +22,7 @@ export as namespace ReactDOM;
|
|
18
22
|
|
19
23
|
import {
|
20
24
|
ReactInstance, Component, ComponentState,
|
21
|
-
ReactElement,
|
25
|
+
ReactElement, FunctionComponentElement, CElement,
|
22
26
|
DOMAttributes, DOMElement, ReactNode, ReactPortal
|
23
27
|
} from 'react';
|
24
28
|
|
@@ -73,7 +77,7 @@ export interface Renderer {
|
|
73
77
|
): Element;
|
74
78
|
|
75
79
|
(
|
76
|
-
element:
|
80
|
+
element: FunctionComponentElement<any> | Array<FunctionComponentElement<any>>,
|
77
81
|
container: Container| null,
|
78
82
|
callback?: () => void
|
79
83
|
): void;
|
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 | undefined;
|
44
|
+
/**
|
45
|
+
* @deprecated Use `hydrateRoot(container, hydrateOptions)` instead
|
46
|
+
*/
|
47
|
+
hydrationOptions?: HydrationOptions | undefined;
|
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,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react-dom",
|
3
|
-
"version": "17.0.
|
3
|
+
"version": "17.0.10",
|
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",
|
@@ -49,6 +49,6 @@
|
|
49
49
|
"dependencies": {
|
50
50
|
"@types/react": "*"
|
51
51
|
},
|
52
|
-
"typesPublisherContentHash": "
|
53
|
-
"typeScriptVersion": "3.
|
52
|
+
"typesPublisherContentHash": "c1a92bea3bf8f276d05855f606108992f2d18a1be2319acd869f8fc298bccb1b",
|
53
|
+
"typeScriptVersion": "3.7"
|
54
54
|
}
|
react-dom/test-utils/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import {
|
2
2
|
AbstractView, Component, ComponentClass,
|
3
3
|
ReactElement, ReactInstance, ClassType,
|
4
|
-
DOMElement,
|
4
|
+
DOMElement, FunctionComponentElement, CElement,
|
5
5
|
ReactHTMLElement, DOMAttributes, SFC
|
6
6
|
} from 'react';
|
7
7
|
|
@@ -10,52 +10,52 @@ import * as ReactTestUtils from ".";
|
|
10
10
|
export {};
|
11
11
|
|
12
12
|
export interface OptionalEventProperties {
|
13
|
-
bubbles?: boolean;
|
14
|
-
cancelable?: boolean;
|
15
|
-
currentTarget?: EventTarget;
|
16
|
-
defaultPrevented?: boolean;
|
17
|
-
eventPhase?: number;
|
18
|
-
isTrusted?: boolean;
|
19
|
-
nativeEvent?: Event;
|
13
|
+
bubbles?: boolean | undefined;
|
14
|
+
cancelable?: boolean | undefined;
|
15
|
+
currentTarget?: EventTarget | undefined;
|
16
|
+
defaultPrevented?: boolean | undefined;
|
17
|
+
eventPhase?: number | undefined;
|
18
|
+
isTrusted?: boolean | undefined;
|
19
|
+
nativeEvent?: Event | undefined;
|
20
20
|
preventDefault?(): void;
|
21
21
|
stopPropagation?(): void;
|
22
|
-
target?: EventTarget;
|
23
|
-
timeStamp?: Date;
|
24
|
-
type?: string;
|
22
|
+
target?: EventTarget | undefined;
|
23
|
+
timeStamp?: Date | undefined;
|
24
|
+
type?: string | undefined;
|
25
25
|
}
|
26
26
|
|
27
27
|
export interface SyntheticEventData extends OptionalEventProperties {
|
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;
|
28
|
+
altKey?: boolean | undefined;
|
29
|
+
button?: number | undefined;
|
30
|
+
buttons?: number | undefined;
|
31
|
+
clientX?: number | undefined;
|
32
|
+
clientY?: number | undefined;
|
33
|
+
changedTouches?: TouchList | undefined;
|
34
|
+
charCode?: number | undefined;
|
35
|
+
clipboardData?: DataTransfer | undefined;
|
36
|
+
ctrlKey?: boolean | undefined;
|
37
|
+
deltaMode?: number | undefined;
|
38
|
+
deltaX?: number | undefined;
|
39
|
+
deltaY?: number | undefined;
|
40
|
+
deltaZ?: number | undefined;
|
41
|
+
detail?: number | undefined;
|
42
42
|
getModifierState?(key: string): boolean;
|
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;
|
43
|
+
key?: string | undefined;
|
44
|
+
keyCode?: number | undefined;
|
45
|
+
locale?: string | undefined;
|
46
|
+
location?: number | undefined;
|
47
|
+
metaKey?: boolean | undefined;
|
48
|
+
pageX?: number | undefined;
|
49
|
+
pageY?: number | undefined;
|
50
|
+
relatedTarget?: EventTarget | undefined;
|
51
|
+
repeat?: boolean | undefined;
|
52
|
+
screenX?: number | undefined;
|
53
|
+
screenY?: number | undefined;
|
54
|
+
shiftKey?: boolean | undefined;
|
55
|
+
targetTouches?: TouchList | undefined;
|
56
|
+
touches?: TouchList | undefined;
|
57
|
+
view?: AbstractView | undefined;
|
58
|
+
which?: number | undefined;
|
59
59
|
}
|
60
60
|
|
61
61
|
export type EventSimulator = (element: Element | Component<any>, eventData?: SyntheticEventData) => void;
|
@@ -157,7 +157,7 @@ export namespace Simulate {
|
|
157
157
|
export function renderIntoDocument<T extends Element>(
|
158
158
|
element: DOMElement<any, T>): T;
|
159
159
|
export function renderIntoDocument(
|
160
|
-
element:
|
160
|
+
element: FunctionComponentElement<any>): void;
|
161
161
|
// If we replace `P` with `any` in this overload, then some tests fail because
|
162
162
|
// calls to `renderIntoDocument` choose the last overload on the
|
163
163
|
// subtype-relation pass and get an undesirably broad return type. Using `P`
|
@@ -194,7 +194,7 @@ export function isElementOfType<P extends DOMAttributes<{}>, T extends Element>(
|
|
194
194
|
* Returns `true` if `element` is a React element whose type is of a React `componentClass`.
|
195
195
|
*/
|
196
196
|
export function isElementOfType<P>(
|
197
|
-
element: ReactElement, type: SFC<P>): element is
|
197
|
+
element: ReactElement, type: SFC<P>): element is FunctionComponentElement<P>;
|
198
198
|
/**
|
199
199
|
* Returns `true` if `element` is a React element whose type is of a React `componentClass`.
|
200
200
|
*/
|