xstate 5.0.0-alpha.3 → 5.0.0-alpha.5

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 (50) hide show
  1. package/actions/dist/xstate-actions.cjs.dev.js +1 -1
  2. package/actions/dist/xstate-actions.cjs.prod.js +1 -1
  3. package/actions/dist/xstate-actions.esm.js +1 -1
  4. package/actions/dist/xstate-actions.umd.min.js +1 -1
  5. package/actions/dist/xstate-actions.umd.min.js.map +1 -1
  6. package/actors/dist/xstate-actors.cjs.dev.js +1 -1
  7. package/actors/dist/xstate-actors.cjs.prod.js +1 -1
  8. package/actors/dist/xstate-actors.esm.js +1 -1
  9. package/actors/dist/xstate-actors.umd.min.js +1 -1
  10. package/actors/dist/xstate-actors.umd.min.js.map +1 -1
  11. package/dev/dist/xstate-dev.umd.min.js.map +1 -1
  12. package/dist/{actions-3910d35f.cjs.prod.js → actions-2479953d.cjs.prod.js} +80 -89
  13. package/dist/{actions-4fe4ada8.esm.js → actions-7678b87b.esm.js} +80 -89
  14. package/dist/{actions-3f0ba11b.cjs.dev.js → actions-96f799fc.cjs.dev.js} +80 -89
  15. package/dist/declarations/src/Machine.d.ts +3 -3
  16. package/dist/declarations/src/SimulatedClock.d.ts +1 -1
  17. package/dist/declarations/src/State.d.ts +3 -3
  18. package/dist/declarations/src/StateMachine.d.ts +4 -4
  19. package/dist/declarations/src/StateNode.d.ts +3 -3
  20. package/dist/declarations/src/actionTypes.d.ts +1 -1
  21. package/dist/declarations/src/actions/assign.d.ts +1 -1
  22. package/dist/declarations/src/actions/cancel.d.ts +2 -2
  23. package/dist/declarations/src/actions/choose.d.ts +2 -2
  24. package/dist/declarations/src/actions/invoke.d.ts +2 -2
  25. package/dist/declarations/src/actions/log.d.ts +2 -2
  26. package/dist/declarations/src/actions/pure.d.ts +1 -1
  27. package/dist/declarations/src/actions/raise.d.ts +1 -1
  28. package/dist/declarations/src/actions/send.d.ts +2 -2
  29. package/dist/declarations/src/actions/stop.d.ts +1 -1
  30. package/dist/declarations/src/actions.d.ts +10 -10
  31. package/dist/declarations/src/actors/index.d.ts +5 -5
  32. package/dist/declarations/src/dev/index.d.ts +1 -1
  33. package/dist/declarations/src/guards.d.ts +2 -2
  34. package/dist/declarations/src/index.d.ts +21 -21
  35. package/dist/declarations/src/interpreter.d.ts +4 -4
  36. package/dist/declarations/src/spawn.d.ts +1 -1
  37. package/dist/declarations/src/stateUtils.d.ts +4 -4
  38. package/dist/declarations/src/typegenTypes.d.ts +1 -1
  39. package/dist/declarations/src/types.d.ts +14 -16
  40. package/dist/declarations/src/utils.d.ts +4 -4
  41. package/dist/xstate.cjs.dev.js +2 -1
  42. package/dist/xstate.cjs.prod.js +2 -1
  43. package/dist/xstate.esm.js +3 -2
  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.dev.js +1 -1
  47. package/guards/dist/xstate-guards.cjs.prod.js +1 -1
  48. package/guards/dist/xstate-guards.esm.js +1 -1
  49. package/guards/dist/xstate-guards.umd.min.js.map +1 -1
  50. package/package.json +1 -1
