1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | import React = require("react");
|
30 | import ReactDOM = require(".");
|
31 |
|
32 | 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 |
|
41 |
|
42 |
|
43 |
|
44 |
|
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 |
|
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 |
|
77 | type PreloadModuleAs = RequestDestination;
|
78 | interface PreloadModuleOptions {
|
79 | |
80 |
|
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 |
|
101 | type PreinitModuleAs = "script";
|
102 | interface PreinitModuleOptions {
|
103 | |
104 |
|
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 | }
|
185 |
|
\ | No newline at end of file |