1 |
|
2 |
|
3 |
|
4 |
|
5 | export as namespace ReactDOM;
|
6 |
|
7 | import { Key, ReactNode, ReactPortal } from "react";
|
8 |
|
9 | export function createPortal(
|
10 | children: ReactNode,
|
11 | container: Element | DocumentFragment,
|
12 | key?: Key | null,
|
13 | ): ReactPortal;
|
14 |
|
15 | export const version: string;
|
16 |
|
17 | export function flushSync<R>(fn: () => R): R;
|
18 |
|
19 | export function unstable_batchedUpdates<A, R>(callback: (a: A) => R, a: A): R;
|
20 | export function unstable_batchedUpdates<R>(callback: () => R): R;
|
21 |
|
22 | export interface FormStatusNotPending {
|
23 | pending: false;
|
24 | data: null;
|
25 | method: null;
|
26 | action: null;
|
27 | }
|
28 |
|
29 | export interface FormStatusPending {
|
30 | pending: true;
|
31 | data: FormData;
|
32 | method: string;
|
33 | action: string | ((formData: FormData) => void | Promise<void>);
|
34 | }
|
35 |
|
36 | export type FormStatus = FormStatusPending | FormStatusNotPending;
|
37 |
|
38 | export function useFormStatus(): FormStatus;
|
39 |
|
40 | export function useFormState<State>(
|
41 | action: (state: Awaited<State>) => State | Promise<State>,
|
42 | initialState: Awaited<State>,
|
43 | permalink?: string,
|
44 | ): [state: Awaited<State>, dispatch: () => void, isPending: boolean];
|
45 | export function useFormState<State, Payload>(
|
46 | action: (state: Awaited<State>, payload: Payload) => State | Promise<State>,
|
47 | initialState: Awaited<State>,
|
48 | permalink?: string,
|
49 | ): [state: Awaited<State>, dispatch: (payload: Payload) => void, isPending: boolean];
|
50 |
|
51 | export function prefetchDNS(href: string): void;
|
52 |
|
53 | export interface PreconnectOptions {
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 | crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
60 | }
|
61 | export function preconnect(href: string, options?: PreconnectOptions): void;
|
62 |
|
63 | export type PreloadAs =
|
64 | | "audio"
|
65 | | "document"
|
66 | | "embed"
|
67 | | "fetch"
|
68 | | "font"
|
69 | | "image"
|
70 | | "object"
|
71 | | "track"
|
72 | | "script"
|
73 | | "style"
|
74 | | "video"
|
75 | | "worker";
|
76 | export interface PreloadOptions {
|
77 | as: PreloadAs;
|
78 | crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
79 | fetchPriority?: "high" | "low" | "auto" | undefined;
|
80 |
|
81 | imageSizes?: string | undefined;
|
82 | imageSrcSet?: string | undefined;
|
83 | integrity?: string | undefined;
|
84 | type?: string | undefined;
|
85 | nonce?: string | undefined;
|
86 | referrerPolicy?: ReferrerPolicy | undefined;
|
87 | }
|
88 | export function preload(href: string, options?: PreloadOptions): void;
|
89 |
|
90 |
|
91 | export type PreloadModuleAs = RequestDestination;
|
92 | export interface PreloadModuleOptions {
|
93 | |
94 |
|
95 |
|
96 | as: PreloadModuleAs;
|
97 | crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
98 | integrity?: string | undefined;
|
99 | nonce?: string | undefined;
|
100 | }
|
101 | export function preloadModule(href: string, options?: PreloadModuleOptions): void;
|
102 |
|
103 | export type PreinitAs = "script" | "style";
|
104 | export interface PreinitOptions {
|
105 | as: PreinitAs;
|
106 | crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
107 | fetchPriority?: "high" | "low" | "auto" | undefined;
|
108 | precedence?: string | undefined;
|
109 | integrity?: string | undefined;
|
110 | nonce?: string | undefined;
|
111 | }
|
112 | export function preinit(href: string, options?: PreinitOptions): void;
|
113 |
|
114 |
|
115 | export type PreinitModuleAs = "script";
|
116 | export interface PreinitModuleOptions {
|
117 | |
118 |
|
119 |
|
120 | as?: PreinitModuleAs;
|
121 | crossOrigin?: "anonymous" | "use-credentials" | "" | undefined;
|
122 | integrity?: string | undefined;
|
123 | nonce?: string | undefined;
|
124 | }
|
125 | export function preinitModule(href: string, options?: PreinitModuleOptions): void;
|
126 |
|
127 | export function requestFormReset(form: HTMLFormElement): void;
|