Skip to content

Commit 1aadc73

Browse files
Sync kit docs (#1628)
sync kit docs Co-authored-by: svelte-docs-bot[bot] <196124396+svelte-docs-bot[bot]@users.noreply.github.com>
1 parent 1edc9f4 commit 1aadc73

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

apps/svelte.dev/content/docs/kit/98-reference/10-@sveltejs-kit.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff 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">

0 commit comments

Comments
 (0)