@types/react 19.0.12 → 19.0.13

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: Wed, 19 Mar 2025 15:02:26 GMT
11
+ * Last updated: Wed, 02 Apr 2025 06:39:08 GMT
12
12
  * Dependencies: [csstype](https://npmjs.com/package/csstype)
13
13
 
14
14
  # Credits
react/experimental.d.ts CHANGED
@@ -125,27 +125,25 @@ declare module "." {
125
125
  name: string;
126
126
  }
127
127
 
128
+ export type ViewTransitionClassPerType = Record<"default" | (string & {}), "none" | "auto" | (string & {})>;
129
+ export type ViewTransitionClass = ViewTransitionClassPerType | ViewTransitionClassPerType[string];
130
+
128
131
  export interface ViewTransitionProps {
129
132
  children?: ReactNode | undefined;
130
133
  /**
131
134
  * Assigns the {@link https://developer.chrome.com/blog/view-transitions-update-io24#view-transition-class `view-transition-class`} class to the underlying DOM node.
132
135
  */
133
- className?: string | undefined;
136
+ default?: ViewTransitionClass | undefined;
134
137
  /**
135
138
  * Combined with {@link className} if this `<ViewTransition>` or its parent Component is mounted and there's no other with the same name being deleted.
136
139
  * `"none"` is a special value that deactivates the view transition name under that condition.
137
140
  */
138
- enter?: "none" | (string & {}) | undefined;
141
+ enter?: ViewTransitionClass | undefined;
139
142
  /**
140
143
  * Combined with {@link className} if this `<ViewTransition>` or its parent Component is unmounted and there's no other with the same name being deleted.
141
144
  * `"none"` is a special value that deactivates the view transition name under that condition.
142
145
  */
143
- exit?: "none" | (string & {}) | undefined;
144
- /**
145
- * Combined with {@link className} there are no updates to the content inside this boundary itself but the boundary has resized or moved due to other changes to siblings.
146
- * `"none"` is a special value that deactivates the view transition name under that condition.
147
- */
148
- layout?: "none" | (string & {}) | undefined;
146
+ exit?: ViewTransitionClass | undefined;
149
147
  /**
150
148
  * "auto" will automatically assign a view-transition-name to the inner DOM node.
151
149
  * That way you can add a View Transition to a Component without controlling its DOM nodes styling otherwise.
@@ -157,34 +155,30 @@ declare module "." {
157
155
  /**
158
156
  * The `<ViewTransition>` or its parent Component is mounted and there's no other `<ViewTransition>` with the same name being deleted.
159
157
  */
160
- onEnter?: (instance: ViewTransitionInstance) => void;
158
+ onEnter?: (instance: ViewTransitionInstance, types: Array<string>) => void;
161
159
  /**
162
160
  * The `<ViewTransition>` or its parent Component is unmounted and there's no other `<ViewTransition>` with the same name being deleted.
163
161
  */
164
- onExit?: (instance: ViewTransitionInstance) => void;
165
- /**
166
- * There are no updates to the content inside this `<ViewTransition>` boundary itself but the boundary has resized or moved due to other changes to siblings.
167
- */
168
- onLayout?: (instance: ViewTransitionInstance) => void;
162
+ onExit?: (instance: ViewTransitionInstance, types: Array<string>) => void;
169
163
  /**
170
164
  * This `<ViewTransition>` is being mounted and another `<ViewTransition>` instance with the same name is being unmounted elsewhere.
171
165
  */
172
- onShare?: (instance: ViewTransitionInstance) => void;
166
+ onShare?: (instance: ViewTransitionInstance, types: Array<string>) => void;
173
167
  /**
174
168
  * The content of `<ViewTransition>` has changed either due to DOM mutations or because an inner child `<ViewTransition>` has resized.
175
169
  */
176
- onUpdate?: (instance: ViewTransitionInstance) => void;
170
+ onUpdate?: (instance: ViewTransitionInstance, types: Array<string>) => void;
177
171
  ref?: Ref<ViewTransitionInstance> | undefined;
178
172
  /**
179
173
  * Combined with {@link className} if this `<ViewTransition>` is being mounted and another instance with the same name is being unmounted elsewhere.
180
174
  * `"none"` is a special value that deactivates the view transition name under that condition.
181
175
  */
182
- share?: "none" | (string & {}) | undefined;
176
+ share?: ViewTransitionClass | undefined;
183
177
  /**
184
178
  * Combined with {@link className} if the content of this `<ViewTransition>` has changed either due to DOM mutations or because an inner child has resized.
185
179
  * `"none"` is a special value that deactivates the view transition name under that condition.
186
180
  */
187
- update?: "none" | (string & {}) | undefined;
181
+ update?: ViewTransitionClass | undefined;
188
182
  }
189
183
 
190
184
  /**
@@ -196,17 +190,21 @@ declare module "." {
196
190
  */
197
191
  export const unstable_ViewTransition: ExoticComponent<ViewTransitionProps>;
198
192
 
193
+ export function unstable_addTransitionType(type: string): void;
194
+
195
+ // @enableGestureTransition
199
196
  // Implemented by the specific renderer e.g. `react-dom`.
200
197
  // Keep in mind that augmented interfaces merge their JSDoc so if you put
201
198
  // JSDoc here and in the renderer, the IDE will display both.
202
199
  export interface GestureProvider {}
203
-
204
- export type StartGesture = (gestureProvider: GestureProvider) => () => void;
205
-
200
+ export interface GestureOptions {
201
+ rangeStart?: number | undefined;
202
+ rangeEnd?: number | undefined;
203
+ }
206
204
  /** */
207
- export function unstable_useSwipeTransition<Value>(
208
- previous: Value,
209
- current: Value,
210
- next: Value,
211
- ): [value: Value, startGesture: StartGesture];
205
+ export function unstable_startGestureTransition(
206
+ provider: GestureProvider,
207
+ scope: () => void,
208
+ options?: GestureOptions,
209
+ ): () => void;
212
210
  }
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "19.0.12",
3
+ "version": "19.0.13",
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": "d6d39c1d98bf77944b5e2f9ed07ca37b70c29b96a108614db9e4b4d5ca8a106d",
209
- "typeScriptVersion": "5.0"
208
+ "typesPublisherContentHash": "38786eb73152e3fd0ce837f2250de108f3c57ca200e55b366f844b148d56ada2",
209
+ "typeScriptVersion": "5.1"
210
210
  }
