@types/react 18.2.3 → 18.2.5
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 +1 -1
- react/experimental.d.ts +10 -1
- react/index.d.ts +17 -1
- react/package.json +2 -2
- react/ts5.0/experimental.d.ts +10 -1
- react/ts5.0/index.d.ts +17 -1
react/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for React (https://react.dev/).
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated: Thu, 04 May 2023
|
11
|
+
* Last updated: Thu, 04 May 2023 13:32:50 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/experimental.d.ts
CHANGED
@@ -42,6 +42,12 @@ declare const UNDEFINED_VOID_ONLY: unique symbol;
|
|
42
42
|
type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
|
43
43
|
|
44
44
|
declare module '.' {
|
45
|
+
// Need an interface to not cause ReactNode to be a self-referential type.
|
46
|
+
interface PromiseLikeOfReactNode extends PromiseLike<ReactNode> {}
|
47
|
+
interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES {
|
48
|
+
promises: PromiseLikeOfReactNode;
|
49
|
+
}
|
50
|
+
|
45
51
|
export interface SuspenseProps {
|
46
52
|
/**
|
47
53
|
* The presence of this prop indicates that the content is computationally expensive to render.
|
@@ -124,8 +130,11 @@ declare module '.' {
|
|
124
130
|
(callback: () => Promise<VoidOrUndefinedOnly>): void;
|
125
131
|
}
|
126
132
|
|
133
|
+
function experimental_useOptimistic<State>(
|
134
|
+
passthrough: State,
|
135
|
+
): [State, (action: State | ((pendingState: State) => State)) => void];
|
127
136
|
function experimental_useOptimistic<State, Action>(
|
128
137
|
passthrough: State,
|
129
|
-
reducer
|
138
|
+
reducer: (state: State, action: Action) => State,
|
130
139
|
): [State, (action: Action) => void];
|
131
140
|
}
|
react/index.d.ts
CHANGED
@@ -238,7 +238,23 @@ declare namespace React {
|
|
238
238
|
*/
|
239
239
|
interface ReactNodeArray extends ReadonlyArray<ReactNode> {}
|
240
240
|
type ReactFragment = Iterable<ReactNode>;
|
241
|
-
|
241
|
+
|
242
|
+
/**
|
243
|
+
* For internal usage only.
|
244
|
+
* Different release channels declare additional types of ReactNode this particular release channel accepts.
|
245
|
+
* App or library types should never augment this interface.
|
246
|
+
*/
|
247
|
+
interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES {}
|
248
|
+
type ReactNode =
|
249
|
+
| ReactElement
|
250
|
+
| string
|
251
|
+
| number
|
252
|
+
| ReactFragment
|
253
|
+
| ReactPortal
|
254
|
+
| boolean
|
255
|
+
| null
|
256
|
+
| undefined
|
257
|
+
| DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES];
|
242
258
|
|
243
259
|
//
|
244
260
|
// Top Level API
|
react/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react",
|
3
|
-
"version": "18.2.
|
3
|
+
"version": "18.2.5",
|
4
4
|
"description": "TypeScript definitions for React",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
|
6
6
|
"license": "MIT",
|
@@ -158,7 +158,7 @@
|
|
158
158
|
"@types/scheduler": "*",
|
159
159
|
"csstype": "^3.0.2"
|
160
160
|
},
|
161
|
-
"typesPublisherContentHash": "
|
161
|
+
"typesPublisherContentHash": "ce0153f6bb1a5154576d9159e1711034f75efa459f9b1e0c773d78e6e18a9fda",
|
162
162
|
"typeScriptVersion": "4.3",
|
163
163
|
"exports": {
|
164
164
|
".": {
|
react/ts5.0/experimental.d.ts
CHANGED
@@ -42,6 +42,12 @@ declare const UNDEFINED_VOID_ONLY: unique symbol;
|
|
42
42
|
type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
|
43
43
|
|
44
44
|
declare module '.' {
|
45
|
+
// Need an interface to not cause ReactNode to be a self-referential type.
|
46
|
+
interface PromiseLikeOfReactNode extends PromiseLike<ReactNode> {}
|
47
|
+
interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES {
|
48
|
+
promises: PromiseLikeOfReactNode;
|
49
|
+
}
|
50
|
+
|
45
51
|
export interface SuspenseProps {
|
46
52
|
/**
|
47
53
|
* The presence of this prop indicates that the content is computationally expensive to render.
|
@@ -124,8 +130,11 @@ declare module '.' {
|
|
124
130
|
(callback: () => Promise<VoidOrUndefinedOnly>): void;
|
125
131
|
}
|
126
132
|
|
133
|
+
function experimental_useOptimistic<State>(
|
134
|
+
passthrough: State,
|
135
|
+
): [State, (action: State | ((pendingState: State) => State)) => void];
|
127
136
|
function experimental_useOptimistic<State, Action>(
|
128
137
|
passthrough: State,
|
129
|
-
reducer
|
138
|
+
reducer: (state: State, action: Action) => State,
|
130
139
|
): [State, (action: Action) => void];
|
131
140
|
}
|
react/ts5.0/index.d.ts
CHANGED
@@ -206,7 +206,23 @@ declare namespace React {
|
|
206
206
|
*/
|
207
207
|
interface ReactNodeArray extends ReadonlyArray<ReactNode> {}
|
208
208
|
type ReactFragment = Iterable<ReactNode>;
|
209
|
-
|
209
|
+
|
210
|
+
/**
|
211
|
+
* For internal usage only.
|
212
|
+
* Different release channels declare additional types of ReactNode this particular release channel accepts.
|
213
|
+
* App or library types should never augment this interface.
|
214
|
+
*/
|
215
|
+
interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES {}
|
216
|
+
type ReactNode =
|
217
|
+
| ReactElement
|
218
|
+
| string
|
219
|
+
| number
|
220
|
+
| ReactFragment
|
221
|
+
| ReactPortal
|
222
|
+
| boolean
|
223
|
+
| null
|
224
|
+
| undefined
|
225
|
+
| DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES];
|
210
226
|
|
211
227
|
//
|
212
228
|
// Top Level API
|