Options
All
  • Public
  • Public/Protected
  • All
Menu

The main automaton class, holds the state and provides methods for transitioning.

The state defaults to INITIAL.

You can extend this class to implement some custom logic.

Hierarchy

Index

Constructors

constructor

Properties

Private possibleTransitions

possibleTransitions: Transition[] = []

Holds a list of transitions that are possible to perform from the current state.

Private transitions

transitions: Transitions

Accessors

state

state:

Current state of the Automaton.

Methods

Protected doTransition

  • Performs a Transition, calling it's lifecycle methods.

    Parameters

    • implementation: TransitionFunction

      transition function or next finite machine state

    • Rest ...args: any[]

      custom arguments passed to the implementation function

    Returns void

Private findTransitions

  • Returns the transition that satisfies the following conditions:

    • It is possible to perform from the current state
    • It can be performed by the provided Signal

    Parameters

    Returns Transition[]

Private getPossibleTransitions

reset

  • reset(): void

transition

  • transition(signal: Signal, ...args: any[]): void
  • Performs a state machine transition, dispatching a Signal.

    Parameters

    • signal: Signal

      target signal

    • Rest ...args: any[]

      custom arguments passed to the transition function

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc