form-graph
    Preparing search index...

    Interface RuleCtx<State, Ext>

    interface RuleCtx<State, Ext = unknown> {
        ext: Ext;
        next: State;
        patch: Readonly<Record<string, unknown>>;
        state: State;
    }

    Type Parameters

    • State

      The state shape a rule reads for its decisions. Declare only the keys the rule touches, optional — a narrow State keeps the rule assignable to any form whose state carries those keys.

    • Ext = unknown

      External-context type; unknown when rules never read it.

    Index
    ext: Ext
    next: State

    The EFFECTIVE values: state with the accumulated patch overlaid — what things look like if this patch lands. The one to read when a decision needs several fields together (workflow AND resolution), since any of them may be in this very patch. Patched keys are raw (pre-codec), so trust them the way you trust value.

    patch: Readonly<Record<string, unknown>>

    The accumulated patch (earlier rules' corrections included).

    state: State

    The pre-patch state.