@types/react 19.1.2 → 19.2.10

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.
@@ -43,18 +43,22 @@ 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
- export type SuspenseListRevealOrder = "forwards" | "backwards" | "together";
55
- export type SuspenseListTailMode = "collapsed" | "hidden";
55
+ export type SuspenseListRevealOrder = "forwards" | "backwards" | "together" | "independent";
56
+ export type SuspenseListTailMode = "collapsed" | "hidden" | "visible";
56
57
 
57
58
  export interface SuspenseListCommonProps {
59
+ }
60
+
61
+ interface DirectionalSuspenseListProps extends SuspenseListCommonProps {
58
62
  /**
59
63
  * Note that SuspenseList require more than one child;
60
64
  * it is a runtime warning to provide only a single child.
@@ -62,33 +66,34 @@ declare module "." {
62
66
  * It does, however, allow those children to be wrapped inside a single
63
67
  * level of `<React.Fragment>`.
64
68
  */
65
- children: ReactElement | Iterable<ReactElement>;
66
- }
67
-
68
- interface DirectionalSuspenseListProps extends SuspenseListCommonProps {
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";
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
- * - `hidden` doesnt show any unloaded items.
79
+ * - `hidden` doesn't show any unloaded items.
80
+ * - `visible` shows all fallbacks in the list.
81
+ *
82
+ * @default "hidden"
79
83
  */
80
84
  tail?: SuspenseListTailMode | undefined;
81
85
  }
82
86
 
83
87
  interface NonDirectionalSuspenseListProps extends SuspenseListCommonProps {
88
+ children: ReactNode;
84
89
  /**
85
90
  * Defines the order in which the `SuspenseList` children should be revealed.
86
91
  */
87
- revealOrder?: Exclude<SuspenseListRevealOrder, DirectionalSuspenseListProps["revealOrder"]> | undefined;
92
+ revealOrder: Exclude<SuspenseListRevealOrder, DirectionalSuspenseListProps["revealOrder"]>;
88
93
  /**
89
94
  * The tail property is invalid when not using the `forwards` or `backwards` reveal orders.
90
95
  */
91
- tail?: never | undefined;
96
+ tail?: never;
92
97
  }
93
98
 
94
99
  export type SuspenseListProps = DirectionalSuspenseListProps | NonDirectionalSuspenseListProps;
