xstate 5.7.0 → 5.8.0
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 +1 -1
- package/actions/dist/xstate-actions.development.cjs.js +1 -1
- package/actions/dist/xstate-actions.development.esm.js +1 -1
- package/actions/dist/xstate-actions.esm.js +1 -1
- package/actions/dist/xstate-actions.umd.min.js.map +1 -1
- package/dist/declarations/src/State.d.ts +5 -5
- 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-c2d7ade7.cjs.js → log-824ddadc.cjs.js} +6 -2
- package/dist/{log-9b34dd45.development.cjs.js → log-87571c28.development.cjs.js} +6 -2
- package/dist/{log-f78f0918.esm.js → log-a7416dbf.esm.js} +6 -2
- package/dist/{log-dc9ca1e2.development.esm.js → log-b2cc1501.development.esm.js} +6 -2
- package/dist/xstate.cjs.js +1 -1
- package/dist/xstate.development.cjs.js +1 -1
- package/dist/xstate.development.esm.js +2 -2
- package/dist/xstate.esm.js +2 -2
- package/dist/xstate.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -52,12 +52,12 @@ interface MachineSnapshotBase<TContext extends MachineContext, TEvent extends Ev
|
|
|
52
52
|
* Whether the current state value is a subset of the given partial state value.
|
|
53
53
|
* @param partialStateValue
|
|
54
54
|
*/
|
|
55
|
-
matches: (
|
|
55
|
+
matches: (partialStateValue: ToTestStateValue<TStateValue>) => boolean;
|
|
56
56
|
/**
|
|
57
57
|
* Whether the current state nodes has a state node with the specified `tag`.
|
|
58
58
|
* @param tag
|
|
59
59
|
*/
|
|
60
|
-
hasTag: (
|
|
60
|
+
hasTag: (tag: TTag) => boolean;
|
|
61
61
|
/**
|
|
62
62
|
* Determines whether sending the `event` will cause a non-forbidden transition
|
|
63
63
|
* to be selected, even if the transitions have no actions nor
|
|
@@ -66,9 +66,9 @@ interface MachineSnapshotBase<TContext extends MachineContext, TEvent extends Ev
|
|
|
66
66
|
* @param event The event to test
|
|
67
67
|
* @returns Whether the event will cause a transition
|
|
68
68
|
*/
|
|
69
|
-
can: (
|
|
70
|
-
getMeta: (
|
|
71
|
-
toJSON: (
|
|
69
|
+
can: (event: TEvent) => boolean;
|
|
70
|
+
getMeta: () => Record<string, any>;
|
|
71
|
+
toJSON: () => unknown;
|
|
72
72
|
}
|
|
73
73
|
interface ActiveMachineSnapshot<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TStateValue extends StateValue, TTag extends string, TOutput> extends MachineSnapshotBase<TContext, TEvent, TChildren, TStateValue, TTag, TOutput> {
|
|
74
74
|
status: 'active';
|
|
@@ -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
|
};
|
|
@@ -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';
|
|
@@ -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';
|
|
@@ -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';
|
|
@@ -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';
|
package/dist/xstate.cjs.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var actors_dist_xstateActors = require('../actors/dist/xstate-actors.cjs.js');
|
|
6
6
|
var guards_dist_xstateGuards = require('./raise-932934e8.cjs.js');
|
|
7
|
-
var log = require('./log-
|
|
7
|
+
var log = require('./log-824ddadc.cjs.js');
|
|
8
8
|
require('../dev/dist/xstate-dev.cjs.js');
|
|
9
9
|
|
|
10
10
|
class SimulatedClock {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var actors_dist_xstateActors = require('../actors/dist/xstate-actors.development.cjs.js');
|
|
6
6
|
var guards_dist_xstateGuards = require('./raise-0ce4ccae.development.cjs.js');
|
|
7
|
-
var log = require('./log-
|
|
7
|
+
var log = require('./log-87571c28.development.cjs.js');
|
|
8
8
|
require('../dev/dist/xstate-dev.development.cjs.js');
|
|
9
9
|
|
|
10
10
|
class SimulatedClock {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { createEmptyActor, fromCallback, fromEventObservable, fromObservable, fromPromise, fromTransition } from '../actors/dist/xstate-actors.development.esm.js';
|
|
2
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-4593d184.development.esm.js';
|
|
3
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-4593d184.development.esm.js';
|
|
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-
|
|
4
|
+
import { a as assign } from './log-b2cc1501.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-b2cc1501.development.esm.js';
|
|
6
6
|
import '../dev/dist/xstate-dev.development.esm.js';
|
|
7
7
|
|
|
8
8
|
class SimulatedClock {
|
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
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-6420fe44.esm.js';
|
|
3
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-6420fe44.esm.js';
|
|
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-
|
|
4
|
+
import { a as assign } from './log-a7416dbf.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-a7416dbf.esm.js';
|
|
6
6
|
import '../dev/dist/xstate-dev.esm.js';
|
|
7
7
|
|
|
8
8
|
class SimulatedClock {
|