@types/react 18.0.0 → 18.0.3

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 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: Thu, 07 Apr 2022 17:31:22 GMT
11
+ * Last updated: Tue, 12 Apr 2022 18:01:23 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
@@ -102,20 +102,4 @@ declare module '.' {
102
102
  * @see https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist
103
103
  */
104
104
  export const SuspenseList: ExoticComponent<SuspenseListProps>;
105
-
106
- /**
107
- * this should be an internal type
108
- */
109
- interface MutableSource<T> {
110
- _source: T;
111
- }
112
-
113
- export type MutableSourceSubscribe<T> = (source: T, callback: () => void) => () => void;
114
-
115
- // TODO: This may not be intentionally part of the experimental release considering useMutableSource is no longer available
116
- /**
117
- * @param source A source could be anything as long as they can be subscribed to and have a "version".
118
- * @param getVersion A function returns a value which will change whenever part of the source changes.
119
- */
120
- export function unstable_createMutableSource<T>(source: T, getVersion: () => any): MutableSource<T>;
121
105
  }
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
 
@@ -2999,6 +3007,10 @@ declare namespace React {
2999
3007
  // React.Children
3000
3008
  // ----------------------------------------------------------------------
3001
3009
 
3010
+ /**
3011
+ * @deprecated - Use `typeof React.Children` instead.
3012
+ */
3013
+ // Sync with type of `const Children`.
3002
3014
  interface ReactChildren {
3003
3015
  map<T, C>(children: C | ReadonlyArray<C>, fn: (child: C, index: number) => T):
3004
3016
  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.0",
3
+ "version": "18.0.3",
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": "6779161312d4a456b9a73a478b25f72f9b02fc5b0117762da5cfd6e0883bb745",
150
- "typeScriptVersion": "3.9"
149
+ "typesPublisherContentHash": "bb5f8410b9a5449a22b356472225e567ada9c8dbc920851884420efa90b2e518",
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
  }