@types/react-dom 17.0.5 → 17.0.9
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 +4 -0
- react-dom/next.d.ts +63 -0
- react-dom/package.json +4 -3
- react-dom/test-utils/index.d.ts +40 -40
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:
|
11
|
+
* Last updated: Wed, 07 Jul 2021 17:33:41 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 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
@@ -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.
|
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,7 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react-dom",
|
3
|
-
"version": "17.0.
|
3
|
+
"version": "17.0.9",
|
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
|
{
|
@@ -48,6 +49,6 @@
|
|
48
49
|
"dependencies": {
|
49
50
|
"@types/react": "*"
|
50
51
|
},
|
51
|
-
"typesPublisherContentHash": "
|
52
|
-
"typeScriptVersion": "3.
|
52
|
+
"typesPublisherContentHash": "e186af0c24782790d3143b55e1b197a3d699d977458e37175756b95d0aaa4750",
|
53
|
+
"typeScriptVersion": "3.6"
|
53
54
|
}
|
react-dom/test-utils/index.d.ts
CHANGED
@@ -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;
|