xstate 5.0.0-alpha.1 → 5.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +3 -2
  2. package/actions/dist/xstate-actions.cjs.dev.js +3 -2
  3. package/actions/dist/xstate-actions.cjs.prod.js +2 -1
  4. package/actions/dist/xstate-actions.esm.js +2 -2
  5. package/actions/dist/xstate-actions.umd.min.js +1 -1
  6. package/actions/dist/xstate-actions.umd.min.js.map +1 -1
  7. package/actions/dynamicAction.ts +11 -3
  8. package/actors/dist/xstate-actors.cjs.d.ts +1 -1
  9. package/actors/dist/xstate-actors.cjs.dev.js +4 -3
  10. package/actors/dist/xstate-actors.cjs.prod.js +3 -2
  11. package/actors/dist/xstate-actors.esm.js +2 -2
  12. package/actors/dist/xstate-actors.umd.min.js +1 -1
  13. package/actors/dist/xstate-actors.umd.min.js.map +1 -1
  14. package/dev/dist/xstate-dev.cjs.dev.js +1 -1
  15. package/dev/dist/xstate-dev.cjs.prod.js +0 -11
  16. package/dev/dist/xstate-dev.esm.js +1 -1
  17. package/dev/dist/xstate-dev.umd.min.js.map +1 -1
  18. package/dist/{actions-7ea9280f.cjs.prod.js → actions-3910d35f.cjs.prod.js} +1127 -1491
  19. package/dist/{actions-b08d0da8.cjs.dev.js → actions-3f0ba11b.cjs.dev.js} +1131 -1501
  20. package/dist/{actions-b673cb13.esm.js → actions-4fe4ada8.esm.js} +1134 -1500
  21. package/dist/declarations/actions/dynamicAction.d.ts +3 -3
  22. package/dist/declarations/src/Machine.d.ts +4 -4
  23. package/dist/declarations/src/SimulatedClock.d.ts +1 -1
  24. package/dist/declarations/src/State.d.ts +6 -6
  25. package/dist/declarations/src/StateMachine.d.ts +12 -22
  26. package/dist/declarations/src/StateNode.d.ts +3 -3
  27. package/dist/declarations/src/actionTypes.d.ts +1 -1
  28. package/dist/declarations/src/actions/assign.d.ts +2 -2
  29. package/dist/declarations/src/actions/cancel.d.ts +3 -3
  30. package/dist/declarations/src/actions/choose.d.ts +3 -3
  31. package/dist/declarations/src/actions/invoke.d.ts +3 -3
  32. package/dist/declarations/src/actions/log.d.ts +3 -3
  33. package/dist/declarations/src/actions/pure.d.ts +5 -2
  34. package/dist/declarations/src/actions/raise.d.ts +2 -3
  35. package/dist/declarations/src/actions/send.d.ts +11 -9
  36. package/dist/declarations/src/actions/stop.d.ts +2 -2
  37. package/dist/declarations/src/actions.d.ts +14 -10
  38. package/dist/declarations/src/actors/callback.d.ts +8 -0
  39. package/dist/declarations/src/actors/index.d.ts +27 -0
  40. package/dist/declarations/src/actors/observable.d.ts +23 -0
  41. package/dist/declarations/src/actors/promise.d.ts +12 -0
  42. package/dist/declarations/src/actors/transition.d.ts +13 -0
  43. package/dist/declarations/src/dev/index.d.ts +2 -2
  44. package/dist/declarations/src/guards.d.ts +2 -2
  45. package/dist/declarations/src/index.d.ts +22 -22
  46. package/dist/declarations/src/interpreter.d.ts +26 -30
  47. package/dist/declarations/src/spawn.d.ts +2 -2
  48. package/dist/declarations/src/stateUtils.d.ts +11 -11
  49. package/dist/declarations/src/system.d.ts +2 -0
  50. package/dist/declarations/src/typegenTypes.d.ts +9 -9
  51. package/dist/declarations/src/types.d.ts +300 -267
  52. package/dist/declarations/src/utils.d.ts +14 -10
  53. package/dist/{index-20b364c4.esm.js → index-50bd0aff.esm.js} +0 -12
  54. package/dist/{index-2a564d03.cjs.dev.js → index-ebaab3c9.cjs.dev.js} +0 -12
  55. package/dist/xstate.cjs.dev.js +142 -217
  56. package/dist/xstate.cjs.prod.js +141 -216
  57. package/dist/xstate.esm.js +140 -216
  58. package/dist/xstate.umd.min.js +1 -1
  59. package/dist/xstate.umd.min.js.map +1 -1
  60. package/guards/dist/xstate-guards.cjs.dev.js +2 -2
  61. package/guards/dist/xstate-guards.cjs.prod.js +1 -1
  62. package/guards/dist/xstate-guards.esm.js +2 -2
  63. package/guards/dist/xstate-guards.umd.min.js +1 -1
  64. package/guards/dist/xstate-guards.umd.min.js.map +1 -1
  65. package/package.json +8 -9
  66. package/dist/declarations/src/actors.d.ts +0 -37
  67. package/dist/declarations/src/registry.d.ts +0 -8
@@ -1,5 +1,5 @@
1
1
  import type { BaseActionObject, BaseDynamicActionObject, BuiltInActionObject, EventObject, MachineContext } from '../src/types';
