@types/react-dom 18.3.0 → 19.2.0
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-dom/README.md +4 -3
- react-dom/canary.d.ts +2 -152
- react-dom/client.d.ts +34 -1
- react-dom/experimental.d.ts +51 -0
- react-dom/index.d.ts +105 -121
- react-dom/package.json +46 -5
- react-dom/server.browser.d.ts +1 -0
- react-dom/server.bun.d.ts +1 -0
- react-dom/server.d.ts +80 -23
- react-dom/server.edge.d.ts +1 -0
- react-dom/server.node.d.ts +8 -0
- react-dom/static.browser.d.ts +1 -0
- react-dom/static.d.ts +153 -0
- react-dom/static.edge.d.ts +1 -0
- react-dom/static.node.d.ts +7 -0
- react-dom/test-utils/index.d.ts +4 -399
react-dom/README.md
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
> `npm install --save @types/react-dom`
|
|
3
3
|
|
|
4
4
|
# Summary
|
|
5
|
-
This package contains type definitions for react-dom (https://
|
|
5
|
+
This package contains type definitions for react-dom (https://react.dev/).
|
|
6
6
|
|
|
7
7
|
# Details
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
12
|
-
* Dependencies:
|
|
11
|
+
* Last updated: Wed, 01 Oct 2025 22:02:19 GMT
|
|
12
|
+
* Dependencies: none
|
|
13
|
+
* Peer dependencies: [@types/react](https://npmjs.com/package/@types/react)
|
|
13
14
|
|
|
14
15
|
# Credits
|
|
15
16
|
These definitions were written by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com), [Microsoft](https://microsoft.com), [MartynasZilinskas](https://github.com/MartynasZilinskas), [Josh Rutherford](https://github.com/theruther4d), [Jessica Franco](https://github.com/Jessidhia), and [Sebastian Silbermann](https://github.com/eps1lon).
|
react-dom/canary.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @definitelytyped/no-self-import -- self-imports in module augmentations aren't self-imports */
|
|
2
|
+
/* eslint-disable @definitelytyped/no-declare-current-package -- The module augmentations are optional */
|
|
1
3
|
/**
|
|
2
4
|
* These are types for things that are present in the upcoming React 18 release.
|
|
3
5
|
*
|
|
@@ -30,155 +32,3 @@ import React = require("react");
|
|
|
30
32
|
import ReactDOM = require(".");
|
|
31
33
|
|
|
32
34
|
export {};
|
|
33
|
-
|
|
34
|
-
declare const REACT_FORM_STATE_SIGIL: unique symbol;
|
|
35
|
-
|
|
36
|
-
declare module "." {
|
|
37
|
-
function prefetchDNS(href: string): void;
|
|
38
|
-
|
|
39
|
-
interface PreconnectOptions {
|
|
40
|
-
// Don't create a helper type.
|
|
41
|
-
// It would have to be in module scope to be inlined in TS tooltips.
|
|
42
|
-
// But then it becomes part of the public API.
|
|
43
|
-
// TODO: Upstream to microsoft/TypeScript-DOM-lib-generator -> w3c/webref
|
|
44
|
-
// since the spec has a notion of a dedicated type: https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attribute
|
|
45
|
-
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
|
46
|
-
}
|
|
47
|
-
function preconnect(href: string, options?: PreconnectOptions): void;
|
|
48
|
-
|
|
49
|
-
type PreloadAs =
|
|
50
|
-
| "audio"
|
|
51
|
-
| "document"
|
|
52
|
-
| "embed"
|
|
53
|
-
| "fetch"
|
|
54
|
-
| "font"
|
|
55
|
-
| "image"
|
|
56
|
-
| "object"
|
|
57
|
-
| "track"
|
|
58
|
-
| "script"
|
|
59
|
-
| "style"
|
|
60
|
-
| "video"
|
|
61
|
-
| "worker";
|
|
62
|
-
interface PreloadOptions {
|
|
63
|
-
as: PreloadAs;
|
|
64
|
-
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
|
65
|
-
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
66
|
-
// TODO: These should only be allowed with `as: 'image'` but it's not trivial to write tests against the full TS support matrix.
|
|
67
|
-
imageSizes?: string | undefined;
|
|
68
|
-
imageSrcSet?: string | undefined;
|
|
69
|
-
integrity?: string | undefined;
|
|
70
|
-
type?: string | undefined;
|
|
71
|
-
nonce?: string | undefined;
|
|
72
|
-
referrerPolicy?: ReferrerPolicy | undefined;
|
|
73
|
-
}
|
|
74
|
-
function preload(href: string, options?: PreloadOptions): void;
|
|
75
|
-
|
|
76
|
-
// https://html.spec.whatwg.org/multipage/links.html#link-type-modulepreload
|
|
77
|
-
type PreloadModuleAs = RequestDestination;
|
|
78
|
-
interface PreloadModuleOptions {
|
|
79
|
-
/**
|
|
80
|
-
* @default "script"
|
|
81
|
-
*/
|
|
82
|
-
as: PreloadModuleAs;
|
|
83
|
-
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
|
84
|
-
integrity?: string | undefined;
|
|
85
|
-
nonce?: string | undefined;
|
|
86
|
-
}
|
|
87
|
-
function preloadModule(href: string, options?: PreloadModuleOptions): void;
|
|
88
|
-
|
|
89
|
-
type PreinitAs = "script" | "style";
|
|
90
|
-
interface PreinitOptions {
|
|
91
|
-
as: PreinitAs;
|
|
92
|
-
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
|
93
|
-
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
94
|
-
precedence?: string | undefined;
|
|
95
|
-
integrity?: string | undefined;
|
|
96
|
-
nonce?: string | undefined;
|
|
97
|
-
}
|
|
98
|
-
function preinit(href: string, options?: PreinitOptions): void;
|
|
99
|
-
|
|
100
|
-
// Will be expanded to include all of https://github.com/tc39/proposal-import-attributes
|
|
101
|
-
type PreinitModuleAs = "script";
|
|
102
|
-
interface PreinitModuleOptions {
|
|
103
|
-
/**
|
|
104
|
-
* @default "script"
|
|
105
|
-
*/
|
|
106
|
-
as?: PreinitModuleAs;
|
|
107
|
-
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
|
108
|
-
integrity?: string | undefined;
|
|
109
|
-
nonce?: string | undefined;
|
|
110
|
-
}
|
|
111
|
-
function preinitModule(href: string, options?: PreinitModuleOptions): void;
|
|
112
|
-
|
|
113
|
-
interface FormStatusNotPending {
|
|
114
|
-
pending: false;
|
|
115
|
-
data: null;
|
|
116
|
-
method: null;
|
|
117
|
-
action: null;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
interface FormStatusPending {
|
|
121
|
-
pending: true;
|
|
122
|
-
data: FormData;
|
|
123
|
-
method: string;
|
|
124
|
-
action: string | ((formData: FormData) => void | Promise<void>);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
type FormStatus = FormStatusPending | FormStatusNotPending;
|
|
128
|
-
|
|
129
|
-
function useFormStatus(): FormStatus;
|
|
130
|
-
|
|
131
|
-
function useFormState<State>(
|
|
132
|
-
action: (state: Awaited<State>) => State | Promise<State>,
|
|
133
|
-
initialState: Awaited<State>,
|
|
134
|
-
permalink?: string,
|
|
135
|
-
): [state: Awaited<State>, dispatch: () => void, isPending: boolean];
|
|
136
|
-
function useFormState<State, Payload>(
|
|
137
|
-
action: (state: Awaited<State>, payload: Payload) => State | Promise<State>,
|
|
138
|
-
initialState: Awaited<State>,
|
|
139
|
-
permalink?: string,
|
|
140
|
-
): [state: Awaited<State>, dispatch: (payload: Payload) => void, isPending: boolean];
|
|
141
|
-
|
|
142
|
-
function requestFormReset(form: HTMLFormElement): void;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
declare module "./client" {
|
|
146
|
-
interface ReactFormState {
|
|
147
|
-
[REACT_FORM_STATE_SIGIL]: never;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
interface RootOptions {
|
|
151
|
-
onUncaughtError?:
|
|
152
|
-
| ((error: unknown, errorInfo: { componentStack?: string | undefined }) => void)
|
|
153
|
-
| undefined;
|
|
154
|
-
onCaughtError?:
|
|
155
|
-
| ((
|
|
156
|
-
error: unknown,
|
|
157
|
-
errorInfo: {
|
|
158
|
-
componentStack?: string | undefined;
|
|
159
|
-
errorBoundary?: React.Component<unknown> | undefined;
|
|
160
|
-
},
|
|
161
|
-
) => void)
|
|
162
|
-
| undefined;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
interface HydrationOptions {
|
|
166
|
-
formState?: ReactFormState | null;
|
|
167
|
-
onUncaughtError?:
|
|
168
|
-
| ((error: unknown, errorInfo: { componentStack?: string | undefined }) => void)
|
|
169
|
-
| undefined;
|
|
170
|
-
onCaughtError?:
|
|
171
|
-
| ((
|
|
172
|
-
error: unknown,
|
|
173
|
-
errorInfo: {
|
|
174
|
-
componentStack?: string | undefined;
|
|
175
|
-
errorBoundary?: React.Component<unknown> | undefined;
|
|
176
|
-
},
|
|
177
|
-
) => void)
|
|
178
|
-
| undefined;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_CREATE_ROOT_CONTAINERS {
|
|
182
|
-
document: Document;
|
|
183
|
-
}
|
|
184
|
-
}
|
react-dom/client.d.ts
CHANGED
|
@@ -5,12 +5,33 @@
|
|
|
5
5
|
// See https://github.com/facebook/react/blob/main/packages/react-dom/client.js to see how the exports are declared,
|
|
6
6
|
|
|
7
7
|
import React = require("react");
|
|
8
|
+
|
|
9
|
+
export {};
|
|
10
|
+
|
|
11
|
+
declare const REACT_FORM_STATE_SIGIL: unique symbol;
|
|
12
|
+
export interface ReactFormState {
|
|
13
|
+
[REACT_FORM_STATE_SIGIL]: never;
|
|
14
|
+
}
|
|
15
|
+
|
|
8
16
|
export interface HydrationOptions {
|
|
17
|
+
formState?: ReactFormState | null;
|
|
9
18
|
/**
|
|
10
19
|
* Prefix for `useId`.
|
|
11
20
|
*/
|
|
12
21
|
identifierPrefix?: string;
|
|
22
|
+
onUncaughtError?:
|
|
23
|
+
| ((error: unknown, errorInfo: { componentStack?: string | undefined }) => void)
|
|
24
|
+
| undefined;
|
|
13
25
|
onRecoverableError?: (error: unknown, errorInfo: ErrorInfo) => void;
|
|
26
|
+
onCaughtError?:
|
|
27
|
+
| ((
|
|
28
|
+
error: unknown,
|
|
29
|
+
errorInfo: {
|
|
30
|
+
componentStack?: string | undefined;
|
|
31
|
+
errorBoundary?: React.Component<unknown> | undefined;
|
|
32
|
+
},
|
|
33
|
+
) => void)
|
|
34
|
+
| undefined;
|
|
14
35
|
}
|
|
15
36
|
|
|
16
37
|
export interface RootOptions {
|
|
@@ -18,11 +39,22 @@ export interface RootOptions {
|
|
|
18
39
|
* Prefix for `useId`.
|
|
19
40
|
*/
|
|
20
41
|
identifierPrefix?: string;
|
|
42
|
+
onUncaughtError?:
|
|
43
|
+
| ((error: unknown, errorInfo: { componentStack?: string | undefined }) => void)
|
|
44
|
+
| undefined;
|
|
21
45
|
onRecoverableError?: (error: unknown, errorInfo: ErrorInfo) => void;
|
|
46
|
+
onCaughtError?:
|
|
47
|
+
| ((
|
|
48
|
+
error: unknown,
|
|
49
|
+
errorInfo: {
|
|
50
|
+
componentStack?: string | undefined;
|
|
51
|
+
errorBoundary?: React.Component<unknown> | undefined;
|
|
52
|
+
},
|
|
53
|
+
) => void)
|
|
54
|
+
| undefined;
|
|
22
55
|
}
|
|
23
56
|
|
|
24
57
|
export interface ErrorInfo {
|
|
25
|
-
digest?: string;
|
|
26
58
|
componentStack?: string;
|
|
27
59
|
}
|
|
28
60
|
|
|
@@ -41,6 +73,7 @@ export interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_CREATE_ROOT_CONTAI
|
|
|
41
73
|
export type Container =
|
|
42
74
|
| Element
|
|
43
75
|
| DocumentFragment
|
|
76
|
+
| Document
|
|
44
77
|
| DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_CREATE_ROOT_CONTAINERS[
|
|
45
78
|
keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_CREATE_ROOT_CONTAINERS
|
|
46
79
|
];
|
react-dom/experimental.d.ts
CHANGED
|
@@ -32,5 +32,56 @@ import ReactDOM = require("./canary");
|
|
|
32
32
|
|
|
33
33
|
export {};
|
|
34
34
|
|
|
35
|
+
declare const UNDEFINED_VOID_ONLY: unique symbol;
|
|
36
|
+
type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
|
|
37
|
+
|
|
35
38
|
declare module "." {
|
|
36
39
|
}
|
|
40
|
+
|
|
41
|
+
declare module "react" {
|
|
42
|
+
interface ViewTransitionPseudoElement extends Animatable {
|
|
43
|
+
getComputedStyle: () => CSSStyleDeclaration;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface ViewTransitionInstance {
|
|
47
|
+
group: ViewTransitionPseudoElement;
|
|
48
|
+
imagePair: ViewTransitionPseudoElement;
|
|
49
|
+
old: ViewTransitionPseudoElement;
|
|
50
|
+
new: ViewTransitionPseudoElement;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
54
|
+
interface GestureProvider extends AnimationTimeline {}
|
|
55
|
+
|
|
56
|
+
// @enableFragmentRefs
|
|
57
|
+
interface FragmentInstance {
|
|
58
|
+
blur: () => void;
|
|
59
|
+
focus: (focusOptions?: FocusOptions | undefined) => void;
|
|
60
|
+
focusLast: (focusOptions?: FocusOptions | undefined) => void;
|
|
61
|
+
observeUsing(observer: IntersectionObserver | ResizeObserver): void;
|
|
62
|
+
unobserveUsing(observer: IntersectionObserver | ResizeObserver): void;
|
|
63
|
+
getClientRects(): Array<DOMRect>;
|
|
64
|
+
getRootNode(getRootNodeOptions?: GetRootNodeOptions | undefined): Document | ShadowRoot | FragmentInstance;
|
|
65
|
+
addEventListener(
|
|
66
|
+
type: string,
|
|
67
|
+
listener: EventListener,
|
|
68
|
+
optionsOrUseCapture?: Parameters<Element["addEventListener"]>[2],
|
|
69
|
+
): void;
|
|
70
|
+
removeEventListener(
|
|
71
|
+
type: string,
|
|
72
|
+
listener: EventListener,
|
|
73
|
+
optionsOrUseCapture?: Parameters<Element["removeEventListener"]>[2],
|
|
74
|
+
): void;
|
|
75
|
+
experimental_scrollIntoView(alignToTop?: boolean): void;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
declare module "./client" {
|
|
80
|
+
type TransitionIndicatorCleanup = () => VoidOrUndefinedOnly;
|
|
81
|
+
interface RootOptions {
|
|
82
|
+
onDefaultTransitionIndicator?: (() => void | TransitionIndicatorCleanup) | undefined;
|
|
83
|
+
}
|
|
84
|
+
interface HydrationOptions {
|
|
85
|
+
onDefaultTransitionIndicator?: (() => void | TransitionIndicatorCleanup) | undefined;
|
|
86
|
+
}
|
|
87
|
+
}
|
react-dom/index.d.ts
CHANGED
|
@@ -4,146 +4,130 @@
|
|
|
4
4
|
|
|
5
5
|
export as namespace ReactDOM;
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
FunctionComponentElement,
|
|
14
|
-
ReactElement,
|
|
15
|
-
ReactInstance,
|
|
16
|
-
ReactNode,
|
|
17
|
-
ReactPortal,
|
|
18
|
-
} from "react";
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @deprecated See https://react.dev/reference/react-dom/findDOMNode#alternatives
|
|
22
|
-
*/
|
|
23
|
-
export function findDOMNode(instance: ReactInstance | null | undefined): Element | null | Text;
|
|
24
|
-
/**
|
|
25
|
-
* @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
|
|
26
|
-
*/
|
|
27
|
-
export function unmountComponentAtNode(container: Element | DocumentFragment): boolean;
|
|
7
|
+
import { Key, ReactNode, ReactPortal } from "react";
|
|
8
|
+
|
|
9
|
+
declare module "react" {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
11
|
+
interface CacheSignal extends AbortSignal {}
|
|
12
|
+
}
|
|
28
13
|
|
|
29
14
|
export function createPortal(
|
|
30
15
|
children: ReactNode,
|
|
31
16
|
container: Element | DocumentFragment,
|
|
32
|
-
key?:
|
|
17
|
+
key?: Key | null,
|
|
33
18
|
): ReactPortal;
|
|
34
19
|
|
|
35
20
|
export const version: string;
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
|
|
38
|
-
*/
|
|
39
|
-
export const render: Renderer;
|
|
40
|
-
/**
|
|
41
|
-
* @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
|
|
42
|
-
*/
|
|
43
|
-
export const hydrate: Renderer;
|
|
44
21
|
|
|
45
22
|
export function flushSync<R>(fn: () => R): R;
|
|
46
23
|
|
|
47
24
|
export function unstable_batchedUpdates<A, R>(callback: (a: A) => R, a: A): R;
|
|
48
25
|
export function unstable_batchedUpdates<R>(callback: () => R): R;
|
|
49
26
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
container: Element,
|
|
57
|
-
callback?: (element: T) => any,
|
|
58
|
-
): T;
|
|
59
|
-
/**
|
|
60
|
-
* @deprecated
|
|
61
|
-
*/
|
|
62
|
-
export function unstable_renderSubtreeIntoContainer<P, T extends Component<P, ComponentState>>(
|
|
63
|
-
parentComponent: Component<any>,
|
|
64
|
-
element: CElement<P, T>,
|
|
65
|
-
container: Element,
|
|
66
|
-
callback?: (component: T) => any,
|
|
67
|
-
): T;
|
|
68
|
-
/**
|
|
69
|
-
* @deprecated
|
|
70
|
-
*/
|
|
71
|
-
export function unstable_renderSubtreeIntoContainer<P>(
|
|
72
|
-
parentComponent: Component<any>,
|
|
73
|
-
element: ReactElement<P>,
|
|
74
|
-
container: Element,
|
|
75
|
-
callback?: (component?: Component<P, ComponentState> | Element) => any,
|
|
76
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
77
|
-
): Component<P, ComponentState> | Element | void;
|
|
78
|
-
|
|
79
|
-
export type Container = Element | Document | DocumentFragment;
|
|
80
|
-
|
|
81
|
-
export interface Renderer {
|
|
82
|
-
// Deprecated(render): The return value is deprecated.
|
|
83
|
-
// In future releases the render function's return type will be void.
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
|
|
87
|
-
*/
|
|
88
|
-
<T extends Element>(
|
|
89
|
-
element: DOMElement<DOMAttributes<T>, T>,
|
|
90
|
-
container: Container | null,
|
|
91
|
-
callback?: () => void,
|
|
92
|
-
): T;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
|
|
96
|
-
*/
|
|
97
|
-
(
|
|
98
|
-
element: Array<DOMElement<DOMAttributes<any>, any>>,
|
|
99
|
-
container: Container | null,
|
|
100
|
-
callback?: () => void,
|
|
101
|
-
): Element;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* @deprecated See https://react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis
|
|
105
|
-
*/
|
|
106
|
-
(
|
|
107
|
-
element: FunctionComponentElement<any> | Array<FunctionComponentElement<any>>,
|
|
108
|
-
container: Container | null,
|
|
109
|
-
callback?: () => void,
|
|
110
|
-
): void;
|
|
27
|
+
export interface FormStatusNotPending {
|
|
28
|
+
pending: false;
|
|
29
|
+
data: null;
|
|
30
|
+
method: null;
|
|
31
|
+
action: null;
|
|
32
|
+
}
|
|
111
33
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
callback?: () => void,
|
|
119
|
-
): T;
|
|
34
|
+
export interface FormStatusPending {
|
|
35
|
+
pending: true;
|
|
36
|
+
data: FormData;
|
|
37
|
+
method: string;
|
|
38
|
+
action: string | ((formData: FormData) => void | Promise<void>);
|
|
39
|
+
}
|
|
120
40
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
41
|
+
export type FormStatus = FormStatusPending | FormStatusNotPending;
|
|
42
|
+
|
|
43
|
+
export function useFormStatus(): FormStatus;
|
|
44
|
+
|
|
45
|
+
export function useFormState<State>(
|
|
46
|
+
action: (state: Awaited<State>) => State | Promise<State>,
|
|
47
|
+
initialState: Awaited<State>,
|
|
48
|
+
permalink?: string,
|
|
49
|
+
): [state: Awaited<State>, dispatch: () => void, isPending: boolean];
|
|
50
|
+
export function useFormState<State, Payload>(
|
|
51
|
+
action: (state: Awaited<State>, payload: Payload) => State | Promise<State>,
|
|
52
|
+
initialState: Awaited<State>,
|
|
53
|
+
permalink?: string,
|
|
54
|
+
): [state: Awaited<State>, dispatch: (payload: Payload) => void, isPending: boolean];
|
|
55
|
+
|
|
56
|
+
export function prefetchDNS(href: string): void;
|
|
57
|
+
|
|
58
|
+
export interface PreconnectOptions {
|
|
59
|
+
// Don't create a helper type.
|
|
60
|
+
// It would have to be in module scope to be inlined in TS tooltips.
|
|
61
|
+
// But then it becomes part of the public API.
|
|
62
|
+
// TODO: Upstream to microsoft/TypeScript-DOM-lib-generator -> w3c/webref
|
|
63
|
+
// since the spec has a notion of a dedicated type: https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attribute
|
|
64
|
+
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
|
65
|
+
}
|
|
66
|
+
export function preconnect(href: string, options?: PreconnectOptions): void;
|
|
67
|
+
|
|
68
|
+
export type PreloadAs =
|
|
69
|
+
| "audio"
|
|
70
|
+
| "document"
|
|
71
|
+
| "embed"
|
|
72
|
+
| "fetch"
|
|
73
|
+
| "font"
|
|
74
|
+
| "image"
|
|
75
|
+
| "object"
|
|
76
|
+
| "track"
|
|
77
|
+
| "script"
|
|
78
|
+
| "style"
|
|
79
|
+
| "video"
|
|
80
|
+
| "worker";
|
|
81
|
+
export interface PreloadOptions {
|
|
82
|
+
as: PreloadAs;
|
|
83
|
+
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
|
84
|
+
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
85
|
+
// TODO: These should only be allowed with `as: 'image'` but it's not trivial to write tests against the full TS support matrix.
|
|
86
|
+
imageSizes?: string | undefined;
|
|
87
|
+
imageSrcSet?: string | undefined;
|
|
88
|
+
integrity?: string | undefined;
|
|
89
|
+
type?: string | undefined;
|
|
90
|
+
nonce?: string | undefined;
|
|
91
|
+
referrerPolicy?: ReferrerPolicy | undefined;
|
|
92
|
+
media?: string | undefined;
|
|
93
|
+
}
|
|
94
|
+
export function preload(href: string, options?: PreloadOptions): void;
|
|
129
95
|
|
|
96
|
+
// https://html.spec.whatwg.org/multipage/links.html#link-type-modulepreload
|
|
97
|
+
export type PreloadModuleAs = RequestDestination;
|
|
98
|
+
export interface PreloadModuleOptions {
|
|
130
99
|
/**
|
|
131
|
-
* @
|
|
100
|
+
* @default "script"
|
|
132
101
|
*/
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
102
|
+
as: PreloadModuleAs;
|
|
103
|
+
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
|
104
|
+
integrity?: string | undefined;
|
|
105
|
+
nonce?: string | undefined;
|
|
106
|
+
}
|
|
107
|
+
export function preloadModule(href: string, options?: PreloadModuleOptions): void;
|
|
108
|
+
|
|
109
|
+
export type PreinitAs = "script" | "style";
|
|
110
|
+
export interface PreinitOptions {
|
|
111
|
+
as: PreinitAs;
|
|
112
|
+
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
|
113
|
+
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
114
|
+
precedence?: string | undefined;
|
|
115
|
+
integrity?: string | undefined;
|
|
116
|
+
nonce?: string | undefined;
|
|
117
|
+
}
|
|
118
|
+
export function preinit(href: string, options?: PreinitOptions): void;
|
|
139
119
|
|
|
120
|
+
// Will be expanded to include all of https://github.com/tc39/proposal-import-attributes
|
|
121
|
+
export type PreinitModuleAs = "script";
|
|
122
|
+
export interface PreinitModuleOptions {
|
|
140
123
|
/**
|
|
141
|
-
* @
|
|
124
|
+
* @default "script"
|
|
142
125
|
*/
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
148
|
-
): Component<any, ComponentState> | Element | void;
|
|
126
|
+
as?: PreinitModuleAs;
|
|
127
|
+
crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
|
128
|
+
integrity?: string | undefined;
|
|
129
|
+
nonce?: string | undefined;
|
|
149
130
|
}
|
|
131
|
+
export function preinitModule(href: string, options?: PreinitModuleOptions): void;
|
|
132
|
+
|
|
133
|
+
export function requestFormReset(form: HTMLFormElement): void;
|
react-dom/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/react-dom",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.2.0",
|
|
4
4
|
"description": "TypeScript definitions for react-dom",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom",
|
|
6
6
|
"license": "MIT",
|
|
@@ -61,6 +61,46 @@
|
|
|
61
61
|
"default": "./server.d.ts"
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
|
+
"./server.browser": {
|
|
65
|
+
"types": {
|
|
66
|
+
"default": "./server.browser.d.ts"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"./server.bun": {
|
|
70
|
+
"types": {
|
|
71
|
+
"default": "./server.bun.d.ts"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"./server.edge": {
|
|
75
|
+
"types": {
|
|
76
|
+
"default": "./server.edge.d.ts"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"./server.node": {
|
|
80
|
+
"types": {
|
|
81
|
+
"default": "./server.node.d.ts"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"./static": {
|
|
85
|
+
"types": {
|
|
86
|
+
"default": "./static.d.ts"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"./static.browser": {
|
|
90
|
+
"types": {
|
|
91
|
+
"default": "./static.browser.d.ts"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"./static.edge": {
|
|
95
|
+
"types": {
|
|
96
|
+
"default": "./static.edge.d.ts"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"./static.node": {
|
|
100
|
+
"types": {
|
|
101
|
+
"default": "./static.node.d.ts"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
64
104
|
"./experimental": {
|
|
65
105
|
"types": {
|
|
66
106
|
"default": "./experimental.d.ts"
|
|
@@ -79,9 +119,10 @@
|
|
|
79
119
|
"directory": "types/react-dom"
|
|
80
120
|
},
|
|
81
121
|
"scripts": {},
|
|
82
|
-
"dependencies": {
|
|
83
|
-
|
|
122
|
+
"dependencies": {},
|
|
123
|
+
"peerDependencies": {
|
|
124
|
+
"@types/react": "^19.2.0"
|
|
84
125
|
},
|
|
85
|
-
"typesPublisherContentHash": "
|
|
86
|
-
"typeScriptVersion": "
|
|
126
|
+
"typesPublisherContentHash": "4a296bd89e24edb236357aa2daf5e5f23648fa3270267dfef1e71cafb2822417",
|
|
127
|
+
"typeScriptVersion": "5.2"
|
|
87
128
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { renderToReadableStream, renderToStaticMarkup, renderToString } from "./server";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { renderToReadableStream, renderToStaticMarkup, renderToString } from "./server";
|