Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/xstate/src/types.ts>StateNodeConfig

State machines and statecharts for the modern web.
Go to Latest
interface StateNodeConfig
import { type StateNodeConfig } from "https://deno.land/x/xstate@xstate%405.0.0-beta.23/src/types.ts";

Type Parameters

TContext extends MachineContext
TEvent extends EventObject
TAction extends ParameterizedObject
TActor extends ProvidedActor
TOutput

Properties

optional
initial: InitialTransitionConfig<TContext, TEvent, TAction> | SingleOrArray<string> | undefined

The initial state transition.

optional
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
optional
history:
| "shallow"
| "deep"
| boolean
| undefined

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

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

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

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

optional
entry: Actions<TContext, TEvent, TEvent, undefined, TAction>

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

optional
exit: Actions<TContext, TEvent, TEvent, undefined, TAction>

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

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.

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.

An eventless transition that is always taken when this state node is active.

optional
parent: StateNode<TContext, TEvent>
optional
meta: any

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

optional
output: Mapper<TContext, TEvent, TOutput> | TOutput

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

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

optional
id: string | undefined

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

optional
order: number

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

optional
tags: SingleOrArray<string>

The tags for this state node, which are accumulated into the state.tags property.

optional
description: string

A text description of the state node

optional
target: string

A default target for a history state