1 | import type { StateMachine } from "./StateMachine.js";
|
2 | import type { DelayedTransitionDefinition, EventObject, InitialTransitionDefinition, InvokeDefinition, MachineContext, Mapper, StateNodeConfig, StateNodeDefinition, StateNodesConfig, TransitionDefinition, TransitionDefinitionMap, TODO, UnknownAction, ParameterizedObject, AnyStateMachine, ProvidedActor, NonReducibleUnknown, EventDescriptor } from "./types.js";
|
3 | interface StateNodeOptions<TContext extends MachineContext, TEvent extends EventObject> {
|
4 | _key: string;
|
5 | _parent?: StateNode<TContext, TEvent>;
|
6 | _machine: AnyStateMachine;
|
7 | }
|
8 | export declare class StateNode<TContext extends MachineContext = MachineContext, TEvent extends EventObject = EventObject> {
|
9 |
|
10 | config: StateNodeConfig<TContext, TEvent, TODO,
|
11 | TODO,
|
12 | TODO,
|
13 | TODO,
|
14 | TODO,
|
15 | TODO,
|
16 | TODO,
|
17 | TODO>;
|
18 | |
19 |
|
20 |
|
21 |
|
22 | key: string;
|
23 |
|
24 | id: string;
|
25 | |
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | type: 'atomic' | 'compound' | 'parallel' | 'final' | 'history';
|
35 |
|
36 | path: string[];
|
37 |
|
38 | states: StateNodesConfig<TContext, TEvent>;
|
39 | |
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | history: false | 'shallow' | 'deep';
|
46 |
|
47 | entry: UnknownAction[];
|
48 |
|
49 | exit: UnknownAction[];
|
50 |
|
51 | parent?: StateNode<TContext, TEvent>;
|
52 |
|
53 | machine: StateMachine<TContext, TEvent, any,
|
54 | any,
|
55 | any,
|
56 | any,
|
57 | any,
|
58 | any,
|
59 | any,
|
60 | any,
|
61 | any,
|
62 | any,
|
63 | any,
|
64 | any>;
|
65 | |
66 |
|
67 |
|
68 |
|
69 | meta?: any;
|
70 | |
71 |
|
72 |
|
73 |
|
74 | output?: Mapper<MachineContext, EventObject, unknown, EventObject> | NonReducibleUnknown;
|
75 | |
76 |
|
77 |
|
78 |
|
79 | order: number;
|
80 | description?: string;
|
81 | tags: string[];
|
82 | transitions: Map<string, TransitionDefinition<TContext, TEvent>[]>;
|
83 | always?: Array<TransitionDefinition<TContext, TEvent>>;
|
84 | constructor(
|
85 |
|
86 | config: StateNodeConfig<TContext, TEvent, TODO,
|
87 | TODO,
|
88 | TODO,
|
89 | TODO,
|
90 | TODO,
|
91 | TODO,
|
92 | TODO,
|
93 | TODO>, options: StateNodeOptions<TContext, TEvent>);
|
94 | /** The well-structured state node definition. */
|
95 | get definition(): StateNodeDefinition<TContext, TEvent>;
|
96 | /** The logic invoked as actors by this state node. */
|
97 | get invoke(): Array<InvokeDefinition<TContext, TEvent, ProvidedActor, ParameterizedObject, ParameterizedObject, string, TODO, // TEmitted
|
98 | TODO>>;
|
99 | /** The mapping of events to transitions. */
|
100 | get on(): TransitionDefinitionMap<TContext, TEvent>;
|
101 | get after(): Array<DelayedTransitionDefinition<TContext, TEvent>>;
|
102 | get initial(): InitialTransitionDefinition<TContext, TEvent>;
|
103 | /** All the event types accepted by this state node and its descendants. */
|
104 | get events(): Array<EventDescriptor<TEvent>>;
|
105 | /**
|
106 | * All the events that have transitions directly from this state node.
|
107 | *
|
108 | * Excludes any inert events.
|
109 | */
|
110 | get ownEvents(): Array<EventDescriptor<TEvent>>;
|
111 | }
|
112 | export {};
|