xstate 5.18.2 → 5.19.1

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 (52) hide show
  1. package/actions/dist/xstate-actions.cjs.js +2 -2
  2. package/actions/dist/xstate-actions.development.cjs.js +2 -2
  3. package/actions/dist/xstate-actions.development.esm.js +2 -2
  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/actors/dist/xstate-actors.cjs.js +1 -1
  8. package/actors/dist/xstate-actors.development.cjs.js +1 -1
  9. package/actors/dist/xstate-actors.development.esm.js +1 -1
  10. package/actors/dist/xstate-actors.esm.js +1 -1
  11. package/actors/dist/xstate-actors.umd.min.js +1 -1
  12. package/actors/dist/xstate-actors.umd.min.js.map +1 -1
  13. package/dev/dist/xstate-dev.cjs.js +1 -1
  14. package/dev/dist/xstate-dev.development.cjs.js +1 -1
  15. package/dev/dist/xstate-dev.development.esm.js +1 -1
  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/declarations/src/State.d.ts +1 -1
  19. package/dist/declarations/src/actions/raise.d.ts +9 -1
  20. package/dist/declarations/src/actions/send.d.ts +10 -1
  21. package/dist/declarations/src/createActor.d.ts +2 -1
  22. package/dist/declarations/src/getNextSnapshot.d.ts +2 -0
  23. package/dist/declarations/src/index.d.ts +1 -0
  24. package/dist/declarations/src/inspection.d.ts +1 -1
  25. package/dist/declarations/src/spawn.d.ts +19 -11
  26. package/dist/declarations/src/stateUtils.d.ts +17 -7
  27. package/dist/declarations/src/transition.d.ts +16 -0
  28. package/dist/declarations/src/types.d.ts +48 -14
  29. package/dist/declarations/src/utils.d.ts +1 -1
  30. package/dist/{log-38475d87.development.esm.js → log-0acd9069.development.esm.js} +32 -33
  31. package/dist/{log-15d0f775.esm.js → log-3d9d72a9.esm.js} +31 -29
  32. package/dist/{log-b7ed1b61.development.cjs.js → log-8aa651a0.development.cjs.js} +32 -33
  33. package/dist/{log-98fcce74.cjs.js → log-a019fbd0.cjs.js} +31 -29
  34. package/dist/{raise-5ea71f04.development.esm.js → raise-1db27a82.development.esm.js} +98 -72
  35. package/dist/{raise-e919c5d4.development.cjs.js → raise-4acdb210.development.cjs.js} +98 -72
  36. package/dist/{raise-b1e0b9a9.cjs.js → raise-60cebf03.cjs.js} +94 -70
  37. package/dist/{raise-0f7cf128.esm.js → raise-c17ec2bc.esm.js} +94 -70
  38. package/dist/xstate.cjs.js +57 -15
  39. package/dist/xstate.cjs.mjs +2 -0
  40. package/dist/xstate.development.cjs.js +57 -15
  41. package/dist/xstate.development.cjs.mjs +2 -0
  42. package/dist/xstate.development.esm.js +58 -18
  43. package/dist/xstate.esm.js +58 -18
  44. package/dist/xstate.umd.min.js +1 -1
  45. package/dist/xstate.umd.min.js.map +1 -1
  46. package/guards/dist/xstate-guards.cjs.js +1 -1
  47. package/guards/dist/xstate-guards.development.cjs.js +1 -1
  48. package/guards/dist/xstate-guards.development.esm.js +1 -1
  49. package/guards/dist/xstate-guards.esm.js +1 -1
  50. package/guards/dist/xstate-guards.umd.min.js +1 -1
  51. package/guards/dist/xstate-guards.umd.min.js.map +1 -1
  52. package/package.json +1 -1
@@ -18,7 +18,7 @@ function getGlobal() {
18
18
  }
