Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions apps/svelte.dev/content/docs/kit/98-reference/10-@sveltejs-kit.md
Original file line number Diff line number Diff line change
Expand Up @@ -2357,7 +2357,10 @@ type RemoteForm<
): RemoteForm<Input, Output>;
/** Validate the form contents programmatically */
validate(options?: {
/** Set this to `true` to also show validation issues of fields that haven't been touched yet. */
includeUntouched?: boolean;
/** Set this to `true` to only run the `preflight` validation. */
preflightOnly?: boolean;
/** Perform validation as if the form was submitted by the given button. */
submitter?: HTMLButtonElement | HTMLInputElement;
}): Promise<void>;
Expand Down Expand Up @@ -2459,6 +2462,37 @@ type RemoteFormFieldValue =

</div>

## RemoteFormFields

Recursive type to build form fields structure with proxy access

<div class="ts-block">

```dts
type RemoteFormFields<T> =
WillRecurseIndefinitely<T> extends true
? RecursiveFormFields
: NonNullable<T> extends
| string
| number
| boolean
| File
? RemoteFormField<NonNullable<T>>
: T extends string[] | File[]
? RemoteFormField<T> & {
[K in number]: RemoteFormField<T[number]>;
}
: T extends Array<infer U>
? RemoteFormFieldContainer<T> & {
[K in number]: RemoteFormFields<U>;
}
: RemoteFormFieldContainer<T> & {
[K in keyof T]-?: RemoteFormFields<T[K]>;
};
```

</div>

## RemoteFormInput

<div class="ts-block">
Expand Down