@types/react 19.2.1 → 19.2.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 (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: Mon, 06 Oct 2025 21:02:40 GMT
11
+ * Last updated: Tue, 11 Nov 2025 15:36:05 GMT
12
12
  * Dependencies: [csstype](https://npmjs.com/package/csstype)
13
13
 
14
14
  # Credits
react/canary.d.ts CHANGED
@@ -32,4 +32,89 @@ type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
32
32
 
33
33
  declare module "." {
34
34
  export function unstable_useCacheRefresh(): () => void;
35
+
36
+ // @enableViewTransition
37
+ export interface ViewTransitionInstance {
38
+ /**
39
+ * The {@link ViewTransitionProps name} that was used in the corresponding {@link ViewTransition} component or `"auto"` if the `name` prop was omitted.
40
+ */
41
+ name: string;
42
+ }
43
+
44
+ export type ViewTransitionClassPerType = Record<"default" | (string & {}), "none" | "auto" | (string & {})>;
45
+ export type ViewTransitionClass = ViewTransitionClassPerType | ViewTransitionClassPerType[string];
46
+
47
+ export interface ViewTransitionProps {
48
+ children?: ReactNode | undefined;
49
+ /**
50
+ * Assigns the {@link https://developer.chrome.com/blog/view-transitions-update-io24#view-transition-class `view-transition-class`} class to the underlying DOM node.
51
+ */
52
+ default?: ViewTransitionClass | undefined;
53
+ /**
54
+ * Combined with {@link className} if this `<ViewTransition>` or its parent Component is mounted and there's no other with the same name being deleted.
55
+ * `"none"` is a special value that deactivates the view transition name under that condition.
56
+ */
57
+ enter?: ViewTransitionClass | undefined;
58
+ /**
59
+ * Combined with {@link className} if this `<ViewTransition>` or its parent Component is unmounted and there's no other with the same name being deleted.
60
+ * `"none"` is a special value that deactivates the view transition name under that condition.
61
+ */
62
+ exit?: ViewTransitionClass | undefined;
63
+ /**
64
+ * "auto" will automatically assign a view-transition-name to the inner DOM node.
65
+ * That way you can add a View Transition to a Component without controlling its DOM nodes styling otherwise.
66
+ *
67
+ * A difference between this and the browser's built-in view-transition-name: auto is that switching the DOM nodes within the `<ViewTransition>` component preserves the same name so this example cross-fades between the DOM nodes instead of causing an exit and enter.
68
+ * @default "auto"
69
+ */
70
+ name?: "auto" | (string & {}) | undefined;
71
+ /**
72
+ * The `<ViewTransition>` or its parent Component is mounted and there's no other `<ViewTransition>` with the same name being deleted.
73
+ */
74
+ onEnter?: (instance: ViewTransitionInstance, types: Array<string>) => void;
75
+ /**
76
+ * The `<ViewTransition>` or its parent Component is unmounted and there's no other `<ViewTransition>` with the same name being deleted.
77
+ */
78
+ onExit?: (instance: ViewTransitionInstance, types: Array<string>) => void;
79
+ /**
80
+ * This `<ViewTransition>` is being mounted and another `<ViewTransition>` instance with the same name is being unmounted elsewhere.
81
+ */
82
+ onShare?: (instance: ViewTransitionInstance, types: Array<string>) => void;
83
+ /**
84
+ * The content of `<ViewTransition>` has changed either due to DOM mutations or because an inner child `<ViewTransition>` has resized.
85
+ */
86
+ onUpdate?: (instance: ViewTransitionInstance, types: Array<string>) => void;
87
+ ref?: Ref<ViewTransitionInstance> | undefined;
88
+ /**
89
+ * Combined with {@link className} if this `<ViewTransition>` is being mounted and another instance with the same name is being unmounted elsewhere.
90
+ * `"none"` is a special value that deactivates the view transition name under that condition.
91
+ */
92
+ share?: ViewTransitionClass | undefined;
93
+ /**
94
+ * Combined with {@link className} if the content of this `<ViewTransition>` has changed either due to DOM mutations or because an inner child has resized.
95
+ * `"none"` is a special value that deactivates the view transition name under that condition.
96
+ */
97
+ update?: ViewTransitionClass | undefined;
98
+ }
99
+
100
+ /**
101
+ * Opt-in for using {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API View Transitions} in React.
102
+ * View Transitions only trigger for async updates like {@link startTransition}, {@link useDeferredValue}, Actions or <{@link Suspense}> revealing from fallback to content.
103
+ * Synchronous updates provide an opt-out but also guarantee that they commit immediately which View Transitions can't.
104
+ *
105
+ * @see {@link https://react.dev/reference/react/ViewTransition `<ViewTransition>` reference documentation}
106
+ */
107
+ export const ViewTransition: ExoticComponent<ViewTransitionProps>;
108
+
109
+ /**
110
+ * @see {@link https://react.dev/reference/react/addTransitionType `addTransitionType` reference documentation}
111
+ */
112
+ export function addTransitionType(type: string): void;
113
+
114
+ // @enableFragmentRefs
115
+ export interface FragmentInstance {}
116
+
117
+ export interface FragmentProps {
118
+ ref?: Ref<FragmentInstance> | undefined;
119
+ }
35
120
  }
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";
@@ -117,80 +118,6 @@ declare module "." {
117
118
  ): void;
118
119
  function experimental_taintObjectReference(message: string | undefined, object: Reference): void;
119
120
 
120
- export interface ViewTransitionInstance {
121
- /**
122
- * The {@link ViewTransitionProps name} that was used in the corresponding {@link ViewTransition} component or `"auto"` if the `name` prop was omitted.
123
- */
124
- name: string;
125
- }
126
-
127
- export type ViewTransitionClassPerType = Record<"default" | (string & {}), "none" | "auto" | (string & {})>;
128
- export type ViewTransitionClass = ViewTransitionClassPerType | ViewTransitionClassPerType[string];
129
-
130
- export interface ViewTransitionProps {
131
- children?: ReactNode | undefined;
132
- /**
133
- * Assigns the {@link https://developer.chrome.com/blog/view-transitions-update-io24#view-transition-class `view-transition-class`} class to the underlying DOM node.
134
- */
135
- default?: ViewTransitionClass | undefined;
136
- /**
137
- * Combined with {@link className} if this `<ViewTransition>` or its parent Component is mounted and there's no other with the same name being deleted.
138
- * `"none"` is a special value that deactivates the view transition name under that condition.
139
- */
140
- enter?: ViewTransitionClass | undefined;
141
- /**
142
- * Combined with {@link className} if this `<ViewTransition>` or its parent Component is unmounted and there's no other with the same name being deleted.
143
- * `"none"` is a special value that deactivates the view transition name under that condition.
144
- */
145
- exit?: ViewTransitionClass | undefined;
146
- /**
147
- * "auto" will automatically assign a view-transition-name to the inner DOM node.
148
- * That way you can add a View Transition to a Component without controlling its DOM nodes styling otherwise.
149
- *
150
- * A difference between this and the browser's built-in view-transition-name: auto is that switching the DOM nodes within the `<ViewTransition>` component preserves the same name so this example cross-fades between the DOM nodes instead of causing an exit and enter.
151
- * @default "auto"
152
- */
153
- name?: "auto" | (string & {}) | undefined;
154
- /**
155
- * The `<ViewTransition>` or its parent Component is mounted and there's no other `<ViewTransition>` with the same name being deleted.
156
- */
157
- onEnter?: (instance: ViewTransitionInstance, types: Array<string>) => void;
158
- /**
159
- * The `<ViewTransition>` or its parent Component is unmounted and there's no other `<ViewTransition>` with the same name being deleted.
160
- */
161
- onExit?: (instance: ViewTransitionInstance, types: Array<string>) => void;
162
- /**
163
- * This `<ViewTransition>` is being mounted and another `<ViewTransition>` instance with the same name is being unmounted elsewhere.
164
- */
165
- onShare?: (instance: ViewTransitionInstance, types: Array<string>) => void;
166
- /**
167
- * The content of `<ViewTransition>` has changed either due to DOM mutations or because an inner child `<ViewTransition>` has resized.
168
- */
169
- onUpdate?: (instance: ViewTransitionInstance, types: Array<string>) => void;
170
- ref?: Ref<ViewTransitionInstance> | undefined;
171
- /**
172
- * Combined with {@link className} if this `<ViewTransition>` is being mounted and another instance with the same name is being unmounted elsewhere.
173
- * `"none"` is a special value that deactivates the view transition name under that condition.
174
- */
175
- share?: ViewTransitionClass | undefined;
176
- /**
177
- * Combined with {@link className} if the content of this `<ViewTransition>` has changed either due to DOM mutations or because an inner child has resized.
178
- * `"none"` is a special value that deactivates the view transition name under that condition.
179
- */
180
- update?: ViewTransitionClass | undefined;
181
- }
182
-
183
- /**
184
- * Opt-in for using {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API View Transitions} in React.
185
- * View Transitions only trigger for async updates like {@link startTransition}, {@link useDeferredValue}, Actions or <{@link Suspense}> revealing from fallback to content.
186
- * Synchronous updates provide an opt-out but also guarantee that they commit immediately which View Transitions can't.
187
- *
188
- * @see {@link https://github.com/facebook/react/pull/31975}
189
- */
190
- export const unstable_ViewTransition: ExoticComponent<ViewTransitionProps>;
191
-
192
- export function unstable_addTransitionType(type: string): void;
193
-
194
121
  // @enableGestureTransition
195
122
  // Implemented by the specific renderer e.g. `react-dom`.
196
123
  // Keep in mind that augmented interfaces merge their JSDoc so if you put
@@ -207,13 +134,6 @@ declare module "." {
207
134
  options?: GestureOptions,
208
135
  ): () => void;
209
136
 
210
- // @enableFragmentRefs
211
- export interface FragmentInstance {}
212
-
213
- export interface FragmentProps {
214
- ref?: Ref<FragmentInstance> | undefined;
215
- }
216
-
217
137
  // @enableSrcObject
218
138
  interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_IMG_SRC_TYPES {
219
139
  srcObject: Blob;
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "19.2.1",
3
+ "version": "19.2.3",
4
4
  "description": "TypeScript definitions for react",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
6
6
  "license": "MIT",
@@ -205,6 +205,6 @@
205
205
  "csstype": "^3.0.2"
206
206
  },
207
207
  "peerDependencies": {},
208
- "typesPublisherContentHash": "7232140fde6d2a47deb1498773132be00e6f7eee4400a4c8fdfa6da8582b5b08",
208
+ "typesPublisherContentHash": "137dc6599832a7f1b9a458198af4ab88316935915facbd7cdf89cd676a01a6da",
209
209
  "typeScriptVersion": "5.2"
210
210
  }
react/ts5.0/canary.d.ts CHANGED
@@ -32,4 +32,89 @@ type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
32
32
 
33
33
  declare module "." {
34
34
  export function unstable_useCacheRefresh(): () => void;
35
+
36
+ // @enableViewTransition
37
+ export interface ViewTransitionInstance {
38
+ /**
39
+ * The {@link ViewTransitionProps name} that was used in the corresponding {@link ViewTransition} component or `"auto"` if the `name` prop was omitted.
40
+ */
41
+ name: string;
42
+ }
43
+
44
+ export type ViewTransitionClassPerType = Record<"default" | (string & {}), "none" | "auto" | (string & {})>;
45
+ export type ViewTransitionClass = ViewTransitionClassPerType | ViewTransitionClassPerType[string];
46
+
47
+ export interface ViewTransitionProps {
48
+ children?: ReactNode | undefined;
49
+ /**
50
+ * Assigns the {@link https://developer.chrome.com/blog/view-transitions-update-io24#view-transition-class `view-transition-class`} class to the underlying DOM node.
51
+ */
52
+ default?: ViewTransitionClass | undefined;
53
+ /**
54
+ * Combined with {@link className} if this `<ViewTransition>` or its parent Component is mounted and there's no other with the same name being deleted.
55
+ * `"none"` is a special value that deactivates the view transition name under that condition.
56
+ */
57
+ enter?: ViewTransitionClass | undefined;
58
+ /**
59
+ * Combined with {@link className} if this `<ViewTransition>` or its parent Component is unmounted and there's no other with the same name being deleted.
60
+ * `"none"` is a special value that deactivates the view transition name under that condition.
61
+ */
62
+ exit?: ViewTransitionClass | undefined;
63
+ /**
64
+ * "auto" will automatically assign a view-transition-name to the inner DOM node.
65
+ * That way you can add a View Transition to a Component without controlling its DOM nodes styling otherwise.
66
+ *
67
+ * A difference between this and the browser's built-in view-transition-name: auto is that switching the DOM nodes within the `<ViewTransition>` component preserves the same name so this example cross-fades between the DOM nodes instead of causing an exit and enter.
68
+ * @default "auto"
69
+ */
70
+ name?: "auto" | (string & {}) | undefined;
71
+ /**
72
+ * The `<ViewTransition>` or its parent Component is mounted and there's no other `<ViewTransition>` with the same name being deleted.
73
+ */
74
+ onEnter?: (instance: ViewTransitionInstance, types: Array<string>) => void;
75
+ /**
76
+ * The `<ViewTransition>` or its parent Component is unmounted and there's no other `<ViewTransition>` with the same name being deleted.
77
+ */
78
+ onExit?: (instance: ViewTransitionInstance, types: Array<string>) => void;
79
+ /**
80
+ * This `<ViewTransition>` is being mounted and another `<ViewTransition>` instance with the same name is being unmounted elsewhere.
81
+ */
82
+ onShare?: (instance: ViewTransitionInstance, types: Array<string>) => void;
83
+ /**
84
+ * The content of `<ViewTransition>` has changed either due to DOM mutations or because an inner child `<ViewTransition>` has resized.
85
+ */
86
+ onUpdate?: (instance: ViewTransitionInstance, types: Array<string>) => void;
87
+ ref?: Ref<ViewTransitionInstance> | undefined;
88
+ /**
89
+ * Combined with {@link className} if this `<ViewTransition>` is being mounted and another instance with the same name is being unmounted elsewhere.
90
+ * `"none"` is a special value that deactivates the view transition name under that condition.
91
+ */
92
+ share?: ViewTransitionClass | undefined;
93
+ /**
94
+ * Combined with {@link className} if the content of this `<ViewTransition>` has changed either due to DOM mutations or because an inner child has resized.
95
+ * `"none"` is a special value that deactivates the view transition name under that condition.
96
+ */
97
+ update?: ViewTransitionClass | undefined;
98
+ }
99
+
100
+ /**
101
+ * Opt-in for using {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API View Transitions} in React.
102
+ * View Transitions only trigger for async updates like {@link startTransition}, {@link useDeferredValue}, Actions or <{@link Suspense}> revealing from fallback to content.
103
+ * Synchronous updates provide an opt-out but also guarantee that they commit immediately which View Transitions can't.
104
+ *
105
+ * @see {@link https://react.dev/reference/react/ViewTransition `<ViewTransition>` reference documentation}
106
+ */
107
+ export const ViewTransition: ExoticComponent<ViewTransitionProps>;
108
+
109
+ /**
110
+ * @see {@link https://react.dev/reference/react/addTransitionType `addTransitionType` reference documentation}
111
+ */
112
+ export function addTransitionType(type: string): void;
113
+
114
+ // @enableFragmentRefs
115
+ export interface FragmentInstance {}
116
+
117
+ export interface FragmentProps {
118
+ ref?: Ref<FragmentInstance> | undefined;
119
+ }
35
120
  }
@@ -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";
@@ -117,80 +118,6 @@ declare module "." {
117
118
  ): void;
118
119
  function experimental_taintObjectReference(message: string | undefined, object: Reference): void;
119
120
 
120
- export interface ViewTransitionInstance {
121
- /**
122
- * The {@link ViewTransitionProps name} that was used in the corresponding {@link ViewTransition} component or `"auto"` if the `name` prop was omitted.
123
- */
124
- name: string;
125
- }
126
-
127
- export type ViewTransitionClassPerType = Record<"default" | (string & {}), "none" | "auto" | (string & {})>;
128
- export type ViewTransitionClass = ViewTransitionClassPerType | ViewTransitionClassPerType[string];
129
-
130
- export interface ViewTransitionProps {
131
- children?: ReactNode | undefined;
132
- /**
133
- * Assigns the {@link https://developer.chrome.com/blog/view-transitions-update-io24#view-transition-class `view-transition-class`} class to the underlying DOM node.
134
- */
135
- default?: ViewTransitionClass | undefined;
136
- /**
137
- * Combined with {@link className} if this `<ViewTransition>` or its parent Component is mounted and there's no other with the same name being deleted.
138
- * `"none"` is a special value that deactivates the view transition name under that condition.
139
- */
140
- enter?: ViewTransitionClass | undefined;
141
- /**
142
- * Combined with {@link className} if this `<ViewTransition>` or its parent Component is unmounted and there's no other with the same name being deleted.
143
- * `"none"` is a special value that deactivates the view transition name under that condition.
144
- */
145
- exit?: ViewTransitionClass | undefined;
146
- /**
147
- * "auto" will automatically assign a view-transition-name to the inner DOM node.
148
- * That way you can add a View Transition to a Component without controlling its DOM nodes styling otherwise.
149
- *
150
- * A difference between this and the browser's built-in view-transition-name: auto is that switching the DOM nodes within the `<ViewTransition>` component preserves the same name so this example cross-fades between the DOM nodes instead of causing an exit and enter.
151
- * @default "auto"
152
- */
153
- name?: "auto" | (string & {}) | undefined;
154
- /**
155
- * The `<ViewTransition>` or its parent Component is mounted and there's no other `<ViewTransition>` with the same name being deleted.
156
- */
157
- onEnter?: (instance: ViewTransitionInstance, types: Array<string>) => void;
158
- /**
159
- * The `<ViewTransition>` or its parent Component is unmounted and there's no other `<ViewTransition>` with the same name being deleted.
160
- */
161
- onExit?: (instance: ViewTransitionInstance, types: Array<string>) => void;
162
- /**
163
- * This `<ViewTransition>` is being mounted and another `<ViewTransition>` instance with the same name is being unmounted elsewhere.
164
- */
165
- onShare?: (instance: ViewTransitionInstance, types: Array<string>) => void;
166
- /**
167
- * The content of `<ViewTransition>` has changed either due to DOM mutations or because an inner child `<ViewTransition>` has resized.
168
- */
169
- onUpdate?: (instance: ViewTransitionInstance, types: Array<string>) => void;
170
- ref?: Ref<ViewTransitionInstance> | undefined;
171
- /**
172
- * Combined with {@link className} if this `<ViewTransition>` is being mounted and another instance with the same name is being unmounted elsewhere.
173
- * `"none"` is a special value that deactivates the view transition name under that condition.
174
- */
175
- share?: ViewTransitionClass | undefined;
176
- /**
177
- * Combined with {@link className} if the content of this `<ViewTransition>` has changed either due to DOM mutations or because an inner child has resized.
178
- * `"none"` is a special value that deactivates the view transition name under that condition.
179
- */
180
- update?: ViewTransitionClass | undefined;
181
- }
182
-
183
- /**
184
- * Opt-in for using {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API View Transitions} in React.
185
- * View Transitions only trigger for async updates like {@link startTransition}, {@link useDeferredValue}, Actions or <{@link Suspense}> revealing from fallback to content.
186
- * Synchronous updates provide an opt-out but also guarantee that they commit immediately which View Transitions can't.
187
- *
188
- * @see {@link https://github.com/facebook/react/pull/31975}
189
- */
190
- export const unstable_ViewTransition: ExoticComponent<ViewTransitionProps>;
191
-
192
- export function unstable_addTransitionType(type: string): void;
193
-
194
121
  // @enableGestureTransition
195
122
  // Implemented by the specific renderer e.g. `react-dom`.
196
123
  // Keep in mind that augmented interfaces merge their JSDoc so if you put
@@ -207,13 +134,6 @@ declare module "." {
207
134
  options?: GestureOptions,
208
135
  ): () => void;
209
136
 
210
- // @enableFragmentRefs
211
- export interface FragmentInstance {}
212
-
213
- export interface FragmentProps {
214
- ref?: Ref<FragmentInstance> | undefined;
215
- }
216
-
217
137
  // @enableSrcObject
218
138
  interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_IMG_SRC_TYPES {
219
139
  srcObject: Blob;