@types/react 18.0.4 → 18.0.7
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/index.d.ts +12 -9
- react/package.json +12 -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:
|
11
|
+
* Last updated: Mon, 25 Apr 2022 19:01:46 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/index.d.ts
CHANGED
@@ -213,20 +213,21 @@ declare namespace React {
|
|
213
213
|
(props?: ClassAttributes<SVGElement> & SVGAttributes<SVGElement> | null, ...children: ReactNode[]): ReactSVGElement;
|
214
214
|
}
|
215
215
|
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
// ----------------------------------------------------------------------
|
220
|
-
|
216
|
+
/**
|
217
|
+
* @deprecated - This type is not relevant when using React. Inline the type instead to make the intent clear.
|
218
|
+
*/
|
221
219
|
type ReactText = string | number;
|
222
|
-
|
220
|
+
/**
|
221
|
+
* @deprecated - This type is not relevant when using React. Inline the type instead to make the intent clear.
|
222
|
+
*/
|
223
|
+
type ReactChild = ReactElement | string | number;
|
223
224
|
|
224
225
|
/**
|
225
226
|
* @deprecated Use either `ReactNode[]` if you need an array or `Iterable<ReactNode>` if its passed to a host component.
|
226
227
|
*/
|
227
228
|
interface ReactNodeArray extends ReadonlyArray<ReactNode> {}
|
228
229
|
type ReactFragment = Iterable<ReactNode>;
|
229
|
-
type ReactNode =
|
230
|
+
type ReactNode = ReactElement | string | number | ReactFragment | ReactPortal | boolean | null | undefined;
|
230
231
|
|
231
232
|
//
|
232
233
|
// Top Level API
|
@@ -3088,6 +3089,8 @@ type MergePropTypes<P, T> =
|
|
3088
3089
|
& Pick<P, Exclude<keyof P, keyof T>>
|
3089
3090
|
: never;
|
3090
3091
|
|
3092
|
+
type InexactPartial<T> = { [K in keyof T]?: T[K] | undefined };
|
3093
|
+
|
3091
3094
|
// Any prop that has a default prop becomes optional, but its type is unchanged
|
3092
3095
|
// Undeclared default props are augmented into the resulting allowable attributes
|
3093
3096
|
// If declared props have indexed properties, ignore default props entirely as keyof gets widened
|
@@ -3095,8 +3098,8 @@ type MergePropTypes<P, T> =
|
|
3095
3098
|
type Defaultize<P, D> = P extends any
|
3096
3099
|
? string extends keyof P ? P :
|
3097
3100
|
& Pick<P, Exclude<keyof P, keyof D>>
|
3098
|
-
&
|
3099
|
-
&
|
3101
|
+
& InexactPartial<Pick<P, Extract<keyof P, keyof D>>>
|
3102
|
+
& InexactPartial<Pick<D, Exclude<keyof D, keyof P>>>
|
3100
3103
|
: never;
|
3101
3104
|
|
3102
3105
|
type ReactManagedAttributes<C, P> = C extends { propTypes: infer T; defaultProps: infer D; }
|
react/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/react",
|
3
|
-
"version": "18.0.
|
3
|
+
"version": "18.0.7",
|
4
4
|
"description": "TypeScript definitions for React",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
|
6
6
|
"license": "MIT",
|
@@ -146,7 +146,7 @@
|
|
146
146
|
"@types/scheduler": "*",
|
147
147
|
"csstype": "^3.0.2"
|
148
148
|
},
|
149
|
-
"typesPublisherContentHash": "
|
149
|
+
"typesPublisherContentHash": "9bf0c0d821eb2f24e24e432e0aeeb25bde800e76a03f272ab1664668f71fc7e2",
|
150
150
|
"typeScriptVersion": "3.9",
|
151
151
|
"exports": {
|
152
152
|
".": {
|
@@ -154,6 +154,16 @@
|
|
154
154
|
"default": "./index.d.ts"
|
155
155
|
}
|
156
156
|
},
|
157
|
+
"./next": {
|
158
|
+
"types": {
|
159
|
+
"default": "./next.d.ts"
|
160
|
+
}
|
161
|
+
},
|
162
|
+
"./experimental": {
|
163
|
+
"types": {
|
164
|
+
"default": "./experimental.d.ts"
|
165
|
+
}
|
166
|
+
},
|
157
167
|
"./jsx-runtime": {
|
158
168
|
"types": {
|
159
169
|
"default": "./jsx-runtime.d.ts"
|