Skip to content

Commit 69b49b6

Browse files
ci: apply automated fixes and generate docs
1 parent 7e46037 commit 69b49b6

16 files changed

+229
-88
lines changed

docs/reference/classes/formapi.md

+34-34
Large diffs are not rendered by default.

docs/reference/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ title: "@tanstack/form-core"
2020
- [FieldListeners](interfaces/fieldlisteners.md)
2121
- [FieldOptions](interfaces/fieldoptions.md)
2222
- [FieldValidators](interfaces/fieldvalidators.md)
23+
- [FormListeners](interfaces/formlisteners.md)
2324
- [FormOptions](interfaces/formoptions.md)
2425
- [FormState](interfaces/formstate.md)
2526
- [FormValidators](interfaces/formvalidators.md)
+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
id: FormListeners
3+
title: FormListeners
4+
---
5+
6+
<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7+
8+
# Interface: FormListeners\<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta\>
9+
10+
Defined in: [packages/form-core/src/FormApi.ts:241](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L241)
11+
12+
## Type Parameters
13+
14+
**TFormData**
15+
16+
**TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\>
17+
18+
**TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\>
19+
20+
**TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>
21+
22+
**TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\>
23+
24+
**TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>
25+
26+
**TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\>
27+
28+
**TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>
29+
30+
**TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>
31+
32+
**TSubmitMeta** = `never`
33+
34+
## Properties
35+
36+
### onBlur()?
37+
38+
```ts
39+
optional onBlur: (props) => void;
40+
```
41+
42+
Defined in: [packages/form-core/src/FormApi.ts:269](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L269)
43+
44+
#### Parameters
45+
46+
##### props
47+
48+
###### fieldApi
49+
50+
[`AnyFieldApi`](../type-aliases/anyfieldapi.md)
51+
52+
###### formApi
53+
54+
[`FormApi`](../classes/formapi.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\>
55+
56+
#### Returns
57+
58+
`void`
59+
60+
***
61+
62+
### onChange()?
63+
64+
```ts
65+
optional onChange: (props) => void;
66+
```
67+
68+
Defined in: [packages/form-core/src/FormApi.ts:253](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L253)
69+
70+
#### Parameters
71+
72+
##### props
73+
74+
###### fieldApi
75+
76+
[`AnyFieldApi`](../type-aliases/anyfieldapi.md)
77+
78+
###### formApi
79+
80+
[`FormApi`](../classes/formapi.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\>
81+
82+
#### Returns
83+
84+
`void`
85+
86+
***
87+
88+
### onMount()?
89+
90+
```ts
91+
optional onMount: (props) => void;
92+
```
93+
94+
Defined in: [packages/form-core/src/FormApi.ts:285](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L285)
95+
96+
#### Parameters
97+
98+
##### props
99+
100+
###### formApi
101+
102+
[`FormApi`](../classes/formapi.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\>
103+
104+
#### Returns
105+
106+
`void`
107+
108+
***
109+
110+
### onSubmit()?
111+
112+
```ts
113+
optional onSubmit: (props) => void;
114+
```
115+
116+
Defined in: [packages/form-core/src/FormApi.ts:300](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L300)
117+
118+
#### Parameters
119+
120+
##### props
121+
122+
###### formApi
123+
124+
[`FormApi`](../classes/formapi.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\>
125+
126+
#### Returns
127+
128+
`void`

docs/reference/interfaces/formoptions.md

+23-11
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: FormOptions
77

88
# Interface: FormOptions\<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta\>
99

10-
Defined in: [packages/form-core/src/FormApi.ts:239](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L239)
10+
Defined in: [packages/form-core/src/FormApi.ts:319](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L319)
1111

1212
An object representing the options for a form.
1313

@@ -41,7 +41,7 @@ An object representing the options for a form.
4141
optional asyncAlways: boolean;
4242
```
4343

44-
Defined in: [packages/form-core/src/FormApi.ts:274](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L274)
44+
Defined in: [packages/form-core/src/FormApi.ts:354](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L354)
4545

4646
If true, always run async validation, even when sync validation has produced an error. Defaults to undefined.
4747

@@ -53,7 +53,7 @@ If true, always run async validation, even when sync validation has produced an
5353
optional asyncDebounceMs: number;
5454
```
5555

56-
Defined in: [packages/form-core/src/FormApi.ts:278](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L278)
56+
Defined in: [packages/form-core/src/FormApi.ts:358](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L358)
5757

5858
Optional time in milliseconds if you want to introduce a delay before firing off an async action.
5959

@@ -65,7 +65,7 @@ Optional time in milliseconds if you want to introduce a delay before firing off
6565
optional canSubmitWhenInvalid: boolean;
6666
```
6767

68-
Defined in: [packages/form-core/src/FormApi.ts:282](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L282)
68+
Defined in: [packages/form-core/src/FormApi.ts:362](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L362)
6969

7070
If true, allows the form to be submitted in an invalid state i.e. canSubmit will remain true regardless of validation errors. Defaults to undefined.
7171

@@ -77,7 +77,7 @@ If true, allows the form to be submitted in an invalid state i.e. canSubmit will
7777
optional defaultState: Partial<FormState<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer>>;
7878
```
7979

80-
Defined in: [packages/form-core/src/FormApi.ts:258](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L258)
80+
Defined in: [packages/form-core/src/FormApi.ts:338](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L338)
8181

8282
The default state for the form.
8383

@@ -89,19 +89,31 @@ The default state for the form.
8989
optional defaultValues: TFormData;
9090
```
9191

92-
Defined in: [packages/form-core/src/FormApi.ts:254](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L254)
92+
Defined in: [packages/form-core/src/FormApi.ts:334](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L334)
9393

9494
Set initial values for your form.
9595

9696
***
9797

98+
### listeners?
99+
100+
```ts
101+
optional listeners: FormListeners<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta>;
102+
```
103+
104+
Defined in: [packages/form-core/src/FormApi.ts:385](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L385)
105+
106+
form level listeners
107+
108+
***
109+
98110
### onSubmit()?
99111

100112
```ts
101113
optional onSubmit: (props) => any;
102114
```
103115

104-
Defined in: [packages/form-core/src/FormApi.ts:305](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L305)
116+
Defined in: [packages/form-core/src/FormApi.ts:401](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L401)
105117

106118
A function to be called when the form is submitted, what should happen once the user submits a valid form returns `any` or a promise `Promise<any>`
107119

@@ -133,7 +145,7 @@ A function to be called when the form is submitted, what should happen once the
133145
optional onSubmitInvalid: (props) => void;
134146
```
135147

136-
Defined in: [packages/form-core/src/FormApi.ts:324](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L324)
148+
Defined in: [packages/form-core/src/FormApi.ts:420](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L420)
137149

138150
Specify an action for scenarios where the user tries to submit an invalid form.
139151

@@ -161,7 +173,7 @@ Specify an action for scenarios where the user tries to submit an invalid form.
161173
optional onSubmitMeta: TSubmitMeta;
162174
```
163175

164-
Defined in: [packages/form-core/src/FormApi.ts:300](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L300)
176+
Defined in: [packages/form-core/src/FormApi.ts:380](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L380)
165177

166178
onSubmitMeta, the data passed from the handleSubmit handler, to the onSubmit function props
167179

@@ -173,7 +185,7 @@ onSubmitMeta, the data passed from the handleSubmit handler, to the onSubmit fun
173185
optional transform: FormTransform<NoInfer<TFormData>, NoInfer<TOnMount>, NoInfer<TOnChange>, NoInfer<TOnChangeAsync>, NoInfer<TOnBlur>, NoInfer<TOnBlurAsync>, NoInfer<TOnSubmit>, NoInfer<TOnSubmitAsync>, NoInfer<TOnServer>, NoInfer<TSubmitMeta>>;
174186
```
175187

176-
Defined in: [packages/form-core/src/FormApi.ts:339](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L339)
188+
Defined in: [packages/form-core/src/FormApi.ts:435](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L435)
177189

178190
***
179191

@@ -183,6 +195,6 @@ Defined in: [packages/form-core/src/FormApi.ts:339](https://github.com/TanStack/
183195
optional validators: FormValidators<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync>;
184196
```
185197

186-
Defined in: [packages/form-core/src/FormApi.ts:286](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L286)
198+
Defined in: [packages/form-core/src/FormApi.ts:366](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L366)
187199

188200
A list of validators to pass to the form

0 commit comments

Comments
 (0)