Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface StateNodeConfig<TContext, TStateSchema, TEvent>

Type Parameters

Hierarchy

  • StateNodeConfig

Index

Properties

activities?: string | ActivityDefinition<TContext, TEvent> | Activity<TContext, TEvent>[]

The activities to be started upon entering the state node, and stopped upon exiting the state node.

after?: Record<string | number, string | TransitionConfig<TContext, TEvent> | TransitionConfig<TContext, TEvent>[]> | (TransitionConfig<TContext, TEvent> & { delay: string | number | Expr<TContext, TEvent, number> })[]

The mapping (or array) of delays (in milliseconds) to their potential transition(s). The delayed transitions are taken after the specified delay in an interpreter.

always?: SingleOrArray<undefined | string | StateNode<TContext, any, TEvent, { context: TContext; value: any }> | TransitionConfig<TContext, TEvent>>

An eventless transition that is always taken when this state node is active. Equivalent to a transition specified as an empty ''' string in the on property.

context?: TContext | (() => TContext)

The initial context (extended state) of the machine.

Can be an object or a function that returns an object.

data?: Mapper<TContext, TEvent, any> | PropertyMapper<TContext, TEvent, any>

The data sent with the "done.state.id" event if this is a final state node.

The data will be evaluated with the current context and placed on the .data property of the event.

delimiter?: string

The string delimiter for serializing the path to a string. The default is "."

entry?: string | ActionObject<TContext, TEvent> | ActionFunction<TContext, TEvent> | Action<TContext, TEvent>[]

The action(s) to be executed upon entering the state node.

exit?: string | ActionObject<TContext, TEvent> | ActionFunction<TContext, TEvent> | Action<TContext, TEvent>[]

The action(s) to be executed upon exiting the state node.

history?: boolean | "shallow" | "deep"

Indicates whether the state node is a history state node, and what type of history: shallow, deep, true (shallow), false (none), undefined (none)

id?: string

The unique ID of the state node, which can be referenced as a transition target via the #id syntax.

initial?: keyof TStateSchema["states"]

The initial state node key.

invoke?: InvokeConfig<TContext, TEvent> | StateMachine<any, any, any, { context: any; value: any }> | (InvokeConfig<TContext, TEvent> | StateMachine<any, any, any, { context: any; value: any }>)[]

The services to invoke upon entering this state node. These services will be stopped upon exiting this state node.

key?: string

The relative key of the state node, which represents its location in the overall state value. This is automatically determined by the configuration shape via the key where it was defined.

meta?: TStateSchema extends { meta: D } ? D : any

The meta data associated with this state node, which will be returned in State instances.

on?: TransitionsConfigMap<TContext, TEvent> | TransitionsConfigArray<TContext, TEvent>

The mapping of event types to their potential transition(s).

onDone?: string | TransitionConfig<TContext, DoneEventObject> | TransitionConfig<TContext, DoneEventObject>[]

The potential transition(s) to be taken upon reaching a final child state node.

This is equivalent to defining a [done(id)] transition on this state node's on property.

onEntry?: string | ActionObject<TContext, TEvent> | ActionFunction<TContext, TEvent> | Action<TContext, TEvent>[]

The action(s) to be executed upon entering the state node.

deprecated

Use entry instead.

onExit?: string | ActionObject<TContext, TEvent> | ActionFunction<TContext, TEvent> | Action<TContext, TEvent>[]

The action(s) to be executed upon exiting the state node.

deprecated

Use exit instead.

order?: number

The order this state node appears. Corresponds to the implicit SCXML document order.

parallel?: boolean
deprecated
states?: StatesConfig<TContext, TStateSchema, TEvent>

The mapping of state node keys to their state node configurations (recursive).

strict?: boolean
type?: "atomic" | "compound" | "parallel" | "final" | "history"

The type of this state node:

  • 'atomic' - no child state nodes
  • 'compound' - nested child state nodes (XOR)
  • 'parallel' - orthogonal nested child state nodes (AND)
  • 'history' - history state node
  • 'final' - final state node

Generated using TypeDoc