@@ -125,27 +125,25 @@ declare module "." {
125
125
  name: string;
126
126
  }
127
127
 
128
+ export type ViewTransitionClassPerType = Record<"default" | (string & {}), "none" | "auto" | (string & {})>;
129
+ export type ViewTransitionClass = ViewTransitionClassPerType | ViewTransitionClassPerType[string];
130
+
128
131
  export interface ViewTransitionProps {
129
132
  children?: ReactNode | undefined;
130
133
  /**
131
134
  * Assigns the {@link https://developer.chrome.com/blog/view-transitions-update-io24#view-transition-class `view-transition-class`} class to the underlying DOM node.
132
135
  */
133
- className?: string | undefined;
136
+ default?: ViewTransitionClass | undefined;
134
137
  /**
135
138
  * Combined with {@link className} if this `<ViewTransition>` or its parent Component is mounted and there's no other with the same name being deleted.
136
139
  * `"none"` is a special value that deactivates the view transition name under that condition.
137
140
  */
138
- enter?: "none" | (string & {}) | undefined;
141
+ enter?: ViewTransitionClass | undefined;
139
142
  /**
140
143
  * Combined with {@link className} if this `<ViewTransition>` or its parent Component is unmounted and there's no other with the same name being deleted.
141
144
  * `"none"` is a special value that deactivates the view transition name under that condition.
142
145
  */
143
- exit?: "none" | (string & {}) | undefined;
144
- /**
145
- * Combined with {@link className} there are no updates to the content inside this boundary itself but the boundary has resized or moved due to other changes to siblings.
146
- * `"none"` is a special value that deactivates the view transition name under that condition.
147
- */
148
- layout?: "none" | (string & {}) | undefined;
146
+ exit?: ViewTransitionClass | undefined;
149
147
  /**
150
148
  * "auto" will automatically assign a view-transition-name to the inner DOM node.
151
149
  * That way you can add a View Transition to a Component without controlling its DOM nodes styling otherwise.
@@ -157,34 +155,30 @@ declare module "." {
157
155
  /**
158
156
  * The `<ViewTransition>` or its parent Component is mounted and there's no other `<ViewTransition>` with the same name being deleted.
159
157
  */
160
- onEnter?: (instance: ViewTransitionInstance) => void;
158
+ onEnter?: (instance: ViewTransitionInstance, types: Array<string>) => void;
161
159
  /**
162
160
  * The `<ViewTransition>` or its parent Component is unmounted and there's no other `<ViewTransition>` with the same name being deleted.
163
161
  */
164
- onExit?: (instance: ViewTransitionInstance) => void;
165
- /**
166
- * There are no updates to the content inside this `<ViewTransition>` boundary itself but the boundary has resized or moved due to other changes to siblings.
167
- */
168
- onLayout?: (instance: ViewTransitionInstance) => void;
162
+ onExit?: (instance: ViewTransitionInstance, types: Array<string>) => void;
169
163
  /**
170
164
  * This `<ViewTransition>` is being mounted and another `<ViewTransition>` instance with the same name is being unmounted elsewhere.
171
165
  */
172
- onShare?: (instance: ViewTransitionInstance) => void;
166
+ onShare?: (instance: ViewTransitionInstance, types: Array<string>) => void;
173
167
  /**
174
168
  * The content of `<ViewTransition>` has changed either due to DOM mutations or because an inner child `<ViewTransition>` has resized.
175
169
  */
176
- onUpdate?: (instance: ViewTransitionInstance) => void;
170
+ onUpdate?: (instance: ViewTransitionInstance, types: Array<string>) => void;
177
171
  ref?: Ref<ViewTransitionInstance> | undefined;
178
172
  /**
179
173
  * Combined with {@link className} if this `<ViewTransition>` is being mounted and another instance with the same name is being unmounted elsewhere.
180
174
  * `"none"` is a special value that deactivates the view transition name under that condition.
181
175
  */
182
- share?: "none" | (string & {}) | undefined;
176
+ share?: ViewTransitionClass | undefined;
183
177
  /**
184
178
  * Combined with {@link className} if the content of this `<ViewTransition>` has changed either due to DOM mutations or because an inner child has resized.
185
179
  * `"none"` is a special value that deactivates the view transition name under that condition.
186
180
  */
187
- update?: "none" | (string & {}) | undefined;
181
+ update?: ViewTransitionClass | undefined;
188
182
  }
189
183
 
190
184
  /**
@@ -196,17 +190,21 @@ declare module "." {
196
190
  */
197
191
  export const unstable_ViewTransition: ExoticComponent<ViewTransitionProps>;
198
192
 
193
+ export function unstable_addTransitionType(type: string): void;
194
+
195
+ // @enableGestureTransition
199
196
  // Implemented by the specific renderer e.g. `react-dom`.
200
197
  // Keep in mind that augmented interfaces merge their JSDoc so if you put
201
198
  // JSDoc here and in the renderer, the IDE will display both.
202
199
  export interface GestureProvider {}
203
-
204
- export type StartGesture = (gestureProvider: GestureProvider) => () => void;
205
-
200
+ export interface GestureOptions {
201
+ rangeStart?: number | undefined;
202
+ rangeEnd?: number | undefined;
203
+ }
206
204
  /** */
207
- export function unstable_useSwipeTransition<Value>(
208
- previous: Value,
209
- current: Value,
210
- next: Value,
211
- ): [value: Value, startGesture: StartGesture];
205
+ export function unstable_startGestureTransition(
206
+ provider: GestureProvider,
207
+ scope: () => void,
208
+ options?: GestureOptions,
209
+ ): () => void;
212
210
  }