@types/react-dom 16.8.4 → 16.9.2

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 CHANGED
@@ -2,15 +2,15 @@
2
2
  > `npm install --save @types/react-dom`
3
3
 
4
4
  # Summary
5
- This package contains type definitions for React (react-dom) ( http://facebook.github.io/react/ ).
5
+ This package contains type definitions for React (react-dom) (http://facebook.github.io/react/).
6
6
 
7
7
  # Details
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: Thu, 11 Apr 2019 17:57:21 GMT
11
+ * Last updated: Mon, 14 Oct 2019 20:17:00 GMT
12
12
  * Dependencies: @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>, 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>, and Jessica Franco <https://github.com/Jessidhia>.
react-dom/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for React (react-dom) 16.8
1
+ // Type definitions for React (react-dom) 16.9
2
2
  // Project: http://facebook.github.io/react/
3
3
  // Definitions by: Asana <https://asana.com>
4
4
  // AssureSign <http://www.assuresign.com>
@@ -92,3 +92,33 @@ export interface Renderer {
92
92
  callback?: () => void
93
93
  ): Component<any, ComponentState> | Element | void;
94
94
  }
95
+
96
+ export interface Work {
97
+ then(onCommit?: () => void): void;
98
+ }
99
+
100
+ export interface Batch {
101
+ commit(): void;
102
+ render(children: React.ReactNode): Work;
103
+ then(onComplete?: () => void): void;
104
+ }
105
+
106
+ export interface RootOptions {
107
+ hydrate?: boolean;
108
+ }
109
+
110
+ export interface SyncRoot {
111
+ render(children: React.ReactNode, callback?: () => void): Work;
112
+ unmount(callback?: () => void): void;
113
+ }
114
+
115
+ export function unstable_createSyncRoot(container: Element, options?: RootOptions): SyncRoot;
116
+
117
+ export interface Root extends SyncRoot {
118
+ createBatch(): Batch;
119
+ }
120
+
121
+ export function unstable_createRoot(
122
+ container: Element,
123
+ options?: RootOptions
124
+ ): Root;
react-dom/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react-dom",
3
- "version": "16.8.4",
3
+ "version": "16.9.2",
4
4
  "description": "TypeScript definitions for React (react-dom)",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -43,6 +43,6 @@
43
43
  "dependencies": {
44
44
  "@types/react": "*"
45
45
  },
46
- "typesPublisherContentHash": "7df644e84370d57e2e797b12e67fc402427275caf9abae68e3b53cdaceed02bc",
46
+ "typesPublisherContentHash": "897ba71f8211baa5df942d6e63bea8ce5f8ed8e500763b5cca5416b832fcb11c",
47
47
  "typeScriptVersion": "2.8"
48
48
  }
@@ -67,10 +67,6 @@ export interface ShallowRenderer {
67
67
  * After `shallowRenderer.render()` has been called, returns shallowly rendered output.
68
68
  */
69
69
  getRenderOutput<E extends ReactElement>(): E;
70
- /**
71
- * After `shallowRenderer.render()` has been called, returns shallowly rendered output.
72
- */
73
- getRenderOutput(): ReactElement;
74
70
  /**
75
71
  * Similar to `ReactDOM.render` but it doesn't require DOM and only renders a single level deep.
76
72
  */
@@ -291,9 +287,10 @@ export function createRenderer(): ShallowRenderer;
291
287
  * @see https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks
292
288
  */
293
289
  // the "void | undefined" is here to forbid any sneaky "Promise" returns.
294
- // the actual return value is always a "DebugPromiseLike",
295
- // but having an "| {}" makes it harder to accidentally use.
296
- export function act(callback: () => void | undefined): DebugPromiseLike | {};
290
+ export function act(callback: () => void | undefined): DebugPromiseLike;
291
+ // the "void | undefined" is here to forbid any sneaky return values
292
+ // tslint:disable-next-line: void-return
293
+ export function act(callback: () => Promise<void | undefined>): Promise<undefined>;
297
294
 
298
295
  // Intentionally doesn't extend PromiseLike<never>.
299
296
  // Ideally this should be as hard to accidentally use as possible.