import { MachineSnapshot } from "./State.js"; import type { StateNode } from "./StateNode.js"; import { AnyEventObject, AnyHistoryValue, AnyMachineSnapshot, AnyStateNode, AnyTransitionDefinition, DelayedTransitionDefinition, EventObject, InitialTransitionConfig, InitialTransitionDefinition, MachineContext, StateValue, StateValueMap, TransitionDefinition, TODO, UnknownAction, AnyTransitionConfig, AnyActorScope } from "./types.js"; type StateNodeIterable = Iterable>; type AnyStateNodeIterable = StateNodeIterable; type AdjList = Map>; export declare const isAtomicStateNode: (stateNode: StateNode) => boolean; export declare function getAllStateNodes(stateNodes: Iterable): Set; export declare function getAdjList(stateNodes: StateNodeIterable): AdjList; export declare function getStateValue(rootNode: AnyStateNode, stateNodes: AnyStateNodeIterable): StateValue; export declare function isInFinalState(stateNodeSet: Set, stateNode: AnyStateNode): boolean; export declare const isStateId: (str: string) => boolean; export declare function getCandidates(stateNode: StateNode, receivedEventType: TEvent['type']): Array>; /** * All delayed transitions from the config. */ export declare function getDelayedTransitions(stateNode: AnyStateNode): Array>; export declare function formatTransition(stateNode: AnyStateNode, descriptor: string, transitionConfig: AnyTransitionConfig): AnyTransitionDefinition; export declare function formatTransitions(stateNode: AnyStateNode): Map[]>; export declare function formatInitialTransition(stateNode: AnyStateNode, _target: string | undefined | InitialTransitionConfig): InitialTransitionDefinition; export declare function resolveTarget(stateNode: AnyStateNode, targets: ReadonlyArray | undefined): ReadonlyArray | undefined; export declare function getInitialStateNodesWithTheirAncestors(stateNode: AnyStateNode): Set; export declare function getInitialStateNodes(stateNode: AnyStateNode): Set; /** * Returns the child state node from its relative `stateKey`, or throws. */ export declare function getStateNode(stateNode: AnyStateNode, stateKey: string): AnyStateNode; /** * Returns the relative state node from the given `statePath`, or throws. * * @param statePath The string or string array relative path to the state node. */ export declare function getStateNodeByPath(stateNode: AnyStateNode, statePath: string | string[]): AnyStateNode; /** * Returns the state nodes represented by the current state value. * * @param stateValue The state value or State instance */ export declare function getStateNodes(stateNode: AnyStateNode, stateValue: StateValue): Array; export declare function transitionAtomicNode(stateNode: AnyStateNode, stateValue: string, snapshot: MachineSnapshot, event: TEvent): Array> | undefined; export declare function transitionCompoundNode(stateNode: AnyStateNode, stateValue: StateValueMap, snapshot: MachineSnapshot, event: TEvent): Array> | undefined; export declare function transitionParallelNode(stateNode: AnyStateNode, stateValue: StateValueMap, snapshot: MachineSnapshot, event: TEvent): Array> | undefined; export declare function transitionNode(stateNode: AnyStateNode, stateValue: StateValue, snapshot: MachineSnapshot, event: TEvent): Array> | undefined; export declare function removeConflictingTransitions(enabledTransitions: Array, stateNodeSet: Set, historyValue: AnyHistoryValue): Array; /** * https://www.w3.org/TR/scxml/#microstepProcedure */ export declare function microstep(transitions: Array, currentSnapshot: AnyMachineSnapshot, actorScope: AnyActorScope, event: AnyEventObject, isInitial: boolean, internalQueue: Array): AnyMachineSnapshot; export declare function resolveActionsAndContext(currentSnapshot: AnyMachineSnapshot, event: AnyEventObject, actorScope: AnyActorScope, actions: UnknownAction[], internalQueue: AnyEventObject[], deferredActorIds?: string[]): AnyMachineSnapshot; export declare function macrostep(snapshot: AnyMachineSnapshot, event: EventObject, actorScope: AnyActorScope, internalQueue?: AnyEventObject[]): { snapshot: typeof snapshot; microstates: Array; }; /** * Resolves a partial state value with its full representation in the state node's machine. * * @param stateValue The partial state value to resolve. */ export declare function resolveStateValue(rootNode: AnyStateNode, stateValue: StateValue): StateValue; export declare function stateValuesEqual(a: StateValue | undefined, b: StateValue | undefined): boolean; export {};