@@ -1,4 +1,4 @@
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';
1
+ import { MachineConfig, EventObject, AnyEventObject, MachineContext, ActorMap, InternalMachineImplementations, ParameterizedObject } from './types.ts';
2
+ import { TypegenConstraint, TypegenDisabled, ResolveTypegenMeta } from './typegenTypes.ts';
3
+ import { StateMachine } from './StateMachine.ts';
4
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.js';
1
+ import { Clock } from './interpreter.ts';
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.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';
1
+ import type { StateNode } from './StateNode.ts';
2
+ import { TypegenDisabled, TypegenEnabled } from './typegenTypes.ts';
3
+ import type { ActorRef, AnyState, AnyStateMachine, BaseActionObject, EventObject, HistoryValue, MachineContext, PersistedMachineState, Prop, SCXML, StateConfig, StateValue, TransitionDefinition } from './types.ts';
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.
@@ -1,7 +1,7 @@
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';
1
+ import { State } from './State.ts';
2
+ import { StateNode } from './StateNode.ts';
3
+ import type { AreAllImplementationsAssumedToBeProvided, MarkAllImplementationsAsProvided, ResolveTypegenMeta, TypegenDisabled } from './typegenTypes.ts';
4
+ import type { ActorContext, ActorMap, ActorBehavior, EventObject, InternalMachineImplementations, MachineConfig, MachineContext, MachineImplementationsSimplified, MachineSchema, NoInfer, SCXML, StateConfig, StateMachineDefinition, StateValue, TransitionDefinition, PersistedMachineState, ParameterizedObject, AnyActorContext } from './types.ts';
5
5
  export declare const NULL_EVENT = "";
6
6
  export declare const STATE_IDENTIFIER = "#";
7
7
  export declare const WILDCARD = "*";
