JSSM, a JavaScript state machine - the FSM for FSL
    Preparing search index...

    Type Alias JssmGenericConfig<StateType, DataType>

    type JssmGenericConfig<StateType, DataType> = {
        actions?: JssmPermittedOpt;
        allow_force?: false;
        allow_islands?: JssmAllowIslands;
        allows_override?: JssmAllowsOverride;
        arrange_declaration?: StateType[][];
        arrange_end_declaration?: StateType[][];
        arrange_start_declaration?: StateType[][];
        auto_api?: boolean | string;
        boundary_depth_limit?: number;
        check?: JssmStatePermitterMaybeArray<DataType>;
        clear_timeout_source?: (handle: number) => void;
        complete?: StateType[];
        config_allows_override?: JssmAllowsOverride;
        data?: DataType;
        default_active_state_config?: JssmStateStyleKeyList;
        default_end_state_config?: JssmStateStyleKeyList;
        default_graph_config?: JssmGraphConfig;
        default_hooked_state_config?: JssmStateStyleKeyList;
        default_size?: JssmDefaultSize;
        default_start_state_config?: JssmStateStyleKeyList;
        default_state_config?: JssmStateStyleKeyList;
        default_terminal_state_config?: JssmStateStyleKeyList;
        default_transition_config?: JssmTransitionConfig;
        dot_preamble?: string;
        editor_config?: JssmEditorConfig;
        end_states?: StateType[];
        failed_outputs?: StateType[];
        farrange_declaration?: StateType[][];
        flow?: FslDirection;
        fsl_version?: JssmParsedSemver;
        graph_layout?: JssmLayout;
        group_hooks?: JssmGroupHooks;
        group_metadata?: Map<string, JssmStateConfig>;
        group_registry?: JssmGroupRegistry;
        history?: number;
        initial_state?: StateType;
        instance_name?: string;
        machine_author?: string | string[];
        machine_comment?: string;
        machine_contributor?: string | string[];
        machine_definition?: string;
        machine_language?: string;
        machine_license?: string;
        machine_name?: string;
        machine_version?: JssmParsedSemver;
        max_exits?: number;
        min_exits?: number;
        name?: string;
        nodes?: StateType[];
        npm_name?: string;
        oarrange_declaration?: StateType[][];
        property_definition?: JssmPropertyDefinition[];
        rng_seed?: number;
        simplify_bidi?: boolean;
        start_states: StateType[];
        start_states_no_enforce?: boolean;
        state_declaration?: object[];
        state_hooks?: JssmStateHooks;
        state_property?: JssmPropertyDefinition[];
        theme?: FslTheme[];
        time_source?: () => number;
        timeout_source?: (fn: () => void, delay_ms: number) => number;
        transitions: JssmTransitions<StateType, DataType>;
    }

    Type Parameters

    • StateType
    • DataType
    Index
    allow_force?: false
    allow_islands?: JssmAllowIslands
    allows_override?: JssmAllowsOverride
    arrange_declaration?: StateType[][]
    arrange_end_declaration?: StateType[][]
    arrange_start_declaration?: StateType[][]
    auto_api?: boolean | string
    boundary_depth_limit?: number

    Maximum depth of the boundary-hook action cascade before the machine throws a jssm_error!JssmError rather than risking a stack overflow or hang.

    Each time a boundary action fires a transition that itself crosses a boundary, the depth counter increments. A cascade exceeding this limit is treated as a probable infinite loop and rejected.

    Defaults to 100. Raise it for legitimate pipelines that genuinely nest more than 100 transitions via boundary hooks.

    • Machine._boundary_depth_limit
    • Machine._fire_boundary_actions
    clear_timeout_source?: (handle: number) => void

    Cancels a timer previously scheduled by timeout_source. Defaults to clearTimeout.

    complete?: StateType[]
    config_allows_override?: JssmAllowsOverride
    data?: DataType
    default_active_state_config?: JssmStateStyleKeyList
    default_end_state_config?: JssmStateStyleKeyList
    default_graph_config?: JssmGraphConfig
    default_hooked_state_config?: JssmStateStyleKeyList
    default_size?: JssmDefaultSize
    default_start_state_config?: JssmStateStyleKeyList
    default_state_config?: JssmStateStyleKeyList
    default_terminal_state_config?: JssmStateStyleKeyList
    default_transition_config?: JssmTransitionConfig
    dot_preamble?: string
    editor_config?: JssmEditorConfig
    end_states?: StateType[]
    failed_outputs?: StateType[]
    farrange_declaration?: StateType[][]
    fsl_version?: JssmParsedSemver
    graph_layout?: JssmLayout
    group_hooks?: JssmGroupHooks
    group_metadata?: Map<string, JssmStateConfig>
    group_registry?: JssmGroupRegistry

    Overlapping-state-group tables produced by the compile pass and consumed by the Task-3 runtime cascade.

    group_registry maps each group name to its ordered list of direct members (states and sub-group references) as declared in the FSL source.

    group_metadata maps each group name to its RAW style object { declarations: [...] } — parsed style items from a state &g : { … }; declaration, not condensed JssmStateConfig style fields. Condensation is intentionally deferred to the Task-3 runtime cascade so that depth-specificity resolution can weight each group's contribution before merging into per-state config.

    group_hooks and state_hooks hold boundary-hook payloads keyed by group name and state name respectively; firing is also a Task-3 concern.

    All four fields are absent (undefined) on machines that declare no groups or hooks.

    history?: number
    initial_state?: StateType
    instance_name?: string
    machine_author?: string | string[]
    machine_comment?: string
    machine_contributor?: string | string[]
    machine_definition?: string
    machine_language?: string
    machine_license?: string
    machine_name?: string
    machine_version?: JssmParsedSemver
    max_exits?: number
    min_exits?: number
    name?: string
    nodes?: StateType[]
    npm_name?: string
    oarrange_declaration?: StateType[][]
    property_definition?: JssmPropertyDefinition[]
    rng_seed?: number
    simplify_bidi?: boolean
    start_states: StateType[]
    start_states_no_enforce?: boolean
    state_declaration?: object[]
    state_hooks?: JssmStateHooks
    state_property?: JssmPropertyDefinition[]
    theme?: FslTheme[]
    time_source?: () => number
    timeout_source?: (fn: () => void, delay_ms: number) => number

    Schedules fn to run after delay_ms, and returns a handle that will be handed back to clear_timeout_source untouched. Defaults to setTimeout.

    The handle is typed number — the browser shape. Node's setTimeout returns a Timeout object instead, so a Node-shaped source casts it (as jssm's own DEFAULT_TIMEOUT_SOURCE does); jssm never inspects the handle, it only stores it and gives it back.

    (Before 5.162.14 these read (Function, number) => number, in which Function and number were parameter names, not types — so both parameters were silently any.)