Skip to content

Commit 2a69677

Browse files
committed
clarify remote form type descriptions
1 parent 05cca10 commit 2a69677

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

packages/kit/src/exports/public.d.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,16 +2008,19 @@ export type RemoteFormFactoryOptions<Input extends RemoteFormInput | void> = {
20082008
preflight?: StandardSchemaV1<Input, any>;
20092009
/** Initial input values for the form fields */
20102010
initialData?: DeepPartial<Input>;
2011-
/** Reset the form values after successful submission (default: true) */
2011+
/** Reset the form values after successful submission, for non-enhanced forms (default: true) */
20122012
resetAfterSuccess?: boolean;
20132013
};
20142014

2015+
/**
2016+
* The return value of a remote `form` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation.
2017+
*/
20152018
export type RemoteFormFactory<Input extends RemoteFormInput | void, Output> = (
20162019
keyOrOptions?: ExtractId<Input> | RemoteFormFactoryOptions<Input>
20172020
) => RemoteForm<Input, Output>;
20182021

20192022
/**
2020-
* The return value of a remote `form` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation.
2023+
* The remote form instance created by the form factory function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation.
20212024
*/
20222025
export type RemoteForm<Input extends RemoteFormInput | void, Output> = {
20232026
/** Attachment that sets up an event handler that intercepts the form submission on the client to prevent a full page reload */

packages/kit/types/index.d.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,16 +1982,19 @@ declare module '@sveltejs/kit' {
19821982
preflight?: StandardSchemaV1<Input, any>;
19831983
/** Initial input values for the form fields */
19841984
initialData?: DeepPartial<Input>;
1985-
/** Reset the form values after successful submission (default: true) */
1985+
/** Reset the form values after successful submission, for non-enhanced forms (default: true) */
19861986
resetAfterSuccess?: boolean;
19871987
};
19881988

1989+
/**
1990+
* The return value of a remote `form` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation.
1991+
*/
19891992
export type RemoteFormFactory<Input extends RemoteFormInput | void, Output> = (
19901993
keyOrOptions?: ExtractId<Input> | RemoteFormFactoryOptions<Input>
19911994
) => RemoteForm<Input, Output>;
19921995

19931996
/**
1994-
* The return value of a remote `form` function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation.
1997+
* The remote form instance created by the form factory function. See [Remote functions](https://svelte.dev/docs/kit/remote-functions#form) for full documentation.
19951998
*/
19961999
export type RemoteForm<Input extends RemoteFormInput | void, Output> = {
19972000
/** Attachment that sets up an event handler that intercepts the form submission on the client to prevent a full page reload */

0 commit comments

Comments
 (0)