xstate 5.7.1 → 5.8.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/dist/declarations/src/actions/assign.d.ts +3 -3
- package/dist/declarations/src/actions/enqueueActions.d.ts +4 -4
- package/dist/declarations/src/actions/raise.d.ts +2 -2
- package/dist/declarations/src/actions/send.d.ts +4 -4
- package/dist/declarations/src/actions/spawnChild.d.ts +2 -2
- package/dist/declarations/src/setup.d.ts +9 -7
- package/dist/{log-9b34dd45.development.cjs.js → log-3f27f22f.development.cjs.js} +7 -3
- package/dist/{log-f78f0918.esm.js → log-666fd90a.esm.js} +7 -3
- package/dist/{log-c2d7ade7.cjs.js → log-caeb9fa9.cjs.js} +7 -3
- package/dist/{log-dc9ca1e2.development.esm.js → log-d6ba5166.development.esm.js} +7 -3
- package/dist/{raise-4593d184.development.esm.js → raise-3f85f1d9.development.esm.js} +3 -3
- package/dist/{raise-0ce4ccae.development.cjs.js → raise-7132462e.development.cjs.js} +3 -3
- package/dist/{raise-6420fe44.esm.js → raise-a7ab421f.esm.js} +3 -3
- package/dist/{raise-932934e8.cjs.js → raise-af6a698b.cjs.js} +3 -3
- package/dist/xstate.cjs.js +2 -2
- package/dist/xstate.development.cjs.js +3 -3
- package/dist/xstate.development.esm.js +5 -5
- package/dist/xstate.esm.js +4 -4
- package/dist/xstate.umd.min.js +1 -1
- 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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var guards_dist_xstateGuards = require('../../dist/raise-
|
|
5
|
+
var guards_dist_xstateGuards = require('../../dist/raise-af6a698b.cjs.js');
|
|
6
6
|
require('../../dev/dist/xstate-dev.cjs.js');
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var guards_dist_xstateGuards = require('../../dist/raise-
|
|
5
|
+
var guards_dist_xstateGuards = require('../../dist/raise-7132462e.development.cjs.js');
|
|
6
6
|
require('../../dev/dist/xstate-dev.development.cjs.js');
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Spawner } from "../spawn.js";
|
|
2
|
-
import type { ActionArgs, AnyEventObject, Assigner, EventObject, LowInfer, MachineContext, ParameterizedObject, PropertyAssigner, ProvidedActor } from "../types.js";
|
|
2
|
+
import type { ActionArgs, AnyEventObject, Assigner, EventObject, LowInfer, MachineContext, ParameterizedObject, PropertyAssigner, ProvidedActor, ActionFunction } from "../types.js";
|
|
3
3
|
export interface AssignArgs<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject, TActor extends ProvidedActor> extends ActionArgs<TContext, TExpressionEvent, TEvent> {
|
|
4
4
|
spawn: Spawner<TActor>;
|
|
5
5
|
}
|
|
@@ -39,5 +39,5 @@ export interface AssignAction<TContext extends MachineContext, TExpressionEvent
|
|
|
39
39
|
});
|
|
40
40
|
```
|
|
41
41
|
*/
|
|
42
|
-
export declare function assign<TContext extends MachineContext, TExpressionEvent extends AnyEventObject
|
|
43
|
-
TParams extends ParameterizedObject['params'] | undefined
|
|
42
|
+
export declare function assign<TContext extends MachineContext, TExpressionEvent extends AnyEventObject, // TODO: consider using a stricter `EventObject` here
|
|
43
|
+
TParams extends ParameterizedObject['params'] | undefined, TEvent extends EventObject, TActor extends ProvidedActor>(assignment: Assigner<LowInfer<TContext>, TExpressionEvent, TParams, TEvent, TActor> | PropertyAssigner<LowInfer<TContext>, TExpressionEvent, TParams, TEvent, TActor>): ActionFunction<TContext, TExpressionEvent, TEvent, TParams, TActor, never, never, never>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Guard } from "../guards.js";
|
|
2
|
-
import { Action, ActionArgs, AnyActorRef, EventObject, MachineContext, ParameterizedObject, ProvidedActor, UnifiedArg } from "../types.js";
|
|
2
|
+
import { Action, ActionArgs, ActionFunction, AnyActorRef, EventObject, MachineContext, ParameterizedObject, ProvidedActor, UnifiedArg } from "../types.js";
|
|
3
3
|
import { assign } from "./assign.js";
|
|
4
4
|
import { cancel } from "./cancel.js";
|
|
5
5
|
import { raise } from "./raise.js";
|
|
@@ -10,8 +10,8 @@ interface ActionEnqueuer<TContext extends MachineContext, TExpressionEvent exten
|
|
|
10
10
|
(action: Action<TContext, TExpressionEvent, TEvent, undefined, TActor, TAction, TGuard, TDelay>): void;
|
|
11
11
|
assign: (...args: Parameters<typeof assign<TContext, TExpressionEvent, undefined, TEvent, TActor>>) => void;
|
|
12
12
|
cancel: (...args: Parameters<typeof cancel<TContext, TExpressionEvent, undefined, TEvent>>) => void;
|
|
13
|
-
raise: (...args: Parameters<typeof raise<TContext, TExpressionEvent, TEvent, undefined, TDelay>>) => void;
|
|
14
|
-
sendTo: <TTargetActor extends AnyActorRef>(...args: Parameters<typeof sendTo<TContext, TExpressionEvent, undefined, TTargetActor, TEvent, TDelay>>) => void;
|
|
13
|
+
raise: (...args: Parameters<typeof raise<TContext, TExpressionEvent, TEvent, undefined, TDelay, TDelay>>) => void;
|
|
14
|
+
sendTo: <TTargetActor extends AnyActorRef>(...args: Parameters<typeof sendTo<TContext, TExpressionEvent, undefined, TTargetActor, TEvent, TDelay, TDelay>>) => void;
|
|
15
15
|
spawnChild: (...args: Parameters<typeof spawnChild<TContext, TExpressionEvent, undefined, TEvent, TActor>>) => void;
|
|
16
16
|
stopChild: (...args: Parameters<typeof stopChild<TContext, TExpressionEvent, undefined, TEvent>>) => void;
|
|
17
17
|
}
|
|
@@ -48,5 +48,5 @@ type CollectActions<TContext extends MachineContext, TExpressionEvent extends Ev
|
|
|
48
48
|
})
|
|
49
49
|
```
|
|
50
50
|
*/
|
|
51
|
-
export declare function enqueueActions<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject = TExpressionEvent, TActor extends ProvidedActor = ProvidedActor, TAction extends ParameterizedObject = ParameterizedObject, TGuard extends ParameterizedObject = ParameterizedObject, TDelay extends string =
|
|
51
|
+
export declare function enqueueActions<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject = TExpressionEvent, TActor extends ProvidedActor = ProvidedActor, TAction extends ParameterizedObject = ParameterizedObject, TGuard extends ParameterizedObject = ParameterizedObject, TDelay extends string = never>(collect: CollectActions<TContext, TExpressionEvent, TEvent, TActor, TAction, TGuard, TDelay>): ActionFunction<TContext, TExpressionEvent, TEvent, unknown, TActor, TAction, TGuard, TDelay>;
|
|
52
52
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionArgs, EventObject, MachineContext, NoInfer, RaiseActionOptions, SendExpr
|
|
1
|
+
import { ActionArgs, ActionFunction, EventObject, MachineContext, NoInfer, 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;
|
|
@@ -10,4 +10,4 @@ export interface RaiseAction<TContext extends MachineContext, TExpressionEvent e
|
|
|
10
10
|
*
|
|
11
11
|
* @param eventType The event to raise.
|
|
12
12
|
*/
|
|
13
|
-
export declare function raise<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject
|
|
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: NoInfer<TEvent> | SendExpr<TContext, TExpressionEvent, TParams, NoInfer<TEvent>, TEvent>, options?: RaiseActionOptions<TContext, TExpressionEvent, TParams, NoInfer<TEvent>, TUsedDelay>): ActionFunction<TContext, TExpressionEvent, TEvent, TParams, never, never, never, TDelay>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionArgs, ActorRef, AnyActorRef, AnyEventObject, Cast, EventFrom, EventObject, InferEvent, MachineContext, NoInfer, ParameterizedObject, SendExpr, SendToActionOptions } from "../types.js";
|
|
1
|
+
import { ActionArgs, ActionFunction, ActorRef, AnyActorRef, AnyEventObject, Cast, EventFrom, EventObject, InferEvent, MachineContext, NoInfer, 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;
|
|
@@ -12,14 +12,14 @@ export interface SendToAction<TContext extends MachineContext, TExpressionEvent
|
|
|
12
12
|
* - `id` - The unique send event identifier (used with `cancel()`).
|
|
13
13
|
* - `delay` - The number of milliseconds to delay the sending of the event.
|
|
14
14
|
*/
|
|
15
|
-
export declare function sendTo<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TTargetActor extends AnyActorRef, TEvent extends EventObject, TDelay extends string>(to: TTargetActor | string | ((args: ActionArgs<TContext, TExpressionEvent, TEvent>, params: TParams) => TTargetActor | string), eventOrExpr: EventFrom<TTargetActor> | SendExpr<TContext, TExpressionEvent, TParams, InferEvent<Cast<EventFrom<TTargetActor>, EventObject>>, TEvent>, options?: SendToActionOptions<TContext, TExpressionEvent, TParams, NoInfer<TEvent>,
|
|
15
|
+
export declare function sendTo<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TTargetActor extends AnyActorRef, TEvent extends EventObject, TDelay extends string = never, TUsedDelay extends TDelay = never>(to: TTargetActor | string | ((args: ActionArgs<TContext, TExpressionEvent, TEvent>, params: TParams) => TTargetActor | string), eventOrExpr: EventFrom<TTargetActor> | SendExpr<TContext, TExpressionEvent, TParams, InferEvent<Cast<EventFrom<TTargetActor>, EventObject>>, TEvent>, options?: SendToActionOptions<TContext, TExpressionEvent, TParams, NoInfer<TEvent>, TUsedDelay>): ActionFunction<TContext, TExpressionEvent, TEvent, TParams, never, never, never, TDelay>;
|
|
16
16
|
/**
|
|
17
17
|
* Sends an event to this machine's parent.
|
|
18
18
|
*
|
|
19
19
|
* @param event The event to send to the parent machine.
|
|
20
20
|
* @param options Options to pass into the send event.
|
|
21
21
|
*/
|
|
22
|
-
export declare function sendParent<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TSentEvent extends EventObject = AnyEventObject, TEvent extends EventObject = AnyEventObject, TDelay extends string = string>(event: TSentEvent | SendExpr<TContext, TExpressionEvent, TParams, TSentEvent, TEvent>, options?: SendToActionOptions<TContext, TExpressionEvent, TParams, TEvent, TDelay>):
|
|
22
|
+
export declare function sendParent<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TSentEvent extends EventObject = AnyEventObject, TEvent extends EventObject = AnyEventObject, TDelay extends string = string>(event: TSentEvent | SendExpr<TContext, TExpressionEvent, TParams, TSentEvent, TEvent>, options?: SendToActionOptions<TContext, TExpressionEvent, TParams, TEvent, TDelay>): ActionFunction<TContext, TExpressionEvent, TEvent, TParams, never, never, never, TDelay>;
|
|
23
23
|
type Target<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TEvent extends EventObject> = string | ActorRef<any, any> | ((args: ActionArgs<TContext, TExpressionEvent, TEvent>, params: TParams) => string | ActorRef<any, any>);
|
|
24
24
|
/**
|
|
25
25
|
* Forwards (sends) an event to the `target` actor.
|
|
@@ -27,5 +27,5 @@ type Target<TContext extends MachineContext, TExpressionEvent extends EventObjec
|
|
|
27
27
|
* @param target The target actor to forward the event to.
|
|
28
28
|
* @param options Options to pass into the send action creator.
|
|
29
29
|
*/
|
|
30
|
-
export declare function forwardTo<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TEvent extends EventObject, TDelay extends string>(target: Target<TContext, TExpressionEvent, TParams, TEvent>, options?: SendToActionOptions<TContext, TExpressionEvent, TParams, TEvent, TDelay>):
|
|
30
|
+
export declare function forwardTo<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TEvent extends EventObject, TDelay extends string>(target: Target<TContext, TExpressionEvent, TParams, TEvent>, options?: SendToActionOptions<TContext, TExpressionEvent, TParams, TEvent, TDelay>): ActionFunction<TContext, TExpressionEvent, TEvent, TParams, never, never, never, TDelay>;
|
|
31
31
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionArgs,
|
|
1
|
+
import { ActionArgs, ActionFunction, AnyActorLogic, ConditionalRequired, EventObject, InputFrom, IsLiteralString, IsNotNever, MachineContext, Mapper, ParameterizedObject, ProvidedActor, RequiredActorOptions, UnifiedArg } from "../types.js";
|
|
2
2
|
type ResolvableActorId<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject, TId extends string | undefined> = TId | ((args: UnifiedArg<TContext, TExpressionEvent, TEvent>) => TId);
|
|
3
3
|
export interface SpawnAction<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TEvent extends EventObject, TActor extends ProvidedActor> {
|
|
4
4
|
(args: ActionArgs<TContext, TExpressionEvent, TEvent>, params: TParams): void;
|
|
@@ -25,5 +25,5 @@ type SpawnArguments<TContext extends MachineContext, TExpressionEvent extends Ev
|
|
|
25
25
|
syncSnapshot?: boolean;
|
|
26
26
|
}
|
|
27
27
|
];
|
|
28
|
-
export declare function spawnChild<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TEvent extends EventObject, TActor extends ProvidedActor>(...[src, { id, systemId, input, syncSnapshot }]: SpawnArguments<TContext, TExpressionEvent, TEvent, TActor>):
|
|
28
|
+
export declare function spawnChild<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TEvent extends EventObject, TActor extends ProvidedActor>(...[src, { id, systemId, input, syncSnapshot }]: SpawnArguments<TContext, TExpressionEvent, TEvent, TActor>): ActionFunction<TContext, TExpressionEvent, TEvent, TParams, TActor, never, never, never>;
|
|
29
29
|
export {};
|
|
@@ -2,17 +2,16 @@ import { StateMachine } from "./StateMachine.js";
|
|
|
2
2
|
import { GuardPredicate } from "./guards.js";
|
|
3
3
|
import { ResolveTypegenMeta, TypegenDisabled } from "./typegenTypes.js";
|
|
4
4
|
import { ActionFunction, AnyActorRef, AnyEventObject, Cast, ConditionalRequired, DelayConfig, Invert, IsNever, MachineConfig, MachineContext, NonReducibleUnknown, ParameterizedObject, SetupTypes, StateSchema, ToChildren, UnknownActorLogic, Values } from "./types.js";
|
|
5
|
-
type ToParameterizedObject<TParameterizedMap extends Record<string, ParameterizedObject['params'] | undefined>> = Values<{
|
|
5
|
+
type ToParameterizedObject<TParameterizedMap extends Record<string, ParameterizedObject['params'] | undefined>> = IsNever<TParameterizedMap> extends true ? never : Values<{
|
|
6
6
|
[K in keyof TParameterizedMap & string]: {
|
|
7
7
|
type: K;
|
|
8
8
|
params: TParameterizedMap[K];
|
|
9
9
|
};
|
|
10
10
|
}>;
|
|
11
|
-
type
|
|
12
|
-
|
|
13
|
-
[K in keyof TResolvedActors & string]: {
|
|
11
|
+
type ToProvidedActor<TChildrenMap extends Record<string, string>, TActors extends Record<string, UnknownActorLogic>> = IsNever<TActors> extends true ? never : Values<{
|
|
12
|
+
[K in keyof TActors & string]: {
|
|
14
13
|
src: K;
|
|
15
|
-
logic:
|
|
14
|
+
logic: TActors[K];
|
|
16
15
|
id: IsNever<TChildrenMap> extends true ? string | undefined : K extends keyof Invert<TChildrenMap> ? Invert<TChildrenMap>[K] & string : string | undefined;
|
|
17
16
|
};
|
|
18
17
|
}>;
|
|
@@ -32,12 +31,13 @@ type ToStateValue<T extends StateSchema> = T extends {
|
|
|
32
31
|
}, T extends {
|
|
33
32
|
type: 'parallel';
|
|
34
33
|
} ? true : false> : never) : {};
|
|
34
|
+
type RequiredSetupKeys<TChildrenMap> = IsNever<keyof TChildrenMap> extends true ? never : 'actors';
|
|
35
35
|
export declare function setup<TContext extends MachineContext, TEvent extends AnyEventObject, // TODO: consider using a stricter `EventObject` here
|
|
36
|
-
TActors extends Record<
|
|
36
|
+
TActors extends Record<string, UnknownActorLogic> = {}, TChildrenMap extends Record<string, string> = {}, TActions extends Record<string, ParameterizedObject['params'] | undefined> = {}, TGuards extends Record<string, ParameterizedObject['params'] | undefined> = {}, TDelay extends string = never, TTag extends string = string, TInput = NonReducibleUnknown, TOutput extends NonReducibleUnknown = NonReducibleUnknown>({ schemas, actors, actions, guards, delays }: {
|
|
37
37
|
schemas?: unknown;
|
|
38
38
|
types?: SetupTypes<TContext, TEvent, TChildrenMap, TTag, TInput, TOutput>;
|
|
39
39
|
actors?: {
|
|
40
|
-
[K in keyof TActors]: TActors[K];
|
|
40
|
+
[K in keyof TActors | Values<TChildrenMap>]: K extends keyof TActors ? TActors[K] : never;
|
|
41
41
|
};
|
|
42
42
|
actions?: {
|
|
43
43
|
[K in keyof TActions]: ActionFunction<TContext, TEvent, TEvent, TActions[K], ToProvidedActor<TChildrenMap, TActors>, ToParameterizedObject<TActions>, ToParameterizedObject<TGuards>, TDelay>;
|
|
@@ -48,6 +48,8 @@ TActors extends Record<Values<TChildrenMap>, UnknownActorLogic>, TActions extend
|
|
|
48
48
|
delays?: {
|
|
49
49
|
[K in TDelay]: DelayConfig<TContext, TEvent, ToParameterizedObject<TActions>['params'], TEvent>;
|
|
50
50
|
};
|
|
51
|
+
} & {
|
|
52
|
+
[K in RequiredSetupKeys<TChildrenMap>]: unknown;
|
|
51
53
|
}): {
|
|
52
54
|
createMachine: <const TConfig extends MachineConfig<TContext, TEvent, ToProvidedActor<TChildrenMap, TActors>, ToParameterizedObject<TActions>, ToParameterizedObject<TGuards>, TDelay, TTag, TInput, TOutput, ResolveTypegenMeta<TypegenDisabled, TEvent, ToProvidedActor<TChildrenMap, TActors>, ToParameterizedObject<TActions>, ToParameterizedObject<TGuards>, TDelay, TTag>>>(config: TConfig) => StateMachine<TContext, TEvent, Cast<ToChildren<ToProvidedActor<TChildrenMap, TActors>>, Record<string, AnyActorRef | undefined>>, ToProvidedActor<TChildrenMap, TActors>, ToParameterizedObject<TActions>, ToParameterizedObject<TGuards>, TDelay, ToStateValue<TConfig>, TTag, TInput, TOutput, ResolveTypegenMeta<TypegenDisabled, TEvent, ToProvidedActor<TChildrenMap, TActors>, ToParameterizedObject<TActions>, ToParameterizedObject<TGuards>, TDelay, TTag>>;
|
|
53
55
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var guards_dist_xstateGuards = require('./raise-
|
|
3
|
+
var guards_dist_xstateGuards = require('./raise-7132462e.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)
|
|
@@ -95,7 +95,7 @@ function resolveAssign(actorScope, snapshot, actionArgs, actionParams, {
|
|
|
95
95
|
*
|
|
96
96
|
* @param assignment An object that represents the partial context to update, or a
|
|
97
97
|
* function that returns an object that represents the partial context to update.
|
|
98
|
-
*
|
|
98
|
+
*
|
|
99
99
|
* @example
|
|
100
100
|
```ts
|
|
101
101
|
import { createMachine, assign } from 'xstate';
|
|
@@ -341,9 +341,13 @@ function resolveEnqueueActions(actorScope, snapshot, args, _actionParams, {
|
|
|
341
341
|
actions.push(guards_dist_xstateGuards.cancel(...args));
|
|
342
342
|
};
|
|
343
343
|
enqueue.raise = (...args) => {
|
|
344
|
+
// for some reason it fails to infer `TDelay` from `...args` here and infers `picks` its default (`never`)
|
|
345
|
+
// then it fails to typecheck that because `...args` use `string` in place of `TDelay`
|
|
344
346
|
actions.push(guards_dist_xstateGuards.raise(...args));
|
|
345
347
|
};
|
|
346
348
|
enqueue.sendTo = (...args) => {
|
|
349
|
+
// for some reason it fails to infer `TDelay` from `...args` here and infers `picks` its default (`never`)
|
|
350
|
+
// then it fails to typecheck that because `...args` use `string` in place of `TDelay
|
|
347
351
|
actions.push(sendTo(...args));
|
|
348
352
|
};
|
|
349
353
|
enqueue.spawnChild = (...args) => {
|
|
@@ -364,7 +368,7 @@ function resolveEnqueueActions(actorScope, snapshot, args, _actionParams, {
|
|
|
364
368
|
}
|
|
365
369
|
/**
|
|
366
370
|
* Creates an action object that will execute actions that are queued by the `enqueue(action)` function.
|
|
367
|
-
*
|
|
371
|
+
*
|
|
368
372
|
* @example
|
|
369
373
|
```ts
|
|
370
374
|
import { createMachine, enqueueActions } from 'xstate';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as ProcessingStatus, z as resolveReferencedActor, A as createActor, U as cloneMachineSnapshot, V as XSTATE_ERROR, W as createErrorActorEvent, e as evaluateGuard, M as cancel, O as raise, P as spawnChild, R as stopChild } from './raise-
|
|
1
|
+
import { T as ProcessingStatus, z as resolveReferencedActor, A as createActor, U as cloneMachineSnapshot, V as XSTATE_ERROR, W as createErrorActorEvent, e as evaluateGuard, M as cancel, O as raise, P as spawnChild, R as stopChild } from './raise-a7ab421f.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)
|
|
@@ -93,7 +93,7 @@ function resolveAssign(actorScope, snapshot, actionArgs, actionParams, {
|
|
|
93
93
|
*
|
|
94
94
|
* @param assignment An object that represents the partial context to update, or a
|
|
95
95
|
* function that returns an object that represents the partial context to update.
|
|
96
|
-
*
|
|
96
|
+
*
|
|
97
97
|
* @example
|
|
98
98
|
```ts
|
|
99
99
|
import { createMachine, assign } from 'xstate';
|
|
@@ -323,9 +323,13 @@ function resolveEnqueueActions(actorScope, snapshot, args, _actionParams, {
|
|
|
323
323
|
actions.push(cancel(...args));
|
|
324
324
|
};
|
|
325
325
|
enqueue.raise = (...args) => {
|
|
326
|
+
// for some reason it fails to infer `TDelay` from `...args` here and infers `picks` its default (`never`)
|
|
327
|
+
// then it fails to typecheck that because `...args` use `string` in place of `TDelay`
|
|
326
328
|
actions.push(raise(...args));
|
|
327
329
|
};
|
|
328
330
|
enqueue.sendTo = (...args) => {
|
|
331
|
+
// for some reason it fails to infer `TDelay` from `...args` here and infers `picks` its default (`never`)
|
|
332
|
+
// then it fails to typecheck that because `...args` use `string` in place of `TDelay
|
|
329
333
|
actions.push(sendTo(...args));
|
|
330
334
|
};
|
|
331
335
|
enqueue.spawnChild = (...args) => {
|
|
@@ -346,7 +350,7 @@ function resolveEnqueueActions(actorScope, snapshot, args, _actionParams, {
|
|
|
346
350
|
}
|
|
347
351
|
/**
|
|
348
352
|
* Creates an action object that will execute actions that are queued by the `enqueue(action)` function.
|
|
349
|
-
*
|
|
353
|
+
*
|
|
350
354
|
* @example
|
|
351
355
|
```ts
|
|
352
356
|
import { createMachine, enqueueActions } from 'xstate';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var guards_dist_xstateGuards = require('./raise-
|
|
3
|
+
var guards_dist_xstateGuards = require('./raise-af6a698b.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)
|
|
@@ -95,7 +95,7 @@ function resolveAssign(actorScope, snapshot, actionArgs, actionParams, {
|
|
|
95
95
|
*
|
|
96
96
|
* @param assignment An object that represents the partial context to update, or a
|
|
97
97
|
* function that returns an object that represents the partial context to update.
|
|
98
|
-
*
|
|
98
|
+
*
|
|
99
99
|
* @example
|
|
100
100
|
```ts
|
|
101
101
|
import { createMachine, assign } from 'xstate';
|
|
@@ -325,9 +325,13 @@ function resolveEnqueueActions(actorScope, snapshot, args, _actionParams, {
|
|
|
325
325
|
actions.push(guards_dist_xstateGuards.cancel(...args));
|
|
326
326
|
};
|
|
327
327
|
enqueue.raise = (...args) => {
|
|
328
|
+
// for some reason it fails to infer `TDelay` from `...args` here and infers `picks` its default (`never`)
|
|
329
|
+
// then it fails to typecheck that because `...args` use `string` in place of `TDelay`
|
|
328
330
|
actions.push(guards_dist_xstateGuards.raise(...args));
|
|
329
331
|
};
|
|
330
332
|
enqueue.sendTo = (...args) => {
|
|
333
|
+
// for some reason it fails to infer `TDelay` from `...args` here and infers `picks` its default (`never`)
|
|
334
|
+
// then it fails to typecheck that because `...args` use `string` in place of `TDelay
|
|
331
335
|
actions.push(sendTo(...args));
|
|
332
336
|
};
|
|
333
337
|
enqueue.spawnChild = (...args) => {
|
|
@@ -348,7 +352,7 @@ function resolveEnqueueActions(actorScope, snapshot, args, _actionParams, {
|
|
|
348
352
|
}
|
|
349
353
|
/**
|
|
350
354
|
* Creates an action object that will execute actions that are queued by the `enqueue(action)` function.
|
|
351
|
-
*
|
|
355
|
+
*
|
|
352
356
|
* @example
|
|
353
357
|
```ts
|
|
354
358
|
import { createMachine, enqueueActions } from 'xstate';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as ProcessingStatus, z as resolveReferencedActor, A as createActor, U as cloneMachineSnapshot, V as XSTATE_ERROR, W as createErrorActorEvent, e as evaluateGuard, M as cancel, O as raise, P as spawnChild, R as stopChild } from './raise-
|
|
1
|
+
import { T as ProcessingStatus, z as resolveReferencedActor, A as createActor, U as cloneMachineSnapshot, V as XSTATE_ERROR, W as createErrorActorEvent, e as evaluateGuard, M as cancel, O as raise, P as spawnChild, R as stopChild } from './raise-3f85f1d9.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)
|
|
@@ -93,7 +93,7 @@ function resolveAssign(actorScope, snapshot, actionArgs, actionParams, {
|
|
|
93
93
|
*
|
|
94
94
|
* @param assignment An object that represents the partial context to update, or a
|
|
95
95
|
* function that returns an object that represents the partial context to update.
|
|
96
|
-
*
|
|
96
|
+
*
|
|
97
97
|
* @example
|
|
98
98
|
```ts
|
|
99
99
|
import { createMachine, assign } from 'xstate';
|
|
@@ -339,9 +339,13 @@ function resolveEnqueueActions(actorScope, snapshot, args, _actionParams, {
|
|
|
339
339
|
actions.push(cancel(...args));
|
|
340
340
|
};
|
|
341
341
|
enqueue.raise = (...args) => {
|
|
342
|
+
// for some reason it fails to infer `TDelay` from `...args` here and infers `picks` its default (`never`)
|
|
343
|
+
// then it fails to typecheck that because `...args` use `string` in place of `TDelay`
|
|
342
344
|
actions.push(raise(...args));
|
|
343
345
|
};
|
|
344
346
|
enqueue.sendTo = (...args) => {
|
|
347
|
+
// for some reason it fails to infer `TDelay` from `...args` here and infers `picks` its default (`never`)
|
|
348
|
+
// then it fails to typecheck that because `...args` use `string` in place of `TDelay
|
|
345
349
|
actions.push(sendTo(...args));
|
|
346
350
|
};
|
|
347
351
|
enqueue.spawnChild = (...args) => {
|
|
@@ -362,7 +366,7 @@ function resolveEnqueueActions(actorScope, snapshot, args, _actionParams, {
|
|
|
362
366
|
}
|
|
363
367
|
/**
|
|
364
368
|
* Creates an action object that will execute actions that are queued by the `enqueue(action)` function.
|
|
365
|
-
*
|
|
369
|
+
*
|
|
366
370
|
* @example
|
|
367
371
|
```ts
|
|
368
372
|
import { createMachine, enqueueActions } from 'xstate';
|
|
@@ -2026,10 +2026,10 @@ function microstep(transitions, currentSnapshot, actorScope, event, isInitial, i
|
|
|
2026
2026
|
}
|
|
2027
2027
|
}
|
|
2028
2028
|
function getMachineOutput(snapshot, event, actorScope, rootNode, rootCompletionNode) {
|
|
2029
|
-
if (
|
|
2029
|
+
if (rootNode.output === undefined) {
|
|
2030
2030
|
return;
|
|
2031
2031
|
}
|
|
2032
|
-
const doneStateEvent = createDoneStateEvent(rootCompletionNode.id, rootCompletionNode.output && rootCompletionNode.parent ? resolveOutput(rootCompletionNode.output, snapshot.context, event, actorScope.self) : undefined);
|
|
2032
|
+
const doneStateEvent = createDoneStateEvent(rootCompletionNode.id, rootCompletionNode.output !== undefined && rootCompletionNode.parent ? resolveOutput(rootCompletionNode.output, snapshot.context, event, actorScope.self) : undefined);
|
|
2033
2033
|
return resolveOutput(rootNode.output, snapshot.context, doneStateEvent, actorScope.self);
|
|
2034
2034
|
}
|
|
2035
2035
|
function enterStates(currentSnapshot, event, actorScope, filteredTransitions, mutStateNodeSet, internalQueue, historyValue, isInitial) {
|
|
@@ -2068,7 +2068,7 @@ function enterStates(currentSnapshot, event, actorScope, filteredTransitions, mu
|
|
|
2068
2068
|
let ancestorMarker = parent?.type === 'parallel' ? parent : parent?.parent;
|
|
2069
2069
|
let rootCompletionNode = ancestorMarker || stateNodeToEnter;
|
|
2070
2070
|
if (parent?.type === 'compound') {
|
|
2071
|
-
internalQueue.push(createDoneStateEvent(parent.id, stateNodeToEnter.output ? resolveOutput(stateNodeToEnter.output, nextSnapshot.context, event, actorScope.self) : undefined));
|
|
2071
|
+
internalQueue.push(createDoneStateEvent(parent.id, stateNodeToEnter.output !== undefined ? resolveOutput(stateNodeToEnter.output, nextSnapshot.context, event, actorScope.self) : undefined));
|
|
2072
2072
|
}
|
|
2073
2073
|
while (ancestorMarker?.type === 'parallel' && !completedNodes.has(ancestorMarker) && isInFinalState(mutStateNodeSet, ancestorMarker)) {
|
|
2074
2074
|
completedNodes.add(ancestorMarker);
|
|
@@ -2028,10 +2028,10 @@ function microstep(transitions, currentSnapshot, actorScope, event, isInitial, i
|
|
|
2028
2028
|
}
|
|
2029
2029
|
}
|
|
2030
2030
|
function getMachineOutput(snapshot, event, actorScope, rootNode, rootCompletionNode) {
|
|
2031
|
-
if (
|
|
2031
|
+
if (rootNode.output === undefined) {
|
|
2032
2032
|
return;
|
|
2033
2033
|
}
|
|
2034
|
-
const doneStateEvent = createDoneStateEvent(rootCompletionNode.id, rootCompletionNode.output && rootCompletionNode.parent ? resolveOutput(rootCompletionNode.output, snapshot.context, event, actorScope.self) : undefined);
|
|
2034
|
+
const doneStateEvent = createDoneStateEvent(rootCompletionNode.id, rootCompletionNode.output !== undefined && rootCompletionNode.parent ? resolveOutput(rootCompletionNode.output, snapshot.context, event, actorScope.self) : undefined);
|
|
2035
2035
|
return resolveOutput(rootNode.output, snapshot.context, doneStateEvent, actorScope.self);
|
|
2036
2036
|
}
|
|
2037
2037
|
function enterStates(currentSnapshot, event, actorScope, filteredTransitions, mutStateNodeSet, internalQueue, historyValue, isInitial) {
|
|
@@ -2070,7 +2070,7 @@ function enterStates(currentSnapshot, event, actorScope, filteredTransitions, mu
|
|
|
2070
2070
|
let ancestorMarker = parent?.type === 'parallel' ? parent : parent?.parent;
|
|
2071
2071
|
let rootCompletionNode = ancestorMarker || stateNodeToEnter;
|
|
2072
2072
|
if (parent?.type === 'compound') {
|
|
2073
|
-
internalQueue.push(createDoneStateEvent(parent.id, stateNodeToEnter.output ? resolveOutput(stateNodeToEnter.output, nextSnapshot.context, event, actorScope.self) : undefined));
|
|
2073
|
+
internalQueue.push(createDoneStateEvent(parent.id, stateNodeToEnter.output !== undefined ? resolveOutput(stateNodeToEnter.output, nextSnapshot.context, event, actorScope.self) : undefined));
|
|
2074
2074
|
}
|
|
2075
2075
|
while (ancestorMarker?.type === 'parallel' && !completedNodes.has(ancestorMarker) && isInFinalState(mutStateNodeSet, ancestorMarker)) {
|
|
2076
2076
|
completedNodes.add(ancestorMarker);
|
|
@@ -1981,10 +1981,10 @@ function microstep(transitions, currentSnapshot, actorScope, event, isInitial, i
|
|
|
1981
1981
|
}
|
|
1982
1982
|
}
|
|
1983
1983
|
function getMachineOutput(snapshot, event, actorScope, rootNode, rootCompletionNode) {
|
|
1984
|
-
if (
|
|
1984
|
+
if (rootNode.output === undefined) {
|
|
1985
1985
|
return;
|
|
1986
1986
|
}
|
|
1987
|
-
const doneStateEvent = createDoneStateEvent(rootCompletionNode.id, rootCompletionNode.output && rootCompletionNode.parent ? resolveOutput(rootCompletionNode.output, snapshot.context, event, actorScope.self) : undefined);
|
|
1987
|
+
const doneStateEvent = createDoneStateEvent(rootCompletionNode.id, rootCompletionNode.output !== undefined && rootCompletionNode.parent ? resolveOutput(rootCompletionNode.output, snapshot.context, event, actorScope.self) : undefined);
|
|
1988
1988
|
return resolveOutput(rootNode.output, snapshot.context, doneStateEvent, actorScope.self);
|
|
1989
1989
|
}
|
|
1990
1990
|
function enterStates(currentSnapshot, event, actorScope, filteredTransitions, mutStateNodeSet, internalQueue, historyValue, isInitial) {
|
|
@@ -2023,7 +2023,7 @@ function enterStates(currentSnapshot, event, actorScope, filteredTransitions, mu
|
|
|
2023
2023
|
let ancestorMarker = parent?.type === 'parallel' ? parent : parent?.parent;
|
|
2024
2024
|
let rootCompletionNode = ancestorMarker || stateNodeToEnter;
|
|
2025
2025
|
if (parent?.type === 'compound') {
|
|
2026
|
-
internalQueue.push(createDoneStateEvent(parent.id, stateNodeToEnter.output ? resolveOutput(stateNodeToEnter.output, nextSnapshot.context, event, actorScope.self) : undefined));
|
|
2026
|
+
internalQueue.push(createDoneStateEvent(parent.id, stateNodeToEnter.output !== undefined ? resolveOutput(stateNodeToEnter.output, nextSnapshot.context, event, actorScope.self) : undefined));
|
|
2027
2027
|
}
|
|
2028
2028
|
while (ancestorMarker?.type === 'parallel' && !completedNodes.has(ancestorMarker) && isInFinalState(mutStateNodeSet, ancestorMarker)) {
|
|
2029
2029
|
completedNodes.add(ancestorMarker);
|
|
@@ -1983,10 +1983,10 @@ function microstep(transitions, currentSnapshot, actorScope, event, isInitial, i
|
|
|
1983
1983
|
}
|
|
1984
1984
|
}
|
|
1985
1985
|
function getMachineOutput(snapshot, event, actorScope, rootNode, rootCompletionNode) {
|
|
1986
|
-
if (
|
|
1986
|
+
if (rootNode.output === undefined) {
|
|
1987
1987
|
return;
|
|
1988
1988
|
}
|
|
1989
|
-
const doneStateEvent = createDoneStateEvent(rootCompletionNode.id, rootCompletionNode.output && rootCompletionNode.parent ? resolveOutput(rootCompletionNode.output, snapshot.context, event, actorScope.self) : undefined);
|
|
1989
|
+
const doneStateEvent = createDoneStateEvent(rootCompletionNode.id, rootCompletionNode.output !== undefined && rootCompletionNode.parent ? resolveOutput(rootCompletionNode.output, snapshot.context, event, actorScope.self) : undefined);
|
|
1990
1990
|
return resolveOutput(rootNode.output, snapshot.context, doneStateEvent, actorScope.self);
|
|
1991
1991
|
}
|
|
1992
1992
|
function enterStates(currentSnapshot, event, actorScope, filteredTransitions, mutStateNodeSet, internalQueue, historyValue, isInitial) {
|
|
@@ -2025,7 +2025,7 @@ function enterStates(currentSnapshot, event, actorScope, filteredTransitions, mu
|
|
|
2025
2025
|
let ancestorMarker = parent?.type === 'parallel' ? parent : parent?.parent;
|
|
2026
2026
|
let rootCompletionNode = ancestorMarker || stateNodeToEnter;
|
|
2027
2027
|
if (parent?.type === 'compound') {
|
|
2028
|
-
internalQueue.push(createDoneStateEvent(parent.id, stateNodeToEnter.output ? resolveOutput(stateNodeToEnter.output, nextSnapshot.context, event, actorScope.self) : undefined));
|
|
2028
|
+
internalQueue.push(createDoneStateEvent(parent.id, stateNodeToEnter.output !== undefined ? resolveOutput(stateNodeToEnter.output, nextSnapshot.context, event, actorScope.self) : undefined));
|
|
2029
2029
|
}
|
|
2030
2030
|
while (ancestorMarker?.type === 'parallel' && !completedNodes.has(ancestorMarker) && isInFinalState(mutStateNodeSet, ancestorMarker)) {
|
|
2031
2031
|
completedNodes.add(ancestorMarker);
|
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-af6a698b.cjs.js');
|
|
7
|
+
var log = require('./log-caeb9fa9.cjs.js');
|
|
8
8
|
require('../dev/dist/xstate-dev.cjs.js');
|
|
9
9
|
|
|
10
10
|
class SimulatedClock {
|
|
@@ -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-7132462e.development.cjs.js');
|
|
7
|
+
var log = require('./log-3f27f22f.development.cjs.js');
|
|
8
8
|
require('../dev/dist/xstate-dev.development.cjs.js');
|
|
9
9
|
|
|
10
10
|
class SimulatedClock {
|
|
@@ -429,7 +429,7 @@ class StateMachine {
|
|
|
429
429
|
this.root._initialize();
|
|
430
430
|
this.states = this.root.states; // TODO: remove!
|
|
431
431
|
this.events = this.root.events;
|
|
432
|
-
if (!this.root
|
|
432
|
+
if (!('output' in this.root) && Object.values(this.states).some(state => state.type === 'final' && 'output' in state)) {
|
|
433
433
|
console.warn('Missing `machine.output` declaration (top-level final state with output detected)');
|
|
434
434
|
}
|
|
435
435
|
}
|
|
@@ -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 toStatePath, w as isStateId, x as getStateNodeByPath, y as getPersistedSnapshot, z as resolveReferencedActor, A as createActor, $ as $$ACTOR_TYPE } from './raise-
|
|
3
|
-
export { B as Actor, I as __unsafe_getAllOwnEventDescriptors, E as and, M as cancel, A as createActor, j as getStateNodes, C as interpret, D as isMachineSnapshot, J as matchesState, F as not, G as or, K as pathToStateValue, O as raise, P as spawnChild, H as stateIn, Q as stop, R as stopChild, L 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 toStatePath, w as isStateId, x as getStateNodeByPath, y as getPersistedSnapshot, z as resolveReferencedActor, A as createActor, $ as $$ACTOR_TYPE } from './raise-3f85f1d9.development.esm.js';
|
|
3
|
+
export { B as Actor, I as __unsafe_getAllOwnEventDescriptors, E as and, M as cancel, A as createActor, j as getStateNodes, C as interpret, D as isMachineSnapshot, J as matchesState, F as not, G as or, K as pathToStateValue, O as raise, P as spawnChild, H as stateIn, Q as stop, R as stopChild, L as toObserver } from './raise-3f85f1d9.development.esm.js';
|
|
4
|
+
import { a as assign } from './log-d6ba5166.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-d6ba5166.development.esm.js';
|
|
6
6
|
import '../dev/dist/xstate-dev.development.esm.js';
|
|
7
7
|
|
|
8
8
|
class SimulatedClock {
|
|
@@ -427,7 +427,7 @@ class StateMachine {
|
|
|
427
427
|
this.root._initialize();
|
|
428
428
|
this.states = this.root.states; // TODO: remove!
|
|
429
429
|
this.events = this.root.events;
|
|
430
|
-
if (!this.root
|
|
430
|
+
if (!('output' in this.root) && Object.values(this.states).some(state => state.type === 'final' && 'output' in state)) {
|
|
431
431
|
console.warn('Missing `machine.output` declaration (top-level final state with output detected)');
|
|
432
432
|
}
|
|
433
433
|
}
|
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 toStatePath, w as isStateId, x as getStateNodeByPath, y as getPersistedSnapshot, z as resolveReferencedActor, A as createActor, $ as $$ACTOR_TYPE } from './raise-
|
|
3
|
-
export { B as Actor, I as __unsafe_getAllOwnEventDescriptors, E as and, M as cancel, A as createActor, j as getStateNodes, C as interpret, D as isMachineSnapshot, J as matchesState, F as not, G as or, K as pathToStateValue, O as raise, P as spawnChild, H as stateIn, Q as stop, R as stopChild, L 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 toStatePath, w as isStateId, x as getStateNodeByPath, y as getPersistedSnapshot, z as resolveReferencedActor, A as createActor, $ as $$ACTOR_TYPE } from './raise-a7ab421f.esm.js';
|
|
3
|
+
export { B as Actor, I as __unsafe_getAllOwnEventDescriptors, E as and, M as cancel, A as createActor, j as getStateNodes, C as interpret, D as isMachineSnapshot, J as matchesState, F as not, G as or, K as pathToStateValue, O as raise, P as spawnChild, H as stateIn, Q as stop, R as stopChild, L as toObserver } from './raise-a7ab421f.esm.js';
|
|
4
|
+
import { a as assign } from './log-666fd90a.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-666fd90a.esm.js';
|
|
6
6
|
import '../dev/dist/xstate-dev.esm.js';
|
|
7
7
|
|
|
8
8
|
class SimulatedClock {
|