@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.
- react/README.md +1 -1
- react/canary.d.ts +85 -0
- react/experimental.d.ts +45 -109
- react/global.d.ts +2 -0
- react/index.d.ts +169 -48
- react/package.json +4 -4
- react/ts5.0/canary.d.ts +85 -0
- react/ts5.0/experimental.d.ts +45 -109
- react/ts5.0/global.d.ts +2 -0
- react/ts5.0/index.d.ts +166 -48
- react/ts5.0/v18/global.d.ts +0 -160
- react/ts5.0/v18/index.d.ts +0 -4543
- react/ts5.0/v18/jsx-dev-runtime.d.ts +0 -45
- react/ts5.0/v18/jsx-runtime.d.ts +0 -36
- react/ts5.0/v18/ts5.0/global.d.ts +0 -160
- react/ts5.0/v18/ts5.0/index.d.ts +0 -4530
- react/ts5.0/v18/ts5.0/jsx-dev-runtime.d.ts +0 -44
- react/ts5.0/v18/ts5.0/jsx-runtime.d.ts +0 -35
react/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
|
) => ReactNode | Promise<ReactNode>)
|
|
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) => ReactNode)
|
|
222
224
|
| keyof JSX.IntrinsicElements,
|
|
223
225
|
> = ComponentRef<C>;
|
|
@@ -927,7 +929,7 @@ declare namespace React {
|
|
|
927
929
|
static propTypes?: any;
|
|
928
930
|
|
|
929
931
|
/**
|
|
930
|
-
* If using
|
|
932
|
+
* If using React Context, re-declare this in your class to be the
|
|
931
933
|
* `React.ContextType` of your `static contextType`.
|
|
932
934
|
* Should be used with type annotation or static contextType.
|
|
933
935
|
*
|
|
@@ -946,6 +948,14 @@ declare namespace React {
|
|
|
946
948
|
|
|
947
949
|
// Keep in sync with constructor signature of JSXElementConstructor and ComponentClass.
|
|
948
950
|
constructor(props: P);
|
|
951
|
+
/**
|
|
952
|
+
* @param props
|
|
953
|
+
* @param context value of the parent {@link https://react.dev/reference/react/Component#context Context} specified
|
|
954
|
+
* in `contextType`.
|
|
955
|
+
*/
|
|
956
|
+
// TODO: Ideally we'd infer the constructor signatur from `contextType`.
|
|
957
|
+
// Might be hard to ship without breaking existing code.
|
|
958
|
+
constructor(props: P, context: any);
|
|
949
959
|
|
|
950
960
|
// We MUST keep setState() as a unified signature because it allows proper checking of the method return type.
|
|
951
961
|
// See: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18365#issuecomment-351013257
|
|
@@ -1117,7 +1127,14 @@ declare namespace React {
|
|
|
1117
1127
|
*/
|
|
1118
1128
|
interface ComponentClass<P = {}, S = ComponentState> extends StaticLifecycle<P, S> {
|
|
1119
1129
|
// constructor signature must match React.Component
|
|
1120
|
-
new(
|
|
1130
|
+
new(
|
|
1131
|
+
props: P,
|
|
1132
|
+
/**
|
|
1133
|
+
* Value of the parent {@link https://react.dev/reference/react/Component#context Context} specified
|
|
1134
|
+
* in `contextType`.
|
|
1135
|
+
*/
|
|
1136
|
+
context?: any,
|
|
1137
|
+
): Component<P, S>;
|
|
1121
1138
|
/**
|
|
1122
1139
|
* Ignored by React.
|
|
1123
1140
|
* @deprecated Only kept in types for backwards compatibility. Will be removed in a future major release.
|
|
@@ -1157,7 +1174,7 @@ declare namespace React {
|
|
|
1157
1174
|
*/
|
|
1158
1175
|
type ClassType<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>> =
|
|
1159
1176
|
& C
|
|
1160
|
-
& (new(props: P) => T);
|
|
1177
|
+
& (new(props: P, context: any) => T);
|
|
1161
1178
|
|
|
1162
1179
|
//
|
|
1163
1180
|
// Component Specs and Lifecycle
|
|
@@ -1684,20 +1701,6 @@ declare namespace React {
|
|
|
1684
1701
|
reducer: (prevState: S, ...args: A) => S,
|
|
1685
1702
|
initialState: S,
|
|
1686
1703
|
): [S, ActionDispatch<A>];
|
|
1687
|
-
/**
|
|
1688
|
-
* An alternative to `useState`.
|
|
1689
|
-
*
|
|
1690
|
-
* `useReducer` is usually preferable to `useState` when you have complex state logic that involves
|
|
1691
|
-
* multiple sub-values. It also lets you optimize performance for components that trigger deep
|
|
1692
|
-
* updates because you can pass `dispatch` down instead of callbacks.
|
|
1693
|
-
*
|
|
1694
|
-
* @version 16.8.0
|
|
1695
|
-
* @see {@link https://react.dev/reference/react/useReducer}
|
|
1696
|
-
*/
|
|
1697
|
-
function useReducer<S, A extends AnyActionArg>(
|
|
1698
|
-
reducer: (prevState: S, ...args: A) => S,
|
|
1699
|
-
initialState: S,
|
|
1700
|
-
): [S, ActionDispatch<A>];
|
|
1701
1704
|
/**
|
|
1702
1705
|
* An alternative to `useState`.
|
|
1703
1706
|
*
|
|
@@ -1772,13 +1775,17 @@ declare namespace React {
|
|
|
1772
1775
|
* @see {@link https://react.dev/reference/react/useEffect}
|
|
1773
1776
|
*/
|
|
1774
1777
|
function useEffect(effect: EffectCallback, deps?: DependencyList): void;
|
|
1778
|
+
/**
|
|
1779
|
+
* @see {@link https://react.dev/reference/react/useEffectEvent `useEffectEvent()` documentation}
|
|
1780
|
+
* @version 19.2.0
|
|
1781
|
+
*/
|
|
1782
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
1783
|
+
export function useEffectEvent<T extends Function>(callback: T): T;
|
|
1775
1784
|
// NOTE: this does not accept strings, but this will have to be fixed by removing strings from type Ref<T>
|
|
1776
1785
|
/**
|
|
1777
1786
|
* `useImperativeHandle` customizes the instance value that is exposed to parent components when using
|
|
1778
1787
|
* `ref`. As always, imperative code using refs should be avoided in most cases.
|
|
1779
1788
|
*
|
|
1780
|
-
* `useImperativeHandle` should be used with `React.forwardRef`.
|
|
1781
|
-
*
|
|
1782
1789
|
* @version 16.8.0
|
|
1783
1790
|
* @see {@link https://react.dev/reference/react/useImperativeHandle}
|
|
1784
1791
|
*/
|
|
@@ -1920,7 +1927,31 @@ declare namespace React {
|
|
|
1920
1927
|
reducer: (state: State, action: Action) => State,
|
|
1921
1928
|
): [State, (action: Action) => void];
|
|
1922
1929
|
|
|
1923
|
-
|
|
1930
|
+
interface UntrackedReactPromise<T> extends PromiseLike<T> {
|
|
1931
|
+
status?: void;
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
export interface PendingReactPromise<T> extends PromiseLike<T> {
|
|
1935
|
+
status: "pending";
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
export interface FulfilledReactPromise<T> extends PromiseLike<T> {
|
|
1939
|
+
status: "fulfilled";
|
|
1940
|
+
value: T;
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
export interface RejectedReactPromise<T> extends PromiseLike<T> {
|
|
1944
|
+
status: "rejected";
|
|
1945
|
+
reason: unknown;
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
export type ReactPromise<T> =
|
|
1949
|
+
| UntrackedReactPromise<T>
|
|
1950
|
+
| PendingReactPromise<T>
|
|
1951
|
+
| FulfilledReactPromise<T>
|
|
1952
|
+
| RejectedReactPromise<T>;
|
|
1953
|
+
|
|
1954
|
+
export type Usable<T> = ReactPromise<T> | Context<T>;
|
|
1924
1955
|
|
|
1925
1956
|
export function use<T>(usable: Usable<T>): T;
|
|
1926
1957
|
|
|
@@ -1938,10 +1969,39 @@ declare namespace React {
|
|
|
1938
1969
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
1939
1970
|
export function cache<CachedFunction extends Function>(fn: CachedFunction): CachedFunction;
|
|
1940
1971
|
|
|
1972
|
+
export interface CacheSignal {}
|
|
1973
|
+
/**
|
|
1974
|
+
* @version 19.2.0
|
|
1975
|
+
*/
|
|
1976
|
+
export function cacheSignal(): null | CacheSignal;
|
|
1977
|
+
|
|
1978
|
+
export interface ActivityProps {
|
|
1979
|
+
/**
|
|
1980
|
+
* @default "visible"
|
|
1981
|
+
*/
|
|
1982
|
+
mode?:
|
|
1983
|
+
| "hidden"
|
|
1984
|
+
| "visible"
|
|
1985
|
+
| undefined;
|
|
1986
|
+
/**
|
|
1987
|
+
* A name for this Activity boundary for instrumentation purposes.
|
|
1988
|
+
* The name will help identify this boundary in React DevTools.
|
|
1989
|
+
*/
|
|
1990
|
+
name?: string | undefined;
|
|
1991
|
+
children: ReactNode;
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
/**
|
|
1995
|
+
* @see {@link https://react.dev/reference/react/Activity `<Activity>` documentation}
|
|
1996
|
+
* @version 19.2.0
|
|
1997
|
+
*/
|
|
1998
|
+
export const Activity: ExoticComponent<ActivityProps>;
|
|
1999
|
+
|
|
1941
2000
|
/**
|
|
1942
2001
|
* Warning: Only available in development builds.
|
|
1943
2002
|
*
|
|
1944
2003
|
* @see {@link https://react.dev/reference/react/captureOwnerStack Reference docs}
|
|
2004
|
+
* @version 19.1.0
|
|
1945
2005
|
*/
|
|
1946
2006
|
function captureOwnerStack(): string | null;
|
|
1947
2007
|
|
|
@@ -2006,15 +2066,32 @@ declare namespace React {
|
|
|
2006
2066
|
target: EventTarget & Target;
|
|
2007
2067
|
}
|
|
2008
2068
|
|
|
2069
|
+
/**
|
|
2070
|
+
* @deprecated FormEvent doesn't actually exist.
|
|
2071
|
+
* You probably meant to use {@link ChangeEvent}, {@link InputEvent}, {@link SubmitEvent}, or just {@link SyntheticEvent} instead
|
|
2072
|
+
* depending on the event type.
|
|
2073
|
+
*/
|
|
2009
2074
|
interface FormEvent<T = Element> extends SyntheticEvent<T> {
|
|
2010
2075
|
}
|
|
2011
2076
|
|
|
2012
2077
|
interface InvalidEvent<T = Element> extends SyntheticEvent<T> {
|
|
2013
|
-
target: EventTarget & T;
|
|
2014
2078
|
}
|
|
2015
2079
|
|
|
2016
|
-
|
|
2017
|
-
|
|
2080
|
+
/**
|
|
2081
|
+
* change events bubble in React so their target is generally unknown.
|
|
2082
|
+
* Only for form elements we know their target type because form events can't
|
|
2083
|
+
* be nested.
|
|
2084
|
+
* This type exists purely to narrow `target` for form elements. It doesn't
|
|
2085
|
+
* reflect a DOM event. Change events are just fired as standard {@link SyntheticEvent}.
|
|
2086
|
+
*/
|
|
2087
|
+
interface ChangeEvent<CurrentTarget = Element, Target = Element> extends SyntheticEvent<CurrentTarget> {
|
|
2088
|
+
// TODO: This is wrong for change event handlers on arbitrary. Should
|
|
2089
|
+
// be EventTarget & Target, but kept for backward compatibility until React 20.
|
|
2090
|
+
target: EventTarget & CurrentTarget;
|
|
2091
|
+
}
|
|
2092
|
+
|
|
2093
|
+
interface InputEvent<T = Element> extends SyntheticEvent<T, NativeInputEvent> {
|
|
2094
|
+
data: string;
|
|
2018
2095
|
}
|
|
2019
2096
|
|
|
2020
2097
|
export type ModifierKey =
|
|
@@ -2080,6 +2157,13 @@ declare namespace React {
|
|
|
2080
2157
|
shiftKey: boolean;
|
|
2081
2158
|
}
|
|
2082
2159
|
|
|
2160
|
+
interface SubmitEvent<T = Element> extends SyntheticEvent<T, NativeSubmitEvent> {
|
|
2161
|
+
// Currently not exposed by Reat
|
|
2162
|
+
// submitter: HTMLElement | null;
|
|
2163
|
+
// SubmitEvents are always targetted at HTMLFormElements.
|
|
2164
|
+
target: EventTarget & HTMLFormElement;
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2083
2167
|
interface TouchEvent<T = Element> extends UIEvent<T, NativeTouchEvent> {
|
|
2084
2168
|
altKey: boolean;
|
|
2085
2169
|
changedTouches: TouchList;
|
|
@@ -2135,10 +2219,19 @@ declare namespace React {
|
|
|
2135
2219
|
type CompositionEventHandler<T = Element> = EventHandler<CompositionEvent<T>>;
|
|
2136
2220
|
type DragEventHandler<T = Element> = EventHandler<DragEvent<T>>;
|
|
2137
2221
|
type FocusEventHandler<T = Element> = EventHandler<FocusEvent<T>>;
|
|
2222
|
+
/**
|
|
2223
|
+
* @deprecated FormEventHandler doesn't actually exist.
|
|
2224
|
+
* You probably meant to use {@link ChangeEventHandler}, {@link InputEventHandler}, {@link SubmitEventHandler}, or just {@link EventHandler} instead
|
|
2225
|
+
* depending on the event type.
|
|
2226
|
+
*/
|
|
2138
2227
|
type FormEventHandler<T = Element> = EventHandler<FormEvent<T>>;
|
|
2139
|
-
type ChangeEventHandler<
|
|
2228
|
+
type ChangeEventHandler<CurrentTarget = Element, Target = Element> = EventHandler<
|
|
2229
|
+
ChangeEvent<CurrentTarget, Target>
|
|
2230
|
+
>;
|
|
2231
|
+
type InputEventHandler<T = Element> = EventHandler<InputEvent<T>>;
|
|
2140
2232
|
type KeyboardEventHandler<T = Element> = EventHandler<KeyboardEvent<T>>;
|
|
2141
2233
|
type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>;
|
|
2234
|
+
type SubmitEventHandler<T = Element> = EventHandler<SubmitEvent<T>>;
|
|
2142
2235
|
type TouchEventHandler<T = Element> = EventHandler<TouchEvent<T>>;
|
|
2143
2236
|
type PointerEventHandler<T = Element> = EventHandler<PointerEvent<T>>;
|
|
2144
2237
|
type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>;
|
|
@@ -2192,19 +2285,19 @@ declare namespace React {
|
|
|
2192
2285
|
onBlur?: FocusEventHandler<T> | undefined;
|
|
2193
2286
|
onBlurCapture?: FocusEventHandler<T> | undefined;
|
|
2194
2287
|
|
|
2195
|
-
//
|
|
2196
|
-
onChange?:
|
|
2197
|
-
onChangeCapture?:
|
|
2198
|
-
onBeforeInput?:
|
|
2199
|
-
onBeforeInputCapture?:
|
|
2200
|
-
onInput?:
|
|
2201
|
-
onInputCapture?:
|
|
2202
|
-
onReset?:
|
|
2203
|
-
onResetCapture?:
|
|
2204
|
-
onSubmit?:
|
|
2205
|
-
onSubmitCapture?:
|
|
2206
|
-
onInvalid?:
|
|
2207
|
-
onInvalidCapture?:
|
|
2288
|
+
// form related Events
|
|
2289
|
+
onChange?: ChangeEventHandler<T> | undefined;
|
|
2290
|
+
onChangeCapture?: ChangeEventHandler<T> | undefined;
|
|
2291
|
+
onBeforeInput?: InputEventHandler<T> | undefined;
|
|
2292
|
+
onBeforeInputCapture?: InputEventHandler<T> | undefined;
|
|
2293
|
+
onInput?: InputEventHandler<T> | undefined;
|
|
2294
|
+
onInputCapture?: InputEventHandler<T> | undefined;
|
|
2295
|
+
onReset?: ReactEventHandler<T> | undefined;
|
|
2296
|
+
onResetCapture?: ReactEventHandler<T> | undefined;
|
|
2297
|
+
onSubmit?: SubmitEventHandler<T> | undefined;
|
|
2298
|
+
onSubmitCapture?: SubmitEventHandler<T> | undefined;
|
|
2299
|
+
onInvalid?: ReactEventHandler<T> | undefined;
|
|
2300
|
+
onInvalidCapture?: ReactEventHandler<T> | undefined;
|
|
2208
2301
|
|
|
2209
2302
|
// Image Events
|
|
2210
2303
|
onLoad?: ReactEventHandler<T> | undefined;
|
|
@@ -2253,8 +2346,6 @@ declare namespace React {
|
|
|
2253
2346
|
onProgressCapture?: ReactEventHandler<T> | undefined;
|
|
2254
2347
|
onRateChange?: ReactEventHandler<T> | undefined;
|
|
2255
2348
|
onRateChangeCapture?: ReactEventHandler<T> | undefined;
|
|
2256
|
-
onResize?: ReactEventHandler<T> | undefined;
|
|
2257
|
-
onResizeCapture?: ReactEventHandler<T> | undefined;
|
|
2258
2349
|
onSeeked?: ReactEventHandler<T> | undefined;
|
|
2259
2350
|
onSeekedCapture?: ReactEventHandler<T> | undefined;
|
|
2260
2351
|
onSeeking?: ReactEventHandler<T> | undefined;
|
|
@@ -2744,7 +2835,7 @@ declare namespace React {
|
|
|
2744
2835
|
unselectable?: "on" | "off" | undefined;
|
|
2745
2836
|
|
|
2746
2837
|
// Popover API
|
|
2747
|
-
popover?: "" | "auto" | "manual" | undefined;
|
|
2838
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined;
|
|
2748
2839
|
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
2749
2840
|
popoverTarget?: string | undefined;
|
|
2750
2841
|
|
|
@@ -2998,6 +3089,7 @@ declare namespace React {
|
|
|
2998
3089
|
}
|
|
2999
3090
|
|
|
3000
3091
|
interface DialogHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
3092
|
+
closedby?: "any" | "closerequest" | "none" | undefined;
|
|
3001
3093
|
onCancel?: ReactEventHandler<T> | undefined;
|
|
3002
3094
|
onClose?: ReactEventHandler<T> | undefined;
|
|
3003
3095
|
open?: boolean | undefined;
|
|
@@ -3212,7 +3304,9 @@ declare namespace React {
|
|
|
3212
3304
|
value?: string | readonly string[] | number | undefined;
|
|
3213
3305
|
width?: number | string | undefined;
|
|
3214
3306
|
|
|
3215
|
-
|
|
3307
|
+
// No other element dispatching change events can be nested in a <input>
|
|
3308
|
+
// so we know the target will be a HTMLInputElement.
|
|
3309
|
+
onChange?: ChangeEventHandler<T, HTMLInputElement> | undefined;
|
|
3216
3310
|
}
|
|
3217
3311
|
|
|
3218
3312
|
interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
@@ -3235,6 +3329,7 @@ declare namespace React {
|
|
|
3235
3329
|
|
|
3236
3330
|
interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
3237
3331
|
as?: string | undefined;
|
|
3332
|
+
blocking?: "render" | (string & {}) | undefined;
|
|
3238
3333
|
crossOrigin?: CrossOrigin;
|
|
3239
3334
|
fetchPriority?: "high" | "low" | "auto";
|
|
3240
3335
|
href?: string | undefined;
|
|
@@ -3354,10 +3449,12 @@ declare namespace React {
|
|
|
3354
3449
|
|
|
3355
3450
|
interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
3356
3451
|
async?: boolean | undefined;
|
|
3452
|
+
blocking?: "render" | (string & {}) | undefined;
|
|
3357
3453
|
/** @deprecated */
|
|
3358
3454
|
charSet?: string | undefined;
|
|
3359
3455
|
crossOrigin?: CrossOrigin;
|
|
3360
3456
|
defer?: boolean | undefined;
|
|
3457
|
+
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
3361
3458
|
integrity?: string | undefined;
|
|
3362
3459
|
noModule?: boolean | undefined;
|
|
3363
3460
|
referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
|
|
@@ -3374,7 +3471,9 @@ declare namespace React {
|
|
|
3374
3471
|
required?: boolean | undefined;
|
|
3375
3472
|
size?: number | undefined;
|
|
3376
3473
|
value?: string | readonly string[] | number | undefined;
|
|
3377
|
-
|
|
3474
|
+
// No other element dispatching change events can be nested in a <select>
|
|
3475
|
+
// so we know the target will be a HTMLSelectElement.
|
|
3476
|
+
onChange?: ChangeEventHandler<T, HTMLSelectElement> | undefined;
|
|
3378
3477
|
}
|
|
3379
3478
|
|
|
3380
3479
|
interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
@@ -3388,6 +3487,7 @@ declare namespace React {
|
|
|
3388
3487
|
}
|
|
3389
3488
|
|
|
3390
3489
|
interface StyleHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
3490
|
+
blocking?: "render" | (string & {}) | undefined;
|
|
3391
3491
|
media?: string | undefined;
|
|
3392
3492
|
scoped?: boolean | undefined;
|
|
3393
3493
|
type?: string | undefined;
|
|
@@ -3425,7 +3525,9 @@ declare namespace React {
|
|
|
3425
3525
|
value?: string | readonly string[] | number | undefined;
|
|
3426
3526
|
wrap?: string | undefined;
|
|
3427
3527
|
|
|
3428
|
-
|
|
3528
|
+
// No other element dispatching change events can be nested in a <textare>
|
|
3529
|
+
// so we know the target will be a HTMLTextAreaElement.
|
|
3530
|
+
onChange?: ChangeEventHandler<T, HTMLTextAreaElement> | undefined;
|
|
3429
3531
|
}
|
|
3430
3532
|
|
|
3431
3533
|
interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
@@ -3468,6 +3570,9 @@ declare namespace React {
|
|
|
3468
3570
|
width?: number | string | undefined;
|
|
3469
3571
|
disablePictureInPicture?: boolean | undefined;
|
|
3470
3572
|
disableRemotePlayback?: boolean | undefined;
|
|
3573
|
+
|
|
3574
|
+
onResize?: ReactEventHandler<T> | undefined;
|
|
3575
|
+
onResizeCapture?: ReactEventHandler<T> | undefined;
|
|
3471
3576
|
}
|
|
3472
3577
|
|
|
3473
3578
|
// this list is "complete" in that it contains every SVG attribute
|
|
@@ -3494,6 +3599,9 @@ declare namespace React {
|
|
|
3494
3599
|
method?: string | undefined;
|
|
3495
3600
|
min?: number | string | undefined;
|
|
3496
3601
|
name?: string | undefined;
|
|
3602
|
+
nonce?: string | undefined;
|
|
3603
|
+
part?: string | undefined;
|
|
3604
|
+
slot?: string | undefined;
|
|
3497
3605
|
style?: CSSProperties | undefined;
|
|
3498
3606
|
target?: string | undefined;
|
|
3499
3607
|
type?: string | undefined;
|
|
@@ -3561,7 +3669,21 @@ declare namespace React {
|
|
|
3561
3669
|
direction?: number | string | undefined;
|
|
3562
3670
|
display?: number | string | undefined;
|
|
3563
3671
|
divisor?: number | string | undefined;
|
|
3564
|
-
dominantBaseline?:
|
|
3672
|
+
dominantBaseline?:
|
|
3673
|
+
| "auto"
|
|
3674
|
+
| "use-script"
|
|
3675
|
+
| "no-change"
|
|
3676
|
+
| "reset-size"
|
|
3677
|
+
| "ideographic"
|
|
3678
|
+
| "alphabetic"
|
|
3679
|
+
| "hanging"
|
|
3680
|
+
| "mathematical"
|
|
3681
|
+
| "central"
|
|
3682
|
+
| "middle"
|
|
3683
|
+
| "text-after-edge"
|
|
3684
|
+
| "text-before-edge"
|
|
3685
|
+
| "inherit"
|
|
3686
|
+
| undefined;
|
|
3565
3687
|
dur?: number | string | undefined;
|
|
3566
3688
|
dx?: number | string | undefined;
|
|
3567
3689
|
dy?: number | string | undefined;
|
|
@@ -3708,7 +3830,7 @@ declare namespace React {
|
|
|
3708
3830
|
tableValues?: number | string | undefined;
|
|
3709
3831
|
targetX?: number | string | undefined;
|
|
3710
3832
|
targetY?: number | string | undefined;
|
|
3711
|
-
textAnchor?:
|
|
3833
|
+
textAnchor?: "start" | "middle" | "end" | "inherit" | undefined;
|
|
3712
3834
|
textDecoration?: number | string | undefined;
|
|
3713
3835
|
textLength?: number | string | undefined;
|
|
3714
3836
|
textRendering?: number | string | undefined;
|
|
@@ -3997,7 +4119,6 @@ declare namespace React {
|
|
|
3997
4119
|
* Captures which component contained the exception, and its ancestors.
|
|
3998
4120
|
*/
|
|
3999
4121
|
componentStack?: string | null;
|
|
4000
|
-
digest?: string | null;
|
|
4001
4122
|
}
|
|
4002
4123
|
|
|
4003
4124
|
// Keep in sync with JSX namespace in ./jsx-runtime.d.ts and ./jsx-dev-runtime.d.ts
|
react/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/react",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.2.10",
|
|
4
4
|
"description": "TypeScript definitions for react",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
|
|
6
6
|
"license": "MIT",
|
|
@@ -202,9 +202,9 @@
|
|
|
202
202
|
},
|
|
203
203
|
"scripts": {},
|
|
204
204
|
"dependencies": {
|
|
205
|
-
"csstype": "^3.
|
|
205
|
+
"csstype": "^3.2.2"
|
|
206
206
|
},
|
|
207
207
|
"peerDependencies": {},
|
|
208
|
-
"typesPublisherContentHash": "
|
|
209
|
-
"typeScriptVersion": "5.
|
|
208
|
+
"typesPublisherContentHash": "c1bacedf82d12682fbaf19b2e74fd83bbeea9f1592d6885e013c8c1379ce22e8",
|
|
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 | (() => 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 | (() => 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 | (() => 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 | (() => 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
|
}
|