.md

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 }).
FormKeyruntime/types/types-apiThe useForm({ key }) identifier: distant lookup, error labelling, DevTools naming.
AttaformRegistryruntime/core/registryThe per-Vue-app container every form registers into. Reached explicitly only for SSR or a custom plugin.
HistoryPluginruntime/types/types-apiWhat historyPlugin() from attaform/history returns; passed via useForm({ history }).
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.
DisplayCtxruntime/types/types-apiWhat a getDisplayState reducer receives: the field and form snapshots, plus the injected clock.
DisplayMachineruntime/types/types-apiWhat a reducer returns: the verdict to render now, plus optional timings to re-run itself.
DisplayTimingsruntime/core/display-stateThe anti-flash delays the default reducer runs on (showDelay, minDuration), in milliseconds.

Reactive surfaces

TypeSourcePurpose
FieldState<Value>runtime/types/types-apiThe 37-property per-leaf reactive bundle.
FieldStateMap<Form>runtime/types/types-apiThe proxy shape exposing form.fields.
FieldStateMapEntry<Form, P>runtime/types/types-apiOne node in that proxy: a FieldState on a leaf, a nested map on a container.
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, data? }). Form identity lives on the response envelope, not per entry.
ErrorInputruntime/types/types-apiWhat form.setErrors accepts: an Error or { message?, path?, code?, data? }. Foreign fields are stripped during normalization, so ValidationError is a subtype.
Jsonruntime/types/types-apiJSON-serialisable value; the type of the optional data payload.
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 (the settled half of validate()'s status).
ParseOptionsruntime/types/types-apiOptions bag for form.parse; commit: true writes the verdict to the error store and cancels in-flight field runs.
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 15-method + 4-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, optional or not.
RecordPath<Form>runtime/types/types-coreEvery reachable path whose value is an open-keyed record.
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.
RecordValue<T, P>runtime/types/types-coreValue type of a record.
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.
UseRegisterOptionsruntime/composables/use-registerOptions for useRegister, including the inner element to re-bind a parent's v-register onto.
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.

SSR payload

TypeSourcePurpose
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.
StepSlot<Forms>runtime/types/types-wizardOne position in the source steps array: a form, a string, a function, or a wrapped marker.
CompiledStep<Forms>runtime/types/types-wizardOne resolved position, as wizard.steps exposes it.
GateMarker / LazyMarkerruntime/types/types-wizardWhat gate(step) and lazy(fn) return. Opaque brands; you never construct one.
FormStatus / FormStatusSeedruntime/types/types-wizardWhat wizard.statuses[key] reads, and the shape defaultStatuses seeds it with.
WizardStatusesProxy<S>runtime/types/types-wizardThe call-or-read proxy behind wizard.statuses.
WizardCtx<Forms> / WizardCtxFormruntime/types/types-wizardWhat a function slot receives, and how a form looks through its ctx.forms lookup.
WizardOnSubmit / WizardOnErrorruntime/types/types-wizardThe wizard.handleSubmit callback signatures. Both span every step, not the active one.
WizardSubmitContext<Forms>runtime/types/types-wizardThe context wizard.handleSubmit's onSubmit receives.
WizardAggregateErrorruntime/types/types-wizardOne entry in wizard.allErrors[key]: a ValidationError plus the formKey that produced it.
WizardPersistFn / WizardRestoreFnruntime/types/types-wizardThe persist / restore callback signatures for step round-tripping.
WizardRestoreStateruntime/types/types-wizardWhat restore hands back: the active step's key, in an open-ended object.
InjectWizardInputruntime/composables/inject-wizardThe object form of injectWizard's argument, mirroring injectForm.

DevTools

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

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