import type { StateMachine } from "./StateMachine.js"; import type { DelayedTransitionDefinition, EventObject, InitialTransitionDefinition, InvokeDefinition, MachineContext, Mapper, StateNodeConfig, StateNodeDefinition, StateNodesConfig, TransitionDefinition, TransitionDefinitionMap, TODO, UnknownAction, ParameterizedObject, AnyStateMachine, ProvidedActor, NonReducibleUnknown, EventDescriptor } from "./types.js"; interface StateNodeOptions { _key: string; _parent?: StateNode; _machine: AnyStateMachine; } export declare class StateNode { /** * The raw config used to create the machine. */ config: StateNodeConfig; /** * The relative key of the state node, which represents its location in the overall state value. */ key: string; /** * The unique ID of the state node. */ id: string; /** * 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 */ type: 'atomic' | 'compound' | 'parallel' | 'final' | 'history'; /** * The string path from the root machine node to this node. */ path: string[]; /** * The child state nodes. */ states: StateNodesConfig; /** * The type of history on this state node. Can be: * * - `'shallow'` - recalls only top-level historical state value * - `'deep'` - recalls historical state value at all levels */ history: false | 'shallow' | 'deep'; /** * The action(s) to be executed upon entering the state node. */ entry: UnknownAction[]; /** * The action(s) to be executed upon exiting the state node. */ exit: UnknownAction[]; /** * The parent state node. */ parent?: StateNode; /** * The root machine node. */ machine: StateMachine; /** * The meta data associated with this state node, which will be returned in State instances. */ meta?: any; /** * The output data sent with the "xstate.done.state._id_" event if this is a final state node. */ output?: Mapper | NonReducibleUnknown; /** * The order this state node appears. Corresponds to the implicit document order. */ order: number; description?: string; tags: string[]; transitions: Map[]>; always?: Array>; constructor( /** * The raw config used to create the machine. */ config: StateNodeConfig, options: StateNodeOptions); /** * The well-structured state node definition. */ get definition(): StateNodeDefinition; /** * The logic invoked as actors by this state node. */ get invoke(): Array>; /** * The mapping of events to transitions. */ get on(): TransitionDefinitionMap; get after(): Array>; get initial(): InitialTransitionDefinition; /** * All the event types accepted by this state node and its descendants. */ get events(): Array>; /** * All the events that have transitions directly from this state node. * * Excludes any inert events. */ get ownEvents(): Array>; } export {};