The codec registry: INFERRED from the form argument, or
ANNOTATED as typeof codecs on the zero-arg call. It is the single source
the returned component derives per-key types from.
Builds an app-typed Controller from a codec registry, so name narrows
value and meta with no per-call-site generics:
PREFERRED: pass the form, and the registry comes from its codecs slot —
nothing separate to export:
const GenController = createTypedController(genForm); <GenController name="steps" render={({ value, meta }) => ...} /> // value: number, meta: { min: number; max: number; step: number }
The zero-arg call with an annotated registry (createTypedController<typeof codecs>()) remains for forms defined without a codecs slot. Where a key
uses different codecs per branch, register the union — value and meta become
the branch union.
The codec registry: INFERRED from the form argument, or
ANNOTATED as typeof codecs on the zero-arg call. It is the single source
the returned component derives per-key types from.
Builds an app-typed Controller from a codec registry, so
namenarrowsvalueandmetawith no per-call-site generics:PREFERRED: pass the form, and the registry comes from its
codecsslot — nothing separate to export:const GenController = createTypedController(genForm); <GenController name="steps" render={({ value, meta }) => ...} /> // value: number, meta: { min: number; max: number; step: number }
The zero-arg call with an annotated registry (
createTypedController<typeof codecs>()) remains for forms defined without a codecs slot. Where a key uses different codecs per branch, register the union — value and meta become the branch union.