@types/react 19.0.9 → 19.0.11

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: Sun, 16 Feb 2025 12:44:21 GMT
11
+ * Last updated: Mon, 17 Mar 2025 21:32:53 GMT
12
12
  * Dependencies: [csstype](https://npmjs.com/package/csstype)
13
13
 
14
14
  # Credits
react/experimental.d.ts CHANGED
@@ -195,4 +195,18 @@ declare module "." {
195
195
  * @see {@link https://github.com/facebook/react/pull/31975}
196
196
  */
197
197
  export const unstable_ViewTransition: ExoticComponent<ViewTransitionProps>;
198
+
199
+ // Implemented by the specific renderer e.g. `react-dom`.
200
+ // Keep in mind that augmented interfaces merge their JSDoc so if you put
201
+ // JSDoc here and in the renderer, the IDE will display both.
202
+ export interface GestureProvider {}
203
+
204
+ export type StartGesture = (gestureProvider: GestureProvider) => () => void;
205
+
206
+ /** */
207
+ export function unstable_useSwipeTransition<Value>(
208
+ previous: Value,
209
+ current: Value,
210
+ next: Value,
211
+ ): [value: Value, startGesture: StartGesture];
198
212
  }
react/index.d.ts CHANGED
@@ -1177,7 +1177,7 @@ declare namespace React {
1177
1177
  * If false is returned, {@link Component.render}, `componentWillUpdate`
1178
1178
  * and `componentDidUpdate` will not be called.
1179
1179
  */
1180
- shouldComponentUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>): boolean;
1180
+ shouldComponentUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): boolean;
1181
1181
  /**
1182
1182
  * Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
1183
1183
  * cancelled network requests, or cleaning up any DOM elements created in `componentDidMount`.
@@ -1276,7 +1276,7 @@ declare namespace React {
1276
1276
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props}
1277
1277
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1278
1278
  */
1279
- componentWillReceiveProps?(nextProps: Readonly<P>): void;
1279
+ componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
1280
1280
  /**
1281
1281
  * Called when the component may be receiving new props.
1282
1282
  * React may call this even if props have not changed, so be sure to compare new and existing
@@ -1294,7 +1294,7 @@ declare namespace React {
1294
1294
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props}
1295
1295
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1296
1296
  */
1297
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P>): void;
1297
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
1298
1298
  /**
1299
1299
  * Called immediately before rendering when new props or state is received. Not called for the initial render.
1300
1300
  *
@@ -1308,7 +1308,7 @@ declare namespace React {
1308
1308
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update}
1309
1309
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1310
1310
  */
1311
- componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>): void;
1311
+ componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
1312
1312
  /**
1313
1313
  * Called immediately before rendering when new props or state is received. Not called for the initial render.
1314
1314
  *
@@ -1324,7 +1324,7 @@ declare namespace React {
1324
1324
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update}
1325
1325
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1326
1326
  */
1327
- UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>): void;
1327
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
1328
1328
  }
1329
1329
 
1330
1330
  function createRef<T>(): RefObject<T | null>;
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "19.0.9",
3
+ "version": "19.0.11",
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": "da61cd14a456db728da7a08fe8f1531a8fa359708106498f19f9321ef393e111",
208
+ "typesPublisherContentHash": "38b67ce09dd4f4133e0566919623c25f533604809d210ab72f951700c866cb83",
209
209
  "typeScriptVersion": "5.0"
210
210
  }
@@ -195,4 +195,18 @@ declare module "." {
195
195
  * @see {@link https://github.com/facebook/react/pull/31975}
196
196
  */
197
197
  export const unstable_ViewTransition: ExoticComponent<ViewTransitionProps>;
198
+
199
+ // Implemented by the specific renderer e.g. `react-dom`.
200
+ // Keep in mind that augmented interfaces merge their JSDoc so if you put
201
+ // JSDoc here and in the renderer, the IDE will display both.
202
+ export interface GestureProvider {}
203
+
204
+ export type StartGesture = (gestureProvider: GestureProvider) => () => void;
205
+
206
+ /** */
207
+ export function unstable_useSwipeTransition<Value>(
208
+ previous: Value,
209
+ current: Value,
210
+ next: Value,
211
+ ): [value: Value, startGesture: StartGesture];
198
212
  }
react/ts5.0/index.d.ts CHANGED
@@ -1176,7 +1176,7 @@ declare namespace React {
1176
1176
  * If false is returned, {@link Component.render}, `componentWillUpdate`
1177
1177
  * and `componentDidUpdate` will not be called.
1178
1178
  */
1179
- shouldComponentUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>): boolean;
1179
+ shouldComponentUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): boolean;
1180
1180
  /**
1181
1181
  * Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
1182
1182
  * cancelled network requests, or cleaning up any DOM elements created in `componentDidMount`.
@@ -1275,7 +1275,7 @@ declare namespace React {
1275
1275
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props}
1276
1276
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1277
1277
  */
1278
- componentWillReceiveProps?(nextProps: Readonly<P>): void;
1278
+ componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
1279
1279
  /**
1280
1280
  * Called when the component may be receiving new props.
1281
1281
  * React may call this even if props have not changed, so be sure to compare new and existing
@@ -1293,7 +1293,7 @@ declare namespace React {
1293
1293
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props}
1294
1294
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1295
1295
  */
1296
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P>): void;
1296
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
1297
1297
  /**
1298
1298
  * Called immediately before rendering when new props or state is received. Not called for the initial render.
1299
1299
  *
@@ -1307,7 +1307,7 @@ declare namespace React {
1307
1307
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update}
1308
1308
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1309
1309
  */
1310
- componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>): void;
1310
+ componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
1311
1311
  /**
1312
1312
  * Called immediately before rendering when new props or state is received. Not called for the initial render.
1313
1313
  *
@@ -1323,7 +1323,7 @@ declare namespace React {
1323
1323
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update}
1324
1324
  * @see {@link https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path}
1325
1325
  */
1326
- UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>): void;
1326
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void;
1327
1327
  }
1328
1328
 
1329
1329
  function createRef<T>(): RefObject<T | null>;