@types/react-dom 17.0.3 → 17.0.7

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/LICENSE CHANGED
File without changes
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: Tue, 23 Mar 2021 00:35:10 GMT
11
+ * Last updated: Wed, 09 Jun 2021 05:01:25 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), and [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), [Jessica Franco](https://github.com/Jessidhia), and [Sebastian Silbermann](https://github.com/eps1lon).
@@ -29,53 +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 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
37
  function unstable_flushControlled(callback: () => void): void;
80
38
 
81
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: Element | DocumentFragment | null,
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: Element | DocumentFragment | null,
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: Element | DocumentFragment | null,
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: Element | DocumentFragment | null,
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: Element | DocumentFragment | null,
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: Element | DocumentFragment | null,
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: Element | DocumentFragment | null,
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,55 @@
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
+ hydrate?: boolean;
41
+ hydrationOptions?: HydrationOptions;
42
+ }
43
+
44
+ interface Root {
45
+ render(children: React.ReactChild | React.ReactNodeArray): void;
46
+ unmount(): void;
47
+ }
48
+
49
+ /**
50
+ * Replaces `ReactDOM.render` when the `.render` method is called and enables Concurrent Mode.
51
+ *
52
+ * @see https://reactjs.org/docs/concurrent-mode-reference.html#createroot
53
+ */
54
+ function createRoot(container: Element | Document | DocumentFragment | Comment, options?: RootOptions): Root;
55
+ }
File without changes
react-dom/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@types/react-dom",
3
- "version": "17.0.3",
3
+ "version": "17.0.7",
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": "c4673aa779a5ebe4d5bafd06ad394d3ddbec0f835d8f5ff2c3c6b51f5c26ba7a",
47
- "typeScriptVersion": "3.5"
52
+ "typesPublisherContentHash": "1126f0839213941257a0b52c984816f3a13ac5e179c8d76686f882d31c453fcf",
53
+ "typeScriptVersion": "3.6"
48
54
  }
react-dom/server.d.ts CHANGED
File without changes
File without changes