From de062c3da1e1e64840ade2d755fdb50ad66e79fa Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Thu, 18 Jul 2024 12:26:41 +1000 Subject: [PATCH] docs: Update typedoc (#865) --- .../framework/angular/reference/injectform.md | 6 +- .../angular/reference/injectstore.md | 6 +- .../angular/reference/tanstackfield.md | 82 ++++++--- .../lit/reference/tanstackformcontroller.md | 33 ++-- docs/framework/react/reference/field.md | 6 +- .../react/reference/fieldcomponent.md | 10 +- docs/framework/react/reference/usefield.md | 6 +- docs/framework/react/reference/useform.md | 6 +- .../framework/react/reference/usetransform.md | 6 +- .../{createField.md => createfield.md} | 6 +- .../{createForm.md => createform.md} | 6 +- .../solid/reference/{Field.md => field.md} | 6 +- .../solid/reference/fieldcomponent.md | 10 +- .../vue/reference/{Field.md => field.md} | 6 +- .../framework/vue/reference/fieldcomponent.md | 10 +- .../reference/{useField.md => usefield.md} | 6 +- .../vue/reference/{useForm.md => useform.md} | 6 +- docs/reference/deepkeys.md | 8 +- docs/reference/deepvalue.md | 8 +- docs/reference/fieldapi.md | 120 ++++++------- docs/reference/fieldapioptions.md | 34 ++-- docs/reference/fieldinfo.md | 8 +- docs/reference/fieldmeta.md | 6 +- docs/reference/fieldoptions.md | 30 ++-- docs/reference/fieldstate.md | 8 +- docs/reference/fieldvalidators.md | 46 ++--- docs/reference/formapi.md | 160 ++++++++---------- docs/reference/formoptions.md | 6 +- docs/reference/formstate.md | 8 +- docs/reference/formvalidators.md | 38 ++--- docs/reference/mergeform.md | 6 +- docs/reference/updater.md | 8 +- docs/reference/updaterfn.md | 8 +- docs/reference/validationerror.md | 6 +- docs/reference/validationmeta.md | 6 +- knip.json | 3 +- package.json | 2 +- pnpm-lock.yaml | 143 ++++++++++------ scripts/reference-docs.js | 75 +++----- ...ve-prefix.mjs => typedoc-remove-prefix.js} | 0 40 files changed, 488 insertions(+), 466 deletions(-) rename docs/framework/solid/reference/{createField.md => createfield.md} (78%) rename docs/framework/solid/reference/{createForm.md => createform.md} (73%) rename docs/framework/solid/reference/{Field.md => field.md} (80%) rename docs/framework/vue/reference/{Field.md => field.md} (88%) rename docs/framework/vue/reference/{useField.md => usefield.md} (90%) rename docs/framework/vue/reference/{useForm.md => useform.md} (85%) rename scripts/{typedoc-remove-prefix.mjs => typedoc-remove-prefix.js} (100%) diff --git a/docs/framework/angular/reference/injectform.md b/docs/framework/angular/reference/injectform.md index 77a7fd555..d4c75daec 100644 --- a/docs/framework/angular/reference/injectform.md +++ b/docs/framework/angular/reference/injectform.md @@ -4,7 +4,7 @@ function injectForm(opts?): FormApi ``` -## Type parameters +## Type Parameters • **TFormData** @@ -18,6 +18,6 @@ function injectForm(opts?): FormApi -## Source +## Defined in -[inject-form.ts:4](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/angular-form/src/inject-form.ts#L4) +[inject-form.ts:4](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/angular-form/src/inject-form.ts#L4) diff --git a/docs/framework/angular/reference/injectstore.md b/docs/framework/angular/reference/injectstore.md index ac5907f3c..6d3302b89 100644 --- a/docs/framework/angular/reference/injectstore.md +++ b/docs/framework/angular/reference/injectstore.md @@ -4,7 +4,7 @@ function injectStore(form, selector?): Signal ``` -## Type parameters +## Type Parameters • **TFormData** @@ -22,6 +22,6 @@ function injectStore(form, selector?): Sig `Signal`\<`TSelected`\> -## Source +## Defined in -[inject-store.ts:4](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/angular-form/src/inject-store.ts#L4) +[inject-store.ts:4](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/angular-form/src/inject-store.ts#L4) diff --git a/docs/framework/angular/reference/tanstackfield.md b/docs/framework/angular/reference/tanstackfield.md index afdd9ddbb..bd48818f7 100644 --- a/docs/framework/angular/reference/tanstackfield.md +++ b/docs/framework/angular/reference/tanstackfield.md @@ -1,6 +1,6 @@ # Class: TanStackField\ -## Type parameters +## Type Parameters • **TParentData** @@ -39,9 +39,9 @@ new TanStackField(): api: FieldApi; ``` -#### Source +#### Defined in -[tanstack-field.directive.ts:61](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/angular-form/src/tanstack-field.directive.ts#L61) +[tanstack-field.directive.ts:61](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/angular-form/src/tanstack-field.directive.ts#L61) *** @@ -51,13 +51,15 @@ api: FieldApi; optional asyncAlways: boolean; ``` +If `true`, always run async validation, even if there are errors emitted during synchronous validation. + #### Implementation of `FieldOptions.asyncAlways` -#### Source +#### Defined in -[tanstack-field.directive.ts:50](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/angular-form/src/tanstack-field.directive.ts#L50) +[tanstack-field.directive.ts:50](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/angular-form/src/tanstack-field.directive.ts#L50) *** @@ -67,13 +69,15 @@ optional asyncAlways: boolean; optional asyncDebounceMs: number; ``` +The default time to debounce async validation if there is not a more specific debounce time passed. + #### Implementation of `FieldOptions.asyncDebounceMs` -#### Source +#### Defined in -[tanstack-field.directive.ts:49](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/angular-form/src/tanstack-field.directive.ts#L49) +[tanstack-field.directive.ts:49](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/angular-form/src/tanstack-field.directive.ts#L49) *** @@ -83,13 +87,15 @@ optional asyncDebounceMs: number; optional defaultMeta: Partial; ``` +An optional object with default metadata for the field. + #### Implementation of `FieldOptions.defaultMeta` -#### Source +#### Defined in -[tanstack-field.directive.ts:59](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/angular-form/src/tanstack-field.directive.ts#L59) +[tanstack-field.directive.ts:59](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/angular-form/src/tanstack-field.directive.ts#L59) *** @@ -99,13 +105,15 @@ optional defaultMeta: Partial; optional defaultValue: NoInfer; ``` +An optional default value for the field. + #### Implementation of `FieldOptions.defaultValue` -#### Source +#### Defined in -[tanstack-field.directive.ts:48](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/angular-form/src/tanstack-field.directive.ts#L48) +[tanstack-field.directive.ts:48](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/angular-form/src/tanstack-field.directive.ts#L48) *** @@ -115,13 +123,15 @@ optional defaultValue: NoInfer; name: TName; ``` +The field name. The type will be `DeepKeys` to ensure your name is a deep key of the parent dataset. + #### Implementation of `FieldOptions.name` -#### Source +#### Defined in -[tanstack-field.directive.ts:44](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/angular-form/src/tanstack-field.directive.ts#L44) +[tanstack-field.directive.ts:44](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/angular-form/src/tanstack-field.directive.ts#L44) *** @@ -131,9 +141,9 @@ name: TName; tanstackField: FormApi; ``` -#### Source +#### Defined in -[tanstack-field.directive.ts:52](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/angular-form/src/tanstack-field.directive.ts#L52) +[tanstack-field.directive.ts:52](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/angular-form/src/tanstack-field.directive.ts#L52) *** @@ -147,9 +157,9 @@ optional unmount: () => void; `void` -#### Source +#### Defined in -[tanstack-field.directive.ts:76](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/angular-form/src/tanstack-field.directive.ts#L76) +[tanstack-field.directive.ts:76](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/angular-form/src/tanstack-field.directive.ts#L76) *** @@ -159,13 +169,15 @@ optional unmount: () => void; optional validatorAdapter: TFieldValidator; ``` +A validator provided by an extension, like `yupValidator` from `@tanstack/yup-form-adapter` + #### Implementation of `FieldOptions.validatorAdapter` -#### Source +#### Defined in -[tanstack-field.directive.ts:51](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/angular-form/src/tanstack-field.directive.ts#L51) +[tanstack-field.directive.ts:51](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/angular-form/src/tanstack-field.directive.ts#L51) *** @@ -175,13 +187,15 @@ optional validatorAdapter: TFieldValidator; optional validators: NoInfer>; ``` +A list of validators to pass to the field + #### Implementation of `FieldOptions.validators` -#### Source +#### Defined in -[tanstack-field.directive.ts:56](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/angular-form/src/tanstack-field.directive.ts#L56) +[tanstack-field.directive.ts:56](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/angular-form/src/tanstack-field.directive.ts#L56) ## Methods @@ -191,6 +205,11 @@ optional validators: NoInfer -## Type parameters +## Type Parameters • **TParentData** @@ -28,9 +28,9 @@ new TanStackFormController(host, config?): TanStack [`TanStackFormController`](tanstackformcontroller.md)\<`TParentData`, `TFormValidator`\> -#### Source +#### Defined in -[tanstack-form-controller.ts:93](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/lit-form/src/tanstack-form-controller.ts#L93) +[tanstack-form-controller.ts:93](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/lit-form/src/tanstack-form-controller.ts#L93) ## Properties @@ -40,9 +40,9 @@ new TanStackFormController(host, config?): TanStack api: FormApi; ``` -#### Source +#### Defined in -[tanstack-form-controller.ts:91](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/lit-form/src/tanstack-form-controller.ts#L91) +[tanstack-form-controller.ts:91](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/lit-form/src/tanstack-form-controller.ts#L91) ## Methods @@ -52,7 +52,7 @@ api: FormApi; field(fieldConfig, render): object ``` -#### Type parameters +#### Type Parameters • **TName** *extends* `string` \| `number` @@ -94,9 +94,9 @@ options: FieldOptions; ``` -#### Source +#### Defined in -[tanstack-form-controller.ts:112](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/lit-form/src/tanstack-form-controller.ts#L112) +[tanstack-form-controller.ts:112](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/lit-form/src/tanstack-form-controller.ts#L112) *** @@ -106,6 +106,10 @@ render: renderCallback +# Type Alias: FieldComponent()\ ```ts type FieldComponent: ({ @@ -9,13 +9,13 @@ type FieldComponent: \| `undefined` = `undefined` -## Type parameters +## Type Parameters • **TName** *extends* `DeepKeys`\<`TParentData`\> @@ -34,6 +34,6 @@ A type alias representing a field component for a specific form data type. `NodeType` -## Source +## Defined in -[useField.tsx:133](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/react-form/src/useField.tsx#L133) +[useField.tsx:133](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/react-form/src/useField.tsx#L133) diff --git a/docs/framework/react/reference/usefield.md b/docs/framework/react/reference/usefield.md index 6288dd73d..1212cb601 100644 --- a/docs/framework/react/reference/usefield.md +++ b/docs/framework/react/reference/usefield.md @@ -6,7 +6,7 @@ function useField(op A hook for managing a field in a form. -## Type parameters +## Type Parameters • **TParentData** @@ -30,6 +30,6 @@ An object with field options. The `FieldApi` instance for the specified field. -## Source +## Defined in -[useField.tsx:49](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/react-form/src/useField.tsx#L49) +[useField.tsx:49](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/react-form/src/useField.tsx#L49) diff --git a/docs/framework/react/reference/useform.md b/docs/framework/react/reference/useform.md index 0ac080b51..7853d401e 100644 --- a/docs/framework/react/reference/useform.md +++ b/docs/framework/react/reference/useform.md @@ -8,7 +8,7 @@ A custom React Hook that returns an extended instance of the `FormApi` class. This API encapsulates all the necessary functionalities related to the form. It allows you to manage form state, handle submissions, and interact with form fields -## Type parameters +## Type Parameters • **TFormData** @@ -22,6 +22,6 @@ This API encapsulates all the necessary functionalities related to the form. It `FormApi`\<`TFormData`, `TFormValidator`\> & `ReactFormApi`\<`TFormData`, `TFormValidator`\> -## Source +## Defined in -[useForm.tsx:56](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/react-form/src/useForm.tsx#L56) +[useForm.tsx:56](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/react-form/src/useForm.tsx#L56) diff --git a/docs/framework/react/reference/usetransform.md b/docs/framework/react/reference/usetransform.md index 97de10dac..9710c2395 100644 --- a/docs/framework/react/reference/usetransform.md +++ b/docs/framework/react/reference/usetransform.md @@ -4,7 +4,7 @@ function useTransform(fn, deps): object ``` -## Type parameters +## Type Parameters • **TFormData** @@ -40,6 +40,6 @@ fn: (formBase) => FormApi; `FormApi`\<`TFormData`, `TFormValidator`\> -## Source +## Defined in -[useTransform.ts:3](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/react-form/src/useTransform.ts#L3) +[useTransform.ts:3](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/react-form/src/useTransform.ts#L3) diff --git a/docs/framework/solid/reference/createField.md b/docs/framework/solid/reference/createfield.md similarity index 78% rename from docs/framework/solid/reference/createField.md rename to docs/framework/solid/reference/createfield.md index 9d519913b..813bd8d91 100644 --- a/docs/framework/solid/reference/createField.md +++ b/docs/framework/solid/reference/createfield.md @@ -4,7 +4,7 @@ function createField(opts): () => never ``` -## Type parameters +## Type Parameters • **TParentData** @@ -28,6 +28,6 @@ function createField `never` -## Source +## Defined in -[createField.tsx:87](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/solid-form/src/createField.tsx#L87) +[createField.tsx:87](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/solid-form/src/createField.tsx#L87) diff --git a/docs/framework/solid/reference/createForm.md b/docs/framework/solid/reference/createform.md similarity index 73% rename from docs/framework/solid/reference/createForm.md rename to docs/framework/solid/reference/createform.md index ba0271794..20cff4aa5 100644 --- a/docs/framework/solid/reference/createForm.md +++ b/docs/framework/solid/reference/createform.md @@ -4,7 +4,7 @@ function createForm(opts?): FormApi & SolidFormApi ``` -## Type parameters +## Type Parameters • **TParentData** @@ -18,6 +18,6 @@ function createForm(opts?): FormApi & `SolidFormApi`\<`TParentData`, `TFormValidator`\> -## Source +## Defined in -[createForm.tsx:29](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/solid-form/src/createForm.tsx#L29) +[createForm.tsx:29](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/solid-form/src/createForm.tsx#L29) diff --git a/docs/framework/solid/reference/Field.md b/docs/framework/solid/reference/field.md similarity index 80% rename from docs/framework/solid/reference/Field.md rename to docs/framework/solid/reference/field.md index 17ef1e29f..16397aa14 100644 --- a/docs/framework/solid/reference/Field.md +++ b/docs/framework/solid/reference/field.md @@ -4,7 +4,7 @@ function Field(props): Element ``` -## Type parameters +## Type Parameters • **TParentData** @@ -24,6 +24,6 @@ function Field(props `Element` -## Source +## Defined in -[createField.tsx:185](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/solid-form/src/createField.tsx#L185) +[createField.tsx:185](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/solid-form/src/createField.tsx#L185) diff --git a/docs/framework/solid/reference/fieldcomponent.md b/docs/framework/solid/reference/fieldcomponent.md index 216c936c8..8cc544b66 100644 --- a/docs/framework/solid/reference/fieldcomponent.md +++ b/docs/framework/solid/reference/fieldcomponent.md @@ -1,4 +1,4 @@ -# Type alias: FieldComponent()\ +# Type Alias: FieldComponent()\ ```ts type FieldComponent: ({ @@ -7,13 +7,13 @@ type FieldComponent: JSXElement; ``` -## Type parameters +## Type Parameters • **TParentData** • **TFormValidator** *extends* `Validator`\<`TParentData`, `unknown`\> \| `undefined` = `undefined` -## Type parameters +## Type Parameters • **TName** *extends* `DeepKeys`\<`TParentData`\> @@ -32,6 +32,6 @@ type FieldComponent: (props): any ``` -## Type parameters +## Type Parameters • **TParentData** @@ -24,6 +24,6 @@ function Field(props `any` -## Source +## Defined in -[packages/vue-form/src/useField.tsx:162](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/vue-form/src/useField.tsx#L162) +[packages/vue-form/src/useField.tsx:162](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/vue-form/src/useField.tsx#L162) diff --git a/docs/framework/vue/reference/fieldcomponent.md b/docs/framework/vue/reference/fieldcomponent.md index 425b86946..44c7a941c 100644 --- a/docs/framework/vue/reference/fieldcomponent.md +++ b/docs/framework/vue/reference/fieldcomponent.md @@ -1,16 +1,16 @@ -# Type alias: FieldComponent()\ +# Type Alias: FieldComponent()\ ```ts type FieldComponent: (fieldOptions, context) => any; ``` -## Type parameters +## Type Parameters • **TParentData** • **TFormValidator** *extends* `Validator`\<`TParentData`, `unknown`\> \| `undefined` = `undefined` -## Type parameters +## Type Parameters • **TName** *extends* `DeepKeys`\<`TParentData`\> @@ -28,6 +28,6 @@ type FieldComponent: (opts): object ``` -## Type parameters +## Type Parameters • **TParentData** @@ -36,6 +36,6 @@ readonly api: FieldApi>> = fieldState; ``` -## Source +## Defined in -[packages/vue-form/src/useField.tsx:49](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/vue-form/src/useField.tsx#L49) +[packages/vue-form/src/useField.tsx:49](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/vue-form/src/useField.tsx#L49) diff --git a/docs/framework/vue/reference/useForm.md b/docs/framework/vue/reference/useform.md similarity index 85% rename from docs/framework/vue/reference/useForm.md rename to docs/framework/vue/reference/useform.md index 17372a1a4..009689a55 100644 --- a/docs/framework/vue/reference/useForm.md +++ b/docs/framework/vue/reference/useform.md @@ -4,7 +4,7 @@ function useForm(opts?): FormApi & VueFormApi ``` -## Type parameters +## Type Parameters • **TFormData** @@ -18,6 +18,6 @@ function useForm(opts?): FormApi & `VueFormApi`\<`TFormData`, `TFormValidator`\> -## Source +## Defined in -[packages/vue-form/src/useForm.tsx:30](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/vue-form/src/useForm.tsx#L30) +[packages/vue-form/src/useForm.tsx:30](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/vue-form/src/useForm.tsx#L30) diff --git a/docs/reference/deepkeys.md b/docs/reference/deepkeys.md index afa9863b7..3f080f58a 100644 --- a/docs/reference/deepkeys.md +++ b/docs/reference/deepkeys.md @@ -1,4 +1,4 @@ -# Type alias: DeepKeys\ +# Type Alias: DeepKeys\ ```ts type DeepKeys: TDepth["length"] extends 5 ? never : unknown extends T ? PrefixFromDepth : T extends readonly any[] & IsTuple ? PrefixTupleAccessor, TDepth> : T extends any[] ? PrefixArrayAccessor : T extends Date ? never : T extends object ? PrefixObjectAccessor : T extends string | number | boolean | bigint ? "" : never; @@ -6,12 +6,12 @@ type DeepKeys: TDepth["length"] extends 5 ? never : unknown extends T The keys of an object or array, deeply nested. -## Type parameters +## Type Parameters • **T** • **TDepth** *extends* `any`[] = [] -## Source +## Defined in -[packages/form-core/src/util-types.ts:85](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/util-types.ts#L85) +[packages/form-core/src/util-types.ts:85](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/util-types.ts#L85) diff --git a/docs/reference/deepvalue.md b/docs/reference/deepvalue.md index fb06d50b3..14b04a55c 100644 --- a/docs/reference/deepvalue.md +++ b/docs/reference/deepvalue.md @@ -1,4 +1,4 @@ -# Type alias: DeepValue\ +# Type Alias: DeepValue\ ```ts type DeepValue: unknown extends TValue ? TValue : TValue extends ReadonlyArray ? TAccessor extends `[${infer TBrackets}].${infer TAfter}` ? DeepValue, TAfter> : TAccessor extends `[${infer TBrackets}]` ? DeepValue : TAccessor extends keyof TValue ? TValue[TAccessor] : TValue[TAccessor & number] : TValue extends Record ? TAccessor extends `${infer TBefore}[${infer TEverythingElse}` ? DeepValue, `[${TEverythingElse}`> : TAccessor extends `[${infer TBrackets}]` ? DeepValue : TAccessor extends `${infer TBefore}.${infer TAfter}` ? DeepValue, TAfter> : TAccessor extends string ? TNullable extends true ? Nullable : TValue[TAccessor] : never : never; @@ -6,7 +6,7 @@ type DeepValue: unknown extends TValue ? TValue : Infer the type of a deeply nested property within an object or an array. -## Type parameters +## Type Parameters • **TValue** @@ -14,6 +14,6 @@ Infer the type of a deeply nested property within an object or an array. • **TNullable** *extends* `boolean` = `IsNullable`\<`TValue`\> -## Source +## Defined in -[packages/form-core/src/util-types.ts:109](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/util-types.ts#L109) +[packages/form-core/src/util-types.ts:109](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/util-types.ts#L109) diff --git a/docs/reference/fieldapi.md b/docs/reference/fieldapi.md index 630ecb36b..22e9df467 100644 --- a/docs/reference/fieldapi.md +++ b/docs/reference/fieldapi.md @@ -8,7 +8,7 @@ to create a new instance for you that uses your framework's reactivity model. However, if you need to create a new instance manually, you can do so by calling the `new FieldApi` constructor. -## Type parameters +## Type Parameters • **TParentData** @@ -38,9 +38,9 @@ Initializes a new `FieldApi` instance. [`FieldApi`](fieldapi.md)\<`TParentData`, `TName`, `TFieldValidator`, `TFormValidator`, `TData`\> -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:431](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L431) +[packages/form-core/src/FieldApi.ts:432](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L432) ## Properties @@ -52,9 +52,9 @@ form: FormApi; A reference to the form API instance. -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:394](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L394) +[packages/form-core/src/FieldApi.ts:395](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L395) *** @@ -66,9 +66,9 @@ name: unknown extends TParentData ? string : TParentData extends readonly any[] The field name. -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:404](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L404) +[packages/form-core/src/FieldApi.ts:405](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L405) *** @@ -80,9 +80,9 @@ options: FieldApiOptions; The current field state. -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:422](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L422) +[packages/form-core/src/FieldApi.ts:423](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L423) *** @@ -108,9 +108,9 @@ store: Store, (cb) => FieldState>; The field state store. -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:418](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L418) +[packages/form-core/src/FieldApi.ts:419](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L419) ## Methods @@ -126,9 +126,9 @@ Gets the field information object. [`FieldInfo`](fieldinfo.md)\<`TParentData`, `TFormValidator`\> -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:638](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L638) +[packages/form-core/src/FieldApi.ts:642](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L642) *** @@ -144,9 +144,9 @@ Gets the current field metadata. [`FieldMeta`](fieldmeta.md) -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:617](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L617) +[packages/form-core/src/FieldApi.ts:621](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L621) *** @@ -166,9 +166,9 @@ Gets the current field value. Use `field.state.value` instead. -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:594](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L594) +[packages/form-core/src/FieldApi.ts:601](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L601) *** @@ -184,9 +184,9 @@ Handles the blur event. `void` -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:952](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L952) +[packages/form-core/src/FieldApi.ts:956](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L956) *** @@ -206,9 +206,9 @@ Handles the change event. `void` -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:945](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L945) +[packages/form-core/src/FieldApi.ts:949](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L949) *** @@ -229,17 +229,15 @@ Inserts a value at the specified index, shifting the subsequent values to the ri • **value**: `TData` *extends* `any`[] ? `TData`\<`TData`\>\[`number`\] : `never` -• **opts?** - -• **opts.touch?**: `boolean` +• **opts?**: `UpdateMetaOptions` #### Returns `Promise`\<`void`\> -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:651](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L651) +[packages/form-core/src/FieldApi.ts:655](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L655) *** @@ -259,9 +257,9 @@ Mounts the field instance to the form. `void` -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:514](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L514) +[packages/form-core/src/FieldApi.ts:517](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L517) *** @@ -282,17 +280,15 @@ Moves the value at the first specified index to the second specified index. • **bIndex**: `number` -• **opts?** - -• **opts.touch?**: `boolean` +• **opts?**: `UpdateMetaOptions` #### Returns `void` -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:681](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L681) +[packages/form-core/src/FieldApi.ts:685](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L685) *** @@ -308,17 +304,15 @@ Pushes a new value to the field. • **value**: `TData` *extends* `any`[] ? `TData`\<`TData`\>\[`number`\] : `never` -• **opts?** - -• **opts.touch?**: `boolean` +• **opts?**: `UpdateMetaOptions` #### Returns `void` -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:643](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L643) +[packages/form-core/src/FieldApi.ts:647](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L647) *** @@ -334,17 +328,15 @@ Removes a value at the specified index. • **index**: `number` -• **opts?** - -• **opts.touch?**: `boolean` +• **opts?**: `UpdateMetaOptions` #### Returns `Promise`\<`void`\> -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:669](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L669) +[packages/form-core/src/FieldApi.ts:673](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L673) *** @@ -365,17 +357,15 @@ Replaces a value at the specified index. • **value**: `TData` *extends* `any`[] ? `TData`\<`TData`\>\[`number`\] : `never` -• **opts?** - -• **opts.touch?**: `boolean` +• **opts?**: `UpdateMetaOptions` #### Returns `Promise`\<`void`\> -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:660](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L660) +[packages/form-core/src/FieldApi.ts:664](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L664) *** @@ -395,9 +385,9 @@ Sets the field metadata. `void` -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:632](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L632) +[packages/form-core/src/FieldApi.ts:636](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L636) *** @@ -413,19 +403,15 @@ Sets the field value and run the `change` validator. • **updater**: [`Updater`](updater.md)\<`TData`\> -• **options?** - -• **options.notify?**: `boolean` - -• **options.touch?**: `boolean` +• **options?**: `UpdateMetaOptions` #### Returns `void` -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:601](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L601) +[packages/form-core/src/FieldApi.ts:608](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L608) *** @@ -446,17 +432,15 @@ Swaps the values at the specified indices. • **bIndex**: `number` -• **opts?** - -• **opts.touch?**: `boolean` +• **opts?**: `UpdateMetaOptions` #### Returns `void` -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:675](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L675) +[packages/form-core/src/FieldApi.ts:679](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L679) *** @@ -476,9 +460,9 @@ Updates the field instance with new options. `void` -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:561](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L561) +[packages/form-core/src/FieldApi.ts:564](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L564) *** @@ -498,6 +482,6 @@ Validates the field value. [`ValidationError`](validationerror.md)[] \| `Promise`\<[`ValidationError`](validationerror.md)[]\> -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:919](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L919) +[packages/form-core/src/FieldApi.ts:923](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L923) diff --git a/docs/reference/fieldapioptions.md b/docs/reference/fieldapioptions.md index ba5635a80..09c8dbf65 100644 --- a/docs/reference/fieldapioptions.md +++ b/docs/reference/fieldapioptions.md @@ -6,7 +6,7 @@ An object type representing the required options for the FieldApi class. - [`FieldOptions`](fieldoptions.md)\<`TParentData`, `TName`, `TFieldValidator`, `TFormValidator`, `TData`\> -## Type parameters +## Type Parameters • **TParentData** @@ -32,9 +32,9 @@ If `true`, always run async validation, even if there are errors emitted during [`FieldOptions`](fieldoptions.md).[`asyncAlways`](Interface.FieldOptions.md#asyncalways) -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:283](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L283) +[packages/form-core/src/FieldApi.ts:284](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L284) *** @@ -50,9 +50,9 @@ The default time to debounce async validation if there is not a more specific de [`FieldOptions`](fieldoptions.md).[`asyncDebounceMs`](Interface.FieldOptions.md#asyncdebouncems) -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:279](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L279) +[packages/form-core/src/FieldApi.ts:280](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L280) *** @@ -68,9 +68,9 @@ An optional object with default metadata for the field. [`FieldOptions`](fieldoptions.md).[`defaultMeta`](Interface.FieldOptions.md#defaultmeta) -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:301](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L301) +[packages/form-core/src/FieldApi.ts:302](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L302) *** @@ -86,9 +86,9 @@ An optional default value for the field. [`FieldOptions`](fieldoptions.md).[`defaultValue`](Interface.FieldOptions.md#defaultvalue) -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:275](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L275) +[packages/form-core/src/FieldApi.ts:276](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L276) *** @@ -98,9 +98,9 @@ An optional default value for the field. form: FormApi; ``` -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:324](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L324) +[packages/form-core/src/FieldApi.ts:325](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L325) *** @@ -116,9 +116,9 @@ The field name. The type will be `DeepKeys` to ensure your name is [`FieldOptions`](fieldoptions.md).[`name`](Interface.FieldOptions.md#name) -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:271](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L271) +[packages/form-core/src/FieldApi.ts:272](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L272) *** @@ -134,9 +134,9 @@ A validator provided by an extension, like `yupValidator` from `@tanstack/yup-fo [`FieldOptions`](fieldoptions.md).[`validatorAdapter`](Interface.FieldOptions.md#validatoradapter) -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:287](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L287) +[packages/form-core/src/FieldApi.ts:288](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L288) *** @@ -152,6 +152,6 @@ A list of validators to pass to the field [`FieldOptions`](fieldoptions.md).[`validators`](Interface.FieldOptions.md#validators) -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:291](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L291) +[packages/form-core/src/FieldApi.ts:292](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L292) diff --git a/docs/reference/fieldinfo.md b/docs/reference/fieldinfo.md index f756ab4ba..d412a0598 100644 --- a/docs/reference/fieldinfo.md +++ b/docs/reference/fieldinfo.md @@ -1,4 +1,4 @@ -# Type alias: FieldInfo\ +# Type Alias: FieldInfo\ ```ts type FieldInfo: object; @@ -6,7 +6,7 @@ type FieldInfo: object; An object representing the field information for a specific field within the form. -## Type parameters +## Type Parameters • **TFormData** @@ -30,6 +30,6 @@ validationMetaMap: Record; A record of field validation internal handling. -## Source +## Defined in -[packages/form-core/src/FormApi.ts:175](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L175) +[packages/form-core/src/FormApi.ts:176](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L176) diff --git a/docs/reference/fieldmeta.md b/docs/reference/fieldmeta.md index 68a224de7..a309dd804 100644 --- a/docs/reference/fieldmeta.md +++ b/docs/reference/fieldmeta.md @@ -1,4 +1,4 @@ -# Type alias: FieldMeta +# Type Alias: FieldMeta ```ts type FieldMeta: object; @@ -56,6 +56,6 @@ isValidating: boolean; A flag indicating whether the field is currently being validated. -## Source +## Defined in -[packages/form-core/src/FieldApi.ts:330](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L330) +[packages/form-core/src/FieldApi.ts:331](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L331) diff --git a/docs/reference/fieldoptions.md b/docs/reference/fieldoptions.md index 7af1481db..a4ea71ba6 100644 --- a/docs/reference/fieldoptions.md +++ b/docs/reference/fieldoptions.md @@ -6,7 +6,7 @@ An object type representing the options for a field in a form. - [`FieldApiOptions`](fieldapioptions.md) -## Type parameters +## Type Parameters • **TParentData** @@ -28,9 +28,9 @@ optional asyncAlways: boolean; If `true`, always run async validation, even if there are errors emitted during synchronous validation. -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:283](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L283) +[packages/form-core/src/FieldApi.ts:284](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L284) *** @@ -42,9 +42,9 @@ optional asyncDebounceMs: number; The default time to debounce async validation if there is not a more specific debounce time passed. -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:279](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L279) +[packages/form-core/src/FieldApi.ts:280](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L280) *** @@ -56,9 +56,9 @@ optional defaultMeta: Partial; An optional object with default metadata for the field. -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:301](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L301) +[packages/form-core/src/FieldApi.ts:302](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L302) *** @@ -70,9 +70,9 @@ optional defaultValue: NoInfer; An optional default value for the field. -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:275](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L275) +[packages/form-core/src/FieldApi.ts:276](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L276) *** @@ -84,9 +84,9 @@ name: TName; The field name. The type will be `DeepKeys` to ensure your name is a deep key of the parent dataset. -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:271](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L271) +[packages/form-core/src/FieldApi.ts:272](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L272) *** @@ -98,9 +98,9 @@ optional validatorAdapter: TFieldValidator; A validator provided by an extension, like `yupValidator` from `@tanstack/yup-form-adapter` -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:287](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L287) +[packages/form-core/src/FieldApi.ts:288](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L288) *** @@ -112,6 +112,6 @@ optional validators: FieldValidators +# Type Alias: FieldState\ ```ts type FieldState: object; @@ -6,7 +6,7 @@ type FieldState: object; An object type representing the state of a field. -## Type parameters +## Type Parameters • **TData** @@ -28,6 +28,6 @@ value: TData; The current value of the field. -## Source +## Defined in -[packages/form-core/src/FieldApi.ts:360](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L360) +[packages/form-core/src/FieldApi.ts:361](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L361) diff --git a/docs/reference/fieldvalidators.md b/docs/reference/fieldvalidators.md index f3eb12121..68bdc58df 100644 --- a/docs/reference/fieldvalidators.md +++ b/docs/reference/fieldvalidators.md @@ -1,6 +1,6 @@ # Interface: FieldValidators\ -## Type parameters +## Type Parameters • **TParentData** @@ -29,9 +29,9 @@ If `validatorAdapter` is passed, this may also accept a property from the respec `z.string().min(1)` if `zodAdapter` is passed ``` -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:195](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L195) +[packages/form-core/src/FieldApi.ts:196](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L196) *** @@ -50,9 +50,9 @@ is passed, this may also accept a property from the respective adapter `z.string().refine(async (val) => val.length > 3, { message: 'Testing 123' })` if `zodAdapter` is passed ``` -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:208](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L208) +[packages/form-core/src/FieldApi.ts:209](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L209) *** @@ -66,9 +66,9 @@ An optional number to represent how long the `onBlurAsync` should wait before ru If set to a number larger than 0, will debounce the async validation event by this length of time in milliseconds -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:221](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L221) +[packages/form-core/src/FieldApi.ts:222](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L222) *** @@ -80,9 +80,9 @@ optional onBlurListenTo: unknown extends TParentData ? string : TParentData exte An optional list of field names that should trigger this field's `onBlur` and `onBlurAsync` events when its value changes -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:225](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L225) +[packages/form-core/src/FieldApi.ts:226](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L226) *** @@ -101,9 +101,9 @@ If `validatorAdapter` is passed, this may also accept a property from the respec `z.string().min(1)` if `zodAdapter` is passed ``` -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:159](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L159) +[packages/form-core/src/FieldApi.ts:160](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L160) *** @@ -122,9 +122,9 @@ is passed, this may also accept a property from the respective adapter `z.string().refine(async (val) => val.length > 3, { message: 'Testing 123' })` if `zodAdapter` is passed ``` -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:172](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L172) +[packages/form-core/src/FieldApi.ts:173](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L173) *** @@ -138,9 +138,9 @@ An optional number to represent how long the `onChangeAsync` should wait before If set to a number larger than 0, will debounce the async validation event by this length of time in milliseconds -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:184](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L184) +[packages/form-core/src/FieldApi.ts:185](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L185) *** @@ -152,9 +152,9 @@ optional onChangeListenTo: unknown extends TParentData ? string : TParentData ex An optional list of field names that should trigger this field's `onChange` and `onChangeAsync` events when its value changes -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:188](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L188) +[packages/form-core/src/FieldApi.ts:189](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L189) *** @@ -166,9 +166,9 @@ optional onMount: FieldValidateOrFn val.length > 3, { message: 'Testing 123' })` if `zodAdapter` is passed ``` -#### Source +#### Defined in -[packages/form-core/src/FieldApi.ts:245](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FieldApi.ts#L245) +[packages/form-core/src/FieldApi.ts:246](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FieldApi.ts#L246) diff --git a/docs/reference/formapi.md b/docs/reference/formapi.md index 23ec7da68..b7e0ffa54 100644 --- a/docs/reference/formapi.md +++ b/docs/reference/formapi.md @@ -6,7 +6,7 @@ Normally, you will not need to create a new `FormApi` instance directly. Instead hook/function like `useForm` or `createForm` to create a new instance for you that uses your framework's reactivity model. However, if you need to create a new instance manually, you can do so by calling the `new FormApi` constructor. -## Type parameters +## Type Parameters • **TFormData** @@ -30,9 +30,9 @@ Constructs a new `FormApi` instance with the given form options. [`FormApi`](formapi.md)\<`TFormData`, `TFormValidator`\> -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:344](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L344) +[packages/form-core/src/FormApi.ts:345](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L345) ## Properties @@ -44,9 +44,9 @@ fieldInfo: Record = {}; The options for the form. -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:317](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L317) +[packages/form-core/src/FormApi.ts:318](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L318) *** @@ -76,9 +76,9 @@ The current state of the form. Do not use `state` directly, as it is not reactive. Please use form.useStore() utility to subscribe to state -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:329](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L329) +[packages/form-core/src/FormApi.ts:330](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L330) *** @@ -90,9 +90,9 @@ store: Store, (cb) => FormState>; A [TanStack Store instance](https://tanstack.com/store/latest/docs/reference/Store) that keeps track of the form's state. -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:321](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L321) +[packages/form-core/src/FormApi.ts:322](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L322) ## Methods @@ -102,7 +102,7 @@ A [TanStack Store instance](https://tanstack.com/store/latest/docs/reference/Sto deleteField(field): void ``` -#### Type parameters +#### Type Parameters • **TField** *extends* `string` \| `number` @@ -114,9 +114,9 @@ deleteField(field): void `void` -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:924](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L924) +[packages/form-core/src/FormApi.ts:925](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L925) *** @@ -128,7 +128,7 @@ getFieldInfo(field): FieldInfo Gets the field info of the specified field. -#### Type parameters +#### Type Parameters • **TField** *extends* `string` \| `number` @@ -140,9 +140,9 @@ Gets the field info of the specified field. [`FieldInfo`](fieldinfo.md)\<`TFormData`, `TFormValidator`\> -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:842](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L842) +[packages/form-core/src/FormApi.ts:843](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L843) *** @@ -154,7 +154,7 @@ getFieldMeta(field): undefined | FieldMeta Gets the metadata of the specified field. -#### Type parameters +#### Type Parameters • **TField** *extends* `string` \| `number` @@ -166,9 +166,9 @@ Gets the metadata of the specified field. `undefined` \| [`FieldMeta`](fieldmeta.md) -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:833](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L833) +[packages/form-core/src/FormApi.ts:834](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L834) *** @@ -180,7 +180,7 @@ getFieldValue(field): DeepValue Gets the value of the specified field. -#### Type parameters +#### Type Parameters • **TField** *extends* `string` \| `number` @@ -192,9 +192,9 @@ Gets the value of the specified field. [`DeepValue`](deepvalue.md)\<`TFormData`, `TField`, `IsNullable`\<`TFormData`\>\> -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:826](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L826) +[packages/form-core/src/FormApi.ts:827](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L827) *** @@ -210,9 +210,9 @@ Handles the form submission, performs validation, and calls the appropriate onSu `Promise`\<`void`\> -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:766](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L766) +[packages/form-core/src/FormApi.ts:767](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L767) *** @@ -228,7 +228,7 @@ opts?): Promise Inserts a value into an array field at the specified index, shifting the subsequent values to the right. -#### Type parameters +#### Type Parameters • **TField** *extends* `string` \| `number` @@ -240,17 +240,15 @@ Inserts a value into an array field at the specified index, shifting the subsequ • **value**: [`DeepValue`](deepvalue.md)\<`TFormData`, `TField`, `IsNullable`\<`TFormData`\>\> *extends* `any`[] ? `any`[] & [`DeepValue`](deepvalue.md)\<`TFormData`, `TField`, `IsNullable`\<`TFormData`\>\>\[`number`\] : `never` -• **opts?** - -• **opts.touch?**: `boolean` +• **opts?**: `UpdateMetaOptions` #### Returns `Promise`\<`void`\> -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:956](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L956) +[packages/form-core/src/FormApi.ts:957](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L957) *** @@ -264,9 +262,9 @@ mount(): void `void` -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:442](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L442) +[packages/form-core/src/FormApi.ts:443](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L443) *** @@ -282,7 +280,7 @@ moveFieldValues( Moves the value at the first specified index to the second specified index within an array field. -#### Type parameters +#### Type Parameters • **TField** *extends* `string` \| `number` @@ -294,17 +292,15 @@ Moves the value at the first specified index to the second specified index withi • **index2**: `number` -• **opts?** - -• **opts.touch?**: `boolean` +• **opts?**: `UpdateMetaOptions` #### Returns `void` -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:1074](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L1074) +[packages/form-core/src/FormApi.ts:1075](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L1075) *** @@ -319,7 +315,7 @@ pushFieldValue( Pushes a value into an array field. -#### Type parameters +#### Type Parameters • **TField** *extends* `string` \| `number` @@ -329,17 +325,15 @@ Pushes a value into an array field. • **value**: [`DeepValue`](deepvalue.md)\<`TFormData`, `TField`, `IsNullable`\<`TFormData`\>\> *extends* `any`[] ? `any`[] & [`DeepValue`](deepvalue.md)\<`TFormData`, `TField`, `IsNullable`\<`TFormData`\>\>\[`number`\] : `never` -• **opts?** - -• **opts.touch?**: `boolean` +• **opts?**: `UpdateMetaOptions` #### Returns `void` -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:938](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L938) +[packages/form-core/src/FormApi.ts:939](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L939) *** @@ -354,7 +348,7 @@ opts?): Promise Removes a value from an array field at the specified index. -#### Type parameters +#### Type Parameters • **TField** *extends* `string` \| `number` @@ -364,17 +358,15 @@ Removes a value from an array field at the specified index. • **index**: `number` -• **opts?** - -• **opts.touch?**: `boolean` +• **opts?**: `UpdateMetaOptions` #### Returns `Promise`\<`void`\> -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:1009](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L1009) +[packages/form-core/src/FormApi.ts:1010](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L1010) *** @@ -390,7 +382,7 @@ opts?): Promise Replaces a value into an array field at the specified index. -#### Type parameters +#### Type Parameters • **TField** *extends* `string` \| `number` @@ -402,17 +394,15 @@ Replaces a value into an array field at the specified index. • **value**: [`DeepValue`](deepvalue.md)\<`TFormData`, `TField`, `IsNullable`\<`TFormData`\>\> *extends* `any`[] ? `any`[] & [`DeepValue`](deepvalue.md)\<`TFormData`, `TField`, `IsNullable`\<`TFormData`\>\>\[`number`\] : `never` -• **opts?** - -• **opts.touch?**: `boolean` +• **opts?**: `UpdateMetaOptions` #### Returns `Promise`\<`void`\> -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:983](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L983) +[packages/form-core/src/FormApi.ts:984](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L984) *** @@ -428,9 +418,9 @@ Resets the form state to the default values. `void` -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:504](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L504) +[packages/form-core/src/FormApi.ts:505](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L505) *** @@ -440,7 +430,7 @@ Resets the form state to the default values. resetFieldMeta(fieldMeta): Record ``` -#### Type parameters +#### Type Parameters • **TField** *extends* `string` \| `number` @@ -452,9 +442,9 @@ resetFieldMeta(fieldMeta): Record `Record`\<`TField`, [`FieldMeta`](fieldmeta.md)\> -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:876](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L876) +[packages/form-core/src/FormApi.ts:877](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L877) *** @@ -466,7 +456,7 @@ setFieldMeta(field, updater): void Updates the metadata of the specified field. -#### Type parameters +#### Type Parameters • **TField** *extends* `string` \| `number` @@ -480,9 +470,9 @@ Updates the metadata of the specified field. `void` -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:861](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L861) +[packages/form-core/src/FormApi.ts:862](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L862) *** @@ -497,7 +487,7 @@ setFieldValue( Sets the value of the specified field and optionally updates the touched state. -#### Type parameters +#### Type Parameters • **TField** *extends* `string` \| `number` @@ -507,17 +497,15 @@ Sets the value of the specified field and optionally updates the touched state. • **updater**: [`Updater`](updater.md)\<[`DeepValue`](deepvalue.md)\<`TFormData`, `TField`, `IsNullable`\<`TFormData`\>\>\> -• **opts?** - -• **opts.touch?**: `boolean` +• **opts?**: `UpdateMetaOptions` #### Returns `void` -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:899](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L899) +[packages/form-core/src/FormApi.ts:900](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L900) *** @@ -533,7 +521,7 @@ swapFieldValues( Swaps the values at the specified indices within an array field. -#### Type parameters +#### Type Parameters • **TField** *extends* `string` \| `number` @@ -545,17 +533,15 @@ Swaps the values at the specified indices within an array field. • **index2**: `number` -• **opts?** - -• **opts.touch?**: `boolean` +• **opts?**: `UpdateMetaOptions` #### Returns `void` -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:1048](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L1048) +[packages/form-core/src/FormApi.ts:1049](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L1049) *** @@ -575,9 +561,9 @@ Updates the form options and form state. `void` -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:464](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L464) +[packages/form-core/src/FormApi.ts:465](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L465) *** @@ -597,9 +583,9 @@ Validates all fields in the form using the correct handlers for a given validati `Promise`\<[`ValidationError`](validationerror.md)[]\> -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:519](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L519) +[packages/form-core/src/FormApi.ts:520](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L520) *** @@ -614,7 +600,7 @@ cause): Promise Validates the children of a specified array in the form starting from a given index until the end using the correct handlers for a given validation type. -#### Type parameters +#### Type Parameters • **TField** *extends* `string` \| `number` @@ -630,9 +616,9 @@ Validates the children of a specified array in the form starting from a given in `Promise`\<[`ValidationError`](validationerror.md)[]\> -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:546](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L546) +[packages/form-core/src/FormApi.ts:547](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L547) *** @@ -644,7 +630,7 @@ validateField(field, cause): ValidationError[] | Promise -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:585](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L585) +[packages/form-core/src/FormApi.ts:586](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L586) diff --git a/docs/reference/formoptions.md b/docs/reference/formoptions.md index 826c462bd..87467920d 100644 --- a/docs/reference/formoptions.md +++ b/docs/reference/formoptions.md @@ -4,7 +4,7 @@ function formOptions(defaultOpts?): undefined | FormOptions ``` -## Type parameters +## Type Parameters • **TFormData** @@ -18,6 +18,6 @@ function formOptions(defaultOpts?): undefined | FormO `undefined` \| [`FormOptions`](formoptions.md)\<`TFormData`, `TFormValidator`\> -## Source +## Defined in -[packages/form-core/src/formOptions.ts:4](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/formOptions.ts#L4) +[packages/form-core/src/formOptions.ts:4](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/formOptions.ts#L4) diff --git a/docs/reference/formstate.md b/docs/reference/formstate.md index e13618cb4..0429be6f1 100644 --- a/docs/reference/formstate.md +++ b/docs/reference/formstate.md @@ -1,4 +1,4 @@ -# Type alias: FormState\ +# Type Alias: FormState\ ```ts type FormState: object; @@ -6,7 +6,7 @@ type FormState: object; An object representing the current state of the form. -## Type parameters +## Type Parameters • **TFormData** @@ -156,6 +156,6 @@ values: TFormData; The current values of the form fields. -## Source +## Defined in -[packages/form-core/src/FormApi.ts:197](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L197) +[packages/form-core/src/FormApi.ts:198](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L198) diff --git a/docs/reference/formvalidators.md b/docs/reference/formvalidators.md index e20a39edf..c2c3c4d94 100644 --- a/docs/reference/formvalidators.md +++ b/docs/reference/formvalidators.md @@ -1,6 +1,6 @@ # Interface: FormValidators\ -## Type parameters +## Type Parameters • **TFormData** @@ -16,9 +16,9 @@ optional onBlur: FormValidateOrFn; Optional function that validates the form data when a field loses focus, returns a ValidationError -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:88](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L88) +[packages/form-core/src/FormApi.ts:89](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L89) *** @@ -30,9 +30,9 @@ optional onBlurAsync: FormAsyncValidateOrFn; Optional onBlur asynchronous validation method for when a field loses focus return a `ValidationError` or a promise of `Promise` -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:92](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L92) +[packages/form-core/src/FormApi.ts:93](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L93) *** @@ -44,9 +44,9 @@ optional onBlurAsyncDebounceMs: number; The default time in milliseconds that if set to a number larger than 0, will debounce the async validation event by this length of time in milliseconds. -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:96](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L96) +[packages/form-core/src/FormApi.ts:97](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L97) *** @@ -58,9 +58,9 @@ optional onChange: FormValidateOrFn; Optional function that checks the validity of your data whenever a value changes -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:76](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L76) +[packages/form-core/src/FormApi.ts:77](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L77) *** @@ -72,9 +72,9 @@ optional onChangeAsync: FormAsyncValidateOrFn; Optional onChange asynchronous counterpart to onChange. Useful for more complex validation logic that might involve server requests. -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:80](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L80) +[packages/form-core/src/FormApi.ts:81](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L81) *** @@ -86,9 +86,9 @@ optional onChangeAsyncDebounceMs: number; The default time in milliseconds that if set to a number larger than 0, will debounce the async validation event by this length of time in milliseconds. -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:84](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L84) +[packages/form-core/src/FormApi.ts:85](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L85) *** @@ -100,9 +100,9 @@ optional onMount: FormValidateOrFn; Optional function that fires as soon as the component mounts. -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:72](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L72) +[packages/form-core/src/FormApi.ts:73](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L73) *** @@ -112,9 +112,9 @@ Optional function that fires as soon as the component mounts. optional onSubmit: FormValidateOrFn; ``` -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:97](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L97) +[packages/form-core/src/FormApi.ts:98](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L98) *** @@ -124,6 +124,6 @@ optional onSubmit: FormValidateOrFn; optional onSubmitAsync: FormAsyncValidateOrFn; ``` -#### Source +#### Defined in -[packages/form-core/src/FormApi.ts:98](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L98) +[packages/form-core/src/FormApi.ts:99](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L99) diff --git a/docs/reference/mergeform.md b/docs/reference/mergeform.md index 96ebac2da..02eb444b2 100644 --- a/docs/reference/mergeform.md +++ b/docs/reference/mergeform.md @@ -4,7 +4,7 @@ function mergeForm(baseForm, state): FormApi, NoInfer> ``` -## Type parameters +## Type Parameters • **TFormData** @@ -20,6 +20,6 @@ function mergeForm(baseForm, state): FormApi, `NoInfer`\<`TFormValidator`\>\> -## Source +## Defined in -[packages/form-core/src/mergeForm.ts:37](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/mergeForm.ts#L37) +[packages/form-core/src/mergeForm.ts:37](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/mergeForm.ts#L37) diff --git a/docs/reference/updater.md b/docs/reference/updater.md index 3968ab9b8..c0291d6d9 100644 --- a/docs/reference/updater.md +++ b/docs/reference/updater.md @@ -1,15 +1,15 @@ -# Type alias: Updater\ +# Type Alias: Updater\ ```ts type Updater: TOutput | UpdaterFn; ``` -## Type parameters +## Type Parameters • **TInput** • **TOutput** = `TInput` -## Source +## Defined in -[packages/form-core/src/utils.ts:7](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/utils.ts#L7) +[packages/form-core/src/utils.ts:7](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/utils.ts#L7) diff --git a/docs/reference/updaterfn.md b/docs/reference/updaterfn.md index ce3c42ea7..a5a69ab32 100644 --- a/docs/reference/updaterfn.md +++ b/docs/reference/updaterfn.md @@ -1,10 +1,10 @@ -# Type alias: UpdaterFn()\ +# Type Alias: UpdaterFn()\ ```ts type UpdaterFn: (input) => TOutput; ``` -## Type parameters +## Type Parameters • **TInput** @@ -18,6 +18,6 @@ type UpdaterFn: (input) => TOutput; `TOutput` -## Source +## Defined in -[packages/form-core/src/utils.ts:5](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/utils.ts#L5) +[packages/form-core/src/utils.ts:5](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/utils.ts#L5) diff --git a/docs/reference/validationerror.md b/docs/reference/validationerror.md index 276fb8adc..d1ffbd28a 100644 --- a/docs/reference/validationerror.md +++ b/docs/reference/validationerror.md @@ -1,9 +1,9 @@ -# Type alias: ValidationError +# Type Alias: ValidationError ```ts type ValidationError: undefined | false | null | string; ``` -## Source +## Defined in -[packages/form-core/src/types.ts:1](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/types.ts#L1) +[packages/form-core/src/types.ts:1](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/types.ts#L1) diff --git a/docs/reference/validationmeta.md b/docs/reference/validationmeta.md index 0307820a8..8f0997457 100644 --- a/docs/reference/validationmeta.md +++ b/docs/reference/validationmeta.md @@ -1,4 +1,4 @@ -# Type alias: ValidationMeta +# Type Alias: ValidationMeta ```ts type ValidationMeta: object; @@ -16,6 +16,6 @@ lastAbortController: AbortController; An abort controller stored in memory to cancel previous async validation attempts. -## Source +## Defined in -[packages/form-core/src/FormApi.ts:165](https://github.com/TanStack/form/blob/ada0211684adc85c41587b076e1217390ff5344e/packages/form-core/src/FormApi.ts#L165) +[packages/form-core/src/FormApi.ts:166](https://github.com/TanStack/form/blob/2bebfd5214c4cdfbf6feacb7b1e25a6825957062/packages/form-core/src/FormApi.ts#L166) diff --git a/knip.json b/knip.json index ec7eb0d57..d136a3142 100644 --- a/knip.json +++ b/knip.json @@ -1,5 +1,6 @@ { "$schema": "https://unpkg.com/knip@5/schema.json", "ignoreWorkspaces": ["examples/**"], - "ignoreDependencies": ["@tanstack/start"] + "ignoreDependencies": ["@tanstack/start"], + "ignore": ["scripts/typedoc-remove-prefix.js"] } diff --git a/package.json b/package.json index 75479f5f5..0d5c212a8 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "rimraf": "^5.0.9", "sherif": "^0.10.0", "solid-js": "^1.8.18", - "typedoc": "^0.25.13", + "typedoc": "^0.26.4", "typedoc-plugin-markdown": "^4.2.1", "typescript": "5.4.2", "typescript49": "npm:typescript@4.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bb05a5eb7..402e5c4a3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -78,11 +78,11 @@ importers: specifier: ^1.8.18 version: 1.8.18 typedoc: - specifier: ^0.25.13 - version: 0.25.13(typescript@5.4.2) + specifier: ^0.26.4 + version: 0.26.4(typescript@5.4.2) typedoc-plugin-markdown: specifier: ^4.2.1 - version: 4.2.1(typedoc@0.25.13(typescript@5.4.2)) + version: 4.2.1(typedoc@0.26.4(typescript@5.4.2)) typescript: specifier: 5.4.2 version: 5.4.2 @@ -3623,6 +3623,9 @@ packages: resolution: {integrity: sha512-2g4OmSyE9YGq50Uj7fNI26P/TSAFJ7ZuirwTF2O7Xc4XRQ29/tYIIqhezpNlTb6rlYblcQuMcUZBrMfWJHcqJw==} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} + '@shikijs/core@1.10.3': + resolution: {integrity: sha512-D45PMaBaeDHxww+EkcDQtDAtzv00Gcsp72ukBtaLSmqRvh0WgGMq3Al0rl1QQBZfuneO75NXMIzEZGFitThWbg==} + '@sigstore/bundle@2.2.0': resolution: {integrity: sha512-5VI58qgNs76RDrwXNhpmyN/jKpq9evV/7f1XrcqcAfvxDl5SeVY/I5Rmfe96ULAV7/FK5dge9RBKGBJPhL1WsQ==} engines: {node: ^16.14.0 || >=18.0.0} @@ -3975,6 +3978,9 @@ packages: '@types/express@4.17.21': resolution: {integrity: sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==} + '@types/hast@3.0.4': + resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} + '@types/http-errors@2.0.4': resolution: {integrity: sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==} @@ -4053,6 +4059,9 @@ packages: '@types/trusted-types@2.0.7': resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} + '@types/unist@3.0.2': + resolution: {integrity: sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==} + '@types/ws@8.5.10': resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==} @@ -4472,9 +4481,6 @@ packages: resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} engines: {node: '>=12'} - ansi-sequence-parser@1.1.1: - resolution: {integrity: sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==} - ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} @@ -6637,6 +6643,9 @@ packages: resolution: {integrity: sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + linkify-it@5.0.0: + resolution: {integrity: sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==} + listhen@1.7.2: resolution: {integrity: sha512-7/HamOm5YD9Wb7CFgAZkKgVPA96WwhcTQoqtm2VTZGVbVVn3IWKRBTgrU7cchA3Q8k9iCsG8Osoi9GX4JsGM9g==} hasBin: true @@ -6778,11 +6787,13 @@ packages: resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} engines: {node: '>=8'} - marked@4.3.0: - resolution: {integrity: sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==} - engines: {node: '>= 12'} + markdown-it@14.1.0: + resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==} hasBin: true + mdurl@2.0.0: + resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==} + media-typer@0.3.0: resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} engines: {node: '>= 0.6'} @@ -6879,8 +6890,8 @@ packages: resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} engines: {node: '>=16 || 14 >=14.17'} - minimatch@9.0.4: - resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==} + minimatch@9.0.5: + resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} engines: {node: '>=16 || 14 >=14.17'} minimist-options@4.1.0: @@ -7646,6 +7657,10 @@ packages: engines: {node: '>=16'} hasBin: true + punycode.js@2.3.1: + resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==} + engines: {node: '>=6'} + punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -8164,8 +8179,8 @@ packages: resolution: {integrity: sha512-KAKYAnhgJaz2F7EFowXU3xrukrRWkNsC8OhmTD9TW84mu0Pb6jI2GabFd9U/umMTVshDjS9l43D1JAGx/e0JdQ==} hasBin: true - shiki@0.14.7: - resolution: {integrity: sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==} + shiki@1.10.3: + resolution: {integrity: sha512-eneCLncGuvPdTutJuLyUGS8QNPAVFO5Trvld2wgEq1e002mwctAhJKeMGWtWVXOIEzmlcLRqcgPSorR6AVzOmQ==} shimmer@1.2.1: resolution: {integrity: sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==} @@ -8701,12 +8716,12 @@ packages: peerDependencies: typedoc: 0.26.x - typedoc@0.25.13: - resolution: {integrity: sha512-pQqiwiJ+Z4pigfOnnysObszLiU3mVLWAExSPf+Mu06G/qsc3wzbuM56SZQvONhHLncLUhYzOVkjFFpFfL5AzhQ==} - engines: {node: '>= 16'} + typedoc@0.26.4: + resolution: {integrity: sha512-FlW6HpvULDKgc3rK04V+nbFyXogPV88hurarDPOjuuB5HAwuAlrCMQ5NeH7Zt68a/ikOKu6Z/0hFXAeC9xPccQ==} + engines: {node: '>= 18'} hasBin: true peerDependencies: - typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x + typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x types-react-dom@19.0.0-rc.1: resolution: {integrity: sha512-VSLZJl8VXCD0fAWp7DUTFUDCcZ8DVXOQmjhJMD03odgeFmu14ZQJHCXeETm3BEAhJqfgJaFkLnGkQv88sRx0fQ==} @@ -8754,6 +8769,9 @@ packages: engines: {node: '>=14.17'} hasBin: true + uc.micro@2.1.0: + resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==} + ufo@1.5.3: resolution: {integrity: sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==} @@ -9127,12 +9145,6 @@ packages: jsdom: optional: true - vscode-oniguruma@1.7.0: - resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} - - vscode-textmate@8.0.0: - resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} - vscode-uri@3.0.8: resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==} @@ -9377,6 +9389,11 @@ packages: resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} engines: {node: '>= 6'} + yaml@2.4.5: + resolution: {integrity: sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==} + engines: {node: '>= 14'} + hasBin: true + yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} @@ -12114,6 +12131,10 @@ snapshots: transitivePeerDependencies: - chokidar + '@shikijs/core@1.10.3': + dependencies: + '@types/hast': 3.0.4 + '@sigstore/bundle@2.2.0': dependencies: '@sigstore/protobuf-specs': 0.3.0 @@ -12479,7 +12500,7 @@ snapshots: '@ts-morph/common@0.22.0': dependencies: fast-glob: 3.3.2 - minimatch: 9.0.4 + minimatch: 9.0.5 mkdirp: 3.0.1 path-browserify: 1.0.1 @@ -12488,7 +12509,7 @@ snapshots: '@tufjs/models@2.0.0': dependencies: '@tufjs/canonical-json': 2.0.0 - minimatch: 9.0.4 + minimatch: 9.0.5 '@types/argparse@1.0.38': {} @@ -12567,6 +12588,10 @@ snapshots: '@types/qs': 6.9.12 '@types/serve-static': 1.15.5 + '@types/hast@3.0.4': + dependencies: + '@types/unist': 3.0.2 + '@types/http-errors@2.0.4': {} '@types/http-proxy@1.17.14': @@ -12645,6 +12670,8 @@ snapshots: '@types/trusted-types@2.0.7': {} + '@types/unist@3.0.2': {} + '@types/ws@8.5.10': dependencies: '@types/node': 20.14.10 @@ -12706,7 +12733,7 @@ snapshots: debug: 4.3.5 globby: 11.1.0 is-glob: 4.0.3 - minimatch: 9.0.4 + minimatch: 9.0.5 semver: 7.6.2 ts-api-utils: 1.3.0(typescript@5.4.2) optionalDependencies: @@ -12966,7 +12993,7 @@ snapshots: '@vue/compiler-dom': 3.4.21 '@vue/shared': 3.4.21 computeds: 0.0.1 - minimatch: 9.0.4 + minimatch: 9.0.5 muggle-string: 0.3.1 path-browserify: 1.0.1 vue-template-compiler: 2.7.14 @@ -12979,7 +13006,7 @@ snapshots: '@vue/compiler-dom': 3.4.21 '@vue/shared': 3.4.21 computeds: 0.0.1 - minimatch: 9.0.4 + minimatch: 9.0.5 muggle-string: 0.4.1 path-browserify: 1.0.1 vue-template-compiler: 2.7.14 @@ -13237,8 +13264,6 @@ snapshots: ansi-regex@6.0.1: {} - ansi-sequence-parser@1.1.1: {} - ansi-styles@3.2.1: dependencies: color-convert: 1.9.3 @@ -14339,7 +14364,7 @@ snapshots: eslint-import-resolver-node: 0.3.9 get-tsconfig: 4.7.5 is-glob: 4.0.3 - minimatch: 9.0.4 + minimatch: 9.0.5 semver: 7.6.2 stable-hash: 0.0.4 tslib: 2.6.3 @@ -14356,7 +14381,7 @@ snapshots: get-tsconfig: 4.7.5 globals: 15.8.0 ignore: 5.3.1 - minimatch: 9.0.4 + minimatch: 9.0.5 semver: 7.6.2 eslint-plugin-react-debug@1.5.26(eslint@8.57.0)(typescript@5.4.2): @@ -14884,7 +14909,7 @@ snapshots: dependencies: foreground-child: 3.1.1 jackspeak: 2.3.6 - minimatch: 9.0.4 + minimatch: 9.0.5 minipass: 7.0.3 path-scurry: 1.10.1 @@ -15163,7 +15188,7 @@ snapshots: ignore-walk@6.0.4: dependencies: - minimatch: 9.0.4 + minimatch: 9.0.5 ignore@5.3.1: {} @@ -15713,6 +15738,10 @@ snapshots: lines-and-columns@2.0.3: {} + linkify-it@5.0.0: + dependencies: + uc.micro: 2.1.0 + listhen@1.7.2: dependencies: '@parcel/watcher': 2.4.1 @@ -15885,7 +15914,16 @@ snapshots: map-obj@4.3.0: {} - marked@4.3.0: {} + markdown-it@14.1.0: + dependencies: + argparse: 2.0.1 + entities: 4.5.0 + linkify-it: 5.0.0 + mdurl: 2.0.0 + punycode.js: 2.3.1 + uc.micro: 2.1.0 + + mdurl@2.0.0: {} media-typer@0.3.0: {} @@ -15971,7 +16009,7 @@ snapshots: dependencies: brace-expansion: 2.0.1 - minimatch@9.0.4: + minimatch@9.0.5: dependencies: brace-expansion: 2.0.1 @@ -16899,6 +16937,8 @@ snapshots: picocolors: 1.0.1 sade: 1.8.1 + punycode.js@2.3.1: {} + punycode@2.3.1: {} qs@6.11.0: @@ -17473,12 +17513,10 @@ snapshots: sherif-windows-arm64: 0.10.0 sherif-windows-x64: 0.10.0 - shiki@0.14.7: + shiki@1.10.3: dependencies: - ansi-sequence-parser: 1.1.1 - jsonc-parser: 3.2.1 - vscode-oniguruma: 1.7.0 - vscode-textmate: 8.0.0 + '@shikijs/core': 1.10.3 + '@types/hast': 3.0.4 shimmer@1.2.1: {} @@ -17939,7 +17977,7 @@ snapshots: ts-declaration-location@1.0.2(typescript@5.4.2): dependencies: - minimatch: 9.0.4 + minimatch: 9.0.5 typescript: 5.4.2 ts-morph@21.0.1: @@ -17994,17 +18032,18 @@ snapshots: typed-assert@1.0.9: {} - typedoc-plugin-markdown@4.2.1(typedoc@0.25.13(typescript@5.4.2)): + typedoc-plugin-markdown@4.2.1(typedoc@0.26.4(typescript@5.4.2)): dependencies: - typedoc: 0.25.13(typescript@5.4.2) + typedoc: 0.26.4(typescript@5.4.2) - typedoc@0.25.13(typescript@5.4.2): + typedoc@0.26.4(typescript@5.4.2): dependencies: lunr: 2.3.9 - marked: 4.3.0 - minimatch: 9.0.4 - shiki: 0.14.7 + markdown-it: 14.1.0 + minimatch: 9.0.5 + shiki: 1.10.3 typescript: 5.4.2 + yaml: 2.4.5 types-react-dom@19.0.0-rc.1: dependencies: @@ -18037,6 +18076,8 @@ snapshots: typescript@5.4.2: {} + uc.micro@2.1.0: {} + ufo@1.5.3: {} unc-path-regex@0.1.2: {} @@ -18519,10 +18560,6 @@ snapshots: - supports-color - terser - vscode-oniguruma@1.7.0: {} - - vscode-textmate@8.0.0: {} - vscode-uri@3.0.8: {} vue-component-type-helpers@1.8.4: {} @@ -18811,6 +18848,8 @@ snapshots: yaml@1.10.2: {} + yaml@2.4.5: {} + yargs-parser@21.1.1: {} yargs@17.7.2: diff --git a/scripts/reference-docs.js b/scripts/reference-docs.js index fad58707e..1701c199c 100644 --- a/scripts/reference-docs.js +++ b/scripts/reference-docs.js @@ -1,14 +1,9 @@ -import * as path from 'node:path' +import { resolve } from 'node:path' import { fileURLToPath } from 'node:url' -import { promises } from 'node:fs' +import { mkdir, rm } from 'node:fs/promises' import * as TypeDoc from 'typedoc' -// Prevent Knip from removing the import -import { load } from './typedoc-remove-prefix.mjs' -;(() => load)() - -const { rm, mkdir } = promises -const __dirname = path.dirname(fileURLToPath(import.meta.url)) +const __dirname = fileURLToPath(new URL('.', import.meta.url)) /** * @type {Partial} @@ -16,7 +11,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)) const options = { plugin: [ 'typedoc-plugin-markdown', - path.resolve(__dirname, './typedoc-remove-prefix.mjs'), + resolve(__dirname, './typedoc-remove-prefix.js'), ], hideGenerator: true, readme: 'none', @@ -28,67 +23,47 @@ const options = { excludePrivate: true, } +/** @type {Array<{name: string, entryPoints: Array, tsconfig: string, outputDir: string, exclude?: Array}>} */ const packages = [ { name: 'form-core', - entryPoint: path.resolve(__dirname, '../packages/form-core/src/index.ts'), - tsconfig: path.resolve( - __dirname, - '../packages/form-core/tsconfig.docs.json', - ), - outputDir: path.resolve(__dirname, '../docs/reference'), + entryPoints: [resolve(__dirname, '../packages/form-core/src/index.ts')], + tsconfig: resolve(__dirname, '../packages/form-core/tsconfig.docs.json'), + outputDir: resolve(__dirname, '../docs/reference'), }, { name: 'angular-form', - entryPoint: path.resolve( - __dirname, - '../packages/angular-form/src/index.ts', - ), - tsconfig: path.resolve( - __dirname, - '../packages/angular-form/tsconfig.docs.json', - ), - outputDir: path.resolve(__dirname, '../docs/framework/angular/reference'), + entryPoints: [resolve(__dirname, '../packages/angular-form/src/index.ts')], + tsconfig: resolve(__dirname, '../packages/angular-form/tsconfig.docs.json'), + outputDir: resolve(__dirname, '../docs/framework/angular/reference'), exclude: ['packages/form-core/**/*'], }, { name: 'lit-form', - entryPoint: path.resolve(__dirname, '../packages/lit-form/src/index.ts'), - tsconfig: path.resolve( - __dirname, - '../packages/lit-form/tsconfig.docs.json', - ), - outputDir: path.resolve(__dirname, '../docs/framework/lit/reference'), + entryPoints: [resolve(__dirname, '../packages/lit-form/src/index.ts')], + tsconfig: resolve(__dirname, '../packages/lit-form/tsconfig.docs.json'), + outputDir: resolve(__dirname, '../docs/framework/lit/reference'), exclude: ['packages/form-core/**/*'], }, { name: 'react-form', - entryPoint: path.resolve(__dirname, '../packages/react-form/src/index.ts'), - tsconfig: path.resolve( - __dirname, - '../packages/react-form/tsconfig.docs.json', - ), - outputDir: path.resolve(__dirname, '../docs/framework/react/reference'), + entryPoints: [resolve(__dirname, '../packages/react-form/src/index.ts')], + tsconfig: resolve(__dirname, '../packages/react-form/tsconfig.docs.json'), + outputDir: resolve(__dirname, '../docs/framework/react/reference'), exclude: ['packages/form-core/**/*'], }, { name: 'solid-form', - entryPoint: path.resolve(__dirname, '../packages/solid-form/src/index.ts'), - tsconfig: path.resolve( - __dirname, - '../packages/solid-form/tsconfig.docs.json', - ), - outputDir: path.resolve(__dirname, '../docs/framework/solid/reference'), + entryPoints: [resolve(__dirname, '../packages/solid-form/src/index.tsx')], + tsconfig: resolve(__dirname, '../packages/solid-form/tsconfig.docs.json'), + outputDir: resolve(__dirname, '../docs/framework/solid/reference'), exclude: ['packages/form-core/**/*'], }, { name: 'vue-form', - entryPoint: path.resolve(__dirname, '../packages/vue-form/src/index.ts'), - tsconfig: path.resolve( - __dirname, - '../packages/vue-form/tsconfig.docs.json', - ), - outputDir: path.resolve(__dirname, '../docs/framework/vue/reference'), + entryPoints: [resolve(__dirname, '../packages/vue-form/src/index.ts')], + tsconfig: resolve(__dirname, '../packages/vue-form/tsconfig.docs.json'), + outputDir: resolve(__dirname, '../docs/framework/vue/reference'), exclude: ['packages/form-core/**/*'], }, ] @@ -99,7 +74,7 @@ async function main() { try { await rm(pkg.outputDir, { recursive: true }) } catch (error) { - // @ts-ignore + // @ts-expect-error if (error.code !== 'ENOENT') { throw error } @@ -108,7 +83,7 @@ async function main() { const app = await TypeDoc.Application.bootstrapWithPlugins({ ...options, - entryPoints: [pkg.entryPoint], + entryPoints: pkg.entryPoints, tsconfig: pkg.tsconfig, exclude: pkg.exclude, }) diff --git a/scripts/typedoc-remove-prefix.mjs b/scripts/typedoc-remove-prefix.js similarity index 100% rename from scripts/typedoc-remove-prefix.mjs rename to scripts/typedoc-remove-prefix.js