@types/react-dom 16.9.11 → 17.0.0
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 +2 -2
- react-dom/experimental.d.ts +87 -0
- react-dom v16.9/index.d.ts → react-dom/index.d.ts +1 -1
- {react-dom v16.9 → react-dom}/node-stream/index.d.ts +0 -0
- react-dom v16.9/package.json → react-dom/package.json +4 -4
- {react-dom v16.9 → react-dom}/server/index.d.ts +0 -0
- react-dom v16.9/test-utils/index.d.ts → react-dom/test-utils/index.d.ts +4 -7
File without changes
|
@@ -5,10 +5,10 @@
|
|
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: Fri,
|
11
|
+
* Last updated: Fri, 20 Nov 2020 22:01:05 GMT
|
12
12
|
* Dependencies: [@types/react](https://npmjs.com/package/@types/react)
|
13
13
|
* Global values: `ReactDOM`, `ReactDOMNodeStream`, `ReactDOMServer`
|
14
14
|
|
@@ -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
|
+
}
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react-dom",
|
3
|
-
"version": "
|
3
|
+
"version": "17.0.0",
|
4
4
|
"description": "TypeScript definitions for React (react-dom)",
|
5
5
|
"license": "MIT",
|
6
6
|
"contributors": [
|
@@ -41,8 +41,8 @@
|
|
41
41
|
},
|
42
42
|
"scripts": {},
|
43
43
|
"dependencies": {
|
44
|
-
"@types/react": "
|
44
|
+
"@types/react": "*"
|
45
45
|
},
|
46
|
-
"typesPublisherContentHash": "
|
47
|
-
"typeScriptVersion": "3.
|
46
|
+
"typesPublisherContentHash": "b1d11668457222630c5b11e04c338f3cbcee00f6e40f98e5fef66d0bfe1414cf",
|
47
|
+
"typeScriptVersion": "3.3"
|
48
48
|
}
|
File without changes
|
@@ -7,7 +7,6 @@ import {
|
|
7
7
|
|
8
8
|
import * as ReactTestUtils from ".";
|
9
9
|
|
10
|
-
export {};
|
11
10
|
export interface OptionalEventProperties {
|
12
11
|
bubbles?: boolean;
|
13
12
|
cancelable?: boolean;
|
@@ -289,14 +288,12 @@ export function createRenderer(): ShallowRenderer;
|
|
289
288
|
*/
|
290
289
|
// NOTES
|
291
290
|
// - the order of these signatures matters - typescript will check the signatures in source order.
|
292
|
-
// If the `() =>
|
291
|
+
// If the `() => void` signature is first, it'll erroneously match a Promise returning function for users with
|
293
292
|
// `strictNullChecks: false`.
|
294
|
-
// -
|
295
|
-
declare const UNDEFINED_VOID_ONLY: unique symbol;
|
293
|
+
// - the "void | undefined" types are there to forbid any non-void return values for users with `strictNullChecks: true`
|
296
294
|
// tslint:disable-next-line: void-return
|
297
|
-
|
298
|
-
export function act(callback: () =>
|
299
|
-
export function act(callback: () => VoidOrUndefinedOnly): void;
|
295
|
+
export function act(callback: () => Promise<void | undefined>): Promise<undefined>;
|
296
|
+
export function act(callback: () => void | undefined): void;
|
300
297
|
|
301
298
|
// Intentionally doesn't extend PromiseLike<never>.
|
302
299
|
// Ideally this should be as hard to accidentally use as possible.
|