ErlangFormDocs v1.0.0
Reference

TypeScript types

All exported types and typed configuration patterns.

import { z } from "zod";
import type { FieldConfig, ComponentRegistry } from "erlangform";
const schema = z.object({ profile: z.object({ name: z.string() }) });
type Values = z.infer<typeof schema>;
const config = {
  profile: { name: { label: "Name" } },
} satisfies FieldConfig<Values>;
const registry = {} satisfies ComponentRegistry<Values>;

Use satisfies to check configuration while preserving specific inference. Object/array children are scoped under their parent; item configures array elements, and numeric keys configure tuple positions. See the custom component preview to try typed props.

Exported typePurpose
FieldConfigRoot configuration with legacy child-key fallback
NestedFieldConfigDirect children, including keys from every union branch
FieldOptionsInput/container options chosen by value type
InputFieldOptionsSingle-input options
ResolvedFieldOptionsOptions after evaluating label/placeholder/description/options
ResolvedInputFieldOptionsResolved single-input options
ArrayItemArray element type excluding null/undefined
DeepFieldKeysRecursive key names for compatibility, not dotted paths
FieldContextParent object scope for a key
FieldValueValue type associated with a key
ComponentRegistryInferred type to component mapping
FieldComponentPropsfield/config/state for a custom input
FieldComponentApiname, state.value/meta, handleChange, optional handleBlur
ContainerComponentPropsfield/config/state/values and optional children
FieldStatevisible, disabled, readOnly, required
SectionConfig / SectionConfigsOne section or a section map
FormStep / FormWizardOptionsSteps and navigation callbacks
ServerErrorsRecord of string paths to strings or readonly string arrays
FieldMetaMetadata returned by infer

FieldOptions distinguishes Date/File inputs, dynamic arrays, tuples, objects, and records. Input labels and placeholders are not universal container options. Arrays expose item, array, inputType, and options; tuples use position indexes.

FieldLayout, Resolver, SelectOption, and AutoFormProps are internal and not exported. Select options use { label: string, value: string }. See the runtime API for components and helpers.