19
19
  function getDevTools() {
20
20
  const w = getGlobal();
21
- if (!!w.__xstate__) {
21
+ if (w.__xstate__) {
22
22
  return w.__xstate__;
23
23
  }
24
24
  return undefined;
@@ -15,7 +15,7 @@ function getGlobal() {
15
15
  }
16
16
  function getDevTools() {
17
17
  const w = getGlobal();
18
- if (!!w.__xstate__) {
18
+ if (w.__xstate__) {
19
19
  return w.__xstate__;
20
20
  }
21
21
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"xstate-dev.umd.min.js","sources":["../../src/dev/index.ts"],"sourcesContent":["import isDevelopment from '#is-development';\nimport { AnyActor, DevToolsAdapter } from '../types.ts';\n\ninterface DevInterface {\n services: Set<AnyActor>;\n register(service: AnyActor): void;\n onRegister(listener: ServiceListener): void;\n}\ntype ServiceListener = (service: AnyActor) => void;\n\nexport interface XStateDevInterface {\n register: (service: AnyActor) => void;\n unregister: (service: AnyActor) => void;\n onRegister: (listener: ServiceListener) => {\n unsubscribe: () => void;\n };\n services: Set<AnyActor>;\n}\n\n// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis\nexport function getGlobal(): typeof globalThis | undefined {\n if (typeof globalThis !== 'undefined') {\n return globalThis;\n }\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n if (isDevelopment) {\n console.warn(\n 'XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues'\n );\n }\n}\n\nfunction getDevTools(): DevInterface | undefined {\n const w = getGlobal();\n if (!!(w as any).__xstate__) {\n return (w as any).__xstate__;\n }\n\n return undefined;\n}\n\nexport function registerService(service: AnyActor) {\n if (typeof window === 'undefined') {\n return;\n }\n\n const devTools = getDevTools();\n\n if (devTools) {\n devTools.register(service);\n }\n}\n\nexport const devToolsAdapter: DevToolsAdapter = (service) => {\n if (typeof window === 'undefined') {\n return;\n }\n\n const devTools = getDevTools();\n\n if (devTools) {\n devTools.register(service);\n }\n};\n"],"names":["getGlobal","globalThis","self","window","getDevTools","w","__xstate__","service","devTools","register"],"mappings":"iPAoBO,SAASA,IACd,MAA0B,oBAAfC,WACFA,WAEW,oBAATC,KACFA,KAGAC,MAUX,CAEA,SAASC,IACP,MAAMC,EAAIL,IACV,GAAOK,EAAUC,WACf,OAAQD,EAAUC,UAItB,mBAciDC,IAK/C,MAAMC,EAAWJ,IAEbI,GACFA,EAASC,SAASF,EACpB,kCArBK,SAAyBA,GAK9B,MAAMC,EAAWJ,IAEbI,GACFA,EAASC,SAASF,EAEtB"}
1
+ {"version":3,"file":"xstate-dev.umd.min.js","sources":["../../src/dev/index.ts"],"sourcesContent":["import isDevelopment from '#is-development';\nimport { AnyActor, DevToolsAdapter } from '../types.ts';\n\ninterface DevInterface {\n services: Set<AnyActor>;\n register(service: AnyActor): void;\n onRegister(listener: ServiceListener): void;\n}\ntype ServiceListener = (service: AnyActor) => void;\n\nexport interface XStateDevInterface {\n register: (service: AnyActor) => void;\n unregister: (service: AnyActor) => void;\n onRegister: (listener: ServiceListener) => {\n unsubscribe: () => void;\n };\n services: Set<AnyActor>;\n}\n\n// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis\nexport function getGlobal(): typeof globalThis | undefined {\n if (typeof globalThis !== 'undefined') {\n return globalThis;\n }\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n if (isDevelopment) {\n console.warn(\n 'XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues'\n );\n }\n}\n\nfunction getDevTools(): DevInterface | undefined {\n const w = getGlobal();\n if ((w as any).__xstate__) {\n return (w as any).__xstate__;\n }\n\n return undefined;\n}\n\nexport function registerService(service: AnyActor) {\n if (typeof window === 'undefined') {\n return;\n }\n\n const devTools = getDevTools();\n\n if (devTools) {\n devTools.register(service);\n }\n}\n\nexport const devToolsAdapter: DevToolsAdapter = (service) => {\n if (typeof window === 'undefined') {\n return;\n }\n\n const devTools = getDevTools();\n\n if (devTools) {\n devTools.register(service);\n }\n};\n"],"names":["getGlobal","globalThis","self","window","getDevTools","w","__xstate__","service","devTools","register"],"mappings":"iPAoBO,SAASA,IACd,MAA0B,oBAAfC,WACFA,WAEW,oBAATC,KACFA,KAGAC,MAUX,CAEA,SAASC,IACP,MAAMC,EAAIL,IACV,GAAKK,EAAUC,WACb,OAAQD,EAAUC,UAItB,mBAciDC,IAK/C,MAAMC,EAAWJ,IAEbI,GACFA,EAASC,SAASF,EACpB,kCArBK,SAAyBA,GAK9B,MAAMC,EAAWJ,IAEbI,GACFA,EAASC,SAASF,EAEtB"}
@@ -4,7 +4,7 @@ import type { ProvidedActor, AnyMachineSnapshot, AnyStateMachine, EventObject, H
4
4
  type ToTestStateValue<TStateValue extends StateValue> = TStateValue extends string ? TStateValue : IsNever<keyof TStateValue> extends true ? never : keyof TStateValue | {
5
5
  [K in keyof TStateValue]?: ToTestStateValue<NonNullable<TStateValue[K]>>;
6
6
  };
7
- export declare function isMachineSnapshot<TContext extends MachineContext, TEvent extends EventObject>(value: unknown): value is AnyMachineSnapshot;
7
+ export declare function isMachineSnapshot(value: unknown): value is AnyMachineSnapshot;
8
8
  interface MachineSnapshotBase<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TStateValue extends StateValue, TTag extends string, TOutput, TMeta, TStateSchema extends StateSchema = StateSchema> {
9
9
  /** The state machine that produced this state snapshot. */
10
10
  machine: StateMachine<TContext, TEvent, TChildren, ProvidedActor, ParameterizedObject, ParameterizedObject, string, TStateValue, TTag, unknown, TOutput, EventObject, // TEmitted
@@ -1,4 +1,4 @@
1
- import { ActionArgs, ActionFunction, DoNotInfer, EventObject, MachineContext, ParameterizedObject, RaiseActionOptions, SendExpr } from "../types.js";
1
+ import { ActionArgs, ActionFunction, DoNotInfer, EventObject, ExecutableActionObject, MachineContext, ParameterizedObject, RaiseActionOptions, SendExpr } from "../types.js";
2
2
  export interface RaiseAction<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TEvent extends EventObject, TDelay extends string> {
3
3
  (args: ActionArgs<TContext, TExpressionEvent, TEvent>, params: TParams): void;
4
4
  _out_TEvent?: TEvent;
@@ -11,3 +11,11 @@ export interface RaiseAction<TContext extends MachineContext, TExpressionEvent e
11
11
  * @param eventType The event to raise.
12
12
  */
13
13
  export declare function raise<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TDelay extends string = never, TUsedDelay extends TDelay = never>(eventOrExpr: DoNotInfer<TEvent> | SendExpr<TContext, TExpressionEvent, TParams, DoNotInfer<TEvent>, TEvent>, options?: RaiseActionOptions<TContext, TExpressionEvent, TParams, DoNotInfer<TEvent>, TUsedDelay>): ActionFunction<TContext, TExpressionEvent, TEvent, TParams, never, never, never, TDelay, never>;
14
+ export interface ExecutableRaiseAction extends ExecutableActionObject {
15
+ type: 'xstate.raise';
16
+ params: {
17
+ event: EventObject;
18
+ id: string | undefined;
19
+ delay: number | undefined;
20
+ };
21
+ }
@@ -1,4 +1,4 @@
1
- import { ActionArgs, ActionFunction, AnyActorRef, AnyEventObject, Cast, DoNotInfer, EventFrom, EventObject, InferEvent, MachineContext, ParameterizedObject, SendExpr, SendToActionOptions } from "../types.js";
1
+ import { ActionArgs, ActionFunction, AnyActorRef, AnyEventObject, Cast, DoNotInfer, EventFrom, EventObject, ExecutableActionObject, InferEvent, MachineContext, ParameterizedObject, SendExpr, SendToActionOptions } from "../types.js";
2
2
  export interface SendToAction<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TEvent extends EventObject, TDelay extends string> {
3
3
  (args: ActionArgs<TContext, TExpressionEvent, TEvent>, params: TParams): void;
4
4
  _out_TDelay?: TDelay;
@@ -30,4 +30,13 @@ type Target<TContext extends MachineContext, TExpressionEvent extends EventObjec
30
30
  * @param options Options to pass into the send action creator.
31
31
  */
32
32
  export declare function forwardTo<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TEvent extends EventObject, TDelay extends string = never, TUsedDelay extends TDelay = never>(target: Target<TContext, TExpressionEvent, TParams, TEvent>, options?: SendToActionOptions<TContext, TExpressionEvent, TParams, TEvent, TUsedDelay>): ActionFunction<TContext, TExpressionEvent, TEvent, TParams, never, never, never, TDelay, never>;
33
+ export interface ExecutableSendToAction extends ExecutableActionObject {
34
+ type: 'xstate.sendTo';
35
+ params: {
36
+ event: EventObject;
37
+ id: string | undefined;
38
+ delay: number | undefined;
39
+ to: AnyActorRef;
40
+ };
41
+ }
33
42
  export {};
@@ -1,5 +1,6 @@
1
1
  import { symbolObservable } from "./symbolObservable.js";
2
2
  import { AnyActorSystem, Clock } from "./system.js";
3
+ export declare let executingCustomAction: boolean;
3
4
  import type { AnyActorLogic, AnyActorRef, ConditionalRequired, EmittedFrom, EventFromLogic, InputFrom, IsNotNever, Snapshot, SnapshotFrom } from "./types.js";
4
5
  import { ActorOptions, ActorRef, InteropSubscribable, Observer, Subscription } from "./types.js";
5
6
  export declare const $$ACTOR_TYPE = 1;
@@ -111,7 +112,7 @@ export declare class Actor<TLogic extends AnyActorLogic> implements ActorRef<Sna
111
112
  */
112
113
  subscribe(observer: Observer<SnapshotFrom<TLogic>>): Subscription;
113
114
  subscribe(nextListener?: (snapshot: SnapshotFrom<TLogic>) => void, errorListener?: (error: any) => void, completeListener?: () => void): Subscription;
114
- on<TType extends EmittedFrom<TLogic>['type'] | '*'>(type: TType, handler: (emitted: EmittedFrom<TLogic> & (TType extends '*' ? {} : {
115
+ on<TType extends EmittedFrom<TLogic>['type'] | '*'>(type: TType, handler: (emitted: EmittedFrom<TLogic> & (TType extends '*' ? unknown : {
115
116
  type: TType;
116
117
  })) => void): Subscription;
117
118
  /** Starts the Actor from the initial state */
@@ -1,4 +1,5 @@
1
1
  import { AnyActorLogic, EventFromLogic, InputFrom, SnapshotFrom } from "./types.js";
2
+ /** @deprecated Use `initialTransition(…)` instead. */
2
3
  export declare function getInitialSnapshot<T extends AnyActorLogic>(actorLogic: T, ...[input]: undefined extends InputFrom<T> ? [input?: InputFrom<T>] : [input: InputFrom<T>]): SnapshotFrom<T>;
3
4
  /**
4
5
  * Determines the next snapshot for the given `actorLogic` based on the given
@@ -7,6 +8,7 @@ export declare function getInitialSnapshot<T extends AnyActorLogic>(actorLogic:
7
8
  * If the `snapshot` is `undefined`, the initial snapshot of the `actorLogic` is
8
9
  * used.
9
10
  *
11
+ * @deprecated Use `transition(…)` instead.
10
12
  * @example
11
13
  *
12
14
  * ```ts
@@ -17,6 +17,7 @@ export type { ActorSystem } from "./system.js";
17
17
  export { toPromise } from "./toPromise.js";
18
18
  export * from "./types.js";
19
19
  export { getAllOwnEventDescriptors as __unsafe_getAllOwnEventDescriptors, matchesState, pathToStateValue, toObserver } from "./utils.js";
20
+ export { transition, initialTransition } from "./transition.js";
20
21
  export { waitFor } from "./waitFor.js";
21
22
  declare global {
22
23
  interface SymbolConstructor {
@@ -26,7 +26,7 @@ export interface InspectedActionEvent extends BaseInspectionEventProperties {
26
26
  type: '@xstate.action';
27
27
  action: {
28
28
  type: string;
29
- params: Record<string, unknown>;
29
+ params: unknown;
30
30
  };
31
31
  }
32
32
  export interface InspectedEventEvent extends BaseInspectionEventProperties {
@@ -1,4 +1,4 @@
1
- import { ActorRefFromLogic, AnyActorLogic, AnyActorRef, AnyActorScope, AnyEventObject, AnyMachineSnapshot, ConditionalRequired, GetConcreteByKey, InputFrom, IsLiteralString, IsNotNever, ProvidedActor, RequiredActorOptions } from "./types.js";
1
+ import { ActorRefFromLogic, AnyActorLogic, AnyActorRef, AnyActorScope, AnyEventObject, AnyMachineSnapshot, ConditionalRequired, GetConcreteByKey, InputFrom, IsLiteralString, IsNotNever, ProvidedActor, RequiredActorOptions, type RequiredLogicInput } from "./types.js";
2
2
  type SpawnOptions<TActor extends ProvidedActor, TSrc extends TActor['src']> = TActor extends {
3
3
  src: TSrc;
4
4
  } ? ConditionalRequired<[
@@ -13,17 +13,25 @@ type SpawnOptions<TActor extends ProvidedActor, TSrc extends TActor['src']> = TA
13
13
  ], IsNotNever<RequiredActorOptions<TActor>>> : never;
14
14
  export type Spawner<TActor extends ProvidedActor> = IsLiteralString<TActor['src']> extends true ? {
15
15
  <TSrc extends TActor['src']>(logic: TSrc, ...[options]: SpawnOptions<TActor, TSrc>): ActorRefFromLogic<GetConcreteByKey<TActor, 'src', TSrc>['logic']>;
16
- <TLogic extends AnyActorLogic>(src: TLogic, options?: {
17
- id?: never;
16
+ <TLogic extends AnyActorLogic>(src: TLogic, ...[options]: ConditionalRequired<[
17
+ options?: {
18
+ id?: never;
19
+ systemId?: string;
20
+ input?: InputFrom<TLogic>;
21
+ syncSnapshot?: boolean;
22
+ } & {
23
+ [K in RequiredLogicInput<TLogic>]: unknown;
24
+ }
25
+ ], IsNotNever<RequiredLogicInput<TLogic>>>): ActorRefFromLogic<TLogic>;
26
+ } : <TLogic extends AnyActorLogic | string>(src: TLogic, ...[options]: ConditionalRequired<[
27
+ options?: {
28
+ id?: string;
18
29
  systemId?: string;
19
- input?: InputFrom<TLogic>;
30
+ input?: TLogic extends string ? unknown : InputFrom<TLogic>;
20
31
  syncSnapshot?: boolean;
21
- }): ActorRefFromLogic<TLogic>;
22
- } : <TLogic extends AnyActorLogic | string>(src: TLogic, options?: {
23
- id?: string;
24
- systemId?: string;
25
- input?: TLogic extends string ? unknown : InputFrom<TLogic>;
26
- syncSnapshot?: boolean;
27
- }) => TLogic extends AnyActorLogic ? ActorRefFromLogic<TLogic> : AnyActorRef;
32
+ } & (TLogic extends AnyActorLogic ? {
33
+ [K in RequiredLogicInput<TLogic>]: unknown;
34
+ } : {})
35
+ ], IsNotNever<TLogic extends AnyActorLogic ? RequiredLogicInput<TLogic> : never>>) => TLogic extends AnyActorLogic ? ActorRefFromLogic<TLogic> : AnyActorRef;
28
36
  export declare function createSpawner(actorScope: AnyActorScope, { machine, context }: AnyMachineSnapshot, event: AnyEventObject, spawnedChildren: Record<string, AnyActorRef>): Spawner<any>;
29
37
  export {};
@@ -1,6 +1,6 @@
1
1
  import { MachineSnapshot } from "./State.js";
2
2
  import type { StateNode } from "./StateNode.js";
3
- import { AnyEventObject, AnyMachineSnapshot, AnyStateNode, AnyTransitionDefinition, DelayedTransitionDefinition, EventObject, InitialTransitionConfig, InitialTransitionDefinition, MachineContext, StateValue, TransitionDefinition, TODO, UnknownAction, ActionFunction, AnyTransitionConfig, AnyActorScope } from "./types.js";
3
+ import { ActionArgs, AnyEventObject, AnyMachineSnapshot, AnyStateNode, AnyTransitionDefinition, DelayedTransitionDefinition, EventObject, InitialTransitionConfig, InitialTransitionDefinition, MachineContext, StateValue, TransitionDefinition, TODO, UnknownAction, ParameterizedObject, AnyTransitionConfig, AnyActorScope } from "./types.js";
4
4
  type StateNodeIterable<TContext extends MachineContext, TE extends EventObject> = Iterable<StateNode<TContext, TE>>;
5
5
  type AnyStateNodeIterable = StateNodeIterable<any, any>;
6
6
  export declare function getAllStateNodes(stateNodes: Iterable<AnyStateNode>): Set<AnyStateNode>;
@@ -10,7 +10,7 @@ export declare const isStateId: (str: string) => boolean;
10
10
  export declare function getCandidates<TEvent extends EventObject>(stateNode: StateNode<any, TEvent>, receivedEventType: TEvent['type']): Array<TransitionDefinition<any, TEvent>>;
11
11
  /** All delayed transitions from the config. */
12
12
  export declare function getDelayedTransitions(stateNode: AnyStateNode): Array<DelayedTransitionDefinition<MachineContext, EventObject>>;
13
- export declare function formatTransition<TContext extends MachineContext, TEvent extends EventObject>(stateNode: AnyStateNode, descriptor: string, transitionConfig: AnyTransitionConfig): AnyTransitionDefinition;
13
+ export declare function formatTransition(stateNode: AnyStateNode, descriptor: string, transitionConfig: AnyTransitionConfig): AnyTransitionDefinition;
14
14
  export declare function formatTransitions<TContext extends MachineContext, TEvent extends EventObject>(stateNode: AnyStateNode): Map<string, TransitionDefinition<TContext, TEvent>[]>;
15
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
16
  export declare function getInitialStateNodes(stateNode: AnyStateNode): Set<AnyStateNode>;
@@ -25,13 +25,23 @@ export declare function getStateNodeByPath(stateNode: AnyStateNode, statePath: s
25
25
  *
26
26
  * @param stateValue The state value or State instance
27
27
  */
28
- export declare function getStateNodes<TContext extends MachineContext, TEvent extends EventObject>(stateNode: AnyStateNode, stateValue: StateValue): Array<AnyStateNode>;
28
+ export declare function getStateNodes(stateNode: AnyStateNode, stateValue: StateValue): Array<AnyStateNode>;
29
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
30
  /** https://www.w3.org/TR/scxml/#microstepProcedure */
31
- export declare function microstep<TContext extends MachineContext, TEvent extends EventObject>(transitions: Array<AnyTransitionDefinition>, currentSnapshot: AnyMachineSnapshot, actorScope: AnyActorScope, event: AnyEventObject, isInitial: boolean, internalQueue: Array<AnyEventObject>): AnyMachineSnapshot;
32
- export declare let executingCustomAction: ActionFunction<any, any, any, any, any, any, any, any, any> | false;
33
- export declare function resolveActionsAndContext(currentSnapshot: AnyMachineSnapshot, event: AnyEventObject, actorScope: AnyActorScope, actions: UnknownAction[], internalQueue: AnyEventObject[], deferredActorIds?: string[]): AnyMachineSnapshot;
34
- export declare function macrostep(snapshot: AnyMachineSnapshot, event: EventObject, actorScope: AnyActorScope, internalQueue?: AnyEventObject[]): {
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[]): {
35
45
  snapshot: typeof snapshot;
36
46
  microstates: Array<typeof snapshot>;
37
47
  };
@@ -0,0 +1,16 @@
1
+ import { AnyActorLogic, EventFromLogic, InputFrom, SnapshotFrom, ExecutableActionsFrom } from "./types.js";
2
+ /**
3
+ * Given actor `logic`, a `snapshot`, and an `event`, returns a tuple of the
4
+ * `nextSnapshot` and `actions` to execute.
5
+ *
6
+ * This is a pure function that does not execute `actions`.
7
+ */
8
+ export declare function transition<T extends AnyActorLogic>(logic: T, snapshot: SnapshotFrom<T>, event: EventFromLogic<T>): [nextSnapshot: SnapshotFrom<T>, actions: ExecutableActionsFrom<T>[]];
9
+ /**
10
+ * Given actor `logic` and optional `input`, returns a tuple of the
11
+ * `nextSnapshot` and `actions` to execute from the initial transition (no
12
+ * previous state).
13
+ *
14
+ * This is a pure function that does not execute `actions`.
15
+ */
16
+ export declare function initialTransition<T extends AnyActorLogic>(logic: T, ...[input]: undefined extends InputFrom<T> ? [input?: InputFrom<T>] : [input: InputFrom<T>]): [SnapshotFrom<T>, ExecutableActionsFrom<T>[]];
@@ -2,12 +2,14 @@ import type { MachineSnapshot } from "./State.js";
2
2
  import type { StateMachine } from "./StateMachine.js";
3
3
  import type { StateNode } from "./StateNode.js";
4
4
  import { AssignArgs } from "./actions/assign.js";
5
+ import { ExecutableRaiseAction } from "./actions/raise.js";
6
+ import { ExecutableSendToAction } from "./actions/send.js";
5
7
  import { PromiseActorLogic } from "./actors/promise.js";
6
- import { Guard, GuardPredicate, UnknownGuard } from "./guards.js";
7
8
  import type { Actor } from "./createActor.js";
9
+ import { Guard, GuardPredicate, UnknownGuard } from "./guards.js";
10
+ import { InspectionEvent } from "./inspection.js";
8
11
  import { Spawner } from "./spawn.js";
9
12
  import { AnyActorSystem, Clock } from './system.js';
10
- import { InspectionEvent } from "./inspection.js";
11
13
  export type Identity<T> = {
12
14
  [K in keyof T]: T[K];
13
15
  };
@@ -42,7 +44,7 @@ export type AnyFunction = (...args: any[]) => any;
42
44
  type ReturnTypeOrValue<T> = T extends AnyFunction ? ReturnType<T> : T;
43
45
  export type IsNever<T> = [T] extends [never] ? true : false;
44
46
  export type IsNotNever<T> = [T] extends [never] ? false : true;
45
- export type Compute<A extends any> = {
47
+ export type Compute<A> = {
46
48
  [K in keyof A]: A[K];
47
49
  } & unknown;
48
50
  export type Prop<T, K> = K extends keyof T ? T[K] : never;
@@ -55,13 +57,13 @@ export type IndexByProp<T extends Record<P, string>, P extends keyof T> = {
55
57
  export type IndexByType<T extends {
56
58
  type: string;
57
59
  }> = IndexByProp<T, 'type'>;
58
- export type Equals<A1 extends any, A2 extends any> = (<A>() => A extends A2 ? true : false) extends <A>() => A extends A1 ? true : false ? true : false;
60
+ export type Equals<A1, A2> = (<A>() => A extends A2 ? true : false) extends <A>() => A extends A1 ? true : false ? true : false;
59
61
  export type IsAny<T> = Equals<T, any>;
60
62
  export type Cast<A, B> = A extends B ? A : B;
61
63
  export type DoNotInfer<T> = [T][T extends any ? 0 : any];
62
64
  /** @deprecated Use the built-in `NoInfer` type instead */
63
65
  export type NoInfer<T> = DoNotInfer<T>;
64
- export type LowInfer<T> = T & {};
66
+ export type LowInfer<T> = T & NonNullable<unknown>;
65
67
  export type MetaObject = Record<string, any>;
66
68
  export type Lazy<T> = () => T;
67
69
  export type MaybeLazy<T> = T | Lazy<T>;
@@ -175,7 +177,7 @@ export type DelayedTransitions<TContext extends MachineContext, TEvent extends E
175
177
  [K in Delay<TDelay>]?: string | SingleOrArray<TransitionConfig<TContext, TEvent, TEvent, TActor, TAction, TGuard, TDelay, TODO, // TEmitted
176
178
  TODO>>;
177
179
  };
178
- export type StateTypes = 'atomic' | 'compound' | 'parallel' | 'final' | 'history' | string;
180
+ export type StateTypes = 'atomic' | 'compound' | 'parallel' | 'final' | 'history' | ({} & string);
179
181
  export type SingleOrArray<T> = readonly T[] | T;
180
182
  export type StateNodesConfig<TContext extends MachineContext, TEvent extends EventObject> = {
181
183
  [K in string]: StateNode<TContext, TEvent>;
@@ -253,7 +255,7 @@ export type InvokeConfig<TContext extends MachineContext, TEvent extends EventOb
253
255
  onSnapshot?: string | SingleOrArray<TransitionConfigOrTarget<TContext, SnapshotEvent, TEvent, TActor, TAction, TGuard, TDelay, TEmitted, TMeta>>;
254
256
  };
255
257
  export type AnyInvokeConfig = InvokeConfig<any, any, any, any, any, any, any, any>;
256
- export interface StateNodeConfig<TContext extends MachineContext, TEvent extends EventObject, TActor extends ProvidedActor, TAction extends ParameterizedObject, TGuard extends ParameterizedObject, TDelay extends string, TTag extends string, TOutput, TEmitted extends EventObject, TMeta extends MetaObject> {
258
+ export interface StateNodeConfig<TContext extends MachineContext, TEvent extends EventObject, TActor extends ProvidedActor, TAction extends ParameterizedObject, TGuard extends ParameterizedObject, TDelay extends string, TTag extends string, _TOutput, TEmitted extends EventObject, TMeta extends MetaObject> {
257
259
  /** The initial state transition. */
258
260
  initial?: InitialTransitionConfig<TContext, TEvent, TActor, TAction, TGuard, TDelay> | string | undefined;
259
261
  /**
@@ -755,11 +757,12 @@ export interface ActorRef<TSnapshot extends Snapshot<unknown>, TEvent extends Ev
755
757
  _parent?: AnyActorRef;
756
758
  system: AnyActorSystem;
757
759
  src: string | AnyActorLogic;
758
- on: <TType extends TEmitted['type'] | '*'>(type: TType, handler: (emitted: TEmitted & (TType extends '*' ? {} : {
760
+ on: <TType extends TEmitted['type'] | '*'>(type: TType, handler: (emitted: TEmitted & (TType extends '*' ? unknown : {
759
761
  type: TType;
760
762
  })) => void) => Subscription;
761
763
  }
762
- export type AnyActorRef = ActorRef<any, any, any>;
764
+ export type AnyActorRef = ActorRef<any, any, // TODO: shouldn't this be AnyEventObject?
765
+ any>;
763
766
  export type ActorRefLike = Pick<AnyActorRef, 'sessionId' | 'send' | 'getSnapshot'>;
764
767
  export type UnknownActorRef = ActorRef<Snapshot<unknown>, EventObject>;
765
768
  export type ActorLogicFrom<T> = ReturnTypeOrValue<T> extends infer R ? R extends StateMachine<any, any, any, any, any, any, any, any, any, any, any, any, any, // TMeta
@@ -779,6 +782,7 @@ export interface ActorScope<TSnapshot extends Snapshot<unknown>, TEvent extends
779
782
  emit: (event: TEmitted) => void;
780
783
  system: TSystem;
781
784
  stopChild: (child: AnyActorRef) => void;
785
+ actionExecutor: ActionExecutor;
782
786
  }
783
787
  export type AnyActorScope = ActorScope<any, // TSnapshot
784
788
  any, // TEvent
@@ -815,15 +819,15 @@ in TInput = NonReducibleUnknown, TSystem extends AnyActorSystem = AnyActorSystem
815
819
  /** The initial setup/configuration used to create the actor logic. */
816
820
  config?: unknown;
817
821
  /**
818
- * Transition function that processes the current state and an incoming
819
- * message to produce a new state.
822
+ * Transition function that processes the current state and an incoming event
823
+ * to produce a new state.
820
824
  *
821
825
  * @param snapshot - The current state.
822
- * @param message - The incoming message.
826
+ * @param event - The incoming event.
823
827
  * @param actorScope - The actor scope.
824
828
  * @returns The new state.
825
829
  */
826
- transition: (snapshot: TSnapshot, message: TEvent, actorScope: ActorScope<TSnapshot, TEvent, TSystem, TEmitted>) => TSnapshot;
830
+ transition: (snapshot: TSnapshot, event: TEvent, actorScope: ActorScope<TSnapshot, TEvent, TSystem, TEmitted>) => TSnapshot;
827
831
  /**
828
832
  * Called to provide the initial state of the actor.
829
833
  *
@@ -887,6 +891,7 @@ export interface ActorSystemInfo {
887
891
  actors: Record<string, AnyActorRef>;
888
892
  }
889
893
  export type RequiredActorOptions<TActor extends ProvidedActor> = (undefined extends TActor['id'] ? never : 'id') | (undefined extends InputFrom<TActor['logic']> ? never : 'input');
894
+ export type RequiredLogicInput<TLogic extends AnyActorLogic> = undefined extends InputFrom<TLogic> ? never : 'input';
890
895
  type ExtractLiteralString<T extends string | undefined> = T extends string ? string extends T ? never : T : never;
891
896
  type ToConcreteChildren<TActor extends ProvidedActor> = {
892
897
  [A in TActor as ExtractLiteralString<A['id']>]?: ActorRefFromLogic<A['logic']>;
@@ -895,7 +900,7 @@ export type ToChildren<TActor extends ProvidedActor> = string extends TActor['sr
895
900
  include: {
896
901
  [id: string]: TActor extends any ? ActorRefFromLogic<TActor['logic']> | undefined : never;
897
902
  };
898
- exclude: {};
903
+ exclude: unknown;
899
904
  }[undefined extends TActor['id'] ? 'include' : string extends TActor['id'] ? 'include' : 'exclude']>;
900
905
  export type StateSchema = {
901
906
  id?: string;
@@ -960,4 +965,33 @@ export type ToStateValue<T extends StateSchema> = T extends {
960
965
  [StateKey in K]: ToStateValue<T['states'][K]>;
961
966
  };
962
967
  }>> : never) : {};
968
+ export interface ExecutableActionObject {
969
+ type: string;
970
+ info: ActionArgs<MachineContext, EventObject, EventObject>;
971
+ params: NonReducibleUnknown;
972
+ exec: ((info: ActionArgs<any, any, any>, params: unknown) => void) | undefined;
973
+ }
974
+ export interface ToExecutableAction<T extends ParameterizedObject> extends ExecutableActionObject {
975
+ type: T['type'];
976
+ params: T['params'];
977
+ exec: undefined;
978
+ }
979
+ export interface ExecutableSpawnAction extends ExecutableActionObject {
980
+ type: 'xstate.spawnChild';
981
+ info: ActionArgs<MachineContext, EventObject, EventObject>;
982
+ params: {
983
+ id: string;
984
+ actorRef: AnyActorRef | undefined;
985
+ src: string | AnyActorLogic;
986
+ };
987
+ }
988
+ export type SpecialExecutableAction = ExecutableSpawnAction | ExecutableRaiseAction | ExecutableSendToAction;
989
+ export type ExecutableActionsFrom<T extends AnyActorLogic> = T extends StateMachine<infer _TContext, infer _TEvent, infer _TChildren, infer _TActor, infer TAction, infer _TGuard, infer _TDelay, infer _TStateValue, infer _TTag, infer _TInput, infer _TOutput, infer _TEmitted, infer _TMeta, infer _TConfig> ? SpecialExecutableAction | (string extends TAction['type'] ? never : ToExecutableAction<TAction>) : never;
990
+ export type ActionExecutor = (actionToExecute: ExecutableActionObject) => void;
991
+ export type BuiltinActionResolution = [
992
+ AnyMachineSnapshot,
993
+ NonReducibleUnknown,
994
+ // params
995
+ UnknownAction[] | undefined
996
+ ];
963
997
  export {};
@@ -9,7 +9,7 @@ export declare function mapValues<P, O extends Record<string, unknown>>(collecti
9
9
  export declare function toArray<T>(value: readonly T[] | T | undefined): readonly T[];
10
10
  export declare function resolveOutput<TContext extends MachineContext, TExpressionEvent extends EventObject>(mapper: Mapper<TContext, TExpressionEvent, unknown, EventObject> | NonReducibleUnknown, context: TContext, event: TExpressionEvent, self: AnyActorRef): unknown;
11
11
  export declare function isErrorActorEvent(event: AnyEventObject): event is ErrorActorEvent;
12
- export declare function toTransitionConfigArray<TContext extends MachineContext, TEvent extends EventObject>(configLike: SingleOrArray<AnyTransitionConfig | TransitionConfigTarget>): Array<AnyTransitionConfig>;
12
+ export declare function toTransitionConfigArray(configLike: SingleOrArray<AnyTransitionConfig | TransitionConfigTarget>): Array<AnyTransitionConfig>;
13
13
  export declare function normalizeTarget<TContext extends MachineContext, TEvent extends EventObject>(target: SingleOrArray<string | StateNode<TContext, TEvent>> | undefined): ReadonlyArray<string | StateNode<TContext, TEvent>> | undefined;
14
14
  export declare function toObserver<T>(nextHandler?: Observer<T> | ((value: T) => void), errorHandler?: (error: any) => void, completionHandler?: () => void): Observer<T>;
15
15
  export declare function createInvokeId(stateNodeId: string, index: number): string;
@@ -1,41 +1,37 @@
1
- import { T as ProcessingStatus, z as resolveReferencedActor, A as createActor, U as cloneMachineSnapshot, V as executingCustomAction, W as XSTATE_ERROR, Y as createErrorActorEvent, e as evaluateGuard, M as cancel, O as raise, P as spawnChild, R as stopChild } from './raise-5ea71f04.development.esm.js';
1
+ import { T as ProcessingStatus, z as resolveReferencedActor, A as createActor, U as cloneMachineSnapshot, V as executingCustomAction, W as XSTATE_ERROR, Y as createErrorActorEvent, e as evaluateGuard, M as cancel, O as raise, P as spawnChild, R as stopChild } from './raise-1db27a82.development.esm.js';
2
2
 
3
3
  function createSpawner(actorScope, {
4
4
  machine,
5
5
  context
6
6
  }, event, spawnedChildren) {
7
- const spawn = (src, options = {}) => {
8
- const {
9
- systemId,
10
- input
11
- } = options;
7
+ const spawn = (src, options) => {
12
8
  if (typeof src === 'string') {
13
9
  const logic = resolveReferencedActor(machine, src);
14
10
  if (!logic) {
15
11
  throw new Error(`Actor logic '${src}' not implemented in machine '${machine.id}'`);
16
12
  }
17
13
  const actorRef = createActor(logic, {
18
- id: options.id,
14
+ id: options?.id,
19
15
  parent: actorScope.self,
20
- syncSnapshot: options.syncSnapshot,
21
- input: typeof input === 'function' ? input({
16
+ syncSnapshot: options?.syncSnapshot,
17
+ input: typeof options?.input === 'function' ? options.input({
22
18
  context,
23
19
  event,
24
20
  self: actorScope.self
25
- }) : input,
21
+ }) : options?.input,
26
22
  src,
27
- systemId
23
+ systemId: options?.systemId
28
24
  });
29
25
  spawnedChildren[actorRef.id] = actorRef;
30
26
  return actorRef;
31
27
  } else {
32
28
  const actorRef = createActor(src, {
33
- id: options.id,
29
+ id: options?.id,
34
30
  parent: actorScope.self,
35
- syncSnapshot: options.syncSnapshot,
36
- input: options.input,
31
+ syncSnapshot: options?.syncSnapshot,
32
+ input: options?.input,
37
33
  src,
38
- systemId
34
+ systemId: options?.systemId
39
35
  });
40
36
  return actorRef;
41
37
  }
@@ -83,7 +79,7 @@ function resolveAssign(actorScope, snapshot, actionArgs, actionParams, {
83
79
  ...snapshot.children,
84
80
  ...spawnedChildren
85
81
  } : snapshot.children
86
- })];
82
+ }), undefined, undefined];
87
83
  }
88
84
  /**
89
85
  * Updates the current context of the machine.
@@ -123,7 +119,7 @@ function assign(assignment) {
123
119
  if (executingCustomAction) {
124
120
  console.warn('Custom actions should not call `assign()` directly, as it is not imperative. See https://stately.ai/docs/actions#built-in-actions for more details.');
125
121
  }
126
- function assign(args, params) {
122
+ function assign(_args, _params) {
127
123
  {
128
124
  throw new Error(`This isn't supposed to be called`);
129
125
  }
@@ -137,13 +133,10 @@ function assign(assignment) {
137
133
  function resolveEmit(_, snapshot, args, actionParams, {
138
134
  event: eventOrExpr
139
135
  }) {
140
- if (typeof eventOrExpr === 'string') {
141
- throw new Error(`Only event objects may be used with emit; use emit({ type: "${eventOrExpr}" }) instead`);
142
- }
143
136
  const resolvedEvent = typeof eventOrExpr === 'function' ? eventOrExpr(args, actionParams) : eventOrExpr;
144
137
  return [snapshot, {
145
138
  event: resolvedEvent
146
- }];
139
+ }, undefined];
147
140
  }
148
141
  function executeEmit(actorScope, {
149
142
  event
@@ -191,7 +184,7 @@ eventOrExpr) {
191
184
  if (executingCustomAction) {
192
185
  console.warn('Custom actions should not call `emit()` directly, as it is not imperative. See https://stately.ai/docs/actions#built-in-actions for more details.');
193
186
  }
194
- function emit(args, params) {
187
+ function emit(_args, _params) {
195
188
  {
196
189
  throw new Error(`This isn't supposed to be called`);
197
190
  }
@@ -239,8 +232,6 @@ eventOrExpr) {
239
232
  * "someChildState" }`.
240
233
  */
241
234
 
242
- // TODO: remove once TS fixes this type-widening issue
243
-
244
235
  /** @deprecated Use `AnyMachineSnapshot` instead */
245
236
 
246
237
  // TODO: possibly refactor this somehow, use even a simpler type, and maybe even make `machine.options` private or something
@@ -271,6 +262,8 @@ let SpecialTargets = /*#__PURE__*/function (SpecialTargets) {
271
262
 
272
263
  /** @deprecated */
273
264
 
265
+ // TODO: cover all that can be actually returned
266
+
274
267
  function resolveSendTo(actorScope, snapshot, args, actionParams, {
275
268
  to,
276
269
  event: eventOrExpr,
@@ -279,7 +272,9 @@ function resolveSendTo(actorScope, snapshot, args, actionParams, {
279
272
  }, extra) {
280
273
  const delaysMap = snapshot.machine.implementations.delays;
281
274
  if (typeof eventOrExpr === 'string') {
282
- throw new Error(`Only event objects may be used with sendTo; use sendTo({ type: "${eventOrExpr}" }) instead`);
275
+ throw new Error(
276
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
277
+ `Only event objects may be used with sendTo; use sendTo({ type: "${eventOrExpr}" }) instead`);
283
278
  }
284
279
  const resolvedEvent = typeof eventOrExpr === 'function' ? eventOrExpr(args, actionParams) : eventOrExpr;
285
280
  let resolvedDelay;
@@ -292,9 +287,12 @@ function resolveSendTo(actorScope, snapshot, args, actionParams, {
292
287
  const resolvedTarget = typeof to === 'function' ? to(args, actionParams) : to;
293
288
  let targetActorRef;
294
289
  if (typeof resolvedTarget === 'string') {
290
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
295
291
  if (resolvedTarget === SpecialTargets.Parent) {
296
292
  targetActorRef = actorScope.self._parent;
297
- } else if (resolvedTarget === SpecialTargets.Internal) {
293
+ }
294
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
295
+ else if (resolvedTarget === SpecialTargets.Internal) {
298
296
  targetActorRef = actorScope.self;
299
297
  } else if (resolvedTarget.startsWith('#_')) {
300
298
  // SCXML compatibility: https://www.w3.org/TR/scxml/#SCXMLEventProcessor
@@ -311,10 +309,11 @@ function resolveSendTo(actorScope, snapshot, args, actionParams, {
311
309
  }
312
310
  return [snapshot, {
313
311
  to: targetActorRef,
312
+ targetId: typeof resolvedTarget === 'string' ? resolvedTarget : undefined,
314
313
  event: resolvedEvent,
315
314
  id,
316
315
  delay: resolvedDelay
317
- }];
316
+ }, undefined];
318
317
  }
319
318
  function retryResolveSendTo(_, snapshot, params) {
320
319
  if (typeof params.to === 'string') {
@@ -354,14 +353,14 @@ function executeSendTo(actorScope, params) {
354
353
  */
355
354
  function sendTo(to, eventOrExpr, options) {
356
355
  if (executingCustomAction) {
357
- console.warn('Custom actions should not call `raise()` directly, as it is not imperative. See https://stately.ai/docs/actions#built-in-actions for more details.');
356
+ console.warn('Custom actions should not call `sendTo()` directly, as it is not imperative. See https://stately.ai/docs/actions#built-in-actions for more details.');
358
357
  }
359
- function sendTo(args, params) {
358
+ function sendTo(_args, _params) {
360
359
  {
361
360
  throw new Error(`This isn't supposed to be called`);
362
361
  }
363
362
  }
364
- sendTo.type = 'xsnapshot.sendTo';
363
+ sendTo.type = 'xstate.sendTo';
365
364
  sendTo.to = to;
366
365
  sendTo.event = eventOrExpr;
367
366
  sendTo.id = options?.id;
@@ -471,7 +470,7 @@ function resolveEnqueueActions(actorScope, snapshot, args, actionParams, {
471
470
  * ```
472
471
  */
473
472
  function enqueueActions(collect) {
474
- function enqueueActions(args, params) {
473
+ function enqueueActions(_args, _params) {
475
474
  {
476
475
  throw new Error(`This isn't supposed to be called`);
477
476
  }
@@ -489,7 +488,7 @@ function resolveLog(_, snapshot, actionArgs, actionParams, {
489
488
  return [snapshot, {
490
489
  value: typeof value === 'function' ? value(actionArgs, actionParams) : value,
491
490
  label
492
- }];
491
+ }, undefined];
493
492
  }
494
493
  function executeLog({
495
494
  logger
@@ -519,7 +518,7 @@ function log(value = ({
519
518
  context,
520
519
  event
521
520
  }), label) {
522
- function log(args, params) {
521
+ function log(_args, _params) {
523
522
  {
524
523
  throw new Error(`This isn't supposed to be called`);
525
524
  }