@@ -106,9 +111,6 @@ declare module "." {
106
111
  */
107
112
  export const unstable_SuspenseList: ExoticComponent<SuspenseListProps>;
108
113
 
109
- // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
110
- export function experimental_useEffectEvent<T extends Function>(event: T): T;
111
-
112
114
  type Reference = object;
113
115
  type TaintableUniqueValue = string | bigint | ArrayBufferView;
114
116
  function experimental_taintUniqueValue(
@@ -118,80 +120,6 @@ declare module "." {
118
120
  ): void;
119
121
  function experimental_taintObjectReference(message: string | undefined, object: Reference): void;
120
122
 
121
- export interface ViewTransitionInstance {
122
- /**
123
- * The {@link ViewTransitionProps name} that was used in the corresponding {@link ViewTransition} component or `"auto"` if the `name` prop was omitted.
124
- */
125
- name: string;
126
- }
127
-
128
- export type ViewTransitionClassPerType = Record<"default" | (string & {}), "none" | "auto" | (string & {})>;
129
- export type ViewTransitionClass = ViewTransitionClassPerType | ViewTransitionClassPerType[string];
130
-
131
- export interface ViewTransitionProps {
132
- children?: ReactNode | undefined;
133
- /**
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.
135
- */
136
- default?: ViewTransitionClass | undefined;
137
- /**
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.
139
- * `"none"` is a special value that deactivates the view transition name under that condition.
140
- */
141
- enter?: ViewTransitionClass | undefined;
142
- /**
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.
144
- * `"none"` is a special value that deactivates the view transition name under that condition.
145
- */
146
- exit?: ViewTransitionClass | undefined;
147
- /**
148
- * "auto" will automatically assign a view-transition-name to the inner DOM node.
149
- * That way you can add a View Transition to a Component without controlling its DOM nodes styling otherwise.
150
- *
151
- * 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.
152
- * @default "auto"
153
- */
154
- name?: "auto" | (string & {}) | undefined;
155
- /**
156
- * The `<ViewTransition>` or its parent Component is mounted and there's no other `<ViewTransition>` with the same name being deleted.
157
- */
158
- onEnter?: (instance: ViewTransitionInstance, types: Array<string>) => void;
159
- /**
160
- * The `<ViewTransition>` or its parent Component is unmounted and there's no other `<ViewTransition>` with the same name being deleted.
161
- */
162
- onExit?: (instance: ViewTransitionInstance, types: Array<string>) => void;
163
- /**
164
- * This `<ViewTransition>` is being mounted and another `<ViewTransition>` instance with the same name is being unmounted elsewhere.
165
- */
166
- onShare?: (instance: ViewTransitionInstance, types: Array<string>) => void;
167
- /**
168
- * The content of `<ViewTransition>` has changed either due to DOM mutations or because an inner child `<ViewTransition>` has resized.
169
- */
170
- onUpdate?: (instance: ViewTransitionInstance, types: Array<string>) => void;
171
- ref?: Ref<ViewTransitionInstance> | undefined;
172
- /**
173
- * Combined with {@link className} if this `<ViewTransition>` is being mounted and another instance with the same name is being unmounted elsewhere.
174
- * `"none"` is a special value that deactivates the view transition name under that condition.
175
- */
176
- share?: ViewTransitionClass | undefined;
177
- /**
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.
179
- * `"none"` is a special value that deactivates the view transition name under that condition.
180
- */
181
- update?: ViewTransitionClass | undefined;
182
- }
183
-
184
- /**
185
- * Opt-in for using {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API View Transitions} in React.
186
- * View Transitions only trigger for async updates like {@link startTransition}, {@link useDeferredValue}, Actions or <{@link Suspense}> revealing from fallback to content.
187
- * Synchronous updates provide an opt-out but also guarantee that they commit immediately which View Transitions can't.
188
- *
189
- * @see {@link https://github.com/facebook/react/pull/31975}
190
- */
191
- export const unstable_ViewTransition: ExoticComponent<ViewTransitionProps>;
192
-
193
- export function unstable_addTransitionType(type: string): void;
194
-
195
123
  // @enableGestureTransition
196
124
  // Implemented by the specific renderer e.g. `react-dom`.
197
125
  // Keep in mind that augmented interfaces merge their JSDoc so if you put
@@ -201,6 +129,9 @@ declare module "." {
201
129
  rangeStart?: number | undefined;
202
130
  rangeEnd?: number | undefined;
203
131
  }
132
+ export type GestureOptionsRequired = {
133
+ [P in keyof GestureOptions]-?: NonNullable<GestureOptions[P]>;
134
+ };
204
135
  /** */
205
136
  export function unstable_startGestureTransition(
206
137
  provider: GestureProvider,
@@ -208,28 +139,33 @@ declare module "." {
208
139
  options?: GestureOptions,
209
140
  ): () => void;
210
141
 
211
- // @enableFragmentRefs
212
- export interface FragmentInstance {}
213
-
214
- export interface FragmentProps {
215
- ref?: Ref<FragmentInstance> | undefined;
216
- }
217
-
218
- // @enableActivity
219
- export interface ActivityProps {
220
- /**
221
- * @default "visible"
222
- */
223
- mode?:
224
- | "hidden"
225
- | "visible"
226
- | undefined;
227
- children: ReactNode;
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);
228
167
  }
229
168
 
230
- /** */
231
- export const unstable_Activity: ExoticComponent<ActivityProps>;
232
-
233
169
  // @enableSrcObject
234
170
  interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_IMG_SRC_TYPES {
235
171
  srcObject: Blob;
react/ts5.0/global.d.ts CHANGED
@@ -13,10 +13,12 @@ interface ClipboardEvent extends Event {}
13
13
  interface CompositionEvent extends Event {}
14
14
  interface DragEvent extends Event {}
15
15
  interface FocusEvent extends Event {}
16
+ interface InputEvent extends Event {}
16
17
  interface KeyboardEvent extends Event {}
17
18
  interface MouseEvent extends Event {}
18
19
  interface TouchEvent extends Event {}
19
20
  interface PointerEvent extends Event {}
21
+ interface SubmitEvent extends Event {}
20
22
  interface ToggleEvent extends Event {}
21
23
  interface TransitionEvent extends Event {}
22
24
  interface UIEvent extends Event {}
react/ts5.0/index.d.ts CHANGED
@@ -11,10 +11,12 @@ type NativeClipboardEvent = ClipboardEvent;
11
11
  type NativeCompositionEvent = CompositionEvent;
12
12
  type NativeDragEvent = DragEvent;
13
13
  type NativeFocusEvent = FocusEvent;
14
+ type NativeInputEvent = InputEvent;
14
15
  type NativeKeyboardEvent = KeyboardEvent;
15
16
  type NativeMouseEvent = MouseEvent;
16
17
  type NativeTouchEvent = TouchEvent;
17
18
  type NativePointerEvent = PointerEvent;
19
+ type NativeSubmitEvent = SubmitEvent;
18
20
  type NativeToggleEvent = ToggleEvent;
19
21
  type NativeTransitionEvent = TransitionEvent;
20
22
  type NativeUIEvent = UIEvent;
@@ -134,7 +136,7 @@ declare namespace React {
134
136
  props: P,
135
137
  ) => ReactElement<any, any> | null)
136
138
  // constructor signature must match React.Component
137
- | (new(props: P) => Component<any, any>);
139
+ | (new(props: P, context: any) => Component<any, any>);
138
140
 
139
141
  /**
140
142
  * Created by {@link createRef}, or {@link useRef} when passed `null`.
@@ -217,7 +219,7 @@ declare namespace React {
217
219
  type ElementRef<
218
220
  C extends
219
221
  | ForwardRefExoticComponent<any>
220
- | { new(props: any): Component<any> }
222
+ | { new(props: any, context: any): Component<any> }
221
223
  | ((props: any) => ReactElement | null)
222
224
  | keyof JSX.IntrinsicElements,
223
225
  > = ComponentRef<C>;
@@ -928,7 +930,7 @@ declare namespace React {
928
930
  static propTypes?: any;
929
931
 
930
932
  /**
931
- * If using the new style context, re-declare this in your class to be the
933
+ * If using React Context, re-declare this in your class to be the
932
934
  * `React.ContextType` of your `static contextType`.
933
935
  * Should be used with type annotation or static contextType.
934
936
  *
@@ -947,6 +949,14 @@ declare namespace React {
947
949
 
948
950
  // Keep in sync with constructor signature of JSXElementConstructor and ComponentClass.
949
951
  constructor(props: P);
952
+ /**
953
+ * @param props
954
+ * @param context value of the parent {@link https://react.dev/reference/react/Component#context Context} specified
955
+ * in `contextType`.
956
+ */
957
+ // TODO: Ideally we'd infer the constructor signatur from `contextType`.
958
+ // Might be hard to ship without breaking existing code.
959
+ constructor(props: P, context: any);
950
960
 
951
961
  // We MUST keep setState() as a unified signature because it allows proper checking of the method return type.
952
962
  // See: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18365#issuecomment-351013257
@@ -1116,7 +1126,14 @@ declare namespace React {
1116
1126
  */
1117
1127
  interface ComponentClass<P = {}, S = ComponentState> extends StaticLifecycle<P, S> {
1118
1128
  // constructor signature must match React.Component
1119
- new(props: P): Component<P, S>;
1129
+ new(
1130
+ props: P,
1131
+ /**
1132
+ * Value of the parent {@link https://react.dev/reference/react/Component#context Context} specified
1133
+ * in `contextType`.
1134
+ */
1135
+ context?: any,
1136
+ ): Component<P, S>;
1120
1137
  /**
1121
1138
  * Ignored by React.
1122
1139
  * @deprecated Only kept in types for backwards compatibility. Will be removed in a future major release.
@@ -1156,7 +1173,7 @@ declare namespace React {
1156
1173
  */
1157
1174
  type ClassType<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>> =
1158
1175
  & C
1159
- & (new(props: P) => T);
1176
+ & (new(props: P, context: any) => T);
1160
1177
 
1161
1178
  //
1162
1179
  // Component Specs and Lifecycle
@@ -1683,20 +1700,6 @@ declare namespace React {
1683
1700
  reducer: (prevState: S, ...args: A) => S,
1684
1701
  initialState: S,
1685
1702
  ): [S, ActionDispatch<A>];
1686
- /**
1687
- * An alternative to `useState`.
1688
- *
1689
- * `useReducer` is usually preferable to `useState` when you have complex state logic that involves
1690
- * multiple sub-values. It also lets you optimize performance for components that trigger deep
1691
- * updates because you can pass `dispatch` down instead of callbacks.
1692
- *
1693
- * @version 16.8.0
1694
- * @see {@link https://react.dev/reference/react/useReducer}
1695
- */
1696
- function useReducer<S, A extends AnyActionArg>(
1697
- reducer: (prevState: S, ...args: A) => S,
1698
- initialState: S,
1699
- ): [S, ActionDispatch<A>];
1700
1703
  /**
1701
1704
  * An alternative to `useState`.
1702
1705
  *
@@ -1771,13 +1774,17 @@ declare namespace React {
1771
1774
  * @see {@link https://react.dev/reference/react/useEffect}
1772
1775
  */
1773
1776
  function useEffect(effect: EffectCallback, deps?: DependencyList): void;
1777
+ /**
1778
+ * @see {@link https://react.dev/reference/react/useEffectEvent `useEffectEvent()` documentation}
1779
+ * @version 19.2.0
1780
+ */
1781
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
1782
+ export function useEffectEvent<T extends Function>(callback: T): T;
1774
1783
  // NOTE: this does not accept strings, but this will have to be fixed by removing strings from type Ref<T>
1775
1784
  /**
1776
1785
  * `useImperativeHandle` customizes the instance value that is exposed to parent components when using
1777
1786
  * `ref`. As always, imperative code using refs should be avoided in most cases.
1778
1787
  *
1779
- * `useImperativeHandle` should be used with `React.forwardRef`.
1780
- *
1781
1788
  * @version 16.8.0
1782
1789
  * @see {@link https://react.dev/reference/react/useImperativeHandle}
1783
1790
  */
@@ -1919,7 +1926,31 @@ declare namespace React {
1919
1926
  reducer: (state: State, action: Action) => State,
1920
1927
  ): [State, (action: Action) => void];
1921
1928
 
1922
- 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>;
1923
1954
 
1924
1955
  export function use<T>(usable: Usable<T>): T;
1925
1956
 
@@ -1937,10 +1968,39 @@ declare namespace React {
1937
1968
  // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
1938
1969
  export function cache<CachedFunction extends Function>(fn: CachedFunction): CachedFunction;
1939
1970
 
1971
+ export interface CacheSignal {}
1972
+ /**
1973
+ * @version 19.2.0
1974
+ */
1975
+ export function cacheSignal(): null | CacheSignal;
1976
+
1977
+ export interface ActivityProps {
1978
+ /**
1979
+ * @default "visible"
1980
+ */
1981
+ mode?:
1982
+ | "hidden"
1983
+ | "visible"
1984
+ | undefined;
1985
+ /**
1986
+ * A name for this Activity boundary for instrumentation purposes.
1987
+ * The name will help identify this boundary in React DevTools.
1988
+ */
1989
+ name?: string | undefined;
1990
+ children: ReactNode;
1991
+ }
1992
+
1993
+ /**
1994
+ * @see {@link https://react.dev/reference/react/Activity `<Activity>` documentation}
1995
+ * @version 19.2.0
1996
+ */
1997
+ export const Activity: ExoticComponent<ActivityProps>;
1998
+
1940
1999
  /**
1941
2000
  * Warning: Only available in development builds.
1942
2001
  *
1943
2002
  * @see {@link https://react.dev/reference/react/captureOwnerStack Reference docs}
2003
+ * @version 19.1.0
1944
2004
  */
1945
2005
  function captureOwnerStack(): string | null;
1946
2006
 
@@ -2005,15 +2065,32 @@ declare namespace React {
2005
2065
  target: EventTarget & Target;
2006
2066
  }
2007
2067
 
2068
+ /**
2069
+ * @deprecated FormEvent doesn't actually exist.
2070
+ * You probably meant to use {@link ChangeEvent}, {@link InputEvent}, {@link SubmitEvent}, or just {@link SyntheticEvent} instead
2071
+ * depending on the event type.
2072
+ */
2008
2073
  interface FormEvent<T = Element> extends SyntheticEvent<T> {
2009
2074
  }
2010
2075
 
2011
2076
  interface InvalidEvent<T = Element> extends SyntheticEvent<T> {
2012
- target: EventTarget & T;
2013
2077
  }
2014
2078
 
2015
- interface ChangeEvent<T = Element> extends SyntheticEvent<T> {
2016
- target: EventTarget & T;
2079
+ /**
2080
+ * change events bubble in React so their target is generally unknown.
2081
+ * Only for form elements we know their target type because form events can't
2082
+ * be nested.
2083
+ * This type exists purely to narrow `target` for form elements. It doesn't
2084
+ * reflect a DOM event. React fires change events as {@link SyntheticEvent}.
2085
+ */
2086
+ interface ChangeEvent<CurrentTarget = Element, Target = Element> extends SyntheticEvent<CurrentTarget> {
2087
+ // TODO: This is wrong for change event handlers on arbitrary. Should
2088
+ // be EventTarget & Target, but kept for backward compatibility until React 20.
2089
+ target: EventTarget & CurrentTarget;
2090
+ }
2091
+
2092
+ interface InputEvent<T = Element> extends SyntheticEvent<T, NativeInputEvent> {
2093
+ data: string;
2017
2094
  }
2018
2095
 
2019
2096
  export type ModifierKey =
@@ -2079,6 +2156,13 @@ declare namespace React {
2079
2156
  shiftKey: boolean;
2080
2157
  }
2081
2158
 
2159
+ interface SubmitEvent<T = Element> extends SyntheticEvent<T, NativeSubmitEvent> {
2160
+ // Currently not exposed by Reat
2161
+ // submitter: HTMLElement | null;
2162
+ // SubmitEvents are always targetted at HTMLFormElements.
2163
+ target: EventTarget & HTMLFormElement;
2164
+ }
2165
+
2082
2166
  interface TouchEvent<T = Element> extends UIEvent<T, NativeTouchEvent> {
2083
2167
  altKey: boolean;
2084
2168
  changedTouches: TouchList;
@@ -2134,10 +2218,19 @@ declare namespace React {
2134
2218
  type CompositionEventHandler<T = Element> = EventHandler<CompositionEvent<T>>;
2135
2219
  type DragEventHandler<T = Element> = EventHandler<DragEvent<T>>;
2136
2220
  type FocusEventHandler<T = Element> = EventHandler<FocusEvent<T>>;
2221
+ /**
2222
+ * @deprecated FormEventHandler doesn't actually exist.
2223
+ * You probably meant to use {@link ChangeEventHandler}, {@link InputEventHandler}, {@link SubmitEventHandler}, or just {@link EventHandler} instead
2224
+ * depending on the event type.
2225
+ */
2137
2226
  type FormEventHandler<T = Element> = EventHandler<FormEvent<T>>;
2138
- type ChangeEventHandler<T = Element> = EventHandler<ChangeEvent<T>>;
2227
+ type ChangeEventHandler<CurrentTarget = Element, Target = Element> = EventHandler<
2228
+ ChangeEvent<CurrentTarget, Target>
2229
+ >;
2230
+ type InputEventHandler<T = Element> = EventHandler<InputEvent<T>>;
2139
2231
  type KeyboardEventHandler<T = Element> = EventHandler<KeyboardEvent<T>>;
2140
2232
  type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>;
2233
+ type SubmitEventHandler<T = Element> = EventHandler<SubmitEvent<T>>;
2141
2234
  type TouchEventHandler<T = Element> = EventHandler<TouchEvent<T>>;
2142
2235
  type PointerEventHandler<T = Element> = EventHandler<PointerEvent<T>>;
2143
2236
  type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>;
@@ -2191,19 +2284,19 @@ declare namespace React {
2191
2284
  onBlur?: FocusEventHandler<T> | undefined;
2192
2285
  onBlurCapture?: FocusEventHandler<T> | undefined;
2193
2286
 
2194
- // Form Events
2195
- onChange?: FormEventHandler<T> | undefined;
2196
- onChangeCapture?: FormEventHandler<T> | undefined;
2197
- onBeforeInput?: FormEventHandler<T> | undefined;
2198
- onBeforeInputCapture?: FormEventHandler<T> | undefined;
2199
- onInput?: FormEventHandler<T> | undefined;
2200
- onInputCapture?: FormEventHandler<T> | undefined;
2201
- onReset?: FormEventHandler<T> | undefined;
2202
- onResetCapture?: FormEventHandler<T> | undefined;
2203
- onSubmit?: FormEventHandler<T> | undefined;
2204
- onSubmitCapture?: FormEventHandler<T> | undefined;
2205
- onInvalid?: FormEventHandler<T> | undefined;
2206
- onInvalidCapture?: FormEventHandler<T> | undefined;
2287
+ // form related Events
2288
+ onChange?: ChangeEventHandler<T> | undefined;
2289
+ onChangeCapture?: ChangeEventHandler<T> | undefined;
2290
+ onBeforeInput?: InputEventHandler<T> | undefined;
2291
+ onBeforeInputCapture?: InputEventHandler<T> | undefined;
2292
+ onInput?: InputEventHandler<T> | undefined;
2293
+ onInputCapture?: InputEventHandler<T> | undefined;
2294
+ onReset?: ReactEventHandler<T> | undefined;
2295
+ onResetCapture?: ReactEventHandler<T> | undefined;
2296
+ onSubmit?: SubmitEventHandler<T> | undefined;
2297
+ onSubmitCapture?: SubmitEventHandler<T> | undefined;
2298
+ onInvalid?: ReactEventHandler<T> | undefined;
2299
+ onInvalidCapture?: ReactEventHandler<T> | undefined;
2207
2300
 
2208
2301
  // Image Events
2209
2302
  onLoad?: ReactEventHandler<T> | undefined;
@@ -2252,8 +2345,6 @@ declare namespace React {
2252
2345
  onProgressCapture?: ReactEventHandler<T> | undefined;
2253
2346
  onRateChange?: ReactEventHandler<T> | undefined;
2254
2347
  onRateChangeCapture?: ReactEventHandler<T> | undefined;
2255
- onResize?: ReactEventHandler<T> | undefined;
2256
- onResizeCapture?: ReactEventHandler<T> | undefined;
2257
2348
  onSeeked?: ReactEventHandler<T> | undefined;
2258
2349
  onSeekedCapture?: ReactEventHandler<T> | undefined;
2259
2350
  onSeeking?: ReactEventHandler<T> | undefined;
@@ -2743,7 +2834,7 @@ declare namespace React {
2743
2834
  unselectable?: "on" | "off" | undefined;
2744
2835
 
2745
2836
  // Popover API
2746
- popover?: "" | "auto" | "manual" | undefined;
2837
+ popover?: "" | "auto" | "manual" | "hint" | undefined;
2747
2838
  popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
2748
2839
  popoverTarget?: string | undefined;
2749
2840
 
@@ -2997,6 +3088,7 @@ declare namespace React {
2997
3088
  }
2998
3089
 
2999
3090
  interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
3091
+ closedby?: "any" | "closerequest" | "none" | undefined;
3000
3092
  onCancel?: ReactEventHandler<T> | undefined;
3001
3093
  onClose?: ReactEventHandler<T> | undefined;
3002
3094
  open?: boolean | undefined;
@@ -3211,7 +3303,9 @@ declare namespace React {
3211
3303
  value?: string | readonly string[] | number | undefined;
3212
3304
  width?: number | string | undefined;
3213
3305
 
3214
- onChange?: ChangeEventHandler<T> | undefined;
3306
+ // No other element dispatching change events can be nested in a <input>
3307
+ // so we know the target will be a HTMLInputElement.
3308
+ onChange?: ChangeEventHandler<T, HTMLInputElement> | undefined;
3215
3309
  }
3216
3310
 
3217
3311
  interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
@@ -3234,6 +3328,7 @@ declare namespace React {
3234
3328
 
3235
3329
  interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
3236
3330
  as?: string | undefined;
3331
+ blocking?: "render" | (string & {}) | undefined;
3237
3332
  crossOrigin?: CrossOrigin;
3238
3333
  fetchPriority?: "high" | "low" | "auto";
3239
3334
  href?: string | undefined;
@@ -3353,10 +3448,12 @@ declare namespace React {
3353
3448
 
3354
3449
  interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
3355
3450
  async?: boolean | undefined;
3451
+ blocking?: "render" | (string & {}) | undefined;
3356
3452
  /** @deprecated */
3357
3453
  charSet?: string | undefined;
3358
3454
  crossOrigin?: CrossOrigin;
3359
3455
  defer?: boolean | undefined;
3456
+ fetchPriority?: "high" | "low" | "auto" | undefined;
3360
3457
  integrity?: string | undefined;
3361
3458
  noModule?: boolean | undefined;
3362
3459
  referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
@@ -3373,7 +3470,9 @@ declare namespace React {
3373
3470
  required?: boolean | undefined;
3374
3471
  size?: number | undefined;
3375
3472
  value?: string | readonly string[] | number | undefined;
3376
- onChange?: ChangeEventHandler<T> | undefined;
3473
+ // No other element dispatching change events can be nested in a <select>
3474
+ // so we know the target will be a HTMLSelectElement.
3475
+ onChange?: ChangeEventHandler<T, HTMLSelectElement> | undefined;
3377
3476
  }
3378
3477
 
3379
3478
  interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
@@ -3387,6 +3486,7 @@ declare namespace React {
3387
3486
  }
3388
3487
 
3389
3488
  interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
3489
+ blocking?: "render" | (string & {}) | undefined;
3390
3490
  media?: string | undefined;
3391
3491
  scoped?: boolean | undefined;
3392
3492
  type?: string | undefined;
@@ -3424,7 +3524,9 @@ declare namespace React {
3424
3524
  value?: string | readonly string[] | number | undefined;
3425
3525
  wrap?: string | undefined;
3426
3526
 
3427
- onChange?: ChangeEventHandler<T> | undefined;
3527
+ // No other element dispatching change events can be nested in a <textarea>
3528
+ // so we know the target will be a HTMLTextAreaElement.
3529
+ onChange?: ChangeEventHandler<T, HTMLTextAreaElement> | undefined;
3428
3530
  }
3429
3531
 
3430
3532
  interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
@@ -3467,6 +3569,9 @@ declare namespace React {
3467
3569
  width?: number | string | undefined;
3468
3570
  disablePictureInPicture?: boolean | undefined;
3469
3571
  disableRemotePlayback?: boolean | undefined;
3572
+
3573
+ onResize?: ReactEventHandler<T> | undefined;
3574
+ onResizeCapture?: ReactEventHandler<T> | undefined;
3470
3575
  }
3471
3576
 
3472
3577
  // this list is "complete" in that it contains every SVG attribute
@@ -3560,7 +3665,21 @@ declare namespace React {
3560
3665
  direction?: number | string | undefined;
3561
3666
  display?: number | string | undefined;
3562
3667
  divisor?: number | string | undefined;
3563
- dominantBaseline?: number | string | undefined;
3668
+ dominantBaseline?:
3669
+ | "auto"
3670
+ | "use-script"
3671
+ | "no-change"
3672
+ | "reset-size"
3673
+ | "ideographic"
3674
+ | "alphabetic"
3675
+ | "hanging"
3676
+ | "mathematical"
3677
+ | "central"
3678
+ | "middle"
3679
+ | "text-after-edge"
3680
+ | "text-before-edge"
3681
+ | "inherit"
3682
+ | undefined;
3564
3683
  dur?: number | string | undefined;
3565
3684
  dx?: number | string | undefined;
3566
3685
  dy?: number | string | undefined;
@@ -3707,7 +3826,7 @@ declare namespace React {
3707
3826
  tableValues?: number | string | undefined;
3708
3827
  targetX?: number | string | undefined;
3709
3828
  targetY?: number | string | undefined;
3710
- textAnchor?: string | undefined;
3829
+ textAnchor?: "start" | "middle" | "end" | "inherit" | undefined;
3711
3830
  textDecoration?: number | string | undefined;
3712
3831
  textLength?: number | string | undefined;
3713
3832
  textRendering?: number | string | undefined;
@@ -3996,7 +4115,6 @@ declare namespace React {
3996
4115
  * Captures which component contained the exception, and its ancestors.
3997
4116
  */
3998
4117
  componentStack?: string | null;
3999
- digest?: string | null;
4000
4118
  }
4001
4119
 
4002
4120
  // Keep in sync with JSX namespace in ./jsx-runtime.d.ts and ./jsx-dev-runtime.d.ts