123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- import { Action, Event, EventObject, SingleOrArray, SendAction, SendActionOptions, CancelAction, ActionObject, ActionType, Assigner, PropertyAssigner, AssignAction, ActionFunction, ActionFunctionMap, ActivityActionObject, ActionTypes, ActivityDefinition, RaiseAction, RaiseActionObject, DoneEvent, ErrorPlatformEvent, DoneEventObject, SendExpr, SendActionObject, PureAction, LogExpr, LogAction, LogActionObject, DelayFunctionMap, SCXML, ExprWithMeta, ChooseCondition, ChooseAction, AnyEventObject, Expr, StopAction, StopActionObject, Cast, EventFrom, AnyActorRef, PredictableActionArgumentsExec, RaiseActionOptions, NoInfer, BaseActionObject, LowInfer } from './types';
- import * as actionTypes from './actionTypes';
- import { State } from './State';
- import { StateNode } from './StateNode';
- export { actionTypes };
- export declare const initEvent: SCXML.Event<{
- type: ActionTypes;
- }>;
- export declare function getActionFunction<TContext, TEvent extends EventObject>(actionType: ActionType, actionFunctionMap?: ActionFunctionMap<TContext, TEvent>): ActionObject<TContext, TEvent> | ActionFunction<TContext, TEvent> | undefined;
- export declare function toActionObject<TContext, TEvent extends EventObject>(action: Action<TContext, TEvent>, actionFunctionMap?: ActionFunctionMap<TContext, TEvent>): ActionObject<TContext, TEvent>;
- export declare const toActionObjects: <TContext, TEvent extends EventObject>(action?: SingleOrArray<Action<TContext, TEvent, TEvent>> | undefined, actionFunctionMap?: ActionFunctionMap<TContext, TEvent, BaseActionObject> | undefined) => ActionObject<TContext, TEvent, TEvent, BaseActionObject>[];
- export declare function toActivityDefinition<TContext, TEvent extends EventObject>(action: string | ActivityDefinition<TContext, TEvent>): ActivityDefinition<TContext, TEvent>;
- export declare function raise<TContext, TExpressionEvent extends EventObject, TEvent extends EventObject = TExpressionEvent>(event: NoInfer<Event<TEvent>> | SendExpr<TContext, TExpressionEvent, TEvent>, options?: RaiseActionOptions<TContext, TExpressionEvent>): RaiseAction<TContext, TExpressionEvent, TEvent>;
- export declare function resolveRaise<TContext, TEvent extends EventObject, TExpressionEvent extends EventObject>(action: RaiseAction<TContext, TExpressionEvent, TEvent>, ctx: TContext, _event: SCXML.Event<TExpressionEvent>, delaysMap?: DelayFunctionMap<TContext, TEvent>): RaiseActionObject<TContext, TExpressionEvent, TEvent>;
- export declare function send<TContext, TEvent extends EventObject, TSentEvent extends EventObject = AnyEventObject>(event: Event<AnyEventObject> | SendExpr<TContext, TEvent, AnyEventObject>, options?: SendActionOptions<TContext, TEvent>): SendAction<TContext, TEvent, TSentEvent>;
- export declare function resolveSend<TContext, TEvent extends EventObject, TSentEvent extends EventObject>(action: SendAction<TContext, TEvent, TSentEvent>, ctx: TContext, _event: SCXML.Event<TEvent>, delaysMap?: DelayFunctionMap<TContext, TEvent>): SendActionObject<TContext, TEvent, TSentEvent>;
- export declare function sendParent<TContext, TEvent extends EventObject, TSentEvent extends EventObject = AnyEventObject>(event: Event<AnyEventObject> | SendExpr<TContext, TEvent, AnyEventObject>, options?: SendActionOptions<TContext, TEvent>): SendAction<TContext, TEvent, TSentEvent>;
- declare type InferEvent<E extends EventObject> = {
- [T in E['type']]: {
- type: T;
- } & Extract<E, {
- type: T;
- }>;
- }[E['type']];
- export declare function sendTo<TContext, TEvent extends EventObject, TActor extends AnyActorRef>(actor: string | TActor | ((ctx: TContext, event: TEvent) => TActor), event: EventFrom<TActor> | SendExpr<TContext, TEvent, InferEvent<Cast<EventFrom<TActor>, EventObject>>>, options?: SendActionOptions<TContext, TEvent>): SendAction<TContext, TEvent, any>;
- export declare function sendUpdate<TContext, TEvent extends EventObject>(): SendAction<TContext, TEvent, any>;
- export declare function respond<TContext, TEvent extends EventObject, TSentEvent extends EventObject = AnyEventObject>(event: Event<TEvent> | SendExpr<TContext, TEvent, TSentEvent>, options?: SendActionOptions<TContext, TEvent>): SendAction<TContext, TEvent, AnyEventObject>;
- export declare function log<TContext, TExpressionEvent extends EventObject, TEvent extends EventObject = TExpressionEvent>(expr?: string | LogExpr<TContext, TExpressionEvent>, label?: string): LogAction<TContext, TExpressionEvent, TEvent>;
- export declare const resolveLog: <TContext, TEvent extends EventObject>(action: LogAction<TContext, TEvent, TEvent>, ctx: TContext, _event: SCXML.Event<TEvent>) => LogActionObject<TContext, TEvent>;
- export declare const cancel: <TContext, TExpressionEvent extends EventObject, TEvent extends EventObject>(sendId: string | number) => CancelAction<TContext, TExpressionEvent, TEvent>;
- export declare function start<TContext, TEvent extends EventObject>(activity: string | ActivityDefinition<TContext, TEvent>): ActivityActionObject<TContext, TEvent>;
- export declare function stop<TContext, TExpressionEvent extends EventObject, TEvent extends EventObject = TExpressionEvent>(actorRef: string | Expr<TContext, TExpressionEvent, string | {
- id: string;
- }>): StopAction<TContext, TExpressionEvent, TEvent>;
- export declare function resolveStop<TContext, TEvent extends EventObject>(action: StopAction<TContext, TEvent>, context: TContext, _event: SCXML.Event<TEvent>): StopActionObject;
- export declare const assign: <TContext, TExpressionEvent extends EventObject = EventObject, TEvent extends EventObject = TExpressionEvent>(assignment: Assigner<LowInfer<TContext>, TExpressionEvent> | PropertyAssigner<LowInfer<TContext>, TExpressionEvent>) => AssignAction<TContext, TExpressionEvent, TEvent>;
- export declare function isActionObject<TContext, TEvent extends EventObject>(action: Action<TContext, TEvent>): action is ActionObject<TContext, TEvent>;
- export declare function after(delayRef: number | string, id?: string): string;
- export declare function done(id: string, data?: any): DoneEventObject;
- export declare function doneInvoke(id: string, data?: any): DoneEvent;
- export declare function error(id: string, data?: any): ErrorPlatformEvent & string;
- export declare function pure<TContext, TExpressionEvent extends EventObject, TEvent extends EventObject = TExpressionEvent>(getActions: (context: TContext, event: TExpressionEvent) => SingleOrArray<BaseActionObject | BaseActionObject['type'] | ActionObject<TContext, TExpressionEvent, TEvent> | ActionFunction<TContext, TExpressionEvent>> | undefined): PureAction<TContext, TExpressionEvent, TEvent>;
- export declare function forwardTo<TContext, TEvent extends EventObject>(target: Required<SendActionOptions<TContext, TEvent>>['to'], options?: SendActionOptions<TContext, TEvent>): SendAction<TContext, TEvent, any>;
- export declare function escalate<TContext, TEvent extends EventObject, TErrorData = any>(errorData: TErrorData | ExprWithMeta<TContext, TEvent, TErrorData>, options?: SendActionOptions<TContext, TEvent>): SendAction<TContext, TEvent, any>;
- export declare function choose<TContext, TExpressionEvent extends EventObject, TEvent extends EventObject = TExpressionEvent>(conds: Array<ChooseCondition<TContext, TExpressionEvent, TEvent>>): ChooseAction<TContext, TExpressionEvent, TEvent>;
- export declare function resolveActions<TContext, TEvent extends EventObject>(machine: StateNode<TContext, any, TEvent, any, any, any>, currentState: State<TContext, TEvent, any, any, any> | undefined, currentContext: TContext, _event: SCXML.Event<TEvent>, actionBlocks: Array<{
- type: string;
- actions: Array<ActionObject<TContext, TEvent>>;
- }>, predictableExec?: PredictableActionArgumentsExec, preserveActionOrder?: boolean): [Array<ActionObject<TContext, TEvent>>, TContext];
|