File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
apps/svelte.dev/content/docs/kit/98-reference Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -2357,7 +2357,10 @@ type RemoteForm<
23572357 ): RemoteForm<Input, Output>;
23582358 /** Validate the form contents programmatically */
23592359 validate(options?: {
2360+ /** Set this to `true` to also show validation issues of fields that haven't been touched yet. */
23602361 includeUntouched?: boolean;
2362+ /** Set this to `true` to only run the `preflight` validation. */
2363+ preflightOnly?: boolean;
23612364 /** Perform validation as if the form was submitted by the given button. */
23622365 submitter?: HTMLButtonElement | HTMLInputElement;
23632366 }): Promise<void>;
@@ -2459,6 +2462,37 @@ type RemoteFormFieldValue =
24592462
24602463</div >
24612464
2465+ ## RemoteFormFields
2466+
2467+ Recursive type to build form fields structure with proxy access
2468+
2469+ <div class =" ts-block " >
2470+
2471+ ``` dts
2472+ type RemoteFormFields<T> =
2473+ WillRecurseIndefinitely<T> extends true
2474+ ? RecursiveFormFields
2475+ : NonNullable<T> extends
2476+ | string
2477+ | number
2478+ | boolean
2479+ | File
2480+ ? RemoteFormField<NonNullable<T>>
2481+ : T extends string[] | File[]
2482+ ? RemoteFormField<T> & {
2483+ [K in number]: RemoteFormField<T[number]>;
2484+ }
2485+ : T extends Array<infer U>
2486+ ? RemoteFormFieldContainer<T> & {
2487+ [K in number]: RemoteFormFields<U>;
2488+ }
2489+ : RemoteFormFieldContainer<T> & {
2490+ [K in keyof T]-?: RemoteFormFields<T[K]>;
2491+ };
2492+ ```
2493+
2494+ </div >
2495+
24622496## RemoteFormInput
24632497
24642498<div class =" ts-block " >
You can’t perform that action at this time.
0 commit comments