@types/react 17.0.10 → 17.0.14
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/README.md +2 -2
- react/index.d.ts +958 -952
- react/next.d.ts +31 -4
- react/package.json +2 -7
react/next.d.ts
CHANGED
@@ -39,7 +39,7 @@ declare module '.' {
|
|
39
39
|
* In other words, the tree is CPU bound and not I/O bound (e.g. due to fetching data).
|
40
40
|
* @see {@link https://github.com/facebook/react/pull/19936}
|
41
41
|
*/
|
42
|
-
unstable_expectedLoadTime?: number;
|
42
|
+
unstable_expectedLoadTime?: number | undefined;
|
43
43
|
}
|
44
44
|
|
45
45
|
export type SuspenseListRevealOrder = 'forwards' | 'backwards' | 'together';
|
@@ -68,18 +68,18 @@ declare module '.' {
|
|
68
68
|
* - `collapsed` shows only the next fallback in the list.
|
69
69
|
* - `hidden` doesn’t show any unloaded items.
|
70
70
|
*/
|
71
|
-
tail?: SuspenseListTailMode;
|
71
|
+
tail?: SuspenseListTailMode | undefined;
|
72
72
|
}
|
73
73
|
|
74
74
|
interface NonDirectionalSuspenseListProps extends SuspenseListCommonProps {
|
75
75
|
/**
|
76
76
|
* Defines the order in which the `SuspenseList` children should be revealed.
|
77
77
|
*/
|
78
|
-
revealOrder?: Exclude<SuspenseListRevealOrder, DirectionalSuspenseListProps['revealOrder']
|
78
|
+
revealOrder?: Exclude<SuspenseListRevealOrder, DirectionalSuspenseListProps['revealOrder']> | undefined;
|
79
79
|
/**
|
80
80
|
* The tail property is invalid when not using the `forwards` or `backwards` reveal orders.
|
81
81
|
*/
|
82
|
-
tail?: never;
|
82
|
+
tail?: never | undefined;
|
83
83
|
}
|
84
84
|
|
85
85
|
export type SuspenseListProps = DirectionalSuspenseListProps | NonDirectionalSuspenseListProps;
|
@@ -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.
|
3
|
+
"version": "17.0.14",
|
4
4
|
"description": "TypeScript definitions for React",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
|
6
6
|
"license": "MIT",
|
@@ -32,11 +32,6 @@
|
|
32
32
|
"url": "https://github.com/pzavolinsky",
|
33
33
|
"githubUsername": "pzavolinsky"
|
34
34
|
},
|
35
|
-
{
|
36
|
-
"name": "Digiguru",
|
37
|
-
"url": "https://github.com/digiguru",
|
38
|
-
"githubUsername": "digiguru"
|
39
|
-
},
|
40
35
|
{
|
41
36
|
"name": "Eric Anderson",
|
42
37
|
"url": "https://github.com/ericanderson",
|
@@ -151,6 +146,6 @@
|
|
151
146
|
"@types/scheduler": "*",
|
152
147
|
"csstype": "^3.0.2"
|
153
148
|
},
|
154
|
-
"typesPublisherContentHash": "
|
149
|
+
"typesPublisherContentHash": "29282cd8d1145f8afaa91cacf35059601e19fc519acb89af72a531adddbcbcb5",
|
155
150
|
"typeScriptVersion": "3.6"
|
156
151
|
}
|