effex-monorepo
    Preparing search index...

    Interface Form<Fields, R, FormCtx>

    A Form definition.

    interface Form<
        Fields extends Record<string, Field<any, any>>,
        R = never,
        FormCtx = any,
    > {
        _fields: Fields;
        "[FormTypeId]": typeof FormTypeId;
        fields: FieldAccessors<Fields, FormCtx>;
        form: Effect<
            FormState<
                { [K in string
                | number
                | symbol]: FieldEncodedOf<Fields[K]> },
                { [K in string | number | symbol]: FieldTypeOf<Fields[K]> },
            >,
            never,
            FormCtx,
        >;
        provide: <A, E2, R2>(
            config: ProvideConfig<
                { [K in string
                | number
                | symbol]: FieldEncodedOf<Fields[K]> },
                { [K in string | number | symbol]: FieldTypeOf<Fields[K]> },
                E2,
                R2,
            >,
            children: Effect<A, never, FormCtx>,
        ) => Effect<A, never, Scope | R | R2>;
    }

    Type Parameters

    • Fields extends Record<string, Field<any, any>>

      The record of field definitions

    • R = never

      Requirements from form-level callbacks

    • FormCtx = any

      The form context identifier (internal)

    Index

    Properties

    _fields: Fields

    The field definitions (for introspection).

    "[FormTypeId]": typeof FormTypeId
    fields: FieldAccessors<Fields, FormCtx>

    Access individual field states via context.

    form: Effect<
        FormState<
            { [K in string
            | number
            | symbol]: FieldEncodedOf<Fields[K]> },
            { [K in string | number | symbol]: FieldTypeOf<Fields[K]> },
        >,
        never,
        FormCtx,
    >

    Access form-level state via context.

    provide: <A, E2, R2>(
        config: ProvideConfig<
            { [K in string
            | number
            | symbol]: FieldEncodedOf<Fields[K]> },
            { [K in string | number | symbol]: FieldTypeOf<Fields[K]> },
            E2,
            R2,
        >,
        children: Effect<A, never, FormCtx>,
    ) => Effect<A, never, Scope | R | R2>

    Create live form state and provide context to children.