@@ -1,6 +1,6 @@
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';
1
+ import type { EventObject, StateNodeDefinition, TransitionDefinition, DelayedTransitionDefinition, StateNodeConfig, StateNodesConfig, InvokeDefinition, Mapper, PropertyMapper, SCXML, TransitionDefinitionMap, InitialTransitionDefinition, MachineContext, BaseActionObject } from './types.ts';
2
+ import type { State } from './State.ts';
3
+ import type { StateMachine } from './StateMachine.ts';
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.js';
1
+ import { ActionTypes } from './types.ts';
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,4 +1,4 @@
1
- import type { EventObject, Assigner, PropertyAssigner, MachineContext, DynamicAssignAction, LowInfer } from '../types.js';
1
+ import type { EventObject, Assigner, PropertyAssigner, MachineContext, DynamicAssignAction, LowInfer } from '../types.ts';
2
2
  /**
3
3
  * Updates the current context of the machine.
4
4
  *
@@ -1,5 +1,5 @@
1
- import { EventObject, ExprWithMeta, MachineContext } from '../types.js';
2
- import { BaseDynamicActionObject, CancelActionObject, DynamicCancelActionObject } from '../index.js';
1
+ import { EventObject, ExprWithMeta, MachineContext } from '../types.ts';
2
+ import { BaseDynamicActionObject, CancelActionObject, DynamicCancelActionObject } from '../index.ts';
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
@@ -1,3 +1,3 @@
1
- import { EventObject, ChooseCondition, MachineContext } from '../types.js';
2
- import { BaseDynamicActionObject, ChooseAction, ResolvedChooseAction } from '../index.js';
1
+ import { EventObject, ChooseCondition, MachineContext } from '../types.ts';
2
+ import { BaseDynamicActionObject, ChooseAction, ResolvedChooseAction } from '../index.ts';
3
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.js';
2
- import { BaseDynamicActionObject, DynamicInvokeActionObject, InvokeActionObject } from '../index.js';
1
+ import { EventObject, InvokeDefinition, MachineContext } from '../types.ts';
2
+ import { BaseDynamicActionObject, DynamicInvokeActionObject, InvokeActionObject } from '../index.ts';
3
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.js';
2
- import { BaseDynamicActionObject, DynamicLogAction } from '../index.js';
1
+ import { EventObject, LogExpr, MachineContext, LogActionObject } from '../types.ts';
2
+ import { BaseDynamicActionObject, DynamicLogAction } from '../index.ts';
3
3
  /**
4
4
  *
5
5
  * @param expr The expression function to evaluate which will be logged.
@@ -1,4 +1,4 @@
1
- import { EventObject, SingleOrArray, MachineContext } from '../types.js';
1
+ import { EventObject, SingleOrArray, MachineContext } from '../types.ts';
2
2
  import { BaseActionObject, BaseDynamicActionObject, DynamicPureActionObject, PureActionObject } from '..';
3
3
  export declare function pure<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject = TExpressionEvent>(getActions: ({ context, event }: {
4
4
  context: TContext;
@@ -1,4 +1,4 @@
1
- import { EventObject, MachineContext, RaiseActionObject, BaseDynamicActionObject, RaiseActionOptions, SendExpr, RaiseActionParams, NoInfer } from '../types.js';
1
+ import { EventObject, MachineContext, RaiseActionObject, BaseDynamicActionObject, RaiseActionOptions, SendExpr, RaiseActionParams, NoInfer } from '../types.ts';
2
2
  /**
3
3
  * Raises an event. This places the event in the internal event queue, so that
4
4
  * the event is immediately consumed by the machine in the current step.
@@ -1,5 +1,5 @@
1
- import { EventObject, SendActionParams, SendExpr, AnyEventObject, MachineContext } from '../types.js';
2
- import { AnyActorRef, BaseDynamicActionObject, Cast, EventFrom, ExprWithMeta, InferEvent, SendActionObject, SendActionOptions } from '../index.js';
1
+ import { EventObject, SendActionParams, SendExpr, AnyEventObject, MachineContext } from '../types.ts';
2
+ import { AnyActorRef, BaseDynamicActionObject, Cast, EventFrom, ExprWithMeta, InferEvent, SendActionObject, SendActionOptions } from '../index.ts';
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.
@@ -1,4 +1,4 @@
1
- import { ActorRef, BaseDynamicActionObject, DynamicStopActionObject, EventObject, Expr, MachineContext, StopActionObject } from '../types.js';
1
+ import { ActorRef, BaseDynamicActionObject, DynamicStopActionObject, EventObject, Expr, MachineContext, StopActionObject } from '../types.ts';
2
2
  /**
3
3
  * Stops an actor.
4
4
  *
@@ -1,19 +1,19 @@
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';
1
+ import { Action, EventObject, SingleOrArray, ActionFunction, ActionFunctionMap, ActionTypes, DoneEvent, ErrorPlatformEvent, DoneEventObject, MachineContext, BaseActionObject, SCXML } from './types.ts';
2
+ import * as actionTypes from './actionTypes.ts';
3
+ export { send, sendTo, sendParent, respond, forwardTo, escalate } from './actions/send.ts';
4
+ export { stop } from './actions/stop.ts';
5
+ export { log } from './actions/log.ts';
6
+ export { cancel } from './actions/cancel.ts';
7
+ export { assign } from './actions/assign.ts';
8
+ export { raise } from './actions/raise.ts';
9
+ export { choose } from './actions/choose.ts';
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, TEvent>> | undefined) => BaseActionObject[];
16
+ export declare const toActionObjects: <TContext extends MachineContext, TEvent extends EventObject>(action?: SingleOrArray<Action<TContext, 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`.
@@ -1,8 +1,8 @@
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';
1
+ import type { EventObject, ActorRef, BaseActorRef } from '../types.ts';
2
+ export { fromTransition } from './transition.ts';
3
+ export { fromPromise } from './promise.ts';
4
+ export { fromObservable, fromEventObservable } from './observable.ts';
5
+ export { fromCallback } from './callback.ts';
6
6
  export declare const startSignalType = "xstate.init";
7
7
  export declare const stopSignalType = "xstate.stop";
8
8
  export declare const startSignal: StartSignal;
@@ -1,4 +1,4 @@
1
- import { AnyInterpreter, DevToolsAdapter } from '../types.js';
1
+ import { AnyInterpreter, DevToolsAdapter } from '../types.ts';
2
2
  type ServiceListener = (service: AnyInterpreter) => void;
3
3
  export interface XStateDevInterface {
4
4
  register: (service: AnyInterpreter) => void;
@@ -1,5 +1,5 @@
1
- import type { EventObject, StateValue, BooleanGuardDefinition, GuardConfig, GuardDefinition, SCXML, GuardPredicate, MachineContext } from './types.js';
2
- import type { State } from './State.js';
1
+ import type { EventObject, StateValue, BooleanGuardDefinition, GuardConfig, GuardDefinition, SCXML, GuardPredicate, MachineContext } from './types.ts';
2
+ import type { State } from './State.ts';
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,24 +1,24 @@
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';
1
+ import { after, done, doneInvoke, escalate, forwardTo, respond, sendParent, sendTo } from './actions.ts';
2
+ import { assign } from './actions/assign.ts';
3
+ import { cancel } from './actions/cancel.ts';
4
+ import { choose } from './actions/choose.ts';
5
+ import { log } from './actions/log.ts';
6
+ import { pure } from './actions/pure.ts';
7
+ import { raise } from './actions/raise.ts';
8
+ import { send } from './actions/send.ts';
9
+ import { stop } from './actions/stop.ts';
10
+ import { interpret, Interpreter, ActorStatus } from './interpreter.ts';
11
+ import { createMachine } from './Machine.ts';
12
+ import { mapState } from './mapState.ts';
13
+ import { State } from './State.ts';
14
+ import { StateNode } from './StateNode.ts';
15
+ export { createSchema, t } from './schema.ts';
16
+ export { SimulatedClock } from './SimulatedClock.ts';
17
+ export { StateMachine } from './StateMachine.ts';
18
+ export { getStateNodes } from './stateUtils.ts';
19
+ export * from './typegenTypes.ts';
20
+ export * from './types.ts';
21
+ export { matchesState, pathToStateValue, toObserver, toSCXMLEvent } from './utils.ts';
22
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;
@@ -1,7 +1,7 @@
1
- import type { AnyStateMachine, EventFromBehavior, InterpreterFrom, PersistedStateFrom, SnapshotFrom, ActorSystem, AnyActorBehavior, RaiseActionObject } from './types.js';
2
- import { AreAllImplementationsAssumedToBeProvided } from './typegenTypes.js';
3
- import { ActorRef, DoneEvent, EventObject, InteropSubscribable, InterpreterOptions, Observer, SCXML, SendActionObject, Subscription } from './types.js';
4
- import { symbolObservable } from './symbolObservable.js';
1
+ import { symbolObservable } from './symbolObservable.ts';
2
+ import { AreAllImplementationsAssumedToBeProvided } from './typegenTypes.ts';
3
+ import type { ActorSystem, AnyActorBehavior, AnyStateMachine, EventFromBehavior, InterpreterFrom, PersistedStateFrom, RaiseActionObject, SnapshotFrom } from './types.ts';
4
+ import { ActorRef, DoneEvent, EventObject, InteropSubscribable, InterpreterOptions, Observer, SCXML, SendActionObject, Subscription } from './types.ts';
5
5
  export type SnapshotListener<TBehavior extends AnyActorBehavior> = (state: SnapshotFrom<TBehavior>) => void;
6
6
  export type EventListener<TEvent extends EventObject = EventObject> = (event: TEvent) => void;
7
7
  export type Listener = () => void;
@@ -1,2 +1,2 @@
1
- import { InvokeActionObject, AnyStateMachine, Spawner, ActorRef, MachineContext, EventObject, SCXML } from '.';
1
+ import { InvokeActionObject, AnyStateMachine, Spawner, ActorRef, MachineContext, EventObject, SCXML } from './index.ts';
2
2
  export declare function createSpawner<TContext extends MachineContext, TEvent extends EventObject>(self: ActorRef<any, any> | undefined, machine: AnyStateMachine, context: TContext, _event: SCXML.Event<TEvent>, mutCapturedActions: InvokeActionObject[]): Spawner;
@@ -1,7 +1,7 @@
1
- import { BaseActionObject, EventObject, StateValue, TransitionConfig, TransitionDefinition, SingleOrArray, SCXML, StateValueMap, InitialTransitionConfig, MachineContext } from './types.js';
2
- import { State } from './State.js';
3
- import { NULL_EVENT } from './constants.js';
4
- import type { StateNode } from './StateNode.js';
1
+ import { BaseActionObject, EventObject, StateValue, TransitionConfig, TransitionDefinition, SingleOrArray, SCXML, StateValueMap, InitialTransitionConfig, MachineContext } from './types.ts';
2
+ import { State } from './State.ts';
3
+ import { NULL_EVENT } from './constants.ts';
4
+ import type { StateNode } from './StateNode.ts';
5
5
  import { AnyActorContext, AnyHistoryValue, AnyState, AnyStateMachine, AnyStateNode, AnyTransitionDefinition, DelayedTransitionDefinition, InitialTransitionDefinition, StateFromMachine } from '.';
6
6
  type Configuration<TContext extends MachineContext, TE extends EventObject> = Iterable<StateNode<TContext, TE>>;
7
7
  type AnyConfiguration = Configuration<any, any>;
@@ -1,4 +1,4 @@
1
- import { EventObject, IndexByType, IsNever, Prop, Values, IsAny, ActorMap, Cast, ParameterizedObject } from './types.js';
1
+ import { EventObject, IndexByType, IsNever, Prop, Values, IsAny, ActorMap, Cast, ParameterizedObject } from './types.ts';
2
2
  export interface TypegenDisabled {
3
3
  '@@xstate/typegen': false;
4
4
  }
@@ -1,9 +1,9 @@
1
- import type { StateNode } from './StateNode.js';
2
- import type { State } from './State.js';
3
- import type { ActorStatus, Clock, Interpreter } from './interpreter.js';
4
- import type { StateMachine } from './StateMachine.js';
5
- import type { LifecycleSignal } from './actors/index.js';
6
- import { TypegenDisabled, ResolveTypegenMeta, TypegenConstraint, MarkAllImplementationsAsProvided, AreAllImplementationsAssumedToBeProvided } from './typegenTypes.js';
1
+ import type { StateNode } from './StateNode.ts';
2
+ import type { State } from './State.ts';
3
+ import type { ActorStatus, Clock, Interpreter } from './interpreter.ts';
4
+ import type { StateMachine } from './StateMachine.ts';
5
+ import type { LifecycleSignal } from './actors/index.ts';
6
+ import { TypegenDisabled, ResolveTypegenMeta, TypegenConstraint, MarkAllImplementationsAsProvided, AreAllImplementationsAssumedToBeProvided } from './typegenTypes.ts';
7
7
  export type AnyFunction = (...args: any[]) => any;
8
8
  type ReturnTypeOrValue<T> = T extends AnyFunction ? ReturnType<T> : T;
9
9
  export type IsNever<T> = [T] extends [never] ? true : false;
@@ -70,10 +70,10 @@ export interface BaseDynamicActionObject<TContext extends MachineContext, TExpre
70
70
  (args: {
71
71
  context: TContext;
72
72
  event: TExpressionEvent;
73
- } & ActionMeta<TContext, TEvent, ParameterizedObject>): void;
73
+ } & ActionMeta<TEvent, ParameterizedObject>): void;
74
74
  }
75
75
  export type MachineContext = Record<string, any>;
76
- export interface ActionMeta<TContext extends MachineContext, TEvent extends EventObject, TAction extends ParameterizedObject = ParameterizedObject> extends StateMeta<TContext, TEvent> {
76
+ export interface ActionMeta<TEvent extends EventObject, TAction extends ParameterizedObject = ParameterizedObject> extends StateMeta<TEvent> {
77
77
  action: TAction;
78
78
  _event: SCXML.Event<TEvent>;
79
79
  }
@@ -82,7 +82,7 @@ behavior: T, options?: Partial<{
82
82
  id: string;
83
83
  input: any;
84
84
  }>) => T extends ActorBehavior<infer TActorEvent, infer TActorEmitted> ? ActorRef<TActorEvent, TActorEmitted> : ActorRef<any, any>;
85
- export interface AssignMeta<TContext extends MachineContext, TExpressionEvent extends EventObject, _TEvent extends EventObject> extends StateMeta<TContext, TExpressionEvent> {
85
+ export interface AssignMeta<TExpressionEvent extends EventObject, _TEvent extends EventObject> extends StateMeta<TExpressionEvent> {
86
86
  action: BaseActionObject;
87
87
  _event: SCXML.Event<TExpressionEvent>;
88
88
  spawn: Spawner;
@@ -90,7 +90,7 @@ export interface AssignMeta<TContext extends MachineContext, TExpressionEvent ex
90
90
  export type ActionFunction<TContext extends MachineContext, TExpressionEvent extends EventObject, TAction extends ParameterizedObject = ParameterizedObject, TEvent extends EventObject = TExpressionEvent> = (args: {
91
91
  context: TContext;
92
92
  event: TExpressionEvent;
93
- } & ActionMeta<TContext, TEvent, TAction>) => void;
93
+ } & ActionMeta<TEvent, TAction>) => void;
94
94
  export interface ChooseCondition<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject = TExpressionEvent> {
95
95
  guard?: GuardConfig<TContext, TEvent>;
96
96
  actions: Actions<TContext, TExpressionEvent, TEvent>;
@@ -336,7 +336,6 @@ export interface StateNodeConfig<TContext extends MachineContext, TEvent extends
336
336
  * @private
337
337
  */
