1 | import { MachineSnapshot } from "./State.js";
|
2 | import type { StateNode } from "./StateNode.js";
|
3 | import { ActionArgs, AnyEventObject, AnyMachineSnapshot, AnyStateNode, AnyTransitionDefinition, DelayedTransitionDefinition, EventObject, InitialTransitionConfig, InitialTransitionDefinition, MachineContext, StateValue, TransitionDefinition, TODO, UnknownAction, ParameterizedObject, AnyTransitionConfig, AnyActorScope } from "./types.js";
|
4 | type StateNodeIterable<TContext extends MachineContext, TE extends EventObject> = Iterable<StateNode<TContext, TE>>;
|
5 | type AnyStateNodeIterable = StateNodeIterable<any, any>;
|
6 | export declare function getAllStateNodes(stateNodes: Iterable<AnyStateNode>): Set<AnyStateNode>;
|
7 | export declare function getStateValue(rootNode: AnyStateNode, stateNodes: AnyStateNodeIterable): StateValue;
|
8 | export declare function isInFinalState(stateNodeSet: Set<AnyStateNode>, stateNode: AnyStateNode): boolean;
|
9 | export declare const isStateId: (str: string) => boolean;
|
10 | export declare function getCandidates<TEvent extends EventObject>(stateNode: StateNode<any, TEvent>, receivedEventType: TEvent['type']): Array<TransitionDefinition<any, TEvent>>;
|
11 |
|
12 | export declare function getDelayedTransitions(stateNode: AnyStateNode): Array<DelayedTransitionDefinition<MachineContext, EventObject>>;
|
13 | export declare function formatTransition(stateNode: AnyStateNode, descriptor: string, transitionConfig: AnyTransitionConfig): AnyTransitionDefinition;
|
14 | export declare function formatTransitions<TContext extends MachineContext, TEvent extends EventObject>(stateNode: AnyStateNode): Map<string, TransitionDefinition<TContext, TEvent>[]>;
|
15 | export declare function formatInitialTransition<TContext extends MachineContext, TEvent extends EventObject>(stateNode: AnyStateNode, _target: string | undefined | InitialTransitionConfig<TContext, TEvent, TODO, TODO, TODO, TODO>): InitialTransitionDefinition<TContext, TEvent>;
|
16 | export declare function getInitialStateNodes(stateNode: AnyStateNode): Set<AnyStateNode>;
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | export declare function getStateNodeByPath(stateNode: AnyStateNode, statePath: string | string[]): AnyStateNode;
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | export declare function getStateNodes(stateNode: AnyStateNode, stateValue: StateValue): Array<AnyStateNode>;
|
29 | export declare function transitionNode<TContext extends MachineContext, TEvent extends EventObject>(stateNode: AnyStateNode, stateValue: StateValue, snapshot: MachineSnapshot<TContext, TEvent, any, any, any, any, any, any>, event: TEvent): Array<TransitionDefinition<TContext, TEvent>> | undefined;
|
30 |
|
31 | export declare function microstep(transitions: Array<AnyTransitionDefinition>, currentSnapshot: AnyMachineSnapshot, actorScope: AnyActorScope, event: AnyEventObject, isInitial: boolean, internalQueue: Array<AnyEventObject>): AnyMachineSnapshot;
|
32 | export interface BuiltinAction {
|
33 | (): void;
|
34 | type: `xstate.${string}`;
|
35 | resolve: (actorScope: AnyActorScope, snapshot: AnyMachineSnapshot, actionArgs: ActionArgs<any, any, any>, actionParams: ParameterizedObject['params'] | undefined, action: unknown, extra: unknown) => [
|
36 | newState: AnyMachineSnapshot,
|
37 | params: unknown,
|
38 | actions?: UnknownAction[]
|
39 | ];
|
40 | retryResolve: (actorScope: AnyActorScope, snapshot: AnyMachineSnapshot, params: unknown) => void;
|
41 | execute: (actorScope: AnyActorScope, params: unknown) => void;
|
42 | }
|
43 | export declare function resolveActionsAndContext(currentSnapshot: AnyMachineSnapshot, event: AnyEventObject, actorScope: AnyActorScope, actions: UnknownAction[], internalQueue: AnyEventObject[], deferredActorIds: string[] | undefined): AnyMachineSnapshot;
|
44 | export declare function macrostep(snapshot: AnyMachineSnapshot, event: EventObject, actorScope: AnyActorScope, internalQueue: AnyEventObject[]): {
|
45 | snapshot: typeof snapshot;
|
46 | microstates: Array<typeof snapshot>;
|
47 | };
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 | export declare function resolveStateValue(rootNode: AnyStateNode, stateValue: StateValue): StateValue;
|
55 | export {};
|