fsm-vir - v3.0.0
    Preparing search index...

    Type Alias StateMachine<State, Input>

    Options for runFsm.

    type StateMachine<State, Input> = {
        actions?: PartialWithUndefined<
            {
                postNextState: ActionCallback<State, Input>;
                preNextState: ActionCallback<State, Input>;
            },
        >;
        initState: State;
        inputs: Readonly<Iterable<Input>>;
        nextState: NextStateCallback<State, Input>;
    }

    Type Parameters

    • State
    • Input
    Index

    Properties

    actions?: PartialWithUndefined<
        {
            postNextState: ActionCallback<State, Input>;
            preNextState: ActionCallback<State, Input>;
        },
    >

    Actions to fire on each input value.

    initState: State

    Initial state for the state machine.

    inputs: Readonly<Iterable<Input>>

    All inputs to iterate over for the state machine.

    A function that calculates the next state for each input.