338
338
  parent?: StateNode<TContext, TEvent>;
339
- strict?: boolean | undefined;
340
339
  /**
341
340
  * The meta data associated with this state node, which will be returned in State instances.
342
341
  */
@@ -635,7 +634,7 @@ export interface SendActionObject<TSentEvent extends EventObject = AnyEventObjec
635
634
  };
636
635
  }
637
636
  export type Expr<TContext extends MachineContext, TEvent extends EventObject, T> = (arg: UnifiedArg<TContext, TEvent>) => T;
638
- export type ExprWithMeta<TContext extends MachineContext, TEvent extends EventObject, T> = (args: UnifiedArg<TContext, TEvent> & StateMeta<TContext, TEvent>) => T;
637
+ export type ExprWithMeta<TContext extends MachineContext, TEvent extends EventObject, T> = (args: UnifiedArg<TContext, TEvent> & StateMeta<TEvent>) => T;
639
638
  export type SendExpr<TContext extends MachineContext, TEvent extends EventObject, TSentEvent extends EventObject = AnyEventObject> = ExprWithMeta<TContext, TEvent, TSentEvent>;
640
639
  export declare enum SpecialTargets {
641
640
  Parent = "#_parent",
@@ -669,11 +668,11 @@ export interface CancelActionObject extends BaseActionObject {
669
668
  export type Assigner<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject = TExpressionEvent> = (args: {
670
669
  context: TContext;
671
670
  event: TExpressionEvent;
672
- } & AssignMeta<TContext, TExpressionEvent, TEvent>) => Partial<TContext>;
671
+ } & AssignMeta<TExpressionEvent, TEvent>) => Partial<TContext>;
673
672
  export type PartialAssigner<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject, TKey extends keyof TContext> = (args: {
674
673
  context: TContext;
675
674
  event: TExpressionEvent;
676
- } & AssignMeta<TContext, TExpressionEvent, TEvent>) => TContext[TKey];
675
+ } & AssignMeta<TExpressionEvent, TEvent>) => TContext[TKey];
677
676
  export type PropertyAssigner<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject = TExpressionEvent> = {
678
677
  [K in keyof TContext]?: PartialAssigner<TContext, TExpressionEvent, TEvent, K> | TContext[K];
679
678
  };
