xstate 5.4.0 → 5.4.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.
- package/actions/dist/xstate-actions.cjs.js +2 -2
- package/actions/dist/xstate-actions.development.cjs.js +2 -2
- package/actions/dist/xstate-actions.development.esm.js +2 -2
- package/actions/dist/xstate-actions.esm.js +2 -2
- package/actions/dist/xstate-actions.umd.min.js.map +1 -1
- package/actors/dist/xstate-actors.cjs.js +1 -1
- package/actors/dist/xstate-actors.development.cjs.js +1 -1
- package/actors/dist/xstate-actors.development.esm.js +1 -1
- package/actors/dist/xstate-actors.esm.js +1 -1
- package/actors/dist/xstate-actors.umd.min.js.map +1 -1
- package/dist/declarations/src/State.d.ts +14 -15
- package/dist/declarations/src/StateMachine.d.ts +14 -13
- package/dist/declarations/src/{interpreter.d.ts → createActor.d.ts} +2 -3
- package/dist/declarations/src/index.d.ts +1 -1
- package/dist/declarations/src/typegenTypes.d.ts +5 -14
- package/dist/declarations/src/types.d.ts +8 -7
- package/dist/{log-580765a2.development.esm.js → log-11038f00.development.esm.js} +1 -1
- package/dist/{log-cd3d7c14.development.cjs.js → log-18eb632d.development.cjs.js} +1 -1
- package/dist/{log-a32b44b3.cjs.js → log-2580e864.cjs.js} +1 -1
- package/dist/{log-e870aec8.esm.js → log-88b333eb.esm.js} +1 -1
- package/dist/{raise-0fc3a80c.development.esm.js → raise-057d17af.development.esm.js} +1 -3
- package/dist/{raise-7df513e7.esm.js → raise-3b380e4b.esm.js} +1 -3
- package/dist/{raise-e3ff3de1.development.cjs.js → raise-3d3d6d51.development.cjs.js} +1 -3
- package/dist/{raise-c3bbdd3a.cjs.js → raise-5c58eb8e.cjs.js} +1 -3
- package/dist/xstate.cjs.js +3 -3
- package/dist/xstate.development.cjs.js +3 -3
- package/dist/xstate.development.esm.js +5 -5
- package/dist/xstate.esm.js +5 -5
- package/dist/xstate.umd.min.js.map +1 -1
- package/guards/dist/xstate-guards.cjs.js +1 -1
- package/guards/dist/xstate-guards.development.cjs.js +1 -1
- package/guards/dist/xstate-guards.development.esm.js +1 -1
- package/guards/dist/xstate-guards.esm.js +1 -1
- package/guards/dist/xstate-guards.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { MachineSnapshot } from "./State.js";
|
|
2
2
|
import { StateNode } from "./StateNode.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { AnyActorSystem } from "./system.js";
|
|
4
|
+
import { ResolveTypegenMeta, TypegenDisabled } from "./typegenTypes.js";
|
|
5
|
+
import type { ActorLogic, ActorScope, AnyActorRef, AnyActorScope, Equals, EventDescriptor, EventObject, HistoryValue, InternalMachineImplementations, MachineConfig, MachineContext, MachineImplementationsSimplified, NoInfer, ParameterizedObject, ProvidedActor, Snapshot, StateMachineDefinition, StateValue, TransitionDefinition } from "./types.js";
|
|
5
6
|
export declare const STATE_IDENTIFIER = "#";
|
|
6
7
|
export declare const WILDCARD = "*";
|
|
7
|
-
export declare class StateMachine<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TActor extends ProvidedActor, TAction extends ParameterizedObject, TGuard extends ParameterizedObject, TDelay extends string, TStateValue extends StateValue, TTag extends string, TInput, TOutput, TResolvedTypesMeta = ResolveTypegenMeta<TypegenDisabled, NoInfer<TEvent>, TActor, TAction, TGuard, TDelay, TTag>> implements ActorLogic<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput
|
|
8
|
+
export declare class StateMachine<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TActor extends ProvidedActor, TAction extends ParameterizedObject, TGuard extends ParameterizedObject, TDelay extends string, TStateValue extends StateValue, TTag extends string, TInput, TOutput, TResolvedTypesMeta = ResolveTypegenMeta<TypegenDisabled, NoInfer<TEvent>, TActor, TAction, TGuard, TDelay, TTag>> implements ActorLogic<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput>, TEvent, TInput, AnyActorSystem> {
|
|
8
9
|
/**
|
|
9
10
|
* The raw config used to create the machine.
|
|
10
11
|
*/
|
|
@@ -34,7 +35,7 @@ export declare class StateMachine<TContext extends MachineContext, TEvent extend
|
|
|
34
35
|
*
|
|
35
36
|
* @returns A new `StateMachine` instance with the provided implementations.
|
|
36
37
|
*/
|
|
37
|
-
provide(implementations: InternalMachineImplementations<TContext, TResolvedTypesMeta, true>): StateMachine<TContext, TEvent, TChildren, TActor, TAction, TGuard, TDelay, TStateValue, TTag, TInput, TOutput,
|
|
38
|
+
provide(implementations: InternalMachineImplementations<TContext, TResolvedTypesMeta, true>): StateMachine<TContext, TEvent, TChildren, TActor, TAction, TGuard, TDelay, TStateValue, TTag, TInput, TOutput, TResolvedTypesMeta>;
|
|
38
39
|
resolveState(config: {
|
|
39
40
|
value: StateValue;
|
|
40
41
|
context?: TContext;
|
|
@@ -44,7 +45,7 @@ export declare class StateMachine<TContext extends MachineContext, TEvent extend
|
|
|
44
45
|
error?: unknown;
|
|
45
46
|
} & (Equals<TContext, MachineContext> extends false ? {
|
|
46
47
|
context: unknown;
|
|
47
|
-
} : {})): MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput
|
|
48
|
+
} : {})): MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput>;
|
|
48
49
|
/**
|
|
49
50
|
* Determines the next snapshot given the current `snapshot` and received `event`.
|
|
50
51
|
* Calculates a full macrostep from all microsteps.
|
|
@@ -52,7 +53,7 @@ export declare class StateMachine<TContext extends MachineContext, TEvent extend
|
|
|
52
53
|
* @param snapshot The current snapshot
|
|
53
54
|
* @param event The received event
|
|
54
55
|
*/
|
|
55
|
-
transition(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput
|
|
56
|
+
transition(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput>, event: TEvent, actorScope: ActorScope<typeof snapshot, TEvent>): MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput>;
|
|
56
57
|
/**
|
|
57
58
|
* Determines the next state given the current `state` and `event`.
|
|
58
59
|
* Calculates a microstep.
|
|
@@ -60,8 +61,8 @@ export declare class StateMachine<TContext extends MachineContext, TEvent extend
|
|
|
60
61
|
* @param state The current state
|
|
61
62
|
* @param event The received event
|
|
62
63
|
*/
|
|
63
|
-
microstep(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput
|
|
64
|
-
getTransitionData(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput
|
|
64
|
+
microstep(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput>, event: TEvent, actorScope: AnyActorScope): Array<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput>>;
|
|
65
|
+
getTransitionData(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput>, event: TEvent): Array<TransitionDefinition<TContext, TEvent>>;
|
|
65
66
|
/**
|
|
66
67
|
* The initial state _before_ evaluating any microsteps.
|
|
67
68
|
* This "pre-initial" state is provided to initial actions executed in the initial state.
|
|
@@ -70,13 +71,13 @@ export declare class StateMachine<TContext extends MachineContext, TEvent extend
|
|
|
70
71
|
/**
|
|
71
72
|
* Returns the initial `State` instance, with reference to `self` as an `ActorRef`.
|
|
72
73
|
*/
|
|
73
|
-
getInitialSnapshot(actorScope: ActorScope<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput
|
|
74
|
-
start(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput
|
|
74
|
+
getInitialSnapshot(actorScope: ActorScope<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput>, TEvent>, input?: TInput): MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput>;
|
|
75
|
+
start(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput>): void;
|
|
75
76
|
getStateNodeById(stateId: string): StateNode<TContext, TEvent>;
|
|
76
77
|
get definition(): StateMachineDefinition<TContext, TEvent>;
|
|
77
78
|
toJSON(): StateMachineDefinition<TContext, TEvent>;
|
|
78
|
-
getPersistedSnapshot(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput
|
|
79
|
-
restoreSnapshot(snapshot: Snapshot<unknown>, _actorScope: ActorScope<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput
|
|
80
|
-
/** @deprecated an internal property acting as a "phantom" type, not
|
|
79
|
+
getPersistedSnapshot(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput>, options?: unknown): Snapshot<unknown>;
|
|
80
|
+
restoreSnapshot(snapshot: Snapshot<unknown>, _actorScope: ActorScope<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput>, TEvent>): MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput>;
|
|
81
|
+
/** @deprecated an internal property that was acting as a "phantom" type, it's not used by anything right now but it's kept around for compatibility reasons */
|
|
81
82
|
__TResolvedTypesMeta: TResolvedTypesMeta;
|
|
82
83
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { symbolObservable } from "./symbolObservable.js";
|
|
2
2
|
import { AnyActorSystem, Clock } from "./system.js";
|
|
3
|
-
import {
|
|
4
|
-
import type { AnyActorLogic, AnyStateMachine, EventFromLogic, Snapshot, SnapshotFrom } from "./types.js";
|
|
3
|
+
import type { AnyActorLogic, EventFromLogic, Snapshot, SnapshotFrom } from "./types.js";
|
|
5
4
|
import { ActorOptions, ActorRef, EventObject, InteropSubscribable, Observer, Subscription } from "./types.js";
|
|
6
5
|
export declare const $$ACTOR_TYPE = 1;
|
|
7
6
|
export type SnapshotListener<TLogic extends AnyActorLogic> = (snapshot: SnapshotFrom<TLogic>) => void;
|
|
@@ -196,7 +195,7 @@ export declare class Actor<TLogic extends AnyActorLogic> implements ActorRef<Sna
|
|
|
196
195
|
* @param logic - The actor logic to create an actor from. For a state machine actor logic creator, see {@link createMachine}. Other actor logic creators include {@link fromCallback}, {@link fromEventObservable}, {@link fromObservable}, {@link fromPromise}, and {@link fromTransition}.
|
|
197
196
|
* @param options - Actor options
|
|
198
197
|
*/
|
|
199
|
-
export declare function createActor<TLogic extends AnyActorLogic>(logic: TLogic
|
|
198
|
+
export declare function createActor<TLogic extends AnyActorLogic>(logic: TLogic, options?: ActorOptions<TLogic>): Actor<TLogic>;
|
|
200
199
|
/**
|
|
201
200
|
* Creates a new Interpreter instance for the given machine with the provided options, if any.
|
|
202
201
|
*
|
|
@@ -9,7 +9,7 @@ export * from "./typegenTypes.js";
|
|
|
9
9
|
export * from "./types.js";
|
|
10
10
|
export { waitFor } from "./waitFor.js";
|
|
11
11
|
import { createMachine } from "./createMachine.js";
|
|
12
|
-
import { Actor, createActor, interpret, Interpreter } from "./
|
|
12
|
+
import { Actor, createActor, interpret, Interpreter } from "./createActor.js";
|
|
13
13
|
import { StateNode } from "./StateNode.js";
|
|
14
14
|
export { and, not, or, stateIn } from "./guards.js";
|
|
15
15
|
export { setup } from "./setup.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EventObject, IndexByType, IsNever, Prop, ParameterizedObject, ProvidedActor, OutputFrom, AnyActorLogic, IndexByProp } from "./types.js";
|
|
2
2
|
export interface TypegenDisabled {
|
|
3
3
|
'@@xstate/typegen': false;
|
|
4
4
|
}
|
|
@@ -87,15 +87,10 @@ export interface ResolvedTypegenMeta extends TypegenMeta {
|
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
export type TypegenConstraint = TypegenEnabled | TypegenDisabled;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
export type
|
|
94
|
-
'Some implementations missing',
|
|
95
|
-
Values<{
|
|
96
|
-
[K in keyof TMissingImplementations]: TMissingImplementations[K];
|
|
97
|
-
}>
|
|
98
|
-
]>;
|
|
90
|
+
/**
|
|
91
|
+
* @deprecated Always resolves to `true`
|
|
92
|
+
*/
|
|
93
|
+
export type AreAllImplementationsAssumedToBeProvided<_TResolvedTypesMeta, _TMissingImplementations> = true;
|
|
99
94
|
interface AllImplementationsProvided {
|
|
100
95
|
missingImplementations: {
|
|
101
96
|
actions: never;
|
|
@@ -104,10 +99,6 @@ interface AllImplementationsProvided {
|
|
|
104
99
|
guards: never;
|
|
105
100
|
};
|
|
106
101
|
}
|
|
107
|
-
export interface MarkAllImplementationsAsProvided<TResolvedTypesMeta> {
|
|
108
|
-
'@@xstate/typegen': Prop<TResolvedTypesMeta, '@@xstate/typegen'>;
|
|
109
|
-
resolved: Prop<TResolvedTypesMeta, 'resolved'> & AllImplementationsProvided;
|
|
110
|
-
}
|
|
111
102
|
type GenerateActorEvents<TActor extends ProvidedActor, TInvokeSrcNameMap> = string extends TActor['src'] ? never : TActor extends any ? {
|
|
112
103
|
type: TActor['id'] extends string ? `xstate.done.actor.${TActor['id']}` : TActor['src'] extends keyof TInvokeSrcNameMap ? `xstate.done.actor.${TInvokeSrcNameMap[TActor['src']] & string}` : `xstate.done.actor.${string}`;
|
|
113
104
|
output: OutputFrom<TActor['logic']>;
|
|
@@ -4,10 +4,10 @@ import type { StateNode } from "./StateNode.js";
|
|
|
4
4
|
import { AssignArgs } from "./actions/assign.js";
|
|
5
5
|
import { PromiseActorLogic } from "./actors/promise.js";
|
|
6
6
|
import { Guard, GuardPredicate, UnknownGuard } from "./guards.js";
|
|
7
|
-
import type { Actor } from "./
|
|
7
|
+
import type { Actor } from "./createActor.js";
|
|
8
8
|
import { Spawner } from "./spawn.js";
|
|
9
9
|
import { AnyActorSystem, InspectionEvent, Clock } from './system.js';
|
|
10
|
-
import {
|
|
10
|
+
import { ResolveTypegenMeta, TypegenConstraint, TypegenDisabled } from "./typegenTypes.js";
|
|
11
11
|
export type Identity<T> = {
|
|
12
12
|
[K in keyof T]: T[K];
|
|
13
13
|
};
|
|
@@ -754,13 +754,13 @@ export interface ActorRef<TSnapshot extends Snapshot<unknown>, TEvent extends Ev
|
|
|
754
754
|
src: string | AnyActorLogic;
|
|
755
755
|
}
|
|
756
756
|
export type AnyActorRef = ActorRef<any, any>;
|
|
757
|
-
export type ActorLogicFrom<T> = ReturnTypeOrValue<T> extends infer R ? R extends StateMachine<any, any, any, any, any, any, any, any, any, any, any> ? R : R extends Promise<infer U> ? PromiseActorLogic<U> : never : never;
|
|
758
|
-
export type ActorRefFrom<T> = ReturnTypeOrValue<T> extends infer R ? R 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
|
|
757
|
+
export type ActorLogicFrom<T> = ReturnTypeOrValue<T> extends infer R ? R extends StateMachine<any, any, any, any, any, any, any, any, any, any, any, any> ? R : R extends Promise<infer U> ? PromiseActorLogic<U> : never : never;
|
|
758
|
+
export type ActorRefFrom<T> = ReturnTypeOrValue<T> extends infer R ? R 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 _TResolvedTypesMeta> ? ActorRef<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput>, TEvent> : R extends Promise<infer U> ? ActorRefFrom<PromiseActorLogic<U>> : R extends ActorLogic<infer TSnapshot, infer TEvent, infer _TInput, infer _TSystem> ? ActorRef<TSnapshot, TEvent> : never : never;
|
|
759
759
|
export type DevToolsAdapter = (service: AnyActor) => void;
|
|
760
760
|
/**
|
|
761
761
|
* @deprecated Use `Actor<T>` instead.
|
|
762
762
|
*/
|
|
763
|
-
export type InterpreterFrom<T extends AnyStateMachine | ((...args: any[]) => AnyStateMachine)> = ReturnTypeOrValue<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
|
|
763
|
+
export type InterpreterFrom<T extends AnyStateMachine | ((...args: any[]) => AnyStateMachine)> = ReturnTypeOrValue<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 _TResolvedTypesMeta> ? Actor<ActorLogic<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput>, TEvent, TInput, AnyActorSystem>> : never;
|
|
764
764
|
export type MachineImplementationsFrom<T extends AnyStateMachine | ((...args: any[]) => AnyStateMachine), TRequireMissingImplementations extends boolean = false> = ReturnTypeOrValue<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 TResolvedTypesMeta> ? InternalMachineImplementations<TContext, TResolvedTypesMeta, TRequireMissingImplementations> : never;
|
|
765
765
|
export type __ResolvedTypesMetaFrom<T> = T extends StateMachine<any, // context
|
|
766
766
|
any, // event
|
|
@@ -769,6 +769,7 @@ any, // actor
|
|
|
769
769
|
any, // action
|
|
770
770
|
any, // guard
|
|
771
771
|
any, // delay
|
|
772
|
+
any, // state value
|
|
772
773
|
any, // tag
|
|
773
774
|
any, // input
|
|
774
775
|
any, // output
|
|
@@ -858,9 +859,9 @@ any>;
|
|
|
858
859
|
export type UnknownActorLogic = ActorLogic<any, any, never, AnyActorSystem>;
|
|
859
860
|
export type SnapshotFrom<T> = ReturnTypeOrValue<T> extends infer R ? R extends ActorRef<infer TSnapshot, infer _> ? TSnapshot : R extends Actor<infer TLogic> ? SnapshotFrom<TLogic> : R extends ActorLogic<infer _, infer __, infer ___, infer ____> ? ReturnType<R['transition']> : R extends ActorScope<infer TSnapshot, infer _, infer __> ? TSnapshot : never : never;
|
|
860
861
|
export type EventFromLogic<TLogic extends ActorLogic<any, any, any, any>> = TLogic extends ActorLogic<infer _, infer TEvent, infer __, infer _____> ? TEvent : never;
|
|
861
|
-
type ResolveEventType<T> = ReturnTypeOrValue<T> extends infer R ? R 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 _TResolvedTypesMeta> ? TEvent : R extends MachineSnapshot<infer _TContext, infer TEvent, infer _TChildren, infer
|
|
862
|
+
type ResolveEventType<T> = ReturnTypeOrValue<T> extends infer R ? R 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 _TResolvedTypesMeta> ? TEvent : R extends MachineSnapshot<infer _TContext, infer TEvent, infer _TChildren, infer _TStateValue, infer _TTag, infer _TOutput> ? TEvent : R extends ActorRef<infer _, infer TEvent> ? TEvent : never : never;
|
|
862
863
|
export type EventFrom<T, K extends Prop<TEvent, 'type'> = never, TEvent extends EventObject = ResolveEventType<T>> = IsNever<K> extends true ? TEvent : ExtractEvent<TEvent, K>;
|
|
863
|
-
export type ContextFrom<T> = ReturnTypeOrValue<T> extends infer R ? R 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
|
|
864
|
+
export type ContextFrom<T> = ReturnTypeOrValue<T> extends infer R ? R 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 _TResolvedTypesMeta> ? TContext : R extends MachineSnapshot<infer TContext, infer _TEvent, infer _TChildren, infer _TStateValue, infer _TTag, infer _TOutput> ? TContext : R extends Actor<infer TActorLogic> ? TActorLogic extends StateMachine<infer TContext, infer _TEvent, infer _TChildren, infer _TActor, infer _TAction, infer _TGuard, infer _TDelay, infer _TTag, infer _TInput, infer _TOutput, infer _TResolvedTypesMeta> ? TContext : never : never : never;
|
|
864
865
|
export type InferEvent<E extends EventObject> = {
|
|
865
866
|
[T in E['type']]: {
|
|
866
867
|
type: T;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as ProcessingStatus, y as resolveReferencedActor, z as createActor, T as cloneMachineSnapshot, U as XSTATE_ERROR, V as createErrorActorEvent, e as evaluateGuard, L as cancel, M as raise, O as spawnChild, Q as stopChild } from './raise-
|
|
1
|
+
import { R as ProcessingStatus, y as resolveReferencedActor, z as createActor, T as cloneMachineSnapshot, U as XSTATE_ERROR, V as createErrorActorEvent, e as evaluateGuard, L as cancel, M as raise, O as spawnChild, Q as stopChild } from './raise-057d17af.development.esm.js';
|
|
2
2
|
|
|
3
3
|
// it's likely-ish that `(TActor & { src: TSrc })['logic']` would be faster
|
|
4
4
|
// but it's only possible to do it since https://github.com/microsoft/TypeScript/pull/53098 (TS 5.1)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var guards_dist_xstateGuards = require('./raise-
|
|
3
|
+
var guards_dist_xstateGuards = require('./raise-3d3d6d51.development.cjs.js');
|
|
4
4
|
|
|
5
5
|
// it's likely-ish that `(TActor & { src: TSrc })['logic']` would be faster
|
|
6
6
|
// but it's only possible to do it since https://github.com/microsoft/TypeScript/pull/53098 (TS 5.1)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var guards_dist_xstateGuards = require('./raise-
|
|
3
|
+
var guards_dist_xstateGuards = require('./raise-5c58eb8e.cjs.js');
|
|
4
4
|
|
|
5
5
|
// it's likely-ish that `(TActor & { src: TSrc })['logic']` would be faster
|
|
6
6
|
// but it's only possible to do it since https://github.com/microsoft/TypeScript/pull/53098 (TS 5.1)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as ProcessingStatus, y as resolveReferencedActor, z as createActor, T as cloneMachineSnapshot, U as XSTATE_ERROR, V as createErrorActorEvent, e as evaluateGuard, L as cancel, M as raise, O as spawnChild, Q as stopChild } from './raise-
|
|
1
|
+
import { R as ProcessingStatus, y as resolveReferencedActor, z as createActor, T as cloneMachineSnapshot, U as XSTATE_ERROR, V as createErrorActorEvent, e as evaluateGuard, L as cancel, M as raise, O as spawnChild, Q as stopChild } from './raise-3b380e4b.esm.js';
|
|
2
2
|
|
|
3
3
|
// it's likely-ish that `(TActor & { src: TSrc })['logic']` would be faster
|
|
4
4
|
// but it's only possible to do it since https://github.com/microsoft/TypeScript/pull/53098 (TS 5.1)
|
|
@@ -986,10 +986,8 @@ class Actor {
|
|
|
986
986
|
* @param logic - The actor logic to create an actor from. For a state machine actor logic creator, see {@link createMachine}. Other actor logic creators include {@link fromCallback}, {@link fromEventObservable}, {@link fromObservable}, {@link fromPromise}, and {@link fromTransition}.
|
|
987
987
|
* @param options - Actor options
|
|
988
988
|
*/
|
|
989
|
-
|
|
990
989
|
function createActor(logic, options) {
|
|
991
|
-
|
|
992
|
-
return interpreter;
|
|
990
|
+
return new Actor(logic, options);
|
|
993
991
|
}
|
|
994
992
|
|
|
995
993
|
/**
|
|
@@ -972,10 +972,8 @@ class Actor {
|
|
|
972
972
|
* @param logic - The actor logic to create an actor from. For a state machine actor logic creator, see {@link createMachine}. Other actor logic creators include {@link fromCallback}, {@link fromEventObservable}, {@link fromObservable}, {@link fromPromise}, and {@link fromTransition}.
|
|
973
973
|
* @param options - Actor options
|
|
974
974
|
*/
|
|
975
|
-
|
|
976
975
|
function createActor(logic, options) {
|
|
977
|
-
|
|
978
|
-
return interpreter;
|
|
976
|
+
return new Actor(logic, options);
|
|
979
977
|
}
|
|
980
978
|
|
|
981
979
|
/**
|
|
@@ -988,10 +988,8 @@ class Actor {
|
|
|
988
988
|
* @param logic - The actor logic to create an actor from. For a state machine actor logic creator, see {@link createMachine}. Other actor logic creators include {@link fromCallback}, {@link fromEventObservable}, {@link fromObservable}, {@link fromPromise}, and {@link fromTransition}.
|
|
989
989
|
* @param options - Actor options
|
|
990
990
|
*/
|
|
991
|
-
|
|
992
991
|
function createActor(logic, options) {
|
|
993
|
-
|
|
994
|
-
return interpreter;
|
|
992
|
+
return new Actor(logic, options);
|
|
995
993
|
}
|
|
996
994
|
|
|
997
995
|
/**
|
|
@@ -974,10 +974,8 @@ class Actor {
|
|
|
974
974
|
* @param logic - The actor logic to create an actor from. For a state machine actor logic creator, see {@link createMachine}. Other actor logic creators include {@link fromCallback}, {@link fromEventObservable}, {@link fromObservable}, {@link fromPromise}, and {@link fromTransition}.
|
|
975
975
|
* @param options - Actor options
|
|
976
976
|
*/
|
|
977
|
-
|
|
978
977
|
function createActor(logic, options) {
|
|
979
|
-
|
|
980
|
-
return interpreter;
|
|
978
|
+
return new Actor(logic, options);
|
|
981
979
|
}
|
|
982
980
|
|
|
983
981
|
/**
|
package/dist/xstate.cjs.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var actors_dist_xstateActors = require('../actors/dist/xstate-actors.cjs.js');
|
|
6
|
-
var guards_dist_xstateGuards = require('./raise-
|
|
7
|
-
var log = require('./log-
|
|
6
|
+
var guards_dist_xstateGuards = require('./raise-5c58eb8e.cjs.js');
|
|
7
|
+
var log = require('./log-2580e864.cjs.js');
|
|
8
8
|
require('../dev/dist/xstate-dev.cjs.js');
|
|
9
9
|
|
|
10
10
|
class SimulatedClock {
|
|
@@ -395,7 +395,7 @@ class StateMachine {
|
|
|
395
395
|
this.id = void 0;
|
|
396
396
|
this.states = void 0;
|
|
397
397
|
this.events = void 0;
|
|
398
|
-
/** @deprecated an internal property acting as a "phantom" type, not
|
|
398
|
+
/** @deprecated an internal property that was acting as a "phantom" type, it's not used by anything right now but it's kept around for compatibility reasons */
|
|
399
399
|
this.__TResolvedTypesMeta = void 0;
|
|
400
400
|
this.id = config.id || '(machine)';
|
|
401
401
|
this.implementations = {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var actors_dist_xstateActors = require('../actors/dist/xstate-actors.development.cjs.js');
|
|
6
|
-
var guards_dist_xstateGuards = require('./raise-
|
|
7
|
-
var log = require('./log-
|
|
6
|
+
var guards_dist_xstateGuards = require('./raise-3d3d6d51.development.cjs.js');
|
|
7
|
+
var log = require('./log-18eb632d.development.cjs.js');
|
|
8
8
|
require('../dev/dist/xstate-dev.development.cjs.js');
|
|
9
9
|
|
|
10
10
|
class SimulatedClock {
|
|
@@ -395,7 +395,7 @@ class StateMachine {
|
|
|
395
395
|
this.id = void 0;
|
|
396
396
|
this.states = void 0;
|
|
397
397
|
this.events = void 0;
|
|
398
|
-
/** @deprecated an internal property acting as a "phantom" type, not
|
|
398
|
+
/** @deprecated an internal property that was acting as a "phantom" type, it's not used by anything right now but it's kept around for compatibility reasons */
|
|
399
399
|
this.__TResolvedTypesMeta = void 0;
|
|
400
400
|
this.id = config.id || '(machine)';
|
|
401
401
|
this.implementations = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { createEmptyActor, fromCallback, fromEventObservable, fromObservable, fromPromise, fromTransition } from '../actors/dist/xstate-actors.development.esm.js';
|
|
2
|
-
import { S as STATE_DELIMITER, m as mapValues, t as toArray, f as formatTransitions, a as toTransitionConfigArray, b as formatTransition, N as NULL_EVENT, e as evaluateGuard, c as createInvokeId, g as getDelayedTransitions, d as formatInitialTransition, h as getCandidates, r as resolveStateValue, i as getAllStateNodes, j as getStateNodes, k as createMachineSnapshot, l as isInFinalState, n as macrostep, o as transitionNode, p as resolveActionsAndContext, q as createInitEvent, s as microstep, u as getInitialStateNodes, v as isStateId, w as getStateNodeByPath, x as getPersistedSnapshot, y as resolveReferencedActor, z as createActor, $ as $$ACTOR_TYPE } from './raise-
|
|
3
|
-
export { A as Actor, H as __unsafe_getAllOwnEventDescriptors, D as and, L as cancel, z as createActor, j as getStateNodes, B as interpret, C as isMachineSnapshot, I as matchesState, E as not, F as or, J as pathToStateValue, M as raise, O as spawnChild, G as stateIn, P as stop, Q as stopChild, K as toObserver } from './raise-
|
|
4
|
-
import { a as assign } from './log-
|
|
5
|
-
export { S as SpecialTargets, a as assign, e as enqueueActions, f as forwardTo, l as log, s as sendParent, b as sendTo } from './log-
|
|
2
|
+
import { S as STATE_DELIMITER, m as mapValues, t as toArray, f as formatTransitions, a as toTransitionConfigArray, b as formatTransition, N as NULL_EVENT, e as evaluateGuard, c as createInvokeId, g as getDelayedTransitions, d as formatInitialTransition, h as getCandidates, r as resolveStateValue, i as getAllStateNodes, j as getStateNodes, k as createMachineSnapshot, l as isInFinalState, n as macrostep, o as transitionNode, p as resolveActionsAndContext, q as createInitEvent, s as microstep, u as getInitialStateNodes, v as isStateId, w as getStateNodeByPath, x as getPersistedSnapshot, y as resolveReferencedActor, z as createActor, $ as $$ACTOR_TYPE } from './raise-057d17af.development.esm.js';
|
|
3
|
+
export { A as Actor, H as __unsafe_getAllOwnEventDescriptors, D as and, L as cancel, z as createActor, j as getStateNodes, B as interpret, C as isMachineSnapshot, I as matchesState, E as not, F as or, J as pathToStateValue, M as raise, O as spawnChild, G as stateIn, P as stop, Q as stopChild, K as toObserver } from './raise-057d17af.development.esm.js';
|
|
4
|
+
import { a as assign } from './log-11038f00.development.esm.js';
|
|
5
|
+
export { S as SpecialTargets, a as assign, e as enqueueActions, f as forwardTo, l as log, s as sendParent, b as sendTo } from './log-11038f00.development.esm.js';
|
|
6
6
|
import '../dev/dist/xstate-dev.development.esm.js';
|
|
7
7
|
|
|
8
8
|
class SimulatedClock {
|
|
@@ -393,7 +393,7 @@ class StateMachine {
|
|
|
393
393
|
this.id = void 0;
|
|
394
394
|
this.states = void 0;
|
|
395
395
|
this.events = void 0;
|
|
396
|
-
/** @deprecated an internal property acting as a "phantom" type, not
|
|
396
|
+
/** @deprecated an internal property that was acting as a "phantom" type, it's not used by anything right now but it's kept around for compatibility reasons */
|
|
397
397
|
this.__TResolvedTypesMeta = void 0;
|
|
398
398
|
this.id = config.id || '(machine)';
|
|
399
399
|
this.implementations = {
|
package/dist/xstate.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { createEmptyActor, fromCallback, fromEventObservable, fromObservable, fromPromise, fromTransition } from '../actors/dist/xstate-actors.esm.js';
|
|
2
|
-
import { S as STATE_DELIMITER, m as mapValues, t as toArray, f as formatTransitions, a as toTransitionConfigArray, b as formatTransition, N as NULL_EVENT, e as evaluateGuard, c as createInvokeId, g as getDelayedTransitions, d as formatInitialTransition, h as getCandidates, r as resolveStateValue, i as getAllStateNodes, j as getStateNodes, k as createMachineSnapshot, l as isInFinalState, n as macrostep, o as transitionNode, p as resolveActionsAndContext, q as createInitEvent, s as microstep, u as getInitialStateNodes, v as isStateId, w as getStateNodeByPath, x as getPersistedSnapshot, y as resolveReferencedActor, z as createActor, $ as $$ACTOR_TYPE } from './raise-
|
|
3
|
-
export { A as Actor, H as __unsafe_getAllOwnEventDescriptors, D as and, L as cancel, z as createActor, j as getStateNodes, B as interpret, C as isMachineSnapshot, I as matchesState, E as not, F as or, J as pathToStateValue, M as raise, O as spawnChild, G as stateIn, P as stop, Q as stopChild, K as toObserver } from './raise-
|
|
4
|
-
import { a as assign } from './log-
|
|
5
|
-
export { S as SpecialTargets, a as assign, e as enqueueActions, f as forwardTo, l as log, s as sendParent, b as sendTo } from './log-
|
|
2
|
+
import { S as STATE_DELIMITER, m as mapValues, t as toArray, f as formatTransitions, a as toTransitionConfigArray, b as formatTransition, N as NULL_EVENT, e as evaluateGuard, c as createInvokeId, g as getDelayedTransitions, d as formatInitialTransition, h as getCandidates, r as resolveStateValue, i as getAllStateNodes, j as getStateNodes, k as createMachineSnapshot, l as isInFinalState, n as macrostep, o as transitionNode, p as resolveActionsAndContext, q as createInitEvent, s as microstep, u as getInitialStateNodes, v as isStateId, w as getStateNodeByPath, x as getPersistedSnapshot, y as resolveReferencedActor, z as createActor, $ as $$ACTOR_TYPE } from './raise-3b380e4b.esm.js';
|
|
3
|
+
export { A as Actor, H as __unsafe_getAllOwnEventDescriptors, D as and, L as cancel, z as createActor, j as getStateNodes, B as interpret, C as isMachineSnapshot, I as matchesState, E as not, F as or, J as pathToStateValue, M as raise, O as spawnChild, G as stateIn, P as stop, Q as stopChild, K as toObserver } from './raise-3b380e4b.esm.js';
|
|
4
|
+
import { a as assign } from './log-88b333eb.esm.js';
|
|
5
|
+
export { S as SpecialTargets, a as assign, e as enqueueActions, f as forwardTo, l as log, s as sendParent, b as sendTo } from './log-88b333eb.esm.js';
|
|
6
6
|
import '../dev/dist/xstate-dev.esm.js';
|
|
7
7
|
|
|
8
8
|
class SimulatedClock {
|
|
@@ -393,7 +393,7 @@ class StateMachine {
|
|
|
393
393
|
this.id = void 0;
|
|
394
394
|
this.states = void 0;
|
|
395
395
|
this.events = void 0;
|
|
396
|
-
/** @deprecated an internal property acting as a "phantom" type, not
|
|
396
|
+
/** @deprecated an internal property that was acting as a "phantom" type, it's not used by anything right now but it's kept around for compatibility reasons */
|
|
397
397
|
this.__TResolvedTypesMeta = void 0;
|
|
398
398
|
this.id = config.id || '(machine)';
|
|
399
399
|
this.implementations = {
|