form-graph
    Preparing search index...

    Function createTypedController

    • 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.

      Type Parameters

      • R extends CodecRegistry

        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.

      Returns TypedController<R>

    • 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.

      Type Parameters

      • State
      • Ext
      • R extends CodecRegistry

        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.

      Parameters

      Returns TypedController<R>