@types/react 18.0.3 → 18.0.6

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/index.d.ts +14 -8
  3. 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: Tue, 12 Apr 2022 18:01:23 GMT
11
+ * Last updated: Thu, 21 Apr 2022 18:01:41 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,13 +213,11 @@ declare namespace React {
213
213
  (props?: ClassAttributes<SVGElement> & SVGAttributes<SVGElement> | null, ...children: ReactNode[]): ReactSVGElement;
214
214
  }
215
215
 
216
- //
217
- // React Nodes
218
- // http://facebook.github.io/react/docs/glossary.html
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
- type ReactChild = ReactElement | ReactText;
220
+ type ReactChild = ReactElement | string | number;
223
221
 
224
222
  /**
225
223
  * @deprecated Use either `ReactNode[]` if you need an array or `Iterable<ReactNode>` if its passed to a host component.
@@ -523,8 +521,14 @@ declare namespace React {
523
521
  displayName?: string | undefined;
524
522
  }
525
523
 
524
+ /**
525
+ * @deprecated - Equivalent with `React.FC`.
526
+ */
526
527
  type VFC<P = {}> = VoidFunctionComponent<P>;
527
528
 
529
+ /**
530
+ * @deprecated - Equivalent with `React.FunctionComponent`.
531
+ */
528
532
  interface VoidFunctionComponent<P = {}> {
529
533
  (props: P, context?: any): ReactElement<any, any> | null;
530
534
  propTypes?: WeakValidationMap<P> | undefined;
@@ -3082,6 +3086,8 @@ type MergePropTypes<P, T> =
3082
3086
  & Pick<P, Exclude<keyof P, keyof T>>
3083
3087
  : never;
3084
3088
 
3089
+ type InexactPartial<T> = { [K in keyof T]?: T[K] | undefined };
3090
+
3085
3091
  // Any prop that has a default prop becomes optional, but its type is unchanged
3086
3092
  // Undeclared default props are augmented into the resulting allowable attributes
3087
3093
  // If declared props have indexed properties, ignore default props entirely as keyof gets widened
@@ -3089,8 +3095,8 @@ type MergePropTypes<P, T> =
3089
3095
  type Defaultize<P, D> = P extends any
3090
3096
  ? string extends keyof P ? P :
3091
3097
  & Pick<P, Exclude<keyof P, keyof D>>
3092
- & Partial<Pick<P, Extract<keyof P, keyof D>>>
3093
- & Partial<Pick<D, Exclude<keyof D, keyof P>>>
3098
+ & InexactPartial<Pick<P, Extract<keyof P, keyof D>>>
3099
+ & InexactPartial<Pick<D, Exclude<keyof D, keyof P>>>
3094
3100
  : never;
3095
3101
 
3096
3102
  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",
3
+ "version": "18.0.6",
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": "bb5f8410b9a5449a22b356472225e567ada9c8dbc920851884420efa90b2e518",
149
+ "typesPublisherContentHash": "a0fc5dcbcfe16404a35cb4d2c3150e31d591f9d8c02ee29498fda0d7b548cb8b",
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"