@types/react 19.0.2 → 19.0.4

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, 18 Dec 2024 16:02:33 GMT
11
+ * Last updated: Wed, 08 Jan 2025 20:02:26 GMT
12
12
  * Dependencies: [csstype](https://npmjs.com/package/csstype)
13
13
 
14
14
  # Credits
react/experimental.d.ts CHANGED
@@ -122,4 +122,29 @@ declare module "." {
122
122
  value: TaintableUniqueValue,
123
123
  ): void;
124
124
  function experimental_taintObjectReference(message: string | undefined, object: Reference): void;
125
+
126
+ export interface ViewTransitionProps {
127
+ /**
128
+ * Assigns the {@link https://developer.chrome.com/blog/view-transitions-update-io24#view-transition-class `view-transition-class`} class to the underlying DOM node.
129
+ */
130
+ className?: string | undefined;
131
+ /**
132
+ * "auto" will automatically assign a view-transition-name to the inner DOM node.
133
+ * That way you can add a View Transition to a Component without controlling its DOM nodes styling otherwise.
134
+ *
135
+ * 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.
136
+ * @default "auto"
137
+ */
138
+ name?: "auto" | (string & {}) | undefined;
139
+ children?: ReactNode | undefined;
140
+ }
141
+
142
+ /**
143
+ * Opt-in for using {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API View Transitions} in React.
144
+ * View Transitions only trigger for async updates like {@link startTransition}, {@link useDeferredValue}, Actions or <{@link Suspense}> revealing from fallback to content.
145
+ * Synchronous updates provide an opt-out but also guarantee that they commit immediately which View Transitions can't.
146
+ *
147
+ * @see {@link https://github.com/facebook/react/pull/31975}
148
+ */
149
+ export const unstable_ViewTransition: ExoticComponent<ViewTransitionProps>;
125
150
  }
react/index.d.ts CHANGED
@@ -1864,7 +1864,6 @@ declare namespace React {
1864
1864
  * @param callback A function which causes state updates that can be deferred.
1865
1865
  */
1866
1866
  export function startTransition(scope: TransitionFunction): void;
1867
- export function startTransition(scope: TransitionFunction): void;
1868
1867
 
1869
1868
  /**
1870
1869
  * Wrap any code rendering and triggering updates to your components into `act()` calls.
react/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/react",
3
- "version": "19.0.2",
3
+ "version": "19.0.4",
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": "49591d334257359a89d9faf6b1929eb43b48a5e149f50204b56abcc5690a9bdf",
208
+ "typesPublisherContentHash": "1faca4a7f97d59261f420b0b437332c7e5513b5febbebb40d1599180f6e27b64",
209
209
  "typeScriptVersion": "5.0"
210
210
  }
@@ -122,4 +122,29 @@ declare module "." {
122
122
  value: TaintableUniqueValue,
123
123
  ): void;
124
124
  function experimental_taintObjectReference(message: string | undefined, object: Reference): void;
125
+
126
+ export interface ViewTransitionProps {
127
+ /**
128
+ * Assigns the {@link https://developer.chrome.com/blog/view-transitions-update-io24#view-transition-class `view-transition-class`} class to the underlying DOM node.
129
+ */
130
+ className?: string | undefined;
131
+ /**
132
+ * "auto" will automatically assign a view-transition-name to the inner DOM node.
133
+ * That way you can add a View Transition to a Component without controlling its DOM nodes styling otherwise.
134
+ *
135
+ * 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.
136
+ * @default "auto"
137
+ */
138
+ name?: "auto" | (string & {}) | undefined;
139
+ children?: ReactNode | undefined;
140
+ }
141
+
142
+ /**
143
+ * Opt-in for using {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API View Transitions} in React.
144
+ * View Transitions only trigger for async updates like {@link startTransition}, {@link useDeferredValue}, Actions or <{@link Suspense}> revealing from fallback to content.
145
+ * Synchronous updates provide an opt-out but also guarantee that they commit immediately which View Transitions can't.
146
+ *
147
+ * @see {@link https://github.com/facebook/react/pull/31975}
148
+ */
149
+ export const unstable_ViewTransition: ExoticComponent<ViewTransitionProps>;
125
150
  }
react/ts5.0/index.d.ts CHANGED
@@ -1863,7 +1863,6 @@ declare namespace React {
1863
1863
  * @param callback A function which causes state updates that can be deferred.
1864
1864
  */
1865
1865
  export function startTransition(scope: TransitionFunction): void;
1866
- export function startTransition(scope: TransitionFunction): void;
1867
1866
 
1868
1867
  /**
1869
1868
  * Wrap any code rendering and triggering updates to your components into `act()` calls.