2
- export declare function createDynamicAction<TContext extends MachineContext, TEvent extends EventObject, TAction extends BaseActionObject, TDynamicParams extends Record<string, any>>(action: BuiltInActionObject & {
2
+ export declare function createDynamicAction<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject, TAction extends BaseActionObject, TDynamicParams extends Record<string, any>>(action: BuiltInActionObject & {
3
3
  params: TDynamicParams;
4
- }, resolve: BaseDynamicActionObject<TContext, TEvent, TAction, TDynamicParams>['resolve']): BaseDynamicActionObject<TContext, TEvent, TAction, TDynamicParams>;
5
- export declare function isDynamicAction(action: any): action is BaseDynamicActionObject<any, any, any, any>;
4
+ }, resolve: BaseDynamicActionObject<TContext, TExpressionEvent, TEvent, TAction, TDynamicParams>['resolve']): BaseDynamicActionObject<TContext, TExpressionEvent, TEvent, TAction, TDynamicParams>;
5
+ export declare function isDynamicAction(action: any): action is BaseDynamicActionObject<any, any, any, any, any>;
@@ -1,4 +1,4 @@
1
- import { MachineConfig, EventObject, AnyEventObject, MachineContext, ActorMap, InternalMachineImplementations, BaseActionObject } from './types';
2
- import { TypegenConstraint, TypegenDisabled, ResolveTypegenMeta } from './typegenTypes';
3
- import { StateMachine } from './StateMachine';
4
- export declare function createMachine<TContext extends MachineContext, TEvent extends EventObject = AnyEventObject, TActorMap extends ActorMap = ActorMap, TTypesMeta extends TypegenConstraint = TypegenDisabled>(config: MachineConfig<TContext, TEvent, BaseActionObject, TActorMap, TTypesMeta>, implementations?: InternalMachineImplementations<TContext, TEvent, ResolveTypegenMeta<TTypesMeta, TEvent, BaseActionObject, TActorMap>>): StateMachine<TContext, TEvent, BaseActionObject, TActorMap, ResolveTypegenMeta<TTypesMeta, TEvent, BaseActionObject, TActorMap>>;
1
+ import { MachineConfig, EventObject, AnyEventObject, MachineContext, ActorMap, InternalMachineImplementations, ParameterizedObject } from './types.js';
2
+ import { TypegenConstraint, TypegenDisabled, ResolveTypegenMeta } from './typegenTypes.js';
3
+ import { StateMachine } from './StateMachine.js';
4
+ export declare function createMachine<TContext extends MachineContext, TEvent extends EventObject = AnyEventObject, TActorMap extends ActorMap = ActorMap, TTypesMeta extends TypegenConstraint = TypegenDisabled>(config: MachineConfig<TContext, TEvent, ParameterizedObject, TActorMap, TTypesMeta>, implementations?: InternalMachineImplementations<TContext, TEvent, ResolveTypegenMeta<TTypesMeta, TEvent, ParameterizedObject, TActorMap>>): StateMachine<TContext, TEvent, ParameterizedObject, TActorMap, ResolveTypegenMeta<TTypesMeta, TEvent, ParameterizedObject, TActorMap>>;
@@ -1,4 +1,4 @@
1
- import { Clock } from './interpreter';
1
+ import { Clock } from './interpreter.js';
2
2
  export interface SimulatedClock extends Clock {
3
3
  start(speed: number): void;
4
4
  increment(ms: number): void;
@@ -1,6 +1,6 @@
1
- import type { StateNode } from './StateNode';
2
- import { TypegenDisabled, TypegenEnabled } from './typegenTypes';
3
- import type { ActorRef, AnyState, AnyStateMachine, BaseActionObject, EventObject, HistoryValue, MachineContext, Prop, SCXML, StateConfig, StateValue, TransitionDefinition } from './types';
1
+ import type { StateNode } from './StateNode.js';
2
+ import { TypegenDisabled, TypegenEnabled } from './typegenTypes.js';
3
+ import type { ActorRef, AnyState, AnyStateMachine, BaseActionObject, EventObject, HistoryValue, MachineContext, PersistedMachineState, Prop, SCXML, StateConfig, StateValue, TransitionDefinition } from './types.js';
4
4
  export declare function isStateConfig<TContext extends MachineContext, TEvent extends EventObject>(state: any): state is StateConfig<TContext, TEvent>;
5
5
  /**
6
6
  * @deprecated Use `isStateConfig(object)` or `state instanceof State` instead.
@@ -8,6 +8,7 @@ export declare function isStateConfig<TContext extends MachineContext, TEvent ex
8
8
  export declare const isState: typeof isStateConfig;
9
9
  export declare class State<TContext extends MachineContext, TEvent extends EventObject = EventObject, TResolvedTypesMeta = TypegenDisabled> {
10
10
  machine: AnyStateMachine;
11
+ tags: Set<string>;
11
12
  value: StateValue;
12
13
  /**
13
14
  * Indicates whether the state is a final state.
@@ -23,7 +24,6 @@ export declare class State<TContext extends MachineContext, TEvent extends Event
23
24
  event: TEvent;
24
25
  _internalQueue: Array<SCXML.Event<TEvent>>;
25
26
  _event: SCXML.Event<TEvent>;
26
- _sessionid: string | undefined;
27
27
  _initial: boolean;
28
28
  /**
29
29
  * Indicates whether the state has changed from the previous state. A state is considered "changed" if:
@@ -64,7 +64,7 @@ export declare class State<TContext extends MachineContext, TEvent extends Event
64
64
  * @param delimiter The character(s) that separate each subpath in the string state node path.
65
65
  */
66
66
  toStrings(stateValue?: StateValue, delimiter?: string): string[];
67
- toJSON(): Omit<this, "nextEvents" | "meta" | "toJSON" | "configuration" | "transitions" | "tags" | "machine" | "toStrings" | "matches" | "hasTag" | "can"> & {
67
+ toJSON(): Omit<this, "meta" | "toJSON" | "configuration" | "transitions" | "tags" | "machine" | "toStrings" | "matches" | "hasTag" | "can" | "nextEvents"> & {
68
68
  tags: string[];
69
69
  meta: Record<string, any>;
70
70
  };
@@ -92,6 +92,6 @@ export declare class State<TContext extends MachineContext, TEvent extends Event
92
92
  */
93
93
  get nextEvents(): Array<TEvent['type']>;
94
94
  get meta(): Record<string, any>;
95
- get tags(): Set<string>;
96
95
  }
97
96
  export declare function cloneState<TState extends AnyState>(state: TState, config?: Partial<StateConfig<any, any>>): TState;
97
+ export declare function getPersistedState<TState extends AnyState>(state: TState): PersistedMachineState<TState>;
@@ -1,17 +1,16 @@
1
- import { State } from './State';
2
- import { StateNode } from './StateNode';
3
- import type { AreAllImplementationsAssumedToBeProvided, MarkAllImplementationsAsProvided, ResolveTypegenMeta, TypegenDisabled } from './typegenTypes';
4
- import type { ActorContext, ActorMap, BaseActionObject, Behavior, EventObject, InternalMachineImplementations, MachineConfig, MachineContext, MachineImplementationsSimplified, MachineSchema, MaybeLazy, NoInfer, SCXML, StateConfig, StateMachineDefinition, StateValue, TransitionDefinition } from './types';
1
+ import { State } from './State.js';
2
+ import { StateNode } from './StateNode.js';
3
+ import type { AreAllImplementationsAssumedToBeProvided, MarkAllImplementationsAsProvided, ResolveTypegenMeta, TypegenDisabled } from './typegenTypes.js';
4
+ import type { ActorContext, ActorMap, ActorBehavior, EventObject, InternalMachineImplementations, MachineConfig, MachineContext, MachineImplementationsSimplified, MachineSchema, NoInfer, SCXML, StateConfig, StateMachineDefinition, StateValue, TransitionDefinition, AnyActorContext, PersistedMachineState, ParameterizedObject } from './types.js';
5
5
  export declare const NULL_EVENT = "";
6
6
  export declare const STATE_IDENTIFIER = "#";
7
7
  export declare const WILDCARD = "*";
8
- export declare class StateMachine<TContext extends MachineContext, TEvent extends EventObject = EventObject, TAction extends BaseActionObject = BaseActionObject, TActorMap extends ActorMap = ActorMap, TResolvedTypesMeta = ResolveTypegenMeta<TypegenDisabled, NoInfer<TEvent>, TAction, TActorMap>> implements Behavior<TEvent | SCXML.Event<TEvent>, State<TContext, TEvent, TResolvedTypesMeta>, State<TContext, TEvent, TResolvedTypesMeta>> {
8
+ export declare class StateMachine<TContext extends MachineContext, TEvent extends EventObject = EventObject, TAction extends ParameterizedObject = ParameterizedObject, TActorMap extends ActorMap = ActorMap, TResolvedTypesMeta = ResolveTypegenMeta<TypegenDisabled, NoInfer<TEvent>, TAction, TActorMap>> implements ActorBehavior<TEvent | SCXML.Event<TEvent>, State<TContext, TEvent, TResolvedTypesMeta>, State<TContext, TEvent, TResolvedTypesMeta>, PersistedMachineState<State<TContext, TEvent, TResolvedTypesMeta>>> {
9
9
  /**
10
10
  * The raw config used to create the machine.
11
11
  */
12
12
  config: MachineConfig<TContext, TEvent, any, any, any>;
13
- private _contextFactory;
14
- get context(): TContext;
13
+ getContext(input?: any): TContext;
15
14
  private getContextAndActions;
16
15
  /**
17
16
  * The machine's own version.
@@ -43,17 +42,7 @@ export declare class StateMachine<TContext extends MachineContext, TEvent extend
43
42
  *
44
43
  * @returns A new `StateMachine` instance with the provided implementations.
45
44
  */
46
- provide(implementations: InternalMachineImplementations<TContext, TEvent, TResolvedTypesMeta, true> & {
47
- context?: MaybeLazy<Partial<TContext>>;
48
- }): StateMachine<TContext, TEvent, TAction, TActorMap, AreAllImplementationsAssumedToBeProvided<TResolvedTypesMeta> extends false ? MarkAllImplementationsAsProvided<TResolvedTypesMeta> : TResolvedTypesMeta>;
49
- /**
50
- * Clones this state machine with custom `context`.
51
- *
52
- * The `context` provided can be partial `context`, which will be combined with the original `context`.
53
- *
54
- * @param context Custom context (will override predefined context, not recursive)
55
- */
56
- withContext(context: Partial<TContext>): this;
45
+ provide(implementations: InternalMachineImplementations<TContext, TEvent, TResolvedTypesMeta, true>): StateMachine<TContext, TEvent, TAction, TActorMap, AreAllImplementationsAssumedToBeProvided<TResolvedTypesMeta> extends false ? MarkAllImplementationsAsProvided<TResolvedTypesMeta> : TResolvedTypesMeta>;
57
46
  /**
58
47
  * Resolves the given `state` to a new `State` instance relative to this machine.
59
48
  *
@@ -78,7 +67,7 @@ export declare class StateMachine<TContext extends MachineContext, TEvent extend
78
67
  * @param state The current state
79
68
  * @param event The received event
80
69
  */
81
- microstep(state: State<TContext, TEvent, TResolvedTypesMeta> | undefined, event: TEvent | SCXML.Event<TEvent>, actorCtx?: ActorContext<any, any> | undefined): Array<State<TContext, TEvent, TResolvedTypesMeta>>;
70
+ microstep(state: State<TContext, TEvent, TResolvedTypesMeta> | undefined, event: TEvent | SCXML.Event<TEvent>, actorCtx?: AnyActorContext | undefined): Array<State<TContext, TEvent, TResolvedTypesMeta>>;
82
71
  getTransitionData(state: State<TContext, TEvent, TResolvedTypesMeta>, _event: SCXML.Event<TEvent>): Array<TransitionDefinition<TContext, TEvent>>;
83
72
  /**
84
73
  * The initial state _before_ evaluating any microsteps.
@@ -93,11 +82,12 @@ export declare class StateMachine<TContext extends MachineContext, TEvent extend
93
82
  /**
94
83
  * Returns the initial `State` instance, with reference to `self` as an `ActorRef`.
95
84
  */
96
- getInitialState(actorCtx?: ActorContext<TEvent, State<TContext, TEvent, TResolvedTypesMeta>>): State<TContext, TEvent, TResolvedTypesMeta>;
97
- start(state: State<TContext, TEvent, TResolvedTypesMeta>, actorCtx: ActorContext<TEvent, State<TContext, TEvent, TResolvedTypesMeta>>): State<TContext, TEvent, TResolvedTypesMeta>;
85
+ getInitialState(actorCtx?: ActorContext<TEvent, State<TContext, TEvent, TResolvedTypesMeta>>, input?: any): State<TContext, TEvent, TResolvedTypesMeta>;
86
+ start(state: State<TContext, TEvent, TResolvedTypesMeta>, actorCtx: ActorContext<TEvent, State<TContext, TEvent, TResolvedTypesMeta>>): void;
98
87
  getStateNodeById(stateId: string): StateNode<TContext, TEvent>;
99
88
  get definition(): StateMachineDefinition<TContext, TEvent>;
100
89
  toJSON(): StateMachineDefinition<TContext, TEvent>;
90
+ getPersistedState(state: State<TContext, TEvent, TResolvedTypesMeta>): PersistedMachineState<State<TContext, TEvent, TResolvedTypesMeta>>;
101
91
  createState(stateConfig: State<TContext, TEvent, TResolvedTypesMeta> | StateConfig<TContext, TEvent>): State<TContext, TEvent, TResolvedTypesMeta>;
102
92
  getStatus(state: State<TContext, TEvent, TResolvedTypesMeta>): {
103
93
  status: string;
@@ -106,7 +96,7 @@ export declare class StateMachine<TContext extends MachineContext, TEvent extend
106
96
  status: string;
107
97
  data?: undefined;
108
98
  };
109
- restoreState(state: State<TContext, TEvent, TResolvedTypesMeta>, _actorCtx?: ActorContext<TEvent, State<TContext, TEvent, TResolvedTypesMeta>>): State<TContext, TEvent, TResolvedTypesMeta>;
99
+ restoreState(state: PersistedMachineState<State<TContext, TEvent, TResolvedTypesMeta>>, _actorCtx: ActorContext<TEvent, State<TContext, TEvent, TResolvedTypesMeta>>): State<TContext, TEvent, TResolvedTypesMeta>;
110
100
  /**@deprecated an internal property acting as a "phantom" type, not meant to be used at runtime */
111
101
  __TContext: TContext;
112
102
  /** @deprecated an internal property acting as a "phantom" type, not meant to be used at runtime */
@@ -1,6 +1,6 @@
1
- import type { EventObject, StateNodeDefinition, TransitionDefinition, DelayedTransitionDefinition, StateNodeConfig, StateNodesConfig, InvokeDefinition, Mapper, PropertyMapper, SCXML, TransitionDefinitionMap, InitialTransitionDefinition, MachineContext, BaseActionObject } from './types';
2
- import type { State } from './State';
3
- import type { StateMachine } from './StateMachine';
1
+ import type { EventObject, StateNodeDefinition, TransitionDefinition, DelayedTransitionDefinition, StateNodeConfig, StateNodesConfig, InvokeDefinition, Mapper, PropertyMapper, SCXML, TransitionDefinitionMap, InitialTransitionDefinition, MachineContext, BaseActionObject } from './types.js';
2
+ import type { State } from './State.js';
3
+ import type { StateMachine } from './StateMachine.js';
4
4
  interface StateNodeOptions<TContext extends MachineContext, TEvent extends EventObject> {
5
5
  _key: string;
6
6
  _parent?: StateNode<TContext, TEvent>;
@@ -1,4 +1,4 @@
1
- import { ActionTypes } from './types';
1
+ import { ActionTypes } from './types.js';
2
2
  export declare const stop = ActionTypes.Stop;
3
3
  export declare const raise = ActionTypes.Raise;
4
4
  export declare const send = ActionTypes.Send;
@@ -1,7 +1,7 @@
1
- import type { EventObject, Assigner, PropertyAssigner, MachineContext, DynamicAssignAction } from '../types';
1
+ import type { EventObject, Assigner, PropertyAssigner, MachineContext, DynamicAssignAction, LowInfer } from '../types.js';
2
2
  /**
3
3
  * Updates the current context of the machine.
4
4
  *
5
5
  * @param assignment An object that represents the partial context to update.
6
6
  */
7
- export declare function assign<TContext extends MachineContext, TEvent extends EventObject = EventObject, TAssignment extends Assigner<TContext, TEvent> | PropertyAssigner<TContext, TEvent> = Assigner<TContext, TEvent> | PropertyAssigner<TContext, TEvent>>(assignment: TAssignment): DynamicAssignAction<TContext, TEvent>;
7
+ export declare function assign<TContext extends MachineContext, TExpressionEvent extends EventObject = EventObject, TEvent extends EventObject = TExpressionEvent>(assignment: Assigner<LowInfer<TContext>, TExpressionEvent, TEvent> | PropertyAssigner<LowInfer<TContext>, TExpressionEvent, TEvent>): DynamicAssignAction<TContext, TExpressionEvent, TEvent>;
@@ -1,5 +1,5 @@
1
- import { EventObject, ExprWithMeta, MachineContext } from '../types';
2
- import { BaseDynamicActionObject, CancelActionObject, DynamicCancelActionObject } from '..';
1
+ import { EventObject, ExprWithMeta, MachineContext } from '../types.js';
2
+ import { BaseDynamicActionObject, CancelActionObject, DynamicCancelActionObject } from '../index.js';
3
3
  /**
4
4
  * Cancels an in-flight `send(...)` action. A canceled sent action will not
5
5
  * be executed, nor will its event be sent, unless it has already been sent
@@ -7,4 +7,4 @@ import { BaseDynamicActionObject, CancelActionObject, DynamicCancelActionObject
7
7
  *
8
8
  * @param sendId The `id` of the `send(...)` action to cancel.
9
9
  */
10
- export declare function cancel<TContext extends MachineContext, TEvent extends EventObject>(sendId: string | ExprWithMeta<TContext, TEvent, string>): BaseDynamicActionObject<TContext, TEvent, CancelActionObject, DynamicCancelActionObject<TContext, TEvent>['params']>;
10
+ export declare function cancel<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject>(sendId: string | ExprWithMeta<TContext, TExpressionEvent, string>): BaseDynamicActionObject<TContext, TExpressionEvent, TEvent, CancelActionObject, DynamicCancelActionObject<TContext, TExpressionEvent>['params']>;
@@ -1,3 +1,3 @@
1
- import { EventObject, ChooseCondition, MachineContext } from '../types';
2
- import { BaseDynamicActionObject, ChooseAction, ResolvedChooseAction } from '..';
3
- export declare function choose<TContext extends MachineContext, TEvent extends EventObject>(guards: Array<ChooseCondition<TContext, TEvent>>): BaseDynamicActionObject<TContext, TEvent, ResolvedChooseAction, ChooseAction<TContext, TEvent>['params']>;
1
+ import { EventObject, ChooseCondition, MachineContext } from '../types.js';
2
+ import { BaseDynamicActionObject, ChooseAction, ResolvedChooseAction } from '../index.js';
3
+ export declare function choose<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject>(guards: Array<ChooseCondition<TContext, TExpressionEvent>>): BaseDynamicActionObject<TContext, TExpressionEvent, TEvent, ResolvedChooseAction, ChooseAction<TContext, TExpressionEvent>['params']>;
@@ -1,3 +1,3 @@
1
- import { EventObject, InvokeDefinition, MachineContext } from '../types';
2
- import { BaseDynamicActionObject, DynamicInvokeActionObject, InvokeActionObject } from '..';
3
- export declare function invoke<TContext extends MachineContext, TEvent extends EventObject>(invokeDef: InvokeDefinition<TContext, TEvent>): BaseDynamicActionObject<TContext, TEvent, InvokeActionObject, DynamicInvokeActionObject<TContext, TEvent>['params']>;
1
+ import { EventObject, InvokeDefinition, MachineContext } from '../types.js';
2
+ import { BaseDynamicActionObject, DynamicInvokeActionObject, InvokeActionObject } from '../index.js';
3
+ export declare function invoke<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject>(invokeDef: InvokeDefinition<TContext, TEvent>): BaseDynamicActionObject<TContext, TExpressionEvent, TEvent, InvokeActionObject, DynamicInvokeActionObject<TContext, TEvent>['params']>;
@@ -1,5 +1,5 @@
1
- import { EventObject, LogExpr, MachineContext, LogActionObject } from '../types';
2
- import { BaseDynamicActionObject, DynamicLogAction } from '..';
1
+ import { EventObject, LogExpr, MachineContext, LogActionObject } from '../types.js';
2
+ import { BaseDynamicActionObject, DynamicLogAction } from '../index.js';
3
3
  /**
4
4
  *
5
5
  * @param expr The expression function to evaluate which will be logged.
@@ -8,4 +8,4 @@ import { BaseDynamicActionObject, DynamicLogAction } from '..';
8
8
  * - `event` - the event that caused this action to be executed.
9
9
  * @param label The label to give to the logged expression.
10
10
  */
11
- export declare function log<TContext extends MachineContext, TEvent extends EventObject>(expr?: string | LogExpr<TContext, TEvent>, label?: string): BaseDynamicActionObject<TContext, TEvent, LogActionObject, DynamicLogAction<TContext, TEvent>['params']>;
11
+ export declare function log<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject = TExpressionEvent>(expr?: string | LogExpr<TContext, TExpressionEvent>, label?: string): BaseDynamicActionObject<TContext, TExpressionEvent, TEvent, LogActionObject, DynamicLogAction<TContext, TExpressionEvent, TEvent>['params']>;
@@ -1,3 +1,6 @@
1
- import { EventObject, SingleOrArray, MachineContext } from '../types';
1
+ import { EventObject, SingleOrArray, MachineContext } from '../types.js';
2
2
  import { BaseActionObject, BaseDynamicActionObject, DynamicPureActionObject, PureActionObject } from '..';
3
- export declare function pure<TContext extends MachineContext, TEvent extends EventObject>(getActions: (context: TContext, event: TEvent) => SingleOrArray<BaseActionObject> | undefined): BaseDynamicActionObject<TContext, TEvent, PureActionObject, DynamicPureActionObject<TContext, TEvent>['params']>;
3
+ export declare function pure<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject = TExpressionEvent>(getActions: ({ context, event }: {
4
+ context: TContext;
5
+ event: TExpressionEvent;
6
+ }) => SingleOrArray<BaseActionObject | string> | undefined): BaseDynamicActionObject<TContext, TExpressionEvent, TEvent, PureActionObject, DynamicPureActionObject<TContext, TExpressionEvent>['params']>;
@@ -1,9 +1,8 @@
1
- import { EventObject, RaiseActionObject } from '../types';
2
- import { BaseDynamicActionObject } from '..';
1
+ import { EventObject, MachineContext, RaiseActionObject, BaseDynamicActionObject, RaiseActionOptions, SendExpr, RaiseActionParams, NoInfer } from '../types.js';
3
2
  /**
4
3
  * Raises an event. This places the event in the internal event queue, so that
5
4
  * the event is immediately consumed by the machine in the current step.
6
5
  *
7
6
  * @param eventType The event to raise.
8
7
  */
9
- export declare function raise<TEvent extends EventObject>(event: TEvent): BaseDynamicActionObject<any, TEvent, RaiseActionObject<TEvent>, RaiseActionObject<TEvent>['params']>;
8
+ export declare function raise<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject = TExpressionEvent>(eventOrExpr: NoInfer<TEvent> | SendExpr<TContext, TExpressionEvent, NoInfer<TEvent>>, options?: RaiseActionOptions<TContext, TExpressionEvent>): BaseDynamicActionObject<TContext, TExpressionEvent, TEvent, RaiseActionObject<TContext, TExpressionEvent, TEvent>, RaiseActionParams<TContext, TExpressionEvent, TEvent>>;
@@ -1,37 +1,39 @@
1
- import { EventObject, SendActionParams, SendExpr, AnyEventObject, MachineContext } from '../types';
2
- import { AnyActorRef, BaseDynamicActionObject, Cast, EventFrom, ExprWithMeta, InferEvent, SendActionObject, SendActionOptions } from '..';
1
+ import { EventObject, SendActionParams, SendExpr, AnyEventObject, MachineContext } from '../types.js';
2
+ import { AnyActorRef, BaseDynamicActionObject, Cast, EventFrom, ExprWithMeta, InferEvent, SendActionObject, SendActionOptions } from '../index.js';
3
3
  /**
4
4
  * Sends an event. This returns an action that will be read by an interpreter to
5
5
  * send the event in the next step, after the current step is finished executing.
6
6
  *
7
- * @param event The event to send.
7
+ * @deprecated Use the `sendTo(...)` action creator instead.
8
+ *
9
+ * @param eventOrExpr The event to send.
8
10
  * @param options Options to pass into the send event:
9
11
  * - `id` - The unique send event identifier (used with `cancel()`).
10
12
  * - `delay` - The number of milliseconds to delay the sending of the event.
11
13
  * - `to` - The target of this event (by default, the machine the event was sent from).
12
14
  */
13
- export declare function send<TContext extends MachineContext, TEvent extends EventObject, TSentEvent extends EventObject = AnyEventObject>(event: TSentEvent | SendExpr<TContext, TEvent, TSentEvent>, options?: SendActionOptions<TContext, TEvent>): BaseDynamicActionObject<TContext, TEvent, SendActionObject<AnyEventObject>, SendActionParams<TContext, TEvent>>;
15
+ export declare function send<TContext extends MachineContext, TEvent extends EventObject, TSentEvent extends EventObject = AnyEventObject>(eventOrExpr: TSentEvent | SendExpr<TContext, TEvent, AnyEventObject>, options?: SendActionOptions<TContext, TEvent>): BaseDynamicActionObject<TContext, TEvent, TEvent, SendActionObject<AnyEventObject>, SendActionParams<TContext, TEvent>>;
14
16
  /**
15
17
  * Sends an event to this machine's parent.
16
18
  *
17
19
  * @param event The event to send to the parent machine.
18
20
  * @param options Options to pass into the send event.
19
21
  */
20
- export declare function sendParent<TContext extends MachineContext, TEvent extends EventObject, TSentEvent extends EventObject = AnyEventObject>(event: TSentEvent | SendExpr<TContext, TEvent, TSentEvent>, options?: SendActionOptions<TContext, TEvent>): BaseDynamicActionObject<TContext, TEvent, SendActionObject<AnyEventObject>, SendActionParams<TContext, TEvent, EventObject>>;
22
+ export declare function sendParent<TContext extends MachineContext, TEvent extends EventObject, TSentEvent extends EventObject = AnyEventObject>(event: TSentEvent | SendExpr<TContext, TEvent, TSentEvent>, options?: SendActionOptions<TContext, TEvent>): BaseDynamicActionObject<TContext, TEvent, TEvent, SendActionObject<AnyEventObject>, SendActionParams<TContext, TEvent, EventObject>>;
21
23
  /**
22
24
  * Sends an event back to the sender of the original event.
23
25
  *
24
26
  * @param event The event to send back to the sender
25
27
  * @param options Options to pass into the send event
26
28
  */
27
- export declare function respond<TContext extends MachineContext, TEvent extends EventObject, TSentEvent extends EventObject = AnyEventObject>(event: TEvent | SendExpr<TContext, TEvent, TSentEvent>, options?: SendActionOptions<TContext, TEvent>): BaseDynamicActionObject<TContext, TEvent, SendActionObject<AnyEventObject>, SendActionParams<TContext, TEvent, EventObject>>;
29
+ export declare function respond<TContext extends MachineContext, TEvent extends EventObject, TSentEvent extends EventObject = AnyEventObject>(event: TEvent | SendExpr<TContext, TEvent, TSentEvent>, options?: SendActionOptions<TContext, TEvent>): BaseDynamicActionObject<TContext, TEvent, TEvent, SendActionObject<AnyEventObject>, SendActionParams<TContext, TEvent, EventObject>>;
28
30
  /**
29
31
  * Forwards (sends) an event to a specified service.
30
32
  *
31
33
  * @param target The target service to forward the event to.
32
34
  * @param options Options to pass into the send action creator.
33
35
  */
34
- export declare function forwardTo<TContext extends MachineContext, TEvent extends EventObject>(target: Required<SendActionParams<TContext, TEvent>>['to'], options?: SendActionOptions<TContext, TEvent>): BaseDynamicActionObject<TContext, TEvent, SendActionObject<AnyEventObject>, SendActionParams<TContext, TEvent, EventObject>>;
36
+ export declare function forwardTo<TContext extends MachineContext, TEvent extends EventObject>(target: Required<SendActionParams<TContext, TEvent>>['to'], options?: SendActionOptions<TContext, TEvent>): BaseDynamicActionObject<TContext, TEvent, TEvent, SendActionObject<AnyEventObject>, SendActionParams<TContext, TEvent, EventObject>>;
35
37
  /**
36
38
  * Escalates an error by sending it as an event to this machine's parent.
37
39
  *
@@ -39,7 +41,7 @@ export declare function forwardTo<TContext extends MachineContext, TEvent extend
39
41
  * takes in the `context`, `event`, and `meta`, and returns the error data to send.
40
42
  * @param options Options to pass into the send action creator.
41
43
  */
42
- export declare function escalate<TContext extends MachineContext, TEvent extends EventObject, TErrorData = any>(errorData: TErrorData | ExprWithMeta<TContext, TEvent, TErrorData>, options?: SendActionParams<TContext, TEvent>): BaseDynamicActionObject<TContext, TEvent, SendActionObject<AnyEventObject>, SendActionParams<TContext, TEvent, EventObject>>;
44
+ export declare function escalate<TContext extends MachineContext, TEvent extends EventObject, TErrorData = any>(errorData: TErrorData | ExprWithMeta<TContext, TEvent, TErrorData>, options?: SendActionParams<TContext, TEvent>): BaseDynamicActionObject<TContext, TEvent, TEvent, SendActionObject<AnyEventObject>, SendActionParams<TContext, TEvent, EventObject>>;
43
45
  /**
44
46
  * Sends an event to an actor.
45
47
  *
@@ -48,4 +50,4 @@ export declare function escalate<TContext extends MachineContext, TEvent extends
48
50
  * @param options Send action options
49
51
  * @returns An XState send action object
50
52
  */
51
- export declare function sendTo<TContext extends MachineContext, TEvent extends EventObject, TActor extends AnyActorRef>(actor: (ctx: TContext) => TActor, event: EventFrom<TActor> | SendExpr<TContext, TEvent, InferEvent<Cast<EventFrom<TActor>, EventObject>>>, options?: SendActionOptions<TContext, TEvent>): BaseDynamicActionObject<TContext, TEvent, SendActionObject<AnyEventObject>, SendActionParams<TContext, TEvent, EventObject>>;
53
+ export declare function sendTo<TContext extends MachineContext, TEvent extends EventObject, TActor extends AnyActorRef>(actor: TActor | string | ExprWithMeta<TContext, TEvent, TActor | string>, event: EventFrom<TActor> | SendExpr<TContext, TEvent, InferEvent<Cast<EventFrom<TActor>, EventObject>>>, options?: SendActionOptions<TContext, TEvent>): BaseDynamicActionObject<TContext, TEvent, TEvent, SendActionObject<AnyEventObject>, SendActionParams<TContext, TEvent, EventObject>>;
@@ -1,7 +1,7 @@
1
- import { ActorRef, BaseDynamicActionObject, DynamicStopActionObject, EventObject, Expr, MachineContext, StopActionObject } from '../types';
1
+ import { ActorRef, BaseDynamicActionObject, DynamicStopActionObject, EventObject, Expr, MachineContext, StopActionObject } from '../types.js';
2
2
  /**
3
3
  * Stops an actor.
4
4
  *
5
5
  * @param actorRef The actor to stop.
6
6
  */
7
- export declare function stop<TContext extends MachineContext, TEvent extends EventObject>(actorRef: string | ActorRef<any> | Expr<TContext, TEvent, ActorRef<any> | string>): BaseDynamicActionObject<TContext, TEvent, StopActionObject, DynamicStopActionObject<TContext, TEvent>['params']>;
7
+ export declare function stop<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject>(actorRef: string | ActorRef<any> | Expr<TContext, TExpressionEvent, ActorRef<any> | string>): BaseDynamicActionObject<TContext, TExpressionEvent, TEvent, StopActionObject, DynamicStopActionObject<TContext, TExpressionEvent>['params']>;
@@ -1,19 +1,19 @@
1
- import { Action, EventObject, SingleOrArray, ActionFunction, ActionFunctionMap, ActionTypes, DoneEvent, ErrorPlatformEvent, DoneEventObject, MachineContext, BaseActionObject, SCXML } from './types';
2
- import * as actionTypes from './actionTypes';
3
- export { send, sendTo, sendParent, respond, forwardTo, escalate } from './actions/send';
4
- export { stop } from './actions/stop';
5
- export { log } from './actions/log';
6
- export { cancel } from './actions/cancel';
7
- export { assign } from './actions/assign';
8
- export { raise } from './actions/raise';
9
- export { choose } from './actions/choose';
1
+ import { Action, EventObject, SingleOrArray, ActionFunction, ActionFunctionMap, ActionTypes, DoneEvent, ErrorPlatformEvent, DoneEventObject, MachineContext, BaseActionObject, SCXML } from './types.js';
2
+ import * as actionTypes from './actionTypes.js';
3
+ export { send, sendTo, sendParent, respond, forwardTo, escalate } from './actions/send.js';
4
+ export { stop } from './actions/stop.js';
5
+ export { log } from './actions/log.js';
6
+ export { cancel } from './actions/cancel.js';
7
+ export { assign } from './actions/assign.js';
8
+ export { raise } from './actions/raise.js';
9
+ export { choose } from './actions/choose.js';
10
10
  export { actionTypes };
11
11
  export declare const initEvent: SCXML.Event<{
12
12
  type: ActionTypes;
13
13
  }>;
14
14
  export declare function resolveActionObject(actionObject: BaseActionObject, actionFunctionMap: ActionFunctionMap<any, any>): BaseActionObject;
15
15
  export declare function toActionObject<TContext extends MachineContext, TEvent extends EventObject>(action: BaseActionObject | ActionFunction<TContext, TEvent> | string): BaseActionObject;
16
- export declare const toActionObjects: <TContext extends MachineContext, TEvent extends EventObject>(action?: SingleOrArray<Action<TContext, TEvent>> | undefined) => BaseActionObject[];
16
+ export declare const toActionObjects: <TContext extends MachineContext, TEvent extends EventObject>(action?: SingleOrArray<Action<TContext, TEvent, TEvent>> | undefined) => BaseActionObject[];
17
17
  /**
18
18
  * Returns an event type that represents an implicit event that
19
19
  * is sent after the specified `delay`.
@@ -41,3 +41,7 @@ export declare function done(id: string, data?: any): DoneEventObject;
41
41
  */
42
42
  export declare function doneInvoke(invokeId: string, data?: any): DoneEvent;
43
43
  export declare function error(id: string, data?: any): ErrorPlatformEvent & string;
44
+ export declare function createInitEvent(input: any): SCXML.Event<{
45
+ type: ActionTypes.Init;
46
+ input: any;
47
+ }>;
@@ -0,0 +1,8 @@
1
+ import { InvokeCallback, ActorBehavior, EventObject } from '../types';
2
+ export interface CallbackInternalState {
3
+ canceled: boolean;
4
+ receivers: Set<(e: EventObject) => void>;
5
+ dispose: void | (() => void) | Promise<any>;
6
+ input?: any;
7
+ }
8
+ export declare function fromCallback<TEvent extends EventObject>(invokeCallback: InvokeCallback): ActorBehavior<TEvent, undefined>;
@@ -0,0 +1,27 @@
1
+ import type { EventObject, ActorRef, BaseActorRef } from '../types.js';
2
+ export { fromTransition } from './transition.js';
3
+ export { fromPromise } from './promise.js';
4
+ export { fromObservable, fromEventObservable } from './observable.js';
5
+ export { fromCallback } from './callback.js';
6
+ export declare const startSignalType = "xstate.init";
7
+ export declare const stopSignalType = "xstate.stop";
8
+ export declare const startSignal: StartSignal;
9
+ export declare const stopSignal: StopSignal;
10
+ export interface StartSignal {
11
+ type: 'xstate.init';
12
+ }
13
+ export interface StopSignal {
14
+ type: 'xstate.stop';
15
+ }
16
+ export type LifecycleSignal = StartSignal | StopSignal;
17
+ export type LifecycleSignalType = typeof startSignalType | typeof stopSignalType;
18
+ /**
19
+ * An object that expresses the behavior of an actor in reaction to received events,
20
+ * as well as an optionally emitted stream of values.
21
+ *
22
+ * @template TReceived The received event
23
+ * @template TSnapshot The emitted value
24
+ */
25
+ export declare function isSignal(eventType: string): eventType is LifecycleSignalType;
26
+ export declare function isActorRef(item: any): item is ActorRef<any>;
27
+ export declare function toActorRef<TEvent extends EventObject, TSnapshot = any, TActorRefLike extends BaseActorRef<TEvent> = BaseActorRef<TEvent>>(actorRefLike: TActorRefLike): ActorRef<TEvent, TSnapshot> & Omit<TActorRefLike, keyof ActorRef<any, any>>;
@@ -0,0 +1,23 @@
1
+ import { Subscribable, ActorBehavior, EventObject, Subscription } from '../types';
2
+ export interface ObservableInternalState<T> {
3
+ subscription: Subscription | undefined;
4
+ canceled: boolean;
5
+ status: 'active' | 'done' | 'error';
6
+ data: T | undefined;
7
+ input?: any;
8
+ }
9
+ export type ObservablePersistedState<T> = Omit<ObservableInternalState<T>, 'subscription'>;
10
+ export declare function fromObservable<T, TEvent extends EventObject>(observableCreator: ({ input }: {
11
+ input: any;
12
+ }) => Subscribable<T>): ActorBehavior<TEvent, T | undefined, ObservableInternalState<T>, ObservablePersistedState<T>>;
13
+ /**
14
+ * Creates an event observable behavior that listens to an observable
15
+ * that delivers event objects.
16
+ *
17
+ *
18
+ * @param lazyObservable A function that creates an observable
19
+ * @returns An event observable behavior
20
+ */
21
+ export declare function fromEventObservable<T extends EventObject>(lazyObservable: ({ input }: {
22
+ input: any;
23
+ }) => Subscribable<T>): ActorBehavior<EventObject, T | undefined>;
@@ -0,0 +1,12 @@
1
+ import { ActorBehavior } from '../types';
2
+ export interface PromiseInternalState<T> {
3
+ status: 'active' | 'error' | 'done';
4
+ canceled: boolean;
5
+ data: T | undefined;
6
+ input?: any;
7
+ }
8
+ export declare function fromPromise<T>(promiseCreator: ({ input }: {
9
+ input: any;
10
+ }) => PromiseLike<T>): ActorBehavior<{
11
+ type: string;
12
+ }, T | undefined, PromiseInternalState<T>>;
@@ -0,0 +1,13 @@
1
+ import { ActorBehavior, ActorContext, ActorSystem, EventObject } from '../types';
2
+ /**
3
+ * Returns an actor behavior from a transition function and its initial state.
4
+ *
5
+ * A transition function is a function that takes the current state and an event and returns the next state.
6
+ *
7
+ * @param transition The transition function that returns the next state given the current state and event.
8
+ * @param initialState The initial state of the transition function.
9
+ * @returns An actor behavior
10
+ */
11
+ export declare function fromTransition<TState, TEvent extends EventObject, TSystem extends ActorSystem<any>>(transition: (state: TState, event: TEvent, actorContext: ActorContext<TEvent, TState, TSystem>) => TState, initialState: TState | (({ input }: {
12
+ input: any;
13
+ }) => TState)): ActorBehavior<TEvent, TState, TState>;
@@ -1,5 +1,5 @@
1
- import { AnyInterpreter, DevToolsAdapter } from '../types';
2
- declare type ServiceListener = (service: AnyInterpreter) => void;
1
+ import { AnyInterpreter, DevToolsAdapter } from '../types.js';
2
+ type ServiceListener = (service: AnyInterpreter) => void;
3
3
  export interface XStateDevInterface {
4
4
  register: (service: AnyInterpreter) => void;
5
5
  unregister: (service: AnyInterpreter) => void;
@@ -1,5 +1,5 @@
1
- import type { EventObject, StateValue, BooleanGuardDefinition, GuardConfig, GuardDefinition, SCXML, GuardPredicate, MachineContext } from './types';
2
- import type { State } from './State';
1
+ import type { EventObject, StateValue, BooleanGuardDefinition, GuardConfig, GuardDefinition, SCXML, GuardPredicate, MachineContext } from './types.js';
2
+ import type { State } from './State.js';
3
3
  export declare function stateIn<TContext extends MachineContext, TEvent extends EventObject>(stateValue: StateValue): GuardDefinition<TContext, TEvent>;
4
4
  export declare function not<TContext extends MachineContext, TEvent extends EventObject>(guard: GuardConfig<TContext, TEvent>): BooleanGuardDefinition<TContext, TEvent>;
5
5
  export declare function and<TContext extends MachineContext, TEvent extends EventObject>(guards: Array<GuardConfig<TContext, TEvent>>): BooleanGuardDefinition<TContext, TEvent>;
@@ -1,25 +1,25 @@
1
- import { after, done, doneInvoke, escalate, forwardTo, respond, sendParent, sendTo } from './actions';
2
- import { assign } from './actions/assign';
3
- import { cancel } from './actions/cancel';
4
- import { choose } from './actions/choose';
5
- import { log } from './actions/log';
6
- import { pure } from './actions/pure';
7
- import { raise } from './actions/raise';
8
- import { send } from './actions/send';
9
- import { stop } from './actions/stop';
10
- import { interpret, Interpreter, ActorStatus } from './interpreter';
11
- import { createMachine } from './Machine';
12
- import { mapState } from './mapState';
13
- import { State } from './State';
14
- import { StateNode } from './StateNode';
15
- export { createSchema, t } from './schema';
16
- export { SimulatedClock } from './SimulatedClock';
17
- export { StateMachine } from './StateMachine';
18
- export { getStateNodes } from './stateUtils';
19
- export * from './typegenTypes';
20
- export * from './types';
21
- export { matchesState, pathToStateValue, toObserver, toSCXMLEvent } from './utils';
22
- export { StateNode, State, mapState, actions, assign, send, sendParent, forwardTo, interpret, Interpreter, ActorStatus as InterpreterStatus, doneInvoke, createMachine };
1
+ import { after, done, doneInvoke, escalate, forwardTo, respond, sendParent, sendTo } from './actions.js';
2
+ import { assign } from './actions/assign.js';
3
+ import { cancel } from './actions/cancel.js';
4
+ import { choose } from './actions/choose.js';
5
+ import { log } from './actions/log.js';
6
+ import { pure } from './actions/pure.js';
7
+ import { raise } from './actions/raise.js';
8
+ import { send } from './actions/send.js';
9
+ import { stop } from './actions/stop.js';
10
+ import { interpret, Interpreter, ActorStatus } from './interpreter.js';
11
+ import { createMachine } from './Machine.js';
12
+ import { mapState } from './mapState.js';
13
+ import { State } from './State.js';
14
+ import { StateNode } from './StateNode.js';
15
+ export { createSchema, t } from './schema.js';
16
+ export { SimulatedClock } from './SimulatedClock.js';
17
+ export { StateMachine } from './StateMachine.js';
18
+ export { getStateNodes } from './stateUtils.js';
19
+ export * from './typegenTypes.js';
20
+ export * from './types.js';
21
+ export { matchesState, pathToStateValue, toObserver, toSCXMLEvent } from './utils.js';
22
+ export { StateNode, State, mapState, actions, assign, send, sendTo, sendParent, forwardTo, interpret, Interpreter, ActorStatus as InterpreterStatus, doneInvoke, createMachine };
23
23
  declare const actions: {
24
24
  raise: typeof raise;
25
25
  send: typeof send;