@@ -782,8 +781,7 @@ export interface Segment<TContext extends MachineContext, TEvent extends EventOb
782
781
  */
783
782
  event: TEvent;
784
783
  }
785
- export interface StateMeta<TContext extends MachineContext, TEvent extends EventObject> {
786
- state: State<TContext, TEvent, any>;
784
+ export interface StateMeta<TEvent extends EventObject> {
787
785
  _event: SCXML.Event<TEvent>;
788
786
  self: ActorRef<TEvent>;
789
787
  system: ActorSystem<any>;
@@ -1,7 +1,7 @@
1
- import { AnyActorBehavior, AnyState } from '.';
2
- import { NULL_EVENT } from './constants.js';
3
- import type { StateNode } from './StateNode.js';
4
- import type { ActorBehavior, EventObject, EventType, InvokeConfig, MachineContext, Mapper, Observer, PropertyMapper, SCXML, SCXMLErrorEvent, SingleOrArray, StateLike, StateValue, Subscribable, TransitionConfig, TransitionConfigTarget } from './types.js';
1
+ import { AnyActorBehavior, AnyState } from './index.ts';
2
+ import { NULL_EVENT } from './constants.ts';
3
+ import type { StateNode } from './StateNode.ts';
4
+ import type { ActorBehavior, EventObject, EventType, InvokeConfig, MachineContext, Mapper, Observer, PropertyMapper, SCXML, SCXMLErrorEvent, SingleOrArray, StateLike, StateValue, Subscribable, TransitionConfig, TransitionConfigTarget } from './types.ts';
5
5
  export declare function keys<T extends object>(value: T): Array<keyof T & string>;
6
6
  export declare function matchesState(parentStateId: StateValue, childStateId: StateValue, delimiter?: string): boolean;
7
7
  export declare function toStatePath(stateId: string | string[], delimiter: string): string[];
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var actors_dist_xstateActors = require('./actions-3f0ba11b.cjs.dev.js');
5
+ var actors_dist_xstateActors = require('./actions-96f799fc.cjs.dev.js');
6
6
  require('./index-ebaab3c9.cjs.dev.js');
7
7
 
8
8
  function pure(getActions) {
@@ -754,6 +754,7 @@ var StateMachine = /*#__PURE__*/function () {
754
754
  });
755
755
  }
756
756
  });
