1 | import { Guard } from "../guards.js";
|
2 | import { Action, ActionArgs, ActionFunction, AnyActorRef, AnyEventObject, EventObject, MachineContext, ParameterizedObject, ProvidedActor, UnifiedArg } from "../types.js";
|
3 | import { assign } from "./assign.js";
|
4 | import { cancel } from "./cancel.js";
|
5 | import { emit } from "./emit.js";
|
6 | import { raise } from "./raise.js";
|
7 | import { sendParent, sendTo } from "./send.js";
|
8 | import { spawnChild } from "./spawnChild.js";
|
9 | import { stopChild } from "./stopChild.js";
|
10 | interface ActionEnqueuer<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject, TActor extends ProvidedActor, TAction extends ParameterizedObject, TGuard extends ParameterizedObject, TDelay extends string, TEmitted extends EventObject> {
|
11 | (action: Action<TContext, TExpressionEvent, TEvent, undefined, TActor, TAction, TGuard, TDelay, TEmitted>): void;
|
12 | assign: (...args: Parameters<typeof assign<TContext, TExpressionEvent, undefined, TEvent, TActor>>) => void;
|
13 | cancel: (...args: Parameters<typeof cancel<TContext, TExpressionEvent, undefined, TEvent>>) => void;
|
14 | raise: (...args: Parameters<typeof raise<TContext, TExpressionEvent, TEvent, undefined, TDelay, TDelay>>) => void;
|
15 | sendTo: <TTargetActor extends AnyActorRef>(...args: Parameters<typeof sendTo<TContext, TExpressionEvent, undefined, TTargetActor, TEvent, TDelay, TDelay>>) => void;
|
16 | sendParent: (...args: Parameters<typeof sendParent<TContext, TExpressionEvent, undefined, AnyEventObject, TEvent, TDelay, TDelay>>) => void;
|
17 | spawnChild: (...args: Parameters<typeof spawnChild<TContext, TExpressionEvent, undefined, TEvent, TActor>>) => void;
|
18 | stopChild: (...args: Parameters<typeof stopChild<TContext, TExpressionEvent, undefined, TEvent>>) => void;
|
19 | emit: (...args: Parameters<typeof emit<TContext, TExpressionEvent, undefined, TEvent, TEmitted>>) => void;
|
20 | }
|
21 | export interface EnqueueActionsAction<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TEvent extends EventObject, TActor extends ProvidedActor, TAction extends ParameterizedObject, TGuard extends ParameterizedObject, TDelay extends string> {
|
22 | (args: ActionArgs<TContext, TExpressionEvent, TEvent>, params: TParams): void;
|
23 | _out_TEvent?: TEvent;
|
24 | _out_TActor?: TActor;
|
25 | _out_TAction?: TAction;
|
26 | _out_TGuard?: TGuard;
|
27 | _out_TDelay?: TDelay;
|
28 | }
|
29 | interface CollectActionsArg<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject, TActor extends ProvidedActor, TAction extends ParameterizedObject, TGuard extends ParameterizedObject, TDelay extends string, TEmitted extends EventObject> extends UnifiedArg<TContext, TExpressionEvent, TEvent> {
|
30 | check: (guard: Guard<TContext, TExpressionEvent, undefined, TGuard>) => boolean;
|
31 | enqueue: ActionEnqueuer<TContext, TExpressionEvent, TEvent, TActor, TAction, TGuard, TDelay, TEmitted>;
|
32 | }
|
33 | type CollectActions<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TEvent extends EventObject, TActor extends ProvidedActor, TAction extends ParameterizedObject, TGuard extends ParameterizedObject, TDelay extends string, TEmitted extends EventObject> = ({ context, event, check, enqueue, self }: CollectActionsArg<TContext, TExpressionEvent, TEvent, TActor, TAction, TGuard, TDelay, TEmitted>, params: TParams) => void;
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | export declare function enqueueActions<TContext extends MachineContext, TExpressionEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TEvent extends EventObject = TExpressionEvent, TActor extends ProvidedActor = ProvidedActor, TAction extends ParameterizedObject = ParameterizedObject, TGuard extends ParameterizedObject = ParameterizedObject, TDelay extends string = never, TEmitted extends EventObject = EventObject>(collect: CollectActions<TContext, TExpressionEvent, TParams, TEvent, TActor, TAction, TGuard, TDelay, TEmitted>): ActionFunction<TContext, TExpressionEvent, TEvent, TParams, TActor, TAction, TGuard, TDelay, TEmitted>;
|
57 | export {};
|