xstate 4.31.0 → 5.0.0-alpha.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/CHANGELOG.md +526 -0
- package/actions/ExecutableAction.ts +58 -0
- package/actions/dist/xstate-actions.cjs.d.ts +1 -0
- package/actions/dist/xstate-actions.cjs.dev.js +32 -0
- package/actions/dist/xstate-actions.cjs.js +7 -0
- package/actions/dist/xstate-actions.cjs.prod.js +32 -0
- package/actions/dist/xstate-actions.esm.js +2 -0
- package/actions/dynamicAction.ts +34 -0
- package/actions/package.json +4 -0
- package/actors/dist/xstate-actors.cjs.d.ts +1 -0
- package/actors/dist/xstate-actors.cjs.dev.js +21 -0
- package/actors/dist/xstate-actors.cjs.js +7 -0
- package/actors/dist/xstate-actors.cjs.prod.js +21 -0
- package/actors/dist/xstate-actors.esm.js +2 -0
- package/actors/package.json +4 -0
- package/dev/dist/xstate-dev.cjs.d.ts +1 -0
- package/dev/dist/xstate-dev.cjs.dev.js +11 -0
- package/dev/dist/xstate-dev.cjs.js +7 -0
- package/{lib/devTools.js → dev/dist/xstate-dev.cjs.prod.js} +17 -10
- package/dev/dist/xstate-dev.esm.js +1 -0
- package/dev/package.json +4 -0
- package/dist/Machine-9ce74c11.cjs.dev.js +755 -0
- package/dist/Machine-dca041dc.cjs.prod.js +749 -0
- package/dist/Machine-fb2f47f5.esm.js +751 -0
- package/dist/actions-6b86876d.cjs.dev.js +4815 -0
- package/dist/actions-70094c93.cjs.prod.js +4765 -0
- package/dist/actions-ff512f16.esm.js +4757 -0
- package/dist/declarations/actions/ExecutableAction.d.ts +23 -0
- package/dist/declarations/actions/dynamicAction.d.ts +3 -0
- package/dist/declarations/src/Machine.d.ts +4 -0
- package/dist/declarations/src/Mailbox.d.ts +12 -0
- package/dist/declarations/src/ObservableActorRef.d.ts +25 -0
- package/{lib → dist/declarations/src}/SimulatedClock.d.ts +0 -1
- package/dist/declarations/src/State.d.ts +104 -0
- package/dist/declarations/src/StateMachine.d.ts +112 -0
- package/dist/declarations/src/StateNode.d.ts +127 -0
- package/{es → dist/declarations/src}/actionTypes.d.ts +0 -3
- package/dist/declarations/src/actions/assign.d.ts +7 -0
- package/dist/declarations/src/actions/cancel.d.ts +10 -0
- package/dist/declarations/src/actions/choose.d.ts +3 -0
- package/dist/declarations/src/actions/invoke.d.ts +3 -0
- package/dist/declarations/src/actions/log.d.ts +11 -0
- package/dist/declarations/src/actions/pure.d.ts +3 -0
- package/dist/declarations/src/actions/raise.d.ts +9 -0
- package/dist/declarations/src/actions/send.d.ts +55 -0
- package/dist/declarations/src/actions/stop.d.ts +8 -0
- package/dist/declarations/src/actions.d.ts +44 -0
- package/dist/declarations/src/actors.d.ts +38 -0
- package/dist/declarations/src/constants.d.ts +5 -0
- package/{lib/devTools.d.ts → dist/declarations/src/dev/index.d.ts} +2 -2
- package/{es → dist/declarations/src}/environment.d.ts +0 -1
- package/dist/declarations/src/guards.d.ts +9 -0
- package/dist/declarations/src/index.d.ts +47 -0
- package/dist/declarations/src/interpreter.d.ts +147 -0
- package/{es → dist/declarations/src}/mapState.d.ts +0 -1
- package/dist/declarations/src/match.d.ts +5 -0
- package/dist/declarations/src/memo.d.ts +1 -0
- package/dist/declarations/src/model.d.ts +5 -0
- package/{lib → dist/declarations/src}/model.types.d.ts +10 -9
- package/dist/declarations/src/registry.d.ts +8 -0
- package/{es → dist/declarations/src}/schema.d.ts +0 -1
- package/dist/declarations/src/spawn.d.ts +2 -0
- package/dist/declarations/src/stateUtils.d.ts +85 -0
- package/{lib → dist/declarations/src}/typegenTypes.d.ts +28 -26
- package/dist/declarations/src/types.d.ts +1026 -0
- package/dist/declarations/src/utils.d.ts +56 -0
- package/{es/devTools.js → dist/index-20b364c4.esm.js} +18 -6
- package/dist/index-2a564d03.cjs.dev.js +64 -0
- package/dist/xstate.cjs.d.ts +1 -0
- package/dist/xstate.cjs.dev.js +217 -0
- package/dist/xstate.cjs.js +7 -0
- package/dist/xstate.cjs.prod.js +217 -0
- package/dist/xstate.esm.js +172 -0
- package/guards/dist/xstate-guards.cjs.d.ts +1 -0
- package/guards/dist/xstate-guards.cjs.dev.js +15 -0
- package/guards/dist/xstate-guards.cjs.js +7 -0
- package/guards/dist/xstate-guards.cjs.prod.js +15 -0
- package/guards/dist/xstate-guards.esm.js +2 -0
- package/guards/package.json +4 -0
- package/invoke/package.json +4 -0
- package/model/dist/xstate-model.cjs.d.ts +1 -0
- package/model/dist/xstate-model.cjs.dev.js +41 -0
- package/model/dist/xstate-model.cjs.js +7 -0
- package/model/dist/xstate-model.cjs.prod.js +41 -0
- package/model/dist/xstate-model.esm.js +37 -0
- package/model/package.json +4 -0
- package/package.json +21 -30
- package/dist/xstate.interpreter.js +0 -15
- package/dist/xstate.js +0 -15
- package/dist/xstate.web.js +0 -15
- package/es/Actor.d.ts +0 -25
- package/es/Actor.js +0 -99
- package/es/Machine.d.ts +0 -12
- package/es/Machine.js +0 -14
- package/es/SimulatedClock.d.ts +0 -17
- package/es/SimulatedClock.js +0 -81
- package/es/State.d.ts +0 -123
- package/es/State.js +0 -274
- package/es/StateNode.d.ts +0 -287
- package/es/StateNode.js +0 -1566
- package/es/_virtual/_tslib.js +0 -78
- package/es/actionTypes.js +0 -22
- package/es/actions.d.ts +0 -154
- package/es/actions.js +0 -520
- package/es/behaviors.d.ts +0 -37
- package/es/behaviors.js +0 -131
- package/es/constants.d.ts +0 -6
- package/es/constants.js +0 -6
- package/es/devTools.d.ts +0 -14
- package/es/each.d.ts +0 -4
- package/es/each.js +0 -13
- package/es/environment.js +0 -3
- package/es/index.d.ts +0 -22
- package/es/index.js +0 -23
- package/es/interpreter.d.ts +0 -209
- package/es/interpreter.js +0 -1402
- package/es/invoke.d.ts +0 -11
- package/es/invokeUtils.d.ts +0 -7
- package/es/invokeUtils.js +0 -40
- package/es/json.d.ts +0 -31
- package/es/json.js +0 -86
- package/es/mapState.js +0 -32
- package/es/match.d.ts +0 -9
- package/es/match.js +0 -34
- package/es/model.d.ts +0 -5
- package/es/model.js +0 -50
- package/es/model.types.d.ts +0 -52
- package/es/patterns.d.ts +0 -14
- package/es/patterns.js +0 -48
- package/es/registry.d.ts +0 -9
- package/es/registry.js +0 -19
- package/es/scheduler.d.ts +0 -17
- package/es/scheduler.js +0 -79
- package/es/schema.js +0 -6
- package/es/scxml.d.ts +0 -6
- package/es/serviceScope.d.ts +0 -4
- package/es/serviceScope.js +0 -16
- package/es/stateUtils.d.ts +0 -17
- package/es/stateUtils.js +0 -259
- package/es/typegenTypes.d.ts +0 -130
- package/es/types.d.ts +0 -1037
- package/es/types.js +0 -33
- package/es/utils.d.ts +0 -72
- package/es/utils.js +0 -626
- package/es/waitFor.d.ts +0 -32
- package/es/waitFor.js +0 -66
- package/lib/Actor.d.ts +0 -25
- package/lib/Actor.js +0 -108
- package/lib/Machine.d.ts +0 -12
- package/lib/Machine.js +0 -19
- package/lib/SimulatedClock.js +0 -85
- package/lib/State.d.ts +0 -123
- package/lib/State.js +0 -282
- package/lib/StateNode.d.ts +0 -287
- package/lib/StateNode.js +0 -1570
- package/lib/_virtual/_tslib.js +0 -85
- package/lib/actionTypes.d.ts +0 -20
- package/lib/actionTypes.js +0 -43
- package/lib/actions.d.ts +0 -154
- package/lib/actions.js +0 -552
- package/lib/behaviors.d.ts +0 -37
- package/lib/behaviors.js +0 -137
- package/lib/constants.d.ts +0 -6
- package/lib/constants.js +0 -13
- package/lib/each.d.ts +0 -4
- package/lib/each.js +0 -17
- package/lib/environment.d.ts +0 -2
- package/lib/environment.js +0 -7
- package/lib/index.d.ts +0 -22
- package/lib/index.js +0 -60
- package/lib/interpreter.d.ts +0 -209
- package/lib/interpreter.js +0 -1408
- package/lib/invoke.d.ts +0 -11
- package/lib/invoke.js +0 -20
- package/lib/invokeUtils.d.ts +0 -7
- package/lib/invokeUtils.js +0 -45
- package/lib/json.d.ts +0 -31
- package/lib/json.js +0 -94
- package/lib/mapState.d.ts +0 -4
- package/lib/mapState.js +0 -36
- package/lib/match.d.ts +0 -9
- package/lib/match.js +0 -38
- package/lib/model.d.ts +0 -5
- package/lib/model.js +0 -54
- package/lib/model.types.js +0 -2
- package/lib/patterns.d.ts +0 -14
- package/lib/patterns.js +0 -53
- package/lib/registry.d.ts +0 -9
- package/lib/registry.js +0 -23
- package/lib/scheduler.d.ts +0 -17
- package/lib/scheduler.js +0 -83
- package/lib/schema.d.ts +0 -3
- package/lib/schema.js +0 -11
- package/lib/scxml.d.ts +0 -6
- package/lib/scxml.js +0 -350
- package/lib/serviceScope.d.ts +0 -4
- package/lib/serviceScope.js +0 -21
- package/lib/stateUtils.d.ts +0 -17
- package/lib/stateUtils.js +0 -273
- package/lib/typegenTypes.js +0 -2
- package/lib/types.d.ts +0 -1037
- package/lib/types.js +0 -35
- package/lib/utils.d.ts +0 -72
- package/lib/utils.js +0 -673
- package/lib/waitFor.d.ts +0 -32
- package/lib/waitFor.js +0 -70
package/es/_virtual/_tslib.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/*! *****************************************************************************
|
|
2
|
-
Copyright (c) Microsoft Corporation.
|
|
3
|
-
|
|
4
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
-
purpose with or without fee is hereby granted.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */
|
|
15
|
-
|
|
16
|
-
var __assign = function() {
|
|
17
|
-
__assign = Object.assign || function __assign(t) {
|
|
18
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
-
s = arguments[i];
|
|
20
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
return __assign.apply(this, arguments);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
function __rest(s, e) {
|
|
28
|
-
var t = {};
|
|
29
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
30
|
-
t[p] = s[p];
|
|
31
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
32
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
33
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
34
|
-
t[p[i]] = s[p[i]];
|
|
35
|
-
}
|
|
36
|
-
return t;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function __values(o) {
|
|
40
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
41
|
-
if (m) return m.call(o);
|
|
42
|
-
if (o && typeof o.length === "number") return {
|
|
43
|
-
next: function () {
|
|
44
|
-
if (o && i >= o.length) o = void 0;
|
|
45
|
-
return { value: o && o[i++], done: !o };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function __read(o, n) {
|
|
52
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
53
|
-
if (!m) return o;
|
|
54
|
-
var i = m.call(o), r, ar = [], e;
|
|
55
|
-
try {
|
|
56
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
57
|
-
}
|
|
58
|
-
catch (error) { e = { error: error }; }
|
|
59
|
-
finally {
|
|
60
|
-
try {
|
|
61
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
62
|
-
}
|
|
63
|
-
finally { if (e) throw e.error; }
|
|
64
|
-
}
|
|
65
|
-
return ar;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function __spreadArray(to, from, pack) {
|
|
69
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
70
|
-
if (ar || !(i in from)) {
|
|
71
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
72
|
-
ar[i] = from[i];
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export { __assign, __read, __rest, __spreadArray, __values };
|
package/es/actionTypes.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ActionTypes } from './types.js';
|
|
2
|
-
|
|
3
|
-
var start = ActionTypes.Start;
|
|
4
|
-
var stop = ActionTypes.Stop;
|
|
5
|
-
var raise = ActionTypes.Raise;
|
|
6
|
-
var send = ActionTypes.Send;
|
|
7
|
-
var cancel = ActionTypes.Cancel;
|
|
8
|
-
var nullEvent = ActionTypes.NullEvent;
|
|
9
|
-
var assign = ActionTypes.Assign;
|
|
10
|
-
var after = ActionTypes.After;
|
|
11
|
-
var doneState = ActionTypes.DoneState;
|
|
12
|
-
var log = ActionTypes.Log;
|
|
13
|
-
var init = ActionTypes.Init;
|
|
14
|
-
var invoke = ActionTypes.Invoke;
|
|
15
|
-
var errorExecution = ActionTypes.ErrorExecution;
|
|
16
|
-
var errorPlatform = ActionTypes.ErrorPlatform;
|
|
17
|
-
var error = ActionTypes.ErrorCustom;
|
|
18
|
-
var update = ActionTypes.Update;
|
|
19
|
-
var choose = ActionTypes.Choose;
|
|
20
|
-
var pure = ActionTypes.Pure;
|
|
21
|
-
|
|
22
|
-
export { after, assign, cancel, choose, doneState, error, errorExecution, errorPlatform, init, invoke, log, nullEvent, pure, raise, send, start, stop, update };
|
package/es/actions.d.ts
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
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, ActorRef, EventFrom } from './types';
|
|
2
|
-
import * as actionTypes from './actionTypes';
|
|
3
|
-
import { State } from './State';
|
|
4
|
-
import { StateNode } from './StateNode';
|
|
5
|
-
export { actionTypes };
|
|
6
|
-
export declare const initEvent: SCXML.Event<{
|
|
7
|
-
type: ActionTypes;
|
|
8
|
-
}>;
|
|
9
|
-
export declare function getActionFunction<TContext, TEvent extends EventObject>(actionType: ActionType, actionFunctionMap?: ActionFunctionMap<TContext, TEvent>): ActionObject<TContext, TEvent> | ActionFunction<TContext, TEvent> | undefined;
|
|
10
|
-
export declare function toActionObject<TContext, TEvent extends EventObject>(action: Action<TContext, TEvent>, actionFunctionMap?: ActionFunctionMap<TContext, TEvent>): ActionObject<TContext, TEvent>;
|
|
11
|
-
export declare const toActionObjects: <TContext, TEvent extends EventObject>(action?: SingleOrArray<Action<TContext, TEvent>> | undefined, actionFunctionMap?: ActionFunctionMap<TContext, TEvent, import("./types").BaseActionObject> | undefined) => ActionObject<TContext, TEvent>[];
|
|
12
|
-
export declare function toActivityDefinition<TContext, TEvent extends EventObject>(action: string | ActivityDefinition<TContext, TEvent>): ActivityDefinition<TContext, TEvent>;
|
|
13
|
-
/**
|
|
14
|
-
* Raises an event. This places the event in the internal event queue, so that
|
|
15
|
-
* the event is immediately consumed by the machine in the current step.
|
|
16
|
-
*
|
|
17
|
-
* @param eventType The event to raise.
|
|
18
|
-
*/
|
|
19
|
-
export declare function raise<TContext, TEvent extends EventObject>(event: Event<TEvent>): RaiseAction<TEvent> | SendAction<TContext, AnyEventObject, TEvent>;
|
|
20
|
-
export declare function resolveRaise<TEvent extends EventObject>(action: RaiseAction<TEvent>): RaiseActionObject<TEvent>;
|
|
21
|
-
/**
|
|
22
|
-
* Sends an event. This returns an action that will be read by an interpreter to
|
|
23
|
-
* send the event in the next step, after the current step is finished executing.
|
|
24
|
-
*
|
|
25
|
-
* @param event The event to send.
|
|
26
|
-
* @param options Options to pass into the send event:
|
|
27
|
-
* - `id` - The unique send event identifier (used with `cancel()`).
|
|
28
|
-
* - `delay` - The number of milliseconds to delay the sending of the event.
|
|
29
|
-
* - `to` - The target of this event (by default, the machine the event was sent from).
|
|
30
|
-
*/
|
|
31
|
-
export declare function send<TContext, TEvent extends EventObject, TSentEvent extends EventObject = AnyEventObject>(event: Event<TSentEvent> | SendExpr<TContext, TEvent, TSentEvent>, options?: SendActionOptions<TContext, TEvent>): SendAction<TContext, TEvent, TSentEvent>;
|
|
32
|
-
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>;
|
|
33
|
-
/**
|
|
34
|
-
* Sends an event to this machine's parent.
|
|
35
|
-
*
|
|
36
|
-
* @param event The event to send to the parent machine.
|
|
37
|
-
* @param options Options to pass into the send event.
|
|
38
|
-
*/
|
|
39
|
-
export declare function sendParent<TContext, TEvent extends EventObject, TSentEvent extends EventObject = AnyEventObject>(event: Event<TSentEvent> | SendExpr<TContext, TEvent, TSentEvent>, options?: SendActionOptions<TContext, TEvent>): SendAction<TContext, TEvent, TSentEvent>;
|
|
40
|
-
declare type InferEvent<E extends EventObject> = {
|
|
41
|
-
[T in E['type']]: {
|
|
42
|
-
type: T;
|
|
43
|
-
} & Extract<E, {
|
|
44
|
-
type: T;
|
|
45
|
-
}>;
|
|
46
|
-
}[E['type']];
|
|
47
|
-
/**
|
|
48
|
-
* Sends an event to an actor.
|
|
49
|
-
*
|
|
50
|
-
* @param actor The `ActorRef` to send the event to.
|
|
51
|
-
* @param event The event to send, or an expression that evaluates to the event to send
|
|
52
|
-
* @param options Send action options
|
|
53
|
-
* @returns An XState send action object
|
|
54
|
-
*/
|
|
55
|
-
export declare function sendTo<TContext, TEvent extends EventObject, TActor extends ActorRef<EventObject>>(actor: (ctx: TContext) => TActor, event: EventFrom<TActor> | SendExpr<TContext, TEvent, InferEvent<Cast<EventFrom<TActor>, EventObject>>>, options?: SendActionOptions<TContext, TEvent>): SendAction<TContext, TEvent, any>;
|
|
56
|
-
/**
|
|
57
|
-
* Sends an update event to this machine's parent.
|
|
58
|
-
*/
|
|
59
|
-
export declare function sendUpdate<TContext, TEvent extends EventObject>(): SendAction<TContext, TEvent, {
|
|
60
|
-
type: ActionTypes.Update;
|
|
61
|
-
}>;
|
|
62
|
-
/**
|
|
63
|
-
* Sends an event back to the sender of the original event.
|
|
64
|
-
*
|
|
65
|
-
* @param event The event to send back to the sender
|
|
66
|
-
* @param options Options to pass into the send event
|
|
67
|
-
*/
|
|
68
|
-
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>;
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
* @param expr The expression function to evaluate which will be logged.
|
|
72
|
-
* Takes in 2 arguments:
|
|
73
|
-
* - `ctx` - the current state context
|
|
74
|
-
* - `event` - the event that caused this action to be executed.
|
|
75
|
-
* @param label The label to give to the logged expression.
|
|
76
|
-
*/
|
|
77
|
-
export declare function log<TContext, TEvent extends EventObject>(expr?: string | LogExpr<TContext, TEvent>, label?: string): LogAction<TContext, TEvent>;
|
|
78
|
-
export declare const resolveLog: <TContext, TEvent extends EventObject>(action: LogAction<TContext, TEvent>, ctx: TContext, _event: SCXML.Event<TEvent>) => LogActionObject<TContext, TEvent>;
|
|
79
|
-
/**
|
|
80
|
-
* Cancels an in-flight `send(...)` action. A canceled sent action will not
|
|
81
|
-
* be executed, nor will its event be sent, unless it has already been sent
|
|
82
|
-
* (e.g., if `cancel(...)` is called after the `send(...)` action's `delay`).
|
|
83
|
-
*
|
|
84
|
-
* @param sendId The `id` of the `send(...)` action to cancel.
|
|
85
|
-
*/
|
|
86
|
-
export declare const cancel: (sendId: string | number) => CancelAction;
|
|
87
|
-
/**
|
|
88
|
-
* Starts an activity.
|
|
89
|
-
*
|
|
90
|
-
* @param activity The activity to start.
|
|
91
|
-
*/
|
|
92
|
-
export declare function start<TContext, TEvent extends EventObject>(activity: string | ActivityDefinition<TContext, TEvent>): ActivityActionObject<TContext, TEvent>;
|
|
93
|
-
/**
|
|
94
|
-
* Stops an activity.
|
|
95
|
-
*
|
|
96
|
-
* @param actorRef The activity to stop.
|
|
97
|
-
*/
|
|
98
|
-
export declare function stop<TContext, TEvent extends EventObject>(actorRef: string | ActivityDefinition<TContext, TEvent> | Expr<TContext, TEvent, string | {
|
|
99
|
-
id: string;
|
|
100
|
-
}>): StopAction<TContext, TEvent>;
|
|
101
|
-
export declare function resolveStop<TContext, TEvent extends EventObject>(action: StopAction<TContext, TEvent>, context: TContext, _event: SCXML.Event<TEvent>): StopActionObject;
|
|
102
|
-
/**
|
|
103
|
-
* Updates the current context of the machine.
|
|
104
|
-
*
|
|
105
|
-
* @param assignment An object that represents the partial context to update.
|
|
106
|
-
*/
|
|
107
|
-
export declare const assign: <TContext, TEvent extends EventObject = EventObject>(assignment: Assigner<TContext, TEvent> | PropertyAssigner<TContext, TEvent>) => AssignAction<TContext, TEvent>;
|
|
108
|
-
export declare function isActionObject<TContext, TEvent extends EventObject>(action: Action<TContext, TEvent>): action is ActionObject<TContext, TEvent>;
|
|
109
|
-
/**
|
|
110
|
-
* Returns an event type that represents an implicit event that
|
|
111
|
-
* is sent after the specified `delay`.
|
|
112
|
-
*
|
|
113
|
-
* @param delayRef The delay in milliseconds
|
|
114
|
-
* @param id The state node ID where this event is handled
|
|
115
|
-
*/
|
|
116
|
-
export declare function after(delayRef: number | string, id?: string): string;
|
|
117
|
-
/**
|
|
118
|
-
* Returns an event that represents that a final state node
|
|
119
|
-
* has been reached in the parent state node.
|
|
120
|
-
*
|
|
121
|
-
* @param id The final state node's parent state node `id`
|
|
122
|
-
* @param data The data to pass into the event
|
|
123
|
-
*/
|
|
124
|
-
export declare function done(id: string, data?: any): DoneEventObject;
|
|
125
|
-
/**
|
|
126
|
-
* Returns an event that represents that an invoked service has terminated.
|
|
127
|
-
*
|
|
128
|
-
* An invoked service is terminated when it has reached a top-level final state node,
|
|
129
|
-
* but not when it is canceled.
|
|
130
|
-
*
|
|
131
|
-
* @param id The final state node ID
|
|
132
|
-
* @param data The data to pass into the event
|
|
133
|
-
*/
|
|
134
|
-
export declare function doneInvoke(id: string, data?: any): DoneEvent;
|
|
135
|
-
export declare function error(id: string, data?: any): ErrorPlatformEvent & string;
|
|
136
|
-
export declare function pure<TContext, TEvent extends EventObject>(getActions: (context: TContext, event: TEvent) => SingleOrArray<ActionObject<TContext, TEvent>> | undefined): PureAction<TContext, TEvent>;
|
|
137
|
-
/**
|
|
138
|
-
* Forwards (sends) an event to a specified service.
|
|
139
|
-
*
|
|
140
|
-
* @param target The target service to forward the event to.
|
|
141
|
-
* @param options Options to pass into the send action creator.
|
|
142
|
-
*/
|
|
143
|
-
export declare function forwardTo<TContext, TEvent extends EventObject>(target: Required<SendActionOptions<TContext, TEvent>>['to'], options?: SendActionOptions<TContext, TEvent>): SendAction<TContext, TEvent, AnyEventObject>;
|
|
144
|
-
/**
|
|
145
|
-
* Escalates an error by sending it as an event to this machine's parent.
|
|
146
|
-
*
|
|
147
|
-
* @param errorData The error data to send, or the expression function that
|
|
148
|
-
* takes in the `context`, `event`, and `meta`, and returns the error data to send.
|
|
149
|
-
* @param options Options to pass into the send action creator.
|
|
150
|
-
*/
|
|
151
|
-
export declare function escalate<TContext, TEvent extends EventObject, TErrorData = any>(errorData: TErrorData | ExprWithMeta<TContext, TEvent, TErrorData>, options?: SendActionOptions<TContext, TEvent>): SendAction<TContext, TEvent, AnyEventObject>;
|
|
152
|
-
export declare function choose<TContext, TEvent extends EventObject>(conds: Array<ChooseCondition<TContext, TEvent>>): ChooseAction<TContext, TEvent>;
|
|
153
|
-
export declare function resolveActions<TContext, TEvent extends EventObject>(machine: StateNode<TContext, any, TEvent, any, any, any>, currentState: State<TContext, TEvent> | undefined, currentContext: TContext, _event: SCXML.Event<TEvent>, actions: Array<ActionObject<TContext, TEvent>>, preserveActionOrder?: boolean): [Array<ActionObject<TContext, TEvent>>, TContext];
|
|
154
|
-
//# sourceMappingURL=actions.d.ts.map
|