@stricahq/ouroboros-network-js - v2.0.0
    Preparing search index...

    Class StateMachine<S, M>

    Type Parameters

    • S extends string
    • M extends string
    Index
    name: string
    • get allowed(): M[]

      The messages that may be sent next, by whichever side has agency.

      Returns M[]

    • get state(): S

      Returns S

    • Moves along the node's message with this tag and returns its name, or throws when the node may not send it in the current state.

      Parameters

      • tag: unknown

      Returns M

    • Moves along name, a message of the client's, or throws when the client may not send it in the current state.

      Parameters

      • name: M

      Returns void