757
+ restoredState.actions = [];
757
758
  return restoredState;
758
759
  }
759
760
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var actors_dist_xstateActors = require('./actions-3910d35f.cjs.prod.js');
5
+ var actors_dist_xstateActors = require('./actions-2479953d.cjs.prod.js');
6
6
  require('../dev/dist/xstate-dev.cjs.prod.js');
7
7
 
8
8
  function pure(getActions) {
@@ -754,6 +754,7 @@ var StateMachine = /*#__PURE__*/function () {
754
754
  });
755
755
  }
756
756
  });
757
+ restoredState.actions = [];
757
758
  return restoredState;
758
759
  }
759
760
 
@@ -1,5 +1,5 @@
1
- import { c as createDynamicAction, p as pure$1, t as toArray, a as toActionObjects, _ as _createClass, f as formatTransitions, b as toTransitionConfigArray, N as NULL_EVENT, d as formatTransition, m as mapValues, e as memo, g as _createForOfIteratorHelper, h as evaluateGuard, i as _toConsumableArray, j as flatten, k as _classCallCheck, l as _defineProperty, n as createInvokeId, o as toInvokeConfig, q as _objectSpread2, r as invoke, s as _objectWithoutProperties, u as getDelayedTransitions, v as formatInitialTransition, w as getCandidates, x as isString, y as createSpawner, z as createInitEvent, A as getConfiguration, B as getStateNodes, C as resolveStateValue, D as isInFinalState, S as State, E as toSCXMLEvent, F as isSCXMLErrorEvent, G as macrostep, H as transitionNode, I as _slicedToArray, J as getInitialConfiguration, K as resolveActionsAndContext, L as microstep, M as error, O as isStateId, P as getPersistedState, Q as resolveReferencedActor, R as interpret, T as STATE_DELIMITER, U as initEvent, V as matchesState, W as raise, X as send, Y as sendParent, Z as sendTo, $ as log, a0 as cancel, a1 as stop, a2 as assign, a3 as after, a4 as done, a5 as respond, a6 as forwardTo, a7 as escalate, a8 as choose } from './actions-4fe4ada8.esm.js';
2
- export { ae as ActionTypes, a9 as Interpreter, aa as InterpreterStatus, af as SpecialTargets, S as State, a2 as assign, ab as doneInvoke, a6 as forwardTo, B as getStateNodes, R as interpret, V as matchesState, ac as pathToStateValue, X as send, Y as sendParent, Z as sendTo, ad as toObserver, E as toSCXMLEvent } from './actions-4fe4ada8.esm.js';
1
+ import { c as createDynamicAction, p as pure$1, t as toArray, a as toActionObjects, _ as _createClass, f as formatTransitions, b as toTransitionConfigArray, N as NULL_EVENT, d as formatTransition, m as mapValues, e as memo, g as _createForOfIteratorHelper, h as evaluateGuard, i as _toConsumableArray, j as flatten, k as _classCallCheck, l as _defineProperty, n as createInvokeId, o as toInvokeConfig, q as _objectSpread2, r as invoke, s as _objectWithoutProperties, u as getDelayedTransitions, v as formatInitialTransition, w as getCandidates, x as isString, y as createSpawner, z as createInitEvent, A as getConfiguration, B as getStateNodes, C as resolveStateValue, D as isInFinalState, S as State, E as toSCXMLEvent, F as isSCXMLErrorEvent, G as macrostep, H as transitionNode, I as _slicedToArray, J as getInitialConfiguration, K as resolveActionsAndContext, L as microstep, M as error, O as isStateId, P as getPersistedState, Q as resolveReferencedActor, R as interpret, T as STATE_DELIMITER, U as initEvent, V as matchesState, W as raise, X as send, Y as sendParent, Z as sendTo, $ as log, a0 as cancel, a1 as stop, a2 as assign, a3 as after, a4 as done, a5 as respond, a6 as forwardTo, a7 as escalate, a8 as choose } from './actions-7678b87b.esm.js';
2
+ export { ae as ActionTypes, a9 as Interpreter, aa as InterpreterStatus, af as SpecialTargets, S as State, a2 as assign, ab as doneInvoke, a6 as forwardTo, B as getStateNodes, R as interpret, V as matchesState, ac as pathToStateValue, X as send, Y as sendParent, Z as sendTo, ad as toObserver, E as toSCXMLEvent } from './actions-7678b87b.esm.js';
3
3
  import './index-50bd0aff.esm.js';
4
4
 
5
5
  function pure(getActions) {
@@ -751,6 +751,7 @@ var StateMachine = /*#__PURE__*/function () {
751
751
  });
752
752
  }
753
753
  });
754
+ restoredState.actions = [];
754
755
  return restoredState;
755
756
  }
756
757