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 type | Purpose |
|---|---|
| FieldConfig | Root configuration with legacy child-key fallback |
| NestedFieldConfig | Direct children, including keys from every union branch |
| FieldOptions | Input/container options chosen by value type |
| InputFieldOptions | Single-input options |
| ResolvedFieldOptions | Options after evaluating label/placeholder/description/options |
| ResolvedInputFieldOptions | Resolved single-input options |
| ArrayItem | Array element type excluding null/undefined |
| DeepFieldKeys | Recursive key names for compatibility, not dotted paths |
| FieldContext | Parent object scope for a key |
| FieldValue | Value type associated with a key |
| ComponentRegistry | Inferred type to component mapping |
| FieldComponentProps | field/config/state for a custom input |
| FieldComponentApi | name, state.value/meta, handleChange, optional handleBlur |
| ContainerComponentProps | field/config/state/values and optional children |
| FieldState | visible, disabled, readOnly, required |
| SectionConfig / SectionConfigs | One section or a section map |
| FormStep / FormWizardOptions | Steps and navigation callbacks |
| ServerErrors | Record of string paths to strings or readonly string arrays |
| FieldMeta | Metadata 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.