xstate 6.0.0-alpha.25 → 6.0.0-alpha.26
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/dist/{StateMachine-b20d5a53.cjs.js → StateMachine-1a51a14a.cjs.js} +2 -0
- package/dist/{StateMachine-bf4ec0f1.development.esm.js → StateMachine-70bbb88f.development.esm.js} +2 -0
- package/dist/{StateMachine-ac1167f3.development.cjs.js → StateMachine-89f725ff.development.cjs.js} +2 -0
- package/dist/{StateMachine-69278d2c.esm.js → StateMachine-bfbf8d6e.esm.js} +2 -0
- package/dist/declarations/src/StateNode.d.ts +2 -0
- package/dist/declarations/src/schema.types.d.ts +5 -0
- package/dist/declarations/src/setup.d.ts +9 -8
- package/dist/declarations/src/types.v6.d.ts +6 -4
- package/dist/xstate-graph.cjs.js +1 -1
- package/dist/xstate-graph.development.cjs.js +1 -1
- package/dist/xstate-graph.development.esm.js +1 -1
- package/dist/xstate-graph.esm.js +1 -1
- package/dist/xstate-graph.umd.min.js +1 -1
- package/dist/xstate-graph.umd.min.js.map +1 -1
- package/dist/xstate.cjs.js +34 -1
- package/dist/xstate.development.cjs.js +34 -1
- package/dist/xstate.development.esm.js +35 -2
- package/dist/xstate.esm.js +35 -2
- package/dist/xstate.umd.min.js +1 -1
- package/dist/xstate.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -195,6 +195,7 @@ class StateNode {
|
|
|
195
195
|
*/
|
|
196
196
|
this.order = -1;
|
|
197
197
|
this.description = void 0;
|
|
198
|
+
this.schemas = void 0;
|
|
198
199
|
this.tags = [];
|
|
199
200
|
this.transitions = void 0;
|
|
200
201
|
this.always = void 0;
|
|
@@ -211,6 +212,7 @@ class StateNode {
|
|
|
211
212
|
this.id = this.config.id || [this.machine.id, ...this.path].join(dist_xstateActors.STATE_DELIMITER);
|
|
212
213
|
this.type = this.config.type || (firstStateKey !== undefined ? 'compound' : this.config.history ? 'history' : 'atomic');
|
|
213
214
|
this.description = this.config.description;
|
|
215
|
+
this.schemas = this.config.schemas;
|
|
214
216
|
validateStateNodeConfig(this);
|
|
215
217
|
this.order = this.machine.idMap.size;
|
|
216
218
|
this.machine.idMap.set(this.id, this);
|
package/dist/{StateMachine-bf4ec0f1.development.esm.js → StateMachine-70bbb88f.development.esm.js}
RENAMED
|
@@ -194,6 +194,7 @@ class StateNode {
|
|
|
194
194
|
*/
|
|
195
195
|
this.order = -1;
|
|
196
196
|
this.description = void 0;
|
|
197
|
+
this.schemas = void 0;
|
|
197
198
|
this.tags = [];
|
|
198
199
|
this.transitions = void 0;
|
|
199
200
|
this.always = void 0;
|
|
@@ -210,6 +211,7 @@ class StateNode {
|
|
|
210
211
|
this.id = this.config.id || [this.machine.id, ...this.path].join(STATE_DELIMITER);
|
|
211
212
|
this.type = this.config.type || (firstStateKey !== undefined ? 'compound' : this.config.history ? 'history' : 'atomic');
|
|
212
213
|
this.description = this.config.description;
|
|
214
|
+
this.schemas = this.config.schemas;
|
|
213
215
|
validateStateNodeConfig(this);
|
|
214
216
|
this.order = this.machine.idMap.size;
|
|
215
217
|
this.machine.idMap.set(this.id, this);
|
package/dist/{StateMachine-ac1167f3.development.cjs.js → StateMachine-89f725ff.development.cjs.js}
RENAMED
|
@@ -196,6 +196,7 @@ class StateNode {
|
|
|
196
196
|
*/
|
|
197
197
|
this.order = -1;
|
|
198
198
|
this.description = void 0;
|
|
199
|
+
this.schemas = void 0;
|
|
199
200
|
this.tags = [];
|
|
200
201
|
this.transitions = void 0;
|
|
201
202
|
this.always = void 0;
|
|
@@ -212,6 +213,7 @@ class StateNode {
|
|
|
212
213
|
this.id = this.config.id || [this.machine.id, ...this.path].join(dist_xstateActors.STATE_DELIMITER);
|
|
213
214
|
this.type = this.config.type || (firstStateKey !== undefined ? 'compound' : this.config.history ? 'history' : 'atomic');
|
|
214
215
|
this.description = this.config.description;
|
|
216
|
+
this.schemas = this.config.schemas;
|
|
215
217
|
validateStateNodeConfig(this);
|
|
216
218
|
this.order = this.machine.idMap.size;
|
|
217
219
|
this.machine.idMap.set(this.id, this);
|
|
@@ -193,6 +193,7 @@ class StateNode {
|
|
|
193
193
|
*/
|
|
194
194
|
this.order = -1;
|
|
195
195
|
this.description = void 0;
|
|
196
|
+
this.schemas = void 0;
|
|
196
197
|
this.tags = [];
|
|
197
198
|
this.transitions = void 0;
|
|
198
199
|
this.always = void 0;
|
|
@@ -209,6 +210,7 @@ class StateNode {
|
|
|
209
210
|
this.id = this.config.id || [this.machine.id, ...this.path].join(STATE_DELIMITER);
|
|
210
211
|
this.type = this.config.type || (firstStateKey !== undefined ? 'compound' : this.config.history ? 'history' : 'atomic');
|
|
211
212
|
this.description = this.config.description;
|
|
213
|
+
this.schemas = this.config.schemas;
|
|
212
214
|
validateStateNodeConfig(this);
|
|
213
215
|
this.order = this.machine.idMap.size;
|
|
214
216
|
this.machine.idMap.set(this.id, this);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SetupStateSchemas } from "./schema.types.js";
|
|
1
2
|
import type { DelayedTransitionDefinition, EventObject, InitialTransitionDefinition, MachineContext, Mapper, StateNodesConfig, TransitionDefinitionMap, AnyStateMachine, AnyStateNodeConfig, NonReducibleUnknown, EventDescriptor, AnyAction, AnyTransitionDefinition, AnyInvokeDefinition } from "./types.js";
|
|
2
3
|
interface StateNodeOptions<TContext extends MachineContext, TEvent extends EventObject> {
|
|
3
4
|
_key: string;
|
|
@@ -60,6 +61,7 @@ export declare class StateNode<TContext extends MachineContext = MachineContext,
|
|
|
60
61
|
*/
|
|
61
62
|
order: number;
|
|
62
63
|
description?: string;
|
|
64
|
+
schemas: SetupStateSchemas | undefined;
|
|
63
65
|
tags: string[];
|
|
64
66
|
transitions: Map<string, AnyTransitionDefinition[]>;
|
|
65
67
|
always?: Array<AnyTransitionDefinition>;
|
|
@@ -3,6 +3,11 @@ export interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
|
3
3
|
/** The Standard Schema properties. */
|
|
4
4
|
readonly '~standard': StandardSchemaV1.Props<Input, Output>;
|
|
5
5
|
}
|
|
6
|
+
/** Schemas that can be declared for an individual state node. */
|
|
7
|
+
export type SetupStateSchemas = {
|
|
8
|
+
context?: StandardSchemaV1;
|
|
9
|
+
input?: StandardSchemaV1;
|
|
10
|
+
};
|
|
6
11
|
/** A type-only Standard Schema produced by {@link types}. */
|
|
7
12
|
export interface TypeSchema<T> extends StandardSchemaV1<T, T> {
|
|
8
13
|
readonly '~standard': StandardSchemaV1.Props<T, T> & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { StandardSchemaV1 } from "./schema.types.js";
|
|
1
|
+
import { SetupStateSchemas, StandardSchemaV1 } from "./schema.types.js";
|
|
2
2
|
import { StateMachine } from "./StateMachine.js";
|
|
3
3
|
import { type Actor, type RequiredActorOptionsKeys } from "./createActor.js";
|
|
4
|
-
import { AnyActorRef, AnyActorLogic, ActorRefFromLogic, AnyStateNode, EventObject, AnyEventObject, EventDescriptor, ExtractEvent, MachineContext, ProvidedActor, RoutableStateId, StateSchema, StateValue, ToChildren, MetaObject, Cast, Compute, EnqueueObject, DoneActorEvent, DoneStateEvent, ErrorActorEvent, SystemRegistry, RegistryKeyForLogic, ActorOptions, Observer, Subscription, OutputArg, SnapshotEvent, SingleOrArray } from "./types.js";
|
|
4
|
+
import { AnyActorRef, AnyActorLogic, ActorRefFromLogic, AnyStateNode, EventObject, AnyEventObject, EventDescriptor, ExtractEvent, MachineContext, ProvidedActor, RoutableStateId, StateSchema, StateValue, ToChildren, MetaObject, Cast, Compute, EnqueueObject, DoneActorEvent, DoneStateEvent, ErrorActorEvent, SystemRegistry, RegistryKeyForLogic, ActorOptions, Observer, Subscription, OutputArg, SnapshotEvent, SingleOrArray, AfterEvent, TimeoutEvent, ErrorEvent } from "./types.js";
|
|
5
5
|
import { AnyActorSystem } from "./system.js";
|
|
6
6
|
import { InspectionEvent } from "./inspection.js";
|
|
7
7
|
import { ActionSchemas, DelayMapFromNames, GuardSchemas, InferChildren, InferActions, InferGuards, Sources, InferOutput, InferEvents, Next_MachineConfig, Next_InvokeConfig, Next_StateNodeConfig, Next_TransitionConfigOrTarget, WithDefault } from "./types.v6.js";
|
|
@@ -50,10 +50,7 @@ type ValidateRegistryKeys<TConfig, TSystemRegistry extends SystemRegistry, TActo
|
|
|
50
50
|
[K in keyof TStates]: TStates[K] & ValidateRegistryKeys<TStates[K], TSystemRegistry, TActorMap>;
|
|
51
51
|
};
|
|
52
52
|
} : unknown);
|
|
53
|
-
export type SetupStateSchemas
|
|
54
|
-
context?: StandardSchemaV1;
|
|
55
|
-
input?: StandardSchemaV1;
|
|
56
|
-
};
|
|
53
|
+
export type { SetupStateSchemas };
|
|
57
54
|
export type SetupSchemas = {
|
|
58
55
|
context?: StandardSchemaV1;
|
|
59
56
|
events?: Record<string, StandardSchemaV1>;
|
|
@@ -245,7 +242,7 @@ type StatesWithInput<TRootStateSchemas extends Record<string, SetupStateSchema>,
|
|
|
245
242
|
[K in TStateKeys]?: StateNodeConfigWithNestedInput<StateSchemasWithKeys<TRootStateSchemas, TStateKeys>, K extends keyof TStateSchemas ? TStateSchemas[K] : {}, TContext, TContextShape, TEvent, TChildren, TDelays, TTag, TOutput, TEmitted, TMeta, TActionMap, TActorMap, TGuardMap, TDelayMap, TSystemRegistry>;
|
|
246
243
|
};
|
|
247
244
|
/** State node config that recursively applies typed input for nested states */
|
|
248
|
-
type StateNodeConfigWithNestedInput<TSiblingStateSchemas extends Record<string, SetupStateSchema>, TStateSchema extends SetupStateSchema, TContext extends MachineContext, TContextShape, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TDelays extends string, TTag extends string, TOutput, TEmitted extends EventObject, TMeta extends MetaObject, TActionMap extends Sources['actions'], TActorMap extends Sources['actors'], TGuardMap extends Sources['guards'], TDelayMap extends Sources['delays'], TSystemRegistry extends SystemRegistry> = WithNestedStates<Omit<Next_StateNodeConfig<StateContext<TStateSchema, TContext>, TEvent, TDelays, TTag, TOutput, TEmitted, TMeta, TChildren, TActionMap, TActorMap, TGuardMap, TDelayMap, StateInput<TStateSchema>, Record<string, unknown>, TSystemRegistry>, 'on' | 'always' | 'initial' | 'invoke' | 'onDone'> & {
|
|
245
|
+
type StateNodeConfigWithNestedInput<TSiblingStateSchemas extends Record<string, SetupStateSchema>, TStateSchema extends SetupStateSchema, TContext extends MachineContext, TContextShape, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TDelays extends string, TTag extends string, TOutput, TEmitted extends EventObject, TMeta extends MetaObject, TActionMap extends Sources['actions'], TActorMap extends Sources['actors'], TGuardMap extends Sources['guards'], TDelayMap extends Sources['delays'], TSystemRegistry extends SystemRegistry> = WithNestedStates<Omit<Next_StateNodeConfig<StateContext<TStateSchema, TContext>, TEvent, TDelays, TTag, TOutput, TEmitted, TMeta, TChildren, TActionMap, TActorMap, TGuardMap, TDelayMap, StateInput<TStateSchema>, Record<string, unknown>, TSystemRegistry>, 'on' | 'always' | 'initial' | 'invoke' | 'onDone' | 'onError' | 'onTimeout' | 'after'> & {
|
|
249
246
|
initial?: TStateSchema['states'] extends Record<string, SetupStateSchema> ? SetupStateKey<TStateSchema['states']> | (string & {}) | InitialTransitionWithInput<TStateSchema['states'], StateContext<TStateSchema, TContext>, TEvent> : string | {
|
|
250
247
|
target: string;
|
|
251
248
|
input?: Record<string, unknown>;
|
|
@@ -254,6 +251,11 @@ type StateNodeConfigWithNestedInput<TSiblingStateSchemas extends Record<string,
|
|
|
254
251
|
always?: StateTransitionConfigOrTarget<TSiblingStateSchemas, StateContext<TStateSchema, TContext>, StateContextShape<TStateSchema, TContextShape>, TEvent, TEvent, TEmitted, TChildren, TMeta, TActionMap, TActorMap, TGuardMap, TDelayMap, TSystemRegistry, StateInput<TStateSchema>>;
|
|
255
252
|
invoke?: SingleOrArray<SetupInvokeConfig<TSiblingStateSchemas, StateContext<TStateSchema, TContext>, StateContextShape<TStateSchema, TContextShape>, TEvent, TEmitted, TChildren, TMeta, TActionMap, TActorMap, TGuardMap, TDelayMap, TSystemRegistry>>;
|
|
256
253
|
onDone?: StateTransitionConfigOrTarget<TSiblingStateSchemas, StateContext<TStateSchema, TContext>, StateContextShape<TStateSchema, TContextShape>, DoneStateEvent, TEvent, TEmitted, TChildren, TMeta, TActionMap, TActorMap, TGuardMap, TDelayMap, TSystemRegistry, StateInput<TStateSchema>>;
|
|
254
|
+
onError?: StateTransitionConfigOrTarget<TSiblingStateSchemas, StateContext<TStateSchema, TContext>, StateContextShape<TStateSchema, TContextShape>, ErrorEvent, TEvent, TEmitted, TChildren, TMeta, TActionMap, TActorMap, TGuardMap, TDelayMap, TSystemRegistry, StateInput<TStateSchema>>;
|
|
255
|
+
onTimeout?: StateTransitionConfigOrTarget<TSiblingStateSchemas, StateContext<TStateSchema, TContext>, StateContextShape<TStateSchema, TContextShape>, TimeoutEvent, TEvent, TEmitted, TChildren, TMeta, TActionMap, TActorMap, TGuardMap, TDelayMap, TSystemRegistry, StateInput<TStateSchema>>;
|
|
256
|
+
after?: {
|
|
257
|
+
[K in NoInfer<TDelays> | number]?: StateTransitionConfigOrTarget<TSiblingStateSchemas, StateContext<TStateSchema, TContext>, StateContextShape<TStateSchema, TContextShape>, AfterEvent, TEvent, TEmitted, TChildren, TMeta, TActionMap, TActorMap, TGuardMap, TDelayMap, TSystemRegistry, StateInput<TStateSchema>>;
|
|
258
|
+
};
|
|
257
259
|
}, TStateSchema['states'] extends Record<string, SetupStateSchema> ? StatesWithInput<TStateSchema['states'], TStateSchema['states'], TContext, StateContextShape<TStateSchema, TContextShape>, TEvent, TChildren, TDelays, TTag, TOutput, TEmitted, TMeta, TActionMap, TActorMap, TGuardMap, TDelayMap, TSystemRegistry> : {
|
|
258
260
|
[K in string]?: Next_StateNodeConfig<TContext, TEvent, TDelays, TTag, TOutput, TEmitted, TMeta, TChildren, TActionMap, TActorMap, TGuardMap, TDelayMap, undefined, Record<string, unknown>, TSystemRegistry>;
|
|
259
261
|
}>;
|
|
@@ -469,4 +471,3 @@ type SystemBuilder<TSystemRegistry extends SystemRegistry> = {
|
|
|
469
471
|
setup<const TSchemas extends SetupSchemas = {}, const TStates extends Record<string, SetupStateSchema> = Record<string, SetupStateSchema>, TActionMap extends Sources['actions'] = {}, TActorMap extends Sources['actors'] = {}, TGuardMap extends Sources['guards'] = {}, TDelayMap extends Sources['delays'] = {}>(config?: SetupConfig<TSchemas, TStates, TActionMap, TActorMap, TGuardMap, TDelayMap>): SetupReturn<TStates, TSchemas, TActionMap, TActorMap, TGuardMap, TDelayMap, Extract<keyof TDelayMap, string>, TSystemRegistry>;
|
|
470
472
|
};
|
|
471
473
|
export declare function createSystem<const TSystemRegistry extends SystemRegistry = {}>(_config?: SystemConfig<TSystemRegistry>): SystemBuilder<TSystemRegistry>;
|
|
472
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StandardSchemaV1 } from "./schema.types.js";
|
|
1
|
+
import { SetupStateSchemas, StandardSchemaV1 } from "./schema.types.js";
|
|
2
2
|
import { MachineSnapshot } from "./State.js";
|
|
3
3
|
import { Action, ActorTimeoutEvent, AfterEvent, ActorLogic, ActorRef, ActorRefFromLogic, ActorSelf, AnyActorLogic, AnyActorRef, Compute, DoneActorEvent, DoNotInfer, ErrorActorEvent, EventDescriptor, ErrorEvent, EventObject, EventPayloadPattern, ExtractEvent, InitialContext, InputFrom, IsNever, MetaObject, NonReducibleUnknown, OutputFrom, SingleOrArray, SnapshotEvent, StateValue, TODO, TransitionContextMapper, TransitionContextPatch, TransitionConfigFunction, Values, AnyStateNode, SystemRegistry, TimeoutEvent } from "./types.js";
|
|
4
4
|
import { MachineContext, Mapper } from "./types.js";
|
|
@@ -102,7 +102,7 @@ type MachineSchemas<TContextSchema extends StandardSchemaV1, TEventSchemaMap ext
|
|
|
102
102
|
children?: TChildrenSchemaMap;
|
|
103
103
|
};
|
|
104
104
|
export type AnyMachineSchemas = MachineSchemas<StandardSchemaV1, Record<string, StandardSchemaV1>, Record<string, StandardSchemaV1>, StandardSchemaV1, StandardSchemaV1, StandardSchemaV1, StandardSchemaV1, Record<string, StandardSchemaV1>>;
|
|
105
|
-
export type Next_MachineConfig<TContextSchema extends StandardSchemaV1, TEventSchemaMap extends Record<string, StandardSchemaV1>, TEmittedSchemaMap extends Record<string, StandardSchemaV1>, TInputSchema extends StandardSchemaV1, TOutputSchema extends StandardSchemaV1, TMetaSchema extends StandardSchemaV1, TTagSchema extends StandardSchemaV1, TChildrenSchemaMap extends Record<string, StandardSchemaV1>, TContext extends MachineContext = InferOutput<TContextSchema, MachineContext>, TEvent extends EventObject = InferEvents<TEventSchemaMap>, TChildren extends Record<string, AnyActorRef | undefined> = InferChildren<TChildrenSchemaMap>, TDelays extends string = string, _TTag extends string = string, TActionMap extends Sources['actions'] = Sources['actions'], TActorMap extends Sources['actors'] = Sources['actors'], TGuardMap extends Sources['guards'] = Sources['guards'], TDelayMap extends Sources['delays'] = Sources['delays'], TContextRequired extends boolean = IsNever<TContext> extends true ? false : true, TSystemRegistry extends SystemRegistry = SystemRegistry> = (DistributiveOmit<Next_StateNodeConfig<TContext, DoNotInfer<InferEvents<TEventSchemaMap>>, DoNotInfer<TDelays>, DoNotInfer<StandardSchemaV1.InferOutput<TTagSchema> & string>, DoNotInfer<StandardSchemaV1.InferOutput<TOutputSchema>>, DoNotInfer<InferEvents<TEmittedSchemaMap>>, DoNotInfer<InferOutput<TMetaSchema, MetaObject>>, DoNotInfer<TChildren>, DoNotInfer<TActionMap>, DoNotInfer<TActorMap>, DoNotInfer<TGuardMap>, DoNotInfer<TDelayMap>, Record<string, unknown> | undefined, Record<string, unknown>, DoNotInfer<TSystemRegistry>, DoNotInfer<InferOutput<TOutputSchema, unknown>>>, 'output'> & {
|
|
105
|
+
export type Next_MachineConfig<TContextSchema extends StandardSchemaV1, TEventSchemaMap extends Record<string, StandardSchemaV1>, TEmittedSchemaMap extends Record<string, StandardSchemaV1>, TInputSchema extends StandardSchemaV1, TOutputSchema extends StandardSchemaV1, TMetaSchema extends StandardSchemaV1, TTagSchema extends StandardSchemaV1, TChildrenSchemaMap extends Record<string, StandardSchemaV1>, TContext extends MachineContext = InferOutput<TContextSchema, MachineContext>, TEvent extends EventObject = InferEvents<TEventSchemaMap>, TChildren extends Record<string, AnyActorRef | undefined> = InferChildren<TChildrenSchemaMap>, TDelays extends string = string, _TTag extends string = string, TActionMap extends Sources['actions'] = Sources['actions'], TActorMap extends Sources['actors'] = Sources['actors'], TGuardMap extends Sources['guards'] = Sources['guards'], TDelayMap extends Sources['delays'] = Sources['delays'], TContextRequired extends boolean = IsNever<TContext> extends true ? false : true, TSystemRegistry extends SystemRegistry = SystemRegistry> = (DistributiveOmit<Next_StateNodeConfig<TContext, DoNotInfer<InferEvents<TEventSchemaMap>>, DoNotInfer<TDelays>, DoNotInfer<StandardSchemaV1.InferOutput<TTagSchema> & string>, DoNotInfer<StandardSchemaV1.InferOutput<TOutputSchema>>, DoNotInfer<InferEvents<TEmittedSchemaMap>>, DoNotInfer<InferOutput<TMetaSchema, MetaObject>>, DoNotInfer<TChildren>, DoNotInfer<TActionMap>, DoNotInfer<TActorMap>, DoNotInfer<TGuardMap>, DoNotInfer<TDelayMap>, Record<string, unknown> | undefined, Record<string, unknown>, DoNotInfer<TSystemRegistry>, DoNotInfer<InferOutput<TOutputSchema, unknown>>>, 'output' | 'schemas'> & {
|
|
106
106
|
internalEvents?: readonly InternalEventDescriptorFor<InferEvents<TEventSchemaMap>>[];
|
|
107
107
|
schemas?: MachineSchemas<TContextSchema, TEventSchemaMap, TEmittedSchemaMap, TInputSchema, TOutputSchema, TMetaSchema, TTagSchema, TChildrenSchemaMap>;
|
|
108
108
|
actions?: TActionMap;
|
|
@@ -264,6 +264,7 @@ type Next_ChoiceConfigFunction<TContext extends MachineContext, TCurrentEvent ex
|
|
|
264
264
|
export type Next_StateNodeConfig<TContext extends MachineContext, TEvent extends EventObject, TDelays extends string, TTag extends string, _TOutput, TEmitted extends EventObject, TMeta extends MetaObject, TChildren extends Record<string, AnyActorRef | undefined>, TActionMap extends Sources['actions'], TActorMap extends Sources['actors'], TGuardMap extends Sources['guards'], TDelayMap extends Sources['delays'], TInput = Record<string, unknown> | undefined, TInputMap extends Record<string, unknown> = Record<string, unknown>, TSystemRegistry extends SystemRegistry = SystemRegistry, TChildOutput = unknown> = Next_RegularStateNodeConfig<TContext, TEvent, TDelays, TTag, _TOutput, TEmitted, TMeta, TChildren, TActionMap, TActorMap, TGuardMap, TDelayMap, TInput, TInputMap, TSystemRegistry, TChildOutput> | Next_ChoiceStateNodeConfig<TContext, TEvent, TTag, TMeta, TActionMap, TActorMap, TGuardMap, TDelayMap>;
|
|
265
265
|
interface Next_ChoiceStateNodeConfig<TContext extends MachineContext, TEvent extends EventObject, TTag extends string, TMeta extends MetaObject, TActionMap extends Sources['actions'], TActorMap extends Sources['actors'], TGuardMap extends Sources['guards'], TDelayMap extends Sources['delays']> {
|
|
266
266
|
contextSchema?: StandardSchemaV1;
|
|
267
|
+
schemas?: SetupStateSchemas;
|
|
267
268
|
type: 'choice';
|
|
268
269
|
/** Function that resolves this choice state to a target. */
|
|
269
270
|
choice: Next_ChoiceConfigFunction<TContext, TEvent, TEvent, TActionMap, TActorMap, TGuardMap, TDelayMap, TMeta>;
|
|
@@ -291,6 +292,7 @@ interface Next_ChoiceStateNodeConfig<TContext extends MachineContext, TEvent ext
|
|
|
291
292
|
}
|
|
292
293
|
interface Next_RegularStateNodeConfig<TContext extends MachineContext, TEvent extends EventObject, TDelays extends string, TTag extends string, TOutput, TEmitted extends EventObject, TMeta extends MetaObject, TChildren extends Record<string, AnyActorRef | undefined>, TActionMap extends Sources['actions'], TActorMap extends Sources['actors'], TGuardMap extends Sources['guards'], TDelayMap extends Sources['delays'], TInput = Record<string, unknown> | undefined, TInputMap extends Record<string, unknown> = Record<string, unknown>, TSystemRegistry extends SystemRegistry = SystemRegistry, TChildOutput = unknown> {
|
|
293
294
|
contextSchema?: StandardSchemaV1;
|
|
295
|
+
schemas?: SetupStateSchemas;
|
|
294
296
|
/** The initial state transition. */
|
|
295
297
|
initial?: string | {
|
|
296
298
|
target: string;
|
|
@@ -418,7 +420,7 @@ interface Next_RegularStateNodeConfig<TContext extends MachineContext, TEvent ex
|
|
|
418
420
|
/** A default target for a history state */
|
|
419
421
|
target?: string | undefined;
|
|
420
422
|
}
|
|
421
|
-
export type Next_TransitionConfigOrTarget<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject, TEmitted extends EventObject, TActionMap extends Sources['actions'], TActorMap extends Sources['actors'], TGuardMap extends Sources['guards'], TDelayMap extends Sources['delays'], TMeta extends MetaObject, TInput = undefined> =
|
|
423
|
+
export type Next_TransitionConfigOrTarget<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject, TEmitted extends EventObject, TActionMap extends Sources['actions'], TActorMap extends Sources['actors'], TGuardMap extends Sources['guards'], TDelayMap extends Sources['delays'], TMeta extends MetaObject, TInput = undefined> = undefined | {
|
|
422
424
|
matches?: EventPayloadPattern<TExpressionEvent>;
|
|
423
425
|
target?: string | string[];
|
|
424
426
|
context?: TransitionContextPatch<TContext> | TransitionContextMapper<TContext, TExpressionEvent, TEvent, TActionMap, TActorMap, TGuardMap, TDelayMap>;
|
|
@@ -440,7 +442,7 @@ export type Next_TransitionConfigOrTarget<TContext extends MachineContext, TExpr
|
|
|
440
442
|
context: any;
|
|
441
443
|
event: any;
|
|
442
444
|
}) => Record<string, unknown>);
|
|
443
|
-
} | TransitionConfigFunction<TContext, TExpressionEvent, TEvent, TEmitted, TActionMap, TActorMap, TGuardMap, TDelayMap, TMeta, TInput
|
|
445
|
+
} | TransitionConfigFunction<TContext, TExpressionEvent, TEvent, TEmitted, TActionMap, TActorMap, TGuardMap, TDelayMap, TMeta, TInput>;
|
|
444
446
|
export type WithDefault<T, Default> = IsNever<T> extends true ? Default : T;
|
|
445
447
|
export interface Sources {
|
|
446
448
|
actions: Record<string, (...args: any[]) => void | {
|
package/dist/xstate-graph.cjs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var dist_xstateActors = require('./index-f58cc498.cjs.js');
|
|
6
|
-
var StateMachine = require('./StateMachine-
|
|
6
|
+
var StateMachine = require('./StateMachine-1a51a14a.cjs.js');
|
|
7
7
|
|
|
8
8
|
function simpleStringify(value) {
|
|
9
9
|
return JSON.stringify(value);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var dist_xstateActors = require('./index-1ad8a761.development.cjs.js');
|
|
6
|
-
var StateMachine = require('./StateMachine-
|
|
6
|
+
var StateMachine = require('./StateMachine-89f725ff.development.cjs.js');
|
|
7
7
|
|
|
8
8
|
function simpleStringify(value) {
|
|
9
9
|
return JSON.stringify(value);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { q as isMachineSnapshot, ai as getAllOwnEvents, aj as matchesEvent, C as createEmptyActor, X as XSTATE_INIT } from './index-b90ebcd4.development.esm.js';
|
|
2
|
-
import { S as StateMachine } from './StateMachine-
|
|
2
|
+
import { S as StateMachine } from './StateMachine-70bbb88f.development.esm.js';
|
|
3
3
|
|
|
4
4
|
function simpleStringify(value) {
|
|
5
5
|
return JSON.stringify(value);
|
package/dist/xstate-graph.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { q as isMachineSnapshot, ai as getAllOwnEvents, aj as matchesEvent, C as createEmptyActor, X as XSTATE_INIT } from './index-036a773f.esm.js';
|
|
2
|
-
import { S as StateMachine } from './StateMachine-
|
|
2
|
+
import { S as StateMachine } from './StateMachine-bfbf8d6e.esm.js';
|
|
3
3
|
|
|
4
4
|
function simpleStringify(value) {
|
|
5
5
|
return JSON.stringify(value);
|