Types reference

Every public type Attaform exports, grouped by purpose. Inference handles the common cases; these are for advanced wiring (custom adapters, deeply nested generic helpers, type-safe consumer libraries).

Category
Reference
Doctrine
inference-first; types exposed but rarely needed
Source
src/runtime/types/types-api.ts + types-core.ts

This page is reference material, alphabetical-ish by purpose. Most consumers never reach for these directly; the Inference-first DX doctrine means useForm + a schema gives you autocomplete on every reactive surface without naming the types.

Form configuration

TypeSourcePurpose
UseFormConfiguration<Form>runtime/types/types-apiThe options bag passed to useForm.
UseFormReturnType<Form, GetValue>runtime/types/types-apiThe whole reactive return: values, fields, errors, meta, methods.
AttaformPluginOptionsruntime/core/pluginOptions for createAttaform({ defaults, devtools }).
AttaformDefaultsruntime/types/types-apiThe fields settable via createAttaform({ defaults }).
HistoryConfigruntime/types/types-apiuseForm({ history }) shape.
PersistConfig / PersistConfigOptionsruntime/types/types-apiuseForm({ persist }) shape (shorthand vs. full options).
PersistIncludeModeruntime/types/types-api'form' | 'form+errors'.
OnInvalidSubmitPolicyruntime/types/types-api'none' | 'focus-first-error' | 'scroll-to-first-error' | 'both'.
ValidateOn / ValidateOnConfigruntime/types/types-apivalidateOn field and its discriminated config.
DisplayState / GetDisplayStateruntime/types/types-apiThe display-state verdict (idle | pending | error | success) and its resolver.

Reactive surfaces

TypeSourcePurpose
FieldState<Value>runtime/types/types-apiThe 29-property per-leaf reactive bundle.
FieldStateMap<Form> / Entryruntime/types/types-apiThe proxy shape exposing form.fields.
FormMeta<Form>runtime/types/types-apiForm-level aggregates over every field's state.
FormErrorsSurface<Form>runtime/types/types-apiThe proxy shape exposing form.errors.
FormErrorRecordruntime/types/types-apiThe per-path error array shape.
ErrorsProxyShape<Form>runtime/types/types-apiType-level view of the errors proxy for advanced helpers.
WriteMetaruntime/types/types-apiMetadata attached to a mutation (source, batch flags).

Validation

TypeSourcePurpose
ValidationErrorruntime/types/types-apiThe error shape ({ path, message, code, formKey }).
ValidationResponse<Form>runtime/types/types-apiDiscriminated success-or-failure validation result with parsed data.
ValidationResponseWithoutValue<Form>runtime/types/types-apiSame shape minus the data payload (used by validateAsync).
ReactiveValidationStatus<Form>runtime/types/types-apiDiscriminated pending-vs-settled reactive validation status.
PendingValidationStatus / SettledValidationStatusruntime/types/types-apiThe two branches of ReactiveValidationStatus.
HandleSubmit / OnSubmit / OnErrorruntime/types/types-apiThe handleSubmit callback signatures.
SubmitHandler<Form>runtime/types/types-apiGeneric handler type for typed user submit functions.

Schema contract

TypeSourcePurpose
AbstractSchema<Form, GetValue>runtime/types/types-apiThe 12-method + 2-optional contract custom adapters implement.
DefaultValuesResponse<Form>runtime/types/types-apiWhat getDefaultValues returns.
SlimPrimitiveKindruntime/types/types-api'string' | 'number' | … (typeof-style kinds).
SlimRuntimeOf<T>runtime/types/types-apiType-level helper to compute the slim primitive set for a type.
FieldMetaPayloadruntime/types/types-apiSchema-attached metadata: label, description, placeholder, meta.

Path types

TypeSourcePurpose
FlatPath<Form>runtime/types/types-coreEvery reachable dotted path through the form.
PartialFlatPath<Form>runtime/types/types-coreSame but allowing partial-prefix paths.
ArrayPath<Form>runtime/types/types-coreEvery reachable path whose value is an array.
JoinSegments<Segments>runtime/types/types-coreType-level join of a segment tuple into a dotted string.
Path / PathKey / Segmentruntime/core/pathsCanonicalized runtime path representation.

Shape helpers

TypeSourcePurpose
GenericFormruntime/types/types-coreThe most-permissive form shape; used in generics that constrain.
DeepPartial<T>runtime/types/types-coreEvery leaf made optional, recursively.
DefaultValuesInput<Schema> / DefaultValuesShape<Form>runtime/types/types-coreThe defaultValues argument shape vs. the resolved tree.
WriteShape<Schema>runtime/types/types-coreThe shape setValue accepts (z.input-equivalent).
NestedReadType<T, P> / NestedType<T, P>runtime/types/types-coreWalk a type to the value at a path.
LiftedValueShape<T>runtime/types/types-coreHelper for variant-memory and discriminated-union plumbing.
ArrayItem<T>runtime/types/types-coreElement type of an array.
IsTuple<T> / IsUnion<T> / KeyofUnion<T> / ValueOfUnion<T>runtime/types/types-coreType-level predicates and unions over generic values.
Primitiveruntime/types/types-coreThe base primitive set.

Binding

TypeSourcePurpose
RegisterDirectiveruntime/types/types-apiThe v-register directive type.
RegisterValue / RegisterOptionsruntime/types/types-apiThe value the directive accepts; the per-register options shape.
RegisterFlatPath<Form>runtime/types/types-apiPaths bindable through register.
RegisterTextModifier / RegisterSelectModifierruntime/types/types-apiThe .lazy / .trim / .number modifier types.
RegisterTransform<V>runtime/types/types-apiCustom DOM ↔ value transform shape.
CustomDirectiveRegisterAssignerFnruntime/types/types-apiThe assignKey custom-assigner signature.
UseRegisterReturn<V>runtime/composables/use-registerWhat useRegister<V>() returns.

Set / mutate

TypeSourcePurpose
SetValuePayload<Form>runtime/types/types-apiWhole-form merge payload shape.
SetValueCallback<Form>runtime/types/types-apiThe (prev) => next callback signature.
MetaTrackerValueruntime/types/types-apiInternal "I'm mutating" flag exposed for advanced consumers.
Unsetruntime/core/unsetThe unset sentinel's brand type.

Storage

TypeSourcePurpose
FormStorageruntime/types/types-apiThe four-method storage interface (read / write / clear / list).
FormStorageKindruntime/types/types-api'local' | 'session' | 'indexeddb'.
SerializedAttaformStateruntime/core/serializeThe SSR payload shape.
SerializedFormDataruntime/core/registrySingle form's serialized state.

Wizard

TypeSourcePurpose
UseWizardReturnType<Forms>runtime/types/types-wizardThe whole wizard return: current, statuses, navigation.
WizardOptions<Forms>runtime/types/types-wizardThe options bag.
AnyForm / FormKeyOf<F> / KeysOf<Forms>runtime/types/types-wizardHelpers for typing forms passed to useWizard.
WizardNavOptionsruntime/types/types-wizardOptions forwarded to next / back / goTo.

DevTools

TypeSourcePurpose
AttaformDevtoolsBridgeruntime/core/devtools-sharedThe window-bridge contract the Nuxt overlay consumes.

API errors

TypeSourcePurpose
ApiErrorEnvelope / ApiErrorDetails / ApiErrorEntryruntime/types/types-apiThe shapes parseApiErrors accepts.
ParseApiErrorsOptionsruntime/core/parse-api-errorsOptions for the parser (formKey, defaultCode, maxEntries, maxPathDepth, maxTotalSegments).
ParseApiErrorsResultruntime/core/parse-api-errorsDiscriminated { ok: true, errors } | { ok: false, errors: [], rejected }.

Coercion

TypeSourcePurpose
CoercionEntry / CoercionRegistry / CoercionResultruntime/types/types-apiThe schema-driven coercion shapes.

Internal-only (not for direct consumption)

These types ride on internal helpers and are exported for advanced custom-adapter authors. The Inference-first DX doctrine means everyday consumers never need them:

  • StorageLeaf / StorageShape: the slim-write-shape internal representations the runtime walks.
  • PartialFlatPath<Form>: used by the path-prefix matchers inside the runtime.
  • LiftedValueShape<T>: variant-memory plumbing.

Treat them as appendix items: stable enough to reference, but the public-facing surfaces (UseFormReturnType, FieldState, ValidationError) are what consumer code should depend on.

Where to next