@types/react-dom 16.9.9 → 16.9.13

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.
File without changes
@@ -5,12 +5,12 @@
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/v16.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Tue, 27 Oct 2020 19:31:41 GMT
11
+ * Last updated: Thu, 13 May 2021 07:31:27 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).
@@ -6,6 +6,7 @@
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
 
@@ -30,6 +31,9 @@ export const version: string;
30
31
  export const render: Renderer;
31
32
  export const hydrate: Renderer;
32
33
 
34
+ export function flushSync<R>(fn: () => R): R;
35
+ export function flushSync<A, R>(fn: (a: A) => R, a: A): R;
36
+
33
37
  export function unstable_batchedUpdates<A, B>(callback: (a: A, b: B) => any, a: A, b: B): void;
34
38
  export function unstable_batchedUpdates<A>(callback: (a: A) => any, a: A): void;
35
39
  export function unstable_batchedUpdates(callback: () => any): void;
@@ -50,49 +54,51 @@ export function unstable_renderSubtreeIntoContainer<P>(
50
54
  container: Element,
51
55
  callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
52
56
 
57
+ export type Container = Element | Document | DocumentFragment;
58
+
53
59
  export interface Renderer {
54
60
  // Deprecated(render): The return value is deprecated.
55
61
  // In future releases the render function's return type will be void.
56
62
 
57
63
  <T extends Element>(
58
64
  element: DOMElement<DOMAttributes<T>, T>,
59
- container: Element | DocumentFragment | null,
65
+ container: Container | null,
60
66
  callback?: () => void
61
67
  ): T;
62
68
 
63
69
  (
64
70
  element: Array<DOMElement<DOMAttributes<any>, any>>,
65
- container: Element | DocumentFragment | null,
71
+ container: Container| null,
66
72
  callback?: () => void
67
73
  ): Element;
68
74
 
69
75
  (
70
76
  element: SFCElement<any> | Array<SFCElement<any>>,
71
- container: Element | DocumentFragment | null,
77
+ container: Container| null,
72
78
  callback?: () => void
73
79
  ): void;
74
80
 
75
81
  <P, T extends Component<P, ComponentState>>(
76
82
  element: CElement<P, T>,
77
- container: Element | DocumentFragment | null,
83
+ container: Container| null,
78
84
  callback?: () => void
79
85
  ): T;
80
86
 
81
87
  (
82
88
  element: Array<CElement<any, Component<any, ComponentState>>>,
83
- container: Element | DocumentFragment | null,
89
+ container: Container| null,
84
90
  callback?: () => void
85
91
  ): Component<any, ComponentState>;
86
92
 
87
93
  <P>(
88
94
  element: ReactElement<P>,
89
- container: Element | DocumentFragment | null,
95
+ container: Container| null,
90
96
  callback?: () => void
91
97
  ): Component<P, ComponentState> | Element | void;
92
98
 
93
99
  (
94
100
  element: ReactElement[],
95
- container: Element | DocumentFragment | null,
101
+ container: Container| null,
96
102
  callback?: () => void
97
103
  ): Component<any, ComponentState> | Element | void;
98
104
  }
File without changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react-dom",
3
- "version": "16.9.9",
3
+ "version": "16.9.13",
4
4
  "description": "TypeScript definitions for React (react-dom)",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -30,6 +30,11 @@
30
30
  "name": "Jessica Franco",
31
31
  "url": "https://github.com/Jessidhia",
32
32
  "githubUsername": "Jessidhia"
33
+ },
34
+ {
35
+ "name": "Sebastian Silbermann",
36
+ "url": "https://github.com/eps1lon",
37
+ "githubUsername": "eps1lon"
33
38
  }
34
39
  ],
35
40
  "main": "",
@@ -41,8 +46,8 @@
41
46
  },
42
47
  "scripts": {},
43
48
  "dependencies": {
44
- "@types/react": "*"
49
+ "@types/react": "^16"
45
50
  },
46
- "typesPublisherContentHash": "36f6fc0b0ee5b2e0826c141030cd74633e4cac4a6733196f4a946011e286f4bd",
47
- "typeScriptVersion": "3.2"
51
+ "typesPublisherContentHash": "fa3d426fb4218bff93873ddc218e6c35019d0a4dd6525c3775d199155d85b1ad",
52
+ "typeScriptVersion": "3.5"
48
53
  }
File without changes
@@ -7,6 +7,7 @@ import {
7
7
 
8
8
  import * as ReactTestUtils from ".";
9
9
 
10
+ export {};
10
11
  export interface OptionalEventProperties {
11
12
  bubbles?: boolean;
12
13
  cancelable?: boolean;
@@ -288,12 +289,14 @@ export function createRenderer(): ShallowRenderer;
288
289
  */
289
290
  // NOTES
290
291
  // - the order of these signatures matters - typescript will check the signatures in source order.
291
- // If the `() => void` signature is first, it'll erroneously match a Promise returning function for users with
292
+ // If the `() => VoidOrUndefinedOnly` signature is first, it'll erroneously match a Promise returning function for users with
292
293
  // `strictNullChecks: false`.
293
- // - the "void | undefined" types are there to forbid any non-void return values for users with `strictNullChecks: true`
294
+ // - VoidOrUndefinedOnly is there to forbid any non-void return values for users with `strictNullChecks: true`
295
+ declare const UNDEFINED_VOID_ONLY: unique symbol;
294
296
  // tslint:disable-next-line: void-return
295
- export function act(callback: () => Promise<void | undefined>): Promise<undefined>;
296
- export function act(callback: () => void | undefined): void;
297
+ type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
298
+ export function act(callback: () => Promise<VoidOrUndefinedOnly>): Promise<undefined>;
299
+ export function act(callback: () => VoidOrUndefinedOnly): void;
297
300
 
298
301
  // Intentionally doesn't extend PromiseLike<never>.
299
302
  // Ideally this should be as hard to accidentally use as possible.
@@ -1,87 +0,0 @@
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
- }