@types/react 17.0.10 → 17.0.11

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.
Files changed (3) hide show
  1. react/README.md +1 -1
  2. react/next.d.ts +27 -0
  3. react/package.json +2 -2
react/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for React (http://facebook.github.io/reac
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 09 Jun 2021 05:01:24 GMT
11
+ * Last updated: Wed, 09 Jun 2021 14:01:27 GMT
12
12
  * Dependencies: [@types/csstype](https://npmjs.com/package/@types/csstype), [@types/prop-types](https://npmjs.com/package/@types/prop-types), [@types/scheduler](https://npmjs.com/package/@types/scheduler)
13
13
  * Global values: `React`
14
14
 
react/next.d.ts CHANGED
@@ -169,4 +169,31 @@ declare module '.' {
169
169
  };
170
170
 
171
171
  export function unstable_useOpaqueIdentifier(): OpaqueIdentifier;
172
+
173
+ /**
174
+ * this should be an internal type
175
+ */
176
+ interface MutableSource<T> {
177
+ _source: T;
178
+ }
179
+
180
+ export type MutableSourceSubscribe<T> = (source: T, callback: () => void) => () => void;
181
+
182
+ /**
183
+ * @param source A source could be anything as long as they can be subscribed to and have a "version".
184
+ * @param getVersion A function returns a value which will change whenever part of the source changes.
185
+ */
186
+ export function unstable_createMutableSource<T>(source: T, getVersion: () => any): MutableSource<T>;
187
+
188
+ /**
189
+ * useMutableSource() enables React components to safely and efficiently read from a mutable external source in Concurrent Mode.
190
+ * The API will detect mutations that occur during a render to avoid tearing
191
+ * and it will automatically schedule updates when the source is mutated.
192
+ * @param MutableSource
193
+ * @param getSnapshot
194
+ * @param subscribe
195
+ *
196
+ * @see https://github.com/reactjs/rfcs/blob/master/text/0147-use-mutable-source.md
197
+ */
198
+ export function unstable_useMutableSource<T, TResult extends unknown>(MutableSource: MutableSource<T>, getSnapshot: (source: T) => TResult, subscribe: MutableSourceSubscribe<T>): TResult;
172
199
  }
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "17.0.10",
3
+ "version": "17.0.11",
4
4
  "description": "TypeScript definitions for React",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
6
6
  "license": "MIT",
@@ -151,6 +151,6 @@
151
151
  "@types/scheduler": "*",
152
152
  "csstype": "^3.0.2"
153
153
  },
154
- "typesPublisherContentHash": "6d41cd913375feff3aa261244379c23d554e3854b1ea539135eec29a48f4df64",
154
+ "typesPublisherContentHash": "c77392134576d6e26ea1cf5757ae9bb18e415173effa960387c647125921ac6b",
155
155
  "typeScriptVersion": "3.6"
156
156
  }