The raw config used to create the machine.
The relative key of the state node, which represents its location in the overall state value.
The unique ID of the state node.
The machine's own version.
The type of this state node:
The string path from the root machine node to this node.
The initial state node key.
(DEPRECATED) Whether the state node is a parallel state node.
Use type: 'parallel' instead.
The child state nodes.
The type of history on this state node. Can be:
The action(s) to be executed upon entering the state node.
The action(s) to be executed upon exiting the state node.
The activities to be started upon entering the state node,
and stopped upon exiting the state node.
The parent state node.
The root machine node.
The meta data associated with this state node, which will be returned in State instances.
The data sent with the "done.state.id" event if this is a final state node.
The string delimiter for serializing the path to a string. The default is "."
The order this state node appears. Corresponds to the implicit SCXML document order.
The services invoked by this state node.
Clones this state machine with custom options and context.
Options (actions, guards, activities, services) to recursively merge with the existing options.
Custom context (will override predefined context)
Clones this state machine with custom context.
Custom context (will override predefined context, not recursive)
The well-structured state node definition.
The mapping of events to transitions.
All the transitions that can be taken from this state node.
Returns the state nodes represented by the current state value.
The state value or State instance
Returns true if this state node explicitly handles the given event.
The event in question
Resolves the given state to a new State instance relative to this machine.
This ensures that .events and .nextEvents represent the correct values.
The state to resolve
Determines the next state given the current state and sent event.
The current State instance or state value
The event that was sent at the current state
The current context (extended state) of the current state
Returns the child state node from its relative stateKey, or throws.
Returns the state node with the given stateId, or throws.
The state ID. The prefix "#" is removed.
Returns the relative state node from the given statePath, or throws.
The string or string array relative path to the state node.
Resolves a partial state value with its full representation in this machine.
The partial state value to resolve.
The initial State instance, which includes all actions to be executed from
entering the initial state.
The target state value of the history state node, if it exists. This represents the
default state value to transition to if no history value exists yet.
Returns the leaf nodes from a state path relative to this state node.
The relative state path to retrieve the state nodes
Whether state nodes should resolve to initial child state nodes
Retrieves state nodes from a relative path to this state node.
The relative path from this state node
All the state node IDs of this state node and its descendant state nodes.
All the event types accepted by this state node and its descendants.
All the events that have transitions directly from this state node.
Excludes any inert events.
Creates a new State instance.
Creates a new State instance for the given stateValue and context.
Creates a new State instance for the given config.
The state config
Creates a new State instance for the given stateValue and context with no actions (side-effects).
Indicates whether the state has changed from the previous state. A state is considered "changed" if:
An initial state (with no history) will return undefined.
Indicates whether the state is a final state.
The enabled state nodes representative of the state value.
The next events that will cause a transition from the current state.
The transition definitions that resulted in this state.
An object mapping actor IDs to spawned actors/invoked services.
Returns an array of all the string leaf state node paths.
The character(s) that separate each subpath in the string state node path.
Whether the current state value is a subset of the given parent state value.
Whether the current state configuration has a state node with the specified tag.
Determines whether sending the event will cause a transition.
The event to test
Creates a new Interpreter instance (i.e., service) for the given machine with the provided options, if any.
The machine to be interpreted
The default interpreter options:
The machine to interpret
The clock that is responsible for setting and clearing timeouts, such as delayed events and transitions.
Whether the service is started.
The globally unique process ID for this invocation.
Executes the actions of the given state, with that state's context and event.
The state whose actions will be executed
The action implementations to use
Adds an event listener that is notified whenever an event is sent to the running interpreter.
The event listener
Adds an event listener that is notified whenever a send event occurs.
Adds a context listener that is notified whenever the state context changes.
The context listener
Adds a listener that is notified when the machine is stopped.
Adds a state listener that is notified when the statechart has reached its final state.
The state listener
Removes a listener.
The listener to remove
Alias for Interpreter.prototype.start
Starts the interpreter from the given state, or the initial state.
The state to start the statechart from
Stops the interpreter and unsubscribe all listeners.
This will also notify the onStop listeners.
Sends an event to the running interpreter to trigger a transition.
An array of events (batched) can be sent as well, which will send all
batched events to the running interpreter. The listeners will be
notified only once when all events are processed.
Returns a send function bound to this interpreter instance.
The event to be sent by the sender.
Returns the next state given the interpreter's current state and the event.
This is a pure method that does not update the interpreter's state.
The event to determine the next state
Sends an event. This returns an action that will be read by an interpreter to
send the event in the next step, after the current step is finished executing.
The event to send.
Options to pass into the send event:
Sends an event to this machine's parent.
The event to send to the parent machine.
Options to pass into the send event.
Sends an update event to this machine's parent.
Forwards (sends) an event to a specified service.
The target service to forward the event to.
Options to pass into the send action creator.
Creates a new Interpreter instance for the given machine with the provided options, if any.
Returns an event that represents that an invoked service has terminated.
An invoked service is terminated when it has reached a top-level final state node,
but not when it is canceled.
The final state node ID
The data to pass into the event
The expression function to evaluate which will be logged.
Takes in 2 arguments:
The label to give to the logged expression.
The activity to start.
The activity to stop.
The delay in milliseconds
The state node ID where this event is handled
The final state node's parent state node id
The event to send back to the sender
Options to pass into the send event
The error data to send, or the expression function that
takes in the context, event, and meta, and returns the error data to send.