@types/react 18.0.1 → 18.0.4

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 +19 -1
  3. react/package.json +21 -3
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: Sat, 09 Apr 2022 18:01:20 GMT
11
+ * Last updated: Wed, 13 Apr 2022 17:31:15 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
@@ -377,7 +377,15 @@ declare namespace React {
377
377
 
378
378
  function isValidElement<P>(object: {} | null | undefined): object is ReactElement<P>;
379
379
 
380
- const Children: ReactChildren;
380
+ // Sync with `ReactChildren` until `ReactChildren` is removed.
381
+ const Children: {
382
+ map<T, C>(children: C | ReadonlyArray<C>, fn: (child: C, index: number) => T):
383
+ C extends null | undefined ? C : Array<Exclude<T, boolean | null | undefined>>;
384
+ forEach<C>(children: C | ReadonlyArray<C>, fn: (child: C, index: number) => void): void;
385
+ count(children: any): number;
386
+ only<C>(children: C): C extends any[] ? never : C;
387
+ toArray(children: ReactNode | ReactNode[]): Array<Exclude<ReactNode, boolean | null | undefined>>;
388
+ };
381
389
  const Fragment: ExoticComponent<{ children?: ReactNode | undefined }>;
382
390
  const StrictMode: ExoticComponent<{ children?: ReactNode | undefined }>;
383
391
 
@@ -515,8 +523,14 @@ declare namespace React {
515
523
  displayName?: string | undefined;
516
524
  }
517
525
 
526
+ /**
527
+ * @deprecated - Equivalent with `React.FC`.
528
+ */
518
529
  type VFC<P = {}> = VoidFunctionComponent<P>;
519
530
 
531
+ /**
532
+ * @deprecated - Equivalent with `React.FunctionComponent`.
533
+ */
520
534
  interface VoidFunctionComponent<P = {}> {
521
535
  (props: P, context?: any): ReactElement<any, any> | null;
522
536
  propTypes?: WeakValidationMap<P> | undefined;
@@ -2999,6 +3013,10 @@ declare namespace React {
2999
3013
  // React.Children
3000
3014
  // ----------------------------------------------------------------------
3001
3015
 
3016
+ /**
3017
+ * @deprecated - Use `typeof React.Children` instead.
3018
+ */
3019
+ // Sync with type of `const Children`.
3002
3020
  interface ReactChildren {
3003
3021
  map<T, C>(children: C | ReadonlyArray<C>, fn: (child: C, index: number) => T):
3004
3022
  C extends null | undefined ? C : Array<Exclude<T, boolean | null | undefined>>;
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "18.0.1",
3
+ "version": "18.0.4",
4
4
  "description": "TypeScript definitions for React",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
6
6
  "license": "MIT",
@@ -146,6 +146,24 @@
146
146
  "@types/scheduler": "*",
147
147
  "csstype": "^3.0.2"
148
148
  },
149
- "typesPublisherContentHash": "ddc52aa6c78f2a2ba91aafa55259e3f26332caf113976b09811527f1f795c40a",
150
- "typeScriptVersion": "3.9"
149
+ "typesPublisherContentHash": "58c782df55e0bf307598c396cb212a6e40bb61a3a156b898b47cd1766b5d7e7d",
150
+ "typeScriptVersion": "3.9",
151
+ "exports": {
152
+ ".": {
153
+ "types": {
154
+ "default": "./index.d.ts"
155
+ }
156
+ },
157
+ "./jsx-runtime": {
158
+ "types": {
159
+ "default": "./jsx-runtime.d.ts"
160
+ }
161
+ },
162
+ "./jsx-dev-runtime": {
163
+ "types": {
164
+ "default": "./jsx-dev-runtime.d.ts"
165
+ }
166
+ },
167
+ "./package.json": "./package.json"
168
+ }
151
169
  }