Form / foldkit-mixins-form

FieldsField

interface · packages/mixins-form/src/index.ts:604

interface FieldsField<
  Key extends string,
  Model,
  FormMessage extends {
    readonly _tag: string
  },
> {
  (
    control: FormControl<Key>,
    model: Model,
    id: string,
    h: HtmlBuilder<FormMessage>,
    override?: FieldOverride<Key, FormMessage, FormMessage>,
  ): Html
  <Message>(
    control: FormControl<Key>,
    model: Model,
    id: string,
    h: HtmlBuilder<Message>,
    override: FieldOverride<Key, FormMessage, Message>,
  ): Html
}

One flat key's control, for a layout the caller owns: through the base field view with a form-universe h, or through the override it is given, with any h. A call with neither a form h nor an override is a type error, since the base view's Messages are the form's own.