@types/react 19.2.2 → 19.2.9

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 (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: Tue, 07 Oct 2025 05:34:23 GMT
11
+ * Last updated: Tue, 20 Jan 2026 14:07:27 GMT
12
12
  * Dependencies: [csstype](https://npmjs.com/package/csstype)
13
13
 
14
14
  # Credits
react/canary.d.ts CHANGED
@@ -71,19 +71,19 @@ declare module "." {
71
71
  /**
72
72
  * The `<ViewTransition>` or its parent Component is mounted and there's no other `<ViewTransition>` with the same name being deleted.
73
73
  */
74
- onEnter?: (instance: ViewTransitionInstance, types: Array<string>) => void;
74
+ onEnter?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
75
75
  /**
76
76
  * The `<ViewTransition>` or its parent Component is unmounted and there's no other `<ViewTransition>` with the same name being deleted.
77
77
  */
78
- onExit?: (instance: ViewTransitionInstance, types: Array<string>) => void;
78
+ onExit?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
79
79
  /**
80
80
  * This `<ViewTransition>` is being mounted and another `<ViewTransition>` instance with the same name is being unmounted elsewhere.
81
81
  */
82
- onShare?: (instance: ViewTransitionInstance, types: Array<string>) => void;
82
+ onShare?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
83
83
  /**
84
84
  * The content of `<ViewTransition>` has changed either due to DOM mutations or because an inner child `<ViewTransition>` has resized.
85
85
  */
86
- onUpdate?: (instance: ViewTransitionInstance, types: Array<string>) => void;
86
+ onUpdate?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
87
87
  ref?: Ref<ViewTransitionInstance> | undefined;
88
88
  /**
89
89
  * Combined with {@link className} if this `<ViewTransition>` is being mounted and another instance with the same name is being unmounted elsewhere.
react/experimental.d.ts CHANGED
@@ -43,12 +43,13 @@ type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
43
43
 
44
44
  declare module "." {
45
45
  export interface SuspenseProps {
46
+ // @enableCPUSuspense
46
47
  /**
47
48
  * The presence of this prop indicates that the content is computationally expensive to render.
48
49
  * In other words, the tree is CPU bound and not I/O bound (e.g. due to fetching data).
49
50
  * @see {@link https://github.com/facebook/react/pull/19936}
50
51
  */
51
- unstable_expectedLoadTime?: number | undefined;
52
+ defer?: boolean | undefined;
52
53
  }
53
54
 
54
55
  export type SuspenseListRevealOrder = "forwards" | "backwards" | "together" | "independent";
@@ -68,17 +69,19 @@ declare module "." {
68
69
  children: Iterable<ReactElement> | AsyncIterable<ReactElement>;
69
70
  /**
70
71
  * Defines the order in which the `SuspenseList` children should be revealed.
72
+ * @default "forwards"
71
73
  */
72
- revealOrder: "forwards" | "backwards" | "unstable_legacy-backwards";
74
+ revealOrder?: "forwards" | "backwards" | "unstable_legacy-backwards" | undefined;
73
75
  /**
74
76
  * Dictates how unloaded items in a SuspenseList is shown.
75
77
  *
76
- * - By default, `SuspenseList` will show all fallbacks in the list.
77
78
  * - `collapsed` shows only the next fallback in the list.
78
79
  * - `hidden` doesn't show any unloaded items.
79
80
  * - `visible` shows all fallbacks in the list.
81
+ *
82
+ * @default "hidden"
80
83
  */
81
- tail: SuspenseListTailMode;
84
+ tail?: SuspenseListTailMode | undefined;
82
85
  }
83
86
 
84
87
  interface NonDirectionalSuspenseListProps extends SuspenseListCommonProps {
@@ -86,7 +89,7 @@ declare module "." {
86
89
  /**
87
90
  * Defines the order in which the `SuspenseList` children should be revealed.
88
91
  */
89
- revealOrder: Exclude<SuspenseListRevealOrder, DirectionalSuspenseListProps["revealOrder"]> | undefined;
92
+ revealOrder: Exclude<SuspenseListRevealOrder, DirectionalSuspenseListProps["revealOrder"]>;
90
93
  /**
91
94
  * The tail property is invalid when not using the `forwards` or `backwards` reveal orders.
92
95
  */
@@ -126,6 +129,9 @@ declare module "." {
126
129
  rangeStart?: number | undefined;
127
130
  rangeEnd?: number | undefined;
128
131
  }
132
+ export type GestureOptionsRequired = {
133
+ [P in keyof GestureOptions]-?: NonNullable<GestureOptions[P]>;
134
+ };
129
135
  /** */
130
136
  export function unstable_startGestureTransition(
131
137
  provider: GestureProvider,
@@ -133,6 +139,33 @@ declare module "." {
133
139
  options?: GestureOptions,
134
140
  ): () => void;
135
141
 
142
+ interface ViewTransitionProps {
143
+ onGestureEnter?: (
144
+ timeline: GestureProvider,
145
+ options: GestureOptionsRequired,
146
+ instance: ViewTransitionInstance,
147
+ types: Array<string>,
148
+ ) => void | (() => void);
149
+ onGestureExit?: (
150
+ timeline: GestureProvider,
151
+ options: GestureOptionsRequired,
152
+ instance: ViewTransitionInstance,
153
+ types: Array<string>,
154
+ ) => void | (() => void);
155
+ onGestureShare?: (
156
+ timeline: GestureProvider,
157
+ options: GestureOptionsRequired,
158
+ instance: ViewTransitionInstance,
159
+ types: Array<string>,
160
+ ) => void | (() => void);
161
+ onGestureUpdate?: (
162
+ timeline: GestureProvider,
163
+ options: GestureOptionsRequired,
164
+ instance: ViewTransitionInstance,
165
+ types: Array<string>,
166
+ ) => void | (() => void);
167
+ }
168
+
136
169
  // @enableSrcObject
137
170
  interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_IMG_SRC_TYPES {
138
171
  srcObject: Blob;
react/index.d.ts CHANGED
@@ -1926,7 +1926,31 @@ declare namespace React {
1926
1926
  reducer: (state: State, action: Action) => State,
1927
1927
  ): [State, (action: Action) => void];
1928
1928
 
1929
- export type Usable<T> = PromiseLike<T> | Context<T>;
1929
+ interface UntrackedReactPromise<T> extends PromiseLike<T> {
1930
+ status?: void;
1931
+ }
1932
+
1933
+ export interface PendingReactPromise<T> extends PromiseLike<T> {
1934
+ status: "pending";
1935
+ }
1936
+
1937
+ export interface FulfilledReactPromise<T> extends PromiseLike<T> {
1938
+ status: "fulfilled";
1939
+ value: T;
1940
+ }
1941
+
1942
+ export interface RejectedReactPromise<T> extends PromiseLike<T> {
1943
+ status: "rejected";
1944
+ reason: unknown;
1945
+ }
1946
+
1947
+ export type ReactPromise<T> =
1948
+ | UntrackedReactPromise<T>
1949
+ | PendingReactPromise<T>
1950
+ | FulfilledReactPromise<T>
1951
+ | RejectedReactPromise<T>;
1952
+
1953
+ export type Usable<T> = ReactPromise<T> | Context<T>;
1930
1954
 
1931
1955
  export function use<T>(usable: Usable<T>): T;
1932
1956
 
@@ -3540,6 +3564,9 @@ declare namespace React {
3540
3564
  method?: string | undefined;
3541
3565
  min?: number | string | undefined;
3542
3566
  name?: string | undefined;
3567
+ nonce?: string | undefined;
3568
+ part?: string | undefined;
3569
+ slot?: string | undefined;
3543
3570
  style?: CSSProperties | undefined;
3544
3571
  target?: string | undefined;
3545
3572
  type?: string | undefined;
@@ -4057,7 +4084,6 @@ declare namespace React {
4057
4084
  * Captures which component contained the exception, and its ancestors.
4058
4085
  */
4059
4086
  componentStack?: string | null;
4060
- digest?: string | null;
4061
4087
  }
4062
4088
 
4063
4089
  // Keep in sync with JSX namespace in ./jsx-runtime.d.ts and ./jsx-dev-runtime.d.ts
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "19.2.2",
3
+ "version": "19.2.9",
4
4
  "description": "TypeScript definitions for react",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
6
6
  "license": "MIT",
@@ -202,9 +202,9 @@
202
202
  },
203
203
  "scripts": {},
204
204
  "dependencies": {
205
- "csstype": "^3.0.2"
205
+ "csstype": "^3.2.2"
206
206
  },
207
207
  "peerDependencies": {},
208
- "typesPublisherContentHash": "68c52e24d44da5913d4220a0dd3380ca866be4e58a724ee668fa152a7b358e72",
208
+ "typesPublisherContentHash": "0494f33a7194f3d93b18f5c5194b5aa3b32b8efc3058b7a50a9b25b1639c19d3",
209
209
  "typeScriptVersion": "5.2"
210
210
  }
react/ts5.0/canary.d.ts CHANGED
@@ -71,19 +71,19 @@ declare module "." {
71
71
  /**
72
72
  * The `<ViewTransition>` or its parent Component is mounted and there's no other `<ViewTransition>` with the same name being deleted.
73
73
  */
74
- onEnter?: (instance: ViewTransitionInstance, types: Array<string>) => void;
74
+ onEnter?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
75
75
  /**
76
76
  * The `<ViewTransition>` or its parent Component is unmounted and there's no other `<ViewTransition>` with the same name being deleted.
77
77
  */
78
- onExit?: (instance: ViewTransitionInstance, types: Array<string>) => void;
78
+ onExit?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
79
79
  /**
80
80
  * This `<ViewTransition>` is being mounted and another `<ViewTransition>` instance with the same name is being unmounted elsewhere.
81
81
  */
82
- onShare?: (instance: ViewTransitionInstance, types: Array<string>) => void;
82
+ onShare?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
83
83
  /**
84
84
  * The content of `<ViewTransition>` has changed either due to DOM mutations or because an inner child `<ViewTransition>` has resized.
85
85
  */
86
- onUpdate?: (instance: ViewTransitionInstance, types: Array<string>) => void;
86
+ onUpdate?: (instance: ViewTransitionInstance, types: Array<string>) => void | (() => void);
87
87
  ref?: Ref<ViewTransitionInstance> | undefined;
88
88
  /**
89
89
  * Combined with {@link className} if this `<ViewTransition>` is being mounted and another instance with the same name is being unmounted elsewhere.
@@ -43,12 +43,13 @@ type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
43
43
 
44
44
  declare module "." {
45
45
  export interface SuspenseProps {
46
+ // @enableCPUSuspense
46
47
  /**
47
48
  * The presence of this prop indicates that the content is computationally expensive to render.
48
49
  * In other words, the tree is CPU bound and not I/O bound (e.g. due to fetching data).
49
50
  * @see {@link https://github.com/facebook/react/pull/19936}
50
51
  */
51
- unstable_expectedLoadTime?: number | undefined;
52
+ defer?: boolean | undefined;
52
53
  }
53
54
 
54
55
  export type SuspenseListRevealOrder = "forwards" | "backwards" | "together" | "independent";
@@ -68,17 +69,19 @@ declare module "." {
68
69
  children: Iterable<ReactElement> | AsyncIterable<ReactElement>;
69
70
  /**
70
71
  * Defines the order in which the `SuspenseList` children should be revealed.
72
+ * @default "forwards"
71
73
  */
72
- revealOrder: "forwards" | "backwards" | "unstable_legacy-backwards";
74
+ revealOrder?: "forwards" | "backwards" | "unstable_legacy-backwards" | undefined;
73
75
  /**
74
76
  * Dictates how unloaded items in a SuspenseList is shown.
75
77
  *
76
- * - By default, `SuspenseList` will show all fallbacks in the list.
77
78
  * - `collapsed` shows only the next fallback in the list.
78
79
  * - `hidden` doesn't show any unloaded items.
79
80
  * - `visible` shows all fallbacks in the list.
81
+ *
82
+ * @default "hidden"
80
83
  */
81
- tail: SuspenseListTailMode;
84
+ tail?: SuspenseListTailMode | undefined;
82
85
  }
83
86
 
84
87
  interface NonDirectionalSuspenseListProps extends SuspenseListCommonProps {
@@ -86,7 +89,7 @@ declare module "." {
86
89
  /**
87
90
  * Defines the order in which the `SuspenseList` children should be revealed.
88
91
  */
89
- revealOrder: Exclude<SuspenseListRevealOrder, DirectionalSuspenseListProps["revealOrder"]> | undefined;
92
+ revealOrder: Exclude<SuspenseListRevealOrder, DirectionalSuspenseListProps["revealOrder"]>;
90
93
  /**
91
94
  * The tail property is invalid when not using the `forwards` or `backwards` reveal orders.
92
95
  */
@@ -126,6 +129,9 @@ declare module "." {
126
129
  rangeStart?: number | undefined;
127
130
  rangeEnd?: number | undefined;
128
131
  }
132
+ export type GestureOptionsRequired = {
133
+ [P in keyof GestureOptions]-?: NonNullable<GestureOptions[P]>;
134
+ };
129
135
  /** */
130
136
  export function unstable_startGestureTransition(
131
137
  provider: GestureProvider,
@@ -133,6 +139,33 @@ declare module "." {
133
139
  options?: GestureOptions,
134
140
  ): () => void;
135
141
 
142
+ interface ViewTransitionProps {
143
+ onGestureEnter?: (
144
+ timeline: GestureProvider,
145
+ options: GestureOptionsRequired,
146
+ instance: ViewTransitionInstance,
147
+ types: Array<string>,
148
+ ) => void | (() => void);
149
+ onGestureExit?: (
150
+ timeline: GestureProvider,
151
+ options: GestureOptionsRequired,
152
+ instance: ViewTransitionInstance,
153
+ types: Array<string>,
154
+ ) => void | (() => void);
155
+ onGestureShare?: (
156
+ timeline: GestureProvider,
157
+ options: GestureOptionsRequired,
158
+ instance: ViewTransitionInstance,
159
+ types: Array<string>,
160
+ ) => void | (() => void);
161
+ onGestureUpdate?: (
162
+ timeline: GestureProvider,
163
+ options: GestureOptionsRequired,
164
+ instance: ViewTransitionInstance,
165
+ types: Array<string>,
166
+ ) => void | (() => void);
167
+ }
168
+
136
169
  // @enableSrcObject
137
170
  interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_IMG_SRC_TYPES {
138
171
  srcObject: Blob;
react/ts5.0/index.d.ts CHANGED
@@ -1925,7 +1925,31 @@ declare namespace React {
1925
1925
  reducer: (state: State, action: Action) => State,
1926
1926
  ): [State, (action: Action) => void];
1927
1927
 
1928
- export type Usable<T> = PromiseLike<T> | Context<T>;
1928
+ interface UntrackedReactPromise<T> extends PromiseLike<T> {
1929
+ status?: void;
1930
+ }
1931
+
1932
+ export interface PendingReactPromise<T> extends PromiseLike<T> {
1933
+ status: "pending";
1934
+ }
1935
+
1936
+ export interface FulfilledReactPromise<T> extends PromiseLike<T> {
1937
+ status: "fulfilled";
1938
+ value: T;
1939
+ }
1940
+
1941
+ export interface RejectedReactPromise<T> extends PromiseLike<T> {
1942
+ status: "rejected";
1943
+ reason: unknown;
1944
+ }
1945
+
1946
+ export type ReactPromise<T> =
1947
+ | UntrackedReactPromise<T>
1948
+ | PendingReactPromise<T>
1949
+ | FulfilledReactPromise<T>
1950
+ | RejectedReactPromise<T>;
1951
+
1952
+ export type Usable<T> = ReactPromise<T> | Context<T>;
1929
1953
 
1930
1954
  export function use<T>(usable: Usable<T>): T;
1931
1955
 
@@ -4056,7 +4080,6 @@ declare namespace React {
4056
4080
  * Captures which component contained the exception, and its ancestors.
4057
4081
  */
4058
4082
  componentStack?: string | null;
4059
- digest?: string | null;
4060
4083
  }
4061
4084
 
4062
4085
  // Keep in sync with JSX namespace in ./jsx-runtime.d.ts and ./jsx-dev-runtime.d.ts