xstate 5.0.0-alpha.0 → 5.0.0-alpha.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/README.md +23 -13
- package/actions/dist/xstate-actions.cjs.dev.js +22 -24
- package/actions/dist/xstate-actions.cjs.prod.js +22 -24
- package/actions/dist/xstate-actions.esm.js +1 -1
- package/actions/dist/xstate-actions.umd.min.js +2 -0
- package/actions/dist/xstate-actions.umd.min.js.map +1 -0
- package/actions/dynamicAction.ts +4 -4
- package/actions/package.json +5 -1
- package/actors/dist/xstate-actors.cjs.dev.js +12 -13
- package/actors/dist/xstate-actors.cjs.prod.js +12 -13
- package/actors/dist/xstate-actors.esm.js +1 -1
- package/actors/dist/xstate-actors.umd.min.js +2 -0
- package/actors/dist/xstate-actors.umd.min.js.map +1 -0
- package/actors/package.json +5 -1
- package/dev/dist/xstate-dev.umd.min.js +2 -0
- package/dev/dist/xstate-dev.umd.min.js.map +1 -0
- package/dev/package.json +5 -1
- package/dist/{actions-70094c93.cjs.prod.js → actions-7ea9280f.cjs.prod.js} +3118 -3209
- package/dist/{actions-6b86876d.cjs.dev.js → actions-b08d0da8.cjs.dev.js} +3105 -3202
- package/dist/{actions-ff512f16.esm.js → actions-b673cb13.esm.js} +3092 -3189
- package/dist/declarations/actions/dynamicAction.d.ts +5 -3
- package/dist/declarations/src/Machine.d.ts +4 -4
- package/dist/declarations/src/Mailbox.d.ts +12 -12
- package/dist/declarations/src/SimulatedClock.d.ts +16 -16
- package/dist/declarations/src/State.d.ts +97 -104
- package/dist/declarations/src/StateMachine.d.ts +120 -112
- package/dist/declarations/src/StateNode.d.ts +127 -127
- package/dist/declarations/src/actionTypes.d.ts +16 -17
- package/dist/declarations/src/actions/assign.d.ts +7 -7
- package/dist/declarations/src/actions/cancel.d.ts +10 -10
- package/dist/declarations/src/actions/choose.d.ts +3 -3
- package/dist/declarations/src/actions/invoke.d.ts +3 -3
- package/dist/declarations/src/actions/log.d.ts +11 -11
- package/dist/declarations/src/actions/pure.d.ts +3 -3
- package/dist/declarations/src/actions/raise.d.ts +9 -9
- package/dist/declarations/src/actions/send.d.ts +51 -55
- package/dist/declarations/src/actions/stop.d.ts +7 -8
- package/dist/declarations/src/actions.d.ts +43 -44
- package/dist/declarations/src/actors.d.ts +37 -38
- package/dist/declarations/src/constants.d.ts +5 -5
- package/dist/declarations/src/dev/index.d.ts +14 -14
- package/dist/declarations/src/environment.d.ts +1 -1
- package/dist/declarations/src/guards.d.ts +8 -9
- package/dist/declarations/src/index.d.ts +44 -47
- package/dist/declarations/src/interpreter.d.ts +108 -147
- package/dist/declarations/src/mapState.d.ts +3 -3
- package/dist/declarations/src/memo.d.ts +2 -1
- package/dist/declarations/src/registry.d.ts +8 -8
- package/dist/declarations/src/schema.d.ts +2 -2
- package/dist/declarations/src/spawn.d.ts +2 -2
- package/dist/declarations/src/stateUtils.d.ts +70 -85
- package/dist/declarations/src/symbolObservable.d.ts +1 -0
- package/dist/declarations/src/typegenTypes.d.ts +132 -132
- package/dist/declarations/src/types.d.ts +1001 -1026
- package/dist/declarations/src/utils.d.ts +54 -56
- package/dist/xstate.cjs.dev.js +856 -80
- package/dist/xstate.cjs.prod.js +856 -80
- package/dist/xstate.esm.js +815 -35
- package/dist/xstate.umd.min.js +2 -0
- package/dist/xstate.umd.min.js.map +1 -0
- package/guards/dist/xstate-guards.cjs.dev.js +7 -7
- package/guards/dist/xstate-guards.cjs.prod.js +7 -7
- package/guards/dist/xstate-guards.esm.js +1 -1
- package/guards/dist/xstate-guards.umd.min.js +2 -0
- package/guards/dist/xstate-guards.umd.min.js.map +1 -0
- package/guards/package.json +5 -1
- package/package.json +25 -2
- package/CHANGELOG.md +0 -1986
- package/actions/ExecutableAction.ts +0 -58
- package/dist/Machine-9ce74c11.cjs.dev.js +0 -755
- package/dist/Machine-dca041dc.cjs.prod.js +0 -749
- package/dist/Machine-fb2f47f5.esm.js +0 -751
- package/dist/declarations/actions/ExecutableAction.d.ts +0 -23
- package/dist/declarations/src/ObservableActorRef.d.ts +0 -25
- package/dist/declarations/src/match.d.ts +0 -5
- package/dist/declarations/src/model.d.ts +0 -5
- package/dist/declarations/src/model.types.d.ts +0 -53
- package/model/dist/xstate-model.cjs.d.ts +0 -1
- package/model/dist/xstate-model.cjs.dev.js +0 -41
- package/model/dist/xstate-model.cjs.js +0 -7
- package/model/dist/xstate-model.cjs.prod.js +0 -41
- package/model/dist/xstate-model.esm.js +0 -37
- package/model/package.json +0 -4
|
@@ -1,56 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function toStatePath(stateId: string | string[], delimiter: string): string[];
|
|
9
|
-
export declare function isStateLike(state: any): state is
|
|
10
|
-
export declare function toStateValue(stateValue: StateLike<any> | StateValue | string[], delimiter: string): StateValue;
|
|
11
|
-
export declare function pathToStateValue(statePath: string[]): StateValue;
|
|
12
|
-
export declare function mapValues<P, O extends Record<string, unknown>>(collection: O, iteratee: (item: O[keyof O], key: keyof O, collection: O, i: number) => P): {
|
|
13
|
-
[key in keyof O]: P;
|
|
14
|
-
};
|
|
15
|
-
export declare function mapFilterValues<T, P>(collection: {
|
|
16
|
-
[key: string]: T;
|
|
17
|
-
}, iteratee: (item: T, key: string, collection: {
|
|
18
|
-
[key: string]: T;
|
|
19
|
-
}) => P, predicate: (item: T) => boolean): {
|
|
20
|
-
[key: string]: P;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Retrieves a value at the given path.
|
|
24
|
-
* @param props The deep path to the prop of the desired value
|
|
25
|
-
*/
|
|
26
|
-
export declare function path<T extends Record<string, any>>(props: string[]): any;
|
|
27
|
-
export declare function toStatePaths(stateValue: StateValue | undefined): string[][];
|
|
28
|
-
export declare function flatten<T>(array: Array<T | T[]>): T[];
|
|
29
|
-
export declare function toArrayStrict<T>(value: T[] | T): T[];
|
|
30
|
-
export declare function toArray<T>(value: T[] | T | undefined): T[];
|
|
31
|
-
export declare function mapContext<TContext extends MachineContext, TEvent extends EventObject>(mapper: Mapper<TContext, TEvent, any> | PropertyMapper<TContext, TEvent, any>, context: TContext, _event: SCXML.Event<TEvent>): any;
|
|
32
|
-
export declare function isBuiltInEvent(eventType: EventType): boolean;
|
|
33
|
-
export declare function isPromiseLike(value: any): value is PromiseLike<any>;
|
|
34
|
-
export declare function isBehavior(value: any): value is Behavior<any, any>;
|
|
35
|
-
export declare function partition<T, A extends T, B extends T>(items: T[], predicate: (item: T) => item is A): [A[], B[]];
|
|
36
|
-
export declare let warn: (condition: boolean | Error, message: string) => void;
|
|
37
|
-
export declare function isArray(value: any): value is any[];
|
|
38
|
-
export declare function isFunction(value: any): value is Function;
|
|
39
|
-
export declare function isString(value: any): value is string;
|
|
40
|
-
export declare function isObservable<T>(value: any): value is Subscribable<T>;
|
|
41
|
-
export declare
|
|
42
|
-
export declare
|
|
43
|
-
export declare
|
|
44
|
-
export declare function
|
|
45
|
-
export declare function
|
|
46
|
-
export declare function
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
export declare function
|
|
52
|
-
export declare function
|
|
53
|
-
export declare function
|
|
54
|
-
export declare function
|
|
55
|
-
export declare function toObserver<T>(nextHandler: Observer<T> | ((value: T) => void), errorHandler?: (error: any) => void, completionHandler?: () => void): Observer<T>;
|
|
56
|
-
export declare function createInvokeId(stateNodeId: string, index: number): string;
|
|
1
|
+
import { AnyState } from '.';
|
|
2
|
+
import { NULL_EVENT } from './constants';
|
|
3
|
+
import type { StateNode } from './StateNode';
|
|
4
|
+
import type { Behavior, BehaviorCreator, EventObject, EventType, InvokeConfig, InvokeSourceDefinition, MachineContext, Mapper, Observer, PropertyMapper, SCXML, SCXMLErrorEvent, SingleOrArray, StateLike, StateValue, Subscribable, TransitionConfig, TransitionConfigTarget } from './types';
|
|
5
|
+
import { AnyStateMachine } from './types';
|
|
6
|
+
export declare function keys<T extends object>(value: T): Array<keyof T & string>;
|
|
7
|
+
export declare function matchesState(parentStateId: StateValue, childStateId: StateValue, delimiter?: string): boolean;
|
|
8
|
+
export declare function toStatePath(stateId: string | string[], delimiter: string): string[];
|
|
9
|
+
export declare function isStateLike(state: any): state is AnyState;
|
|
10
|
+
export declare function toStateValue(stateValue: StateLike<any> | StateValue | string[], delimiter: string): StateValue;
|
|
11
|
+
export declare function pathToStateValue(statePath: string[]): StateValue;
|
|
12
|
+
export declare function mapValues<P, O extends Record<string, unknown>>(collection: O, iteratee: (item: O[keyof O], key: keyof O, collection: O, i: number) => P): {
|
|
13
|
+
[key in keyof O]: P;
|
|
14
|
+
};
|
|
15
|
+
export declare function mapFilterValues<T, P>(collection: {
|
|
16
|
+
[key: string]: T;
|
|
17
|
+
}, iteratee: (item: T, key: string, collection: {
|
|
18
|
+
[key: string]: T;
|
|
19
|
+
}) => P, predicate: (item: T) => boolean): {
|
|
20
|
+
[key: string]: P;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves a value at the given path.
|
|
24
|
+
* @param props The deep path to the prop of the desired value
|
|
25
|
+
*/
|
|
26
|
+
export declare function path<T extends Record<string, any>>(props: string[]): any;
|
|
27
|
+
export declare function toStatePaths(stateValue: StateValue | undefined): string[][];
|
|
28
|
+
export declare function flatten<T>(array: Array<T | T[]>): T[];
|
|
29
|
+
export declare function toArrayStrict<T>(value: T[] | T): T[];
|
|
30
|
+
export declare function toArray<T>(value: T[] | T | undefined): T[];
|
|
31
|
+
export declare function mapContext<TContext extends MachineContext, TEvent extends EventObject>(mapper: Mapper<TContext, TEvent, any> | PropertyMapper<TContext, TEvent, any>, context: TContext, _event: SCXML.Event<TEvent>): any;
|
|
32
|
+
export declare function isBuiltInEvent(eventType: EventType): boolean;
|
|
33
|
+
export declare function isPromiseLike(value: any): value is PromiseLike<any>;
|
|
34
|
+
export declare function isBehavior(value: any): value is Behavior<any, any>;
|
|
35
|
+
export declare function partition<T, A extends T, B extends T>(items: T[], predicate: (item: T) => item is A): [A[], B[]];
|
|
36
|
+
export declare let warn: (condition: boolean | Error, message: string) => void;
|
|
37
|
+
export declare function isArray(value: any): value is any[];
|
|
38
|
+
export declare function isFunction(value: any): value is Function;
|
|
39
|
+
export declare function isString(value: any): value is string;
|
|
40
|
+
export declare function isObservable<T>(value: any): value is Subscribable<T>;
|
|
41
|
+
export declare function isStateMachine(value: any): value is AnyStateMachine;
|
|
42
|
+
export declare const uniqueId: () => string;
|
|
43
|
+
export declare function isSCXMLEvent<TEvent extends EventObject>(event: TEvent | SCXML.Event<TEvent>): event is SCXML.Event<TEvent>;
|
|
44
|
+
export declare function isSCXMLErrorEvent(event: SCXML.Event<any>): event is SCXMLErrorEvent;
|
|
45
|
+
export declare function toSCXMLEvent<TEvent extends EventObject>(event: TEvent | SCXML.Event<TEvent>, scxmlEvent?: Partial<SCXML.Event<TEvent>>): SCXML.Event<TEvent>;
|
|
46
|
+
export declare function toTransitionConfigArray<TContext extends MachineContext, TEvent extends EventObject>(event: TEvent['type'] | typeof NULL_EVENT | '*', configLike: SingleOrArray<TransitionConfig<TContext, TEvent> | TransitionConfigTarget<TContext, TEvent>>): Array<TransitionConfig<TContext, TEvent> & {
|
|
47
|
+
event: TEvent['type'] | typeof NULL_EVENT | '*';
|
|
48
|
+
}>;
|
|
49
|
+
export declare function normalizeTarget<TContext extends MachineContext, TEvent extends EventObject>(target: SingleOrArray<string | StateNode<TContext, TEvent>> | undefined): Array<string | StateNode<TContext, TEvent>> | undefined;
|
|
50
|
+
export declare function reportUnhandledExceptionOnInvocation(originalError: any, currentError: any, id: string): void;
|
|
51
|
+
export declare function toInvokeConfig<TContext extends MachineContext, TEvent extends EventObject>(invocable: InvokeConfig<TContext, TEvent> | string | BehaviorCreator<TContext, TEvent> | Behavior<any, any>, id: string): InvokeConfig<TContext, TEvent>;
|
|
52
|
+
export declare function toInvokeSource(src: string | InvokeSourceDefinition): InvokeSourceDefinition;
|
|
53
|
+
export declare function toObserver<T>(nextHandler?: Observer<T> | ((value: T) => void), errorHandler?: (error: any) => void, completionHandler?: () => void): Observer<T>;
|
|
54
|
+
export declare function createInvokeId(stateNodeId: string, index: number): string;
|