xstate 5.32.2 → 6.0.0-alpha.10

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.
Files changed (121) hide show
  1. package/README.md +25 -24
  2. package/dist/StateMachine-0aa98f54.development.esm.js +746 -0
  3. package/dist/StateMachine-aef700df.cjs.js +732 -0
  4. package/dist/StateMachine-d4931336.esm.js +729 -0
  5. package/dist/StateMachine-da872dde.development.cjs.js +749 -0
  6. package/dist/declarations/src/State.d.ts +11 -13
  7. package/dist/declarations/src/StateMachine.d.ts +40 -26
  8. package/dist/declarations/src/StateNode.d.ts +18 -54
  9. package/dist/declarations/src/actions.d.ts +14 -9
  10. package/dist/declarations/src/actors/callback.d.ts +42 -16
  11. package/dist/declarations/src/actors/index.d.ts +9 -6
  12. package/dist/declarations/src/actors/listener.d.ts +18 -0
  13. package/dist/declarations/src/actors/logic.d.ts +105 -0
  14. package/dist/declarations/src/actors/observable.d.ts +72 -27
  15. package/dist/declarations/src/actors/promise.d.ts +133 -48
  16. package/dist/declarations/src/actors/subscription.d.ts +22 -0
  17. package/dist/declarations/src/createActor.d.ts +33 -34
  18. package/dist/declarations/src/createMachine.d.ts +38 -7
  19. package/dist/declarations/src/createMachineFromConfig.d.ts +177 -0
  20. package/dist/declarations/src/graph/graph.d.ts +6 -4
  21. package/dist/declarations/src/graph/shortestPaths.d.ts +2 -2
  22. package/dist/declarations/src/graph/simplePaths.d.ts +2 -2
  23. package/dist/declarations/src/index.d.ts +13 -9
  24. package/dist/declarations/src/inspection.d.ts +84 -30
  25. package/dist/declarations/src/mapState.d.ts +4 -2
  26. package/dist/declarations/src/schema.types.d.ts +90 -0
  27. package/dist/declarations/src/serialize.d.ts +50 -0
  28. package/dist/declarations/src/setup.d.ts +396 -136
  29. package/dist/declarations/src/spawn.d.ts +7 -32
  30. package/dist/declarations/src/stateUtils.d.ts +22 -19
  31. package/dist/declarations/src/system.d.ts +8 -7
  32. package/dist/declarations/src/transition.d.ts +8 -5
  33. package/dist/declarations/src/transitionActions.d.ts +4 -0
  34. package/dist/declarations/src/types.d.ts +494 -429
  35. package/dist/declarations/src/types.v6.d.ts +423 -0
  36. package/dist/declarations/src/utils.d.ts +5 -3
  37. package/dist/index-219cb621.development.cjs.js +4476 -0
  38. package/dist/index-2f2fbd9b.development.esm.js +4421 -0
  39. package/dist/index-559ceab3.cjs.js +4437 -0
  40. package/dist/index-8828376f.esm.js +4382 -0
  41. package/dist/xstate-actors.cjs.js +12 -838
  42. package/dist/xstate-actors.cjs.mjs +10 -5
  43. package/dist/xstate-actors.development.cjs.js +12 -838
  44. package/dist/xstate-actors.development.cjs.mjs +10 -5
  45. package/dist/xstate-actors.development.esm.js +1 -836
  46. package/dist/xstate-actors.esm.js +1 -836
  47. package/dist/xstate-actors.umd.min.js +1 -1
  48. package/dist/xstate-actors.umd.min.js.map +1 -1
  49. package/dist/xstate-graph.cjs.js +18 -29
  50. package/dist/xstate-graph.development.cjs.js +18 -29
  51. package/dist/xstate-graph.development.esm.js +15 -26
  52. package/dist/xstate-graph.esm.js +15 -26
  53. package/dist/xstate-graph.umd.min.js +1 -1
  54. package/dist/xstate-graph.umd.min.js.map +1 -1
  55. package/dist/xstate.cjs.js +1477 -122
  56. package/dist/xstate.cjs.mjs +19 -22
  57. package/dist/xstate.development.cjs.js +1477 -122
  58. package/dist/xstate.development.cjs.mjs +19 -22
  59. package/dist/xstate.development.esm.js +1442 -86
  60. package/dist/xstate.esm.js +1442 -86
  61. package/dist/xstate.umd.min.js +1 -1
  62. package/dist/xstate.umd.min.js.map +1 -1
  63. package/package.json +3 -47
  64. package/dist/StateMachine-23c204bb.development.esm.js +0 -566
  65. package/dist/StateMachine-67a0f463.development.cjs.js +0 -569
  66. package/dist/StateMachine-94d215e3.cjs.js +0 -563
  67. package/dist/StateMachine-d1d80308.esm.js +0 -560
  68. package/dist/assign-43b1b558.development.esm.js +0 -133
  69. package/dist/assign-54b312bc.esm.js +0 -127
  70. package/dist/assign-b5bc78f7.cjs.js +0 -129
  71. package/dist/assign-f8f66278.development.cjs.js +0 -135
  72. package/dist/declarations/src/actions/assign.d.ts +0 -45
  73. package/dist/declarations/src/actions/cancel.d.ts +0 -39
  74. package/dist/declarations/src/actions/emit.d.ts +0 -44
  75. package/dist/declarations/src/actions/enqueueActions.d.ts +0 -57
  76. package/dist/declarations/src/actions/log.d.ts +0 -16
  77. package/dist/declarations/src/actions/raise.d.ts +0 -21
  78. package/dist/declarations/src/actions/send.d.ts +0 -42
  79. package/dist/declarations/src/actions/spawnChild.d.ts +0 -34
  80. package/dist/declarations/src/actions/stopChild.d.ts +0 -19
  81. package/dist/declarations/src/actors/transition.d.ts +0 -143
  82. package/dist/declarations/src/dev/index.d.ts +0 -14
  83. package/dist/declarations/src/guards.d.ts +0 -128
  84. package/dist/log-9b02c355.esm.js +0 -401
  85. package/dist/log-c94995c7.cjs.js +0 -409
  86. package/dist/log-d9f3f459.development.cjs.js +0 -437
  87. package/dist/log-db444cad.development.esm.js +0 -429
  88. package/dist/raise-235108c6.esm.js +0 -2762
  89. package/dist/raise-45f11c00.development.esm.js +0 -2824
  90. package/dist/raise-c445379d.cjs.js +0 -2817
  91. package/dist/raise-eca73993.development.cjs.js +0 -2879
  92. package/dist/xstate-actions.cjs.d.mts +0 -2
  93. package/dist/xstate-actions.cjs.d.ts +0 -2
  94. package/dist/xstate-actions.cjs.js +0 -23
  95. package/dist/xstate-actions.cjs.mjs +0 -14
  96. package/dist/xstate-actions.development.cjs.js +0 -23
  97. package/dist/xstate-actions.development.cjs.mjs +0 -14
  98. package/dist/xstate-actions.development.esm.js +0 -4
  99. package/dist/xstate-actions.esm.js +0 -4
  100. package/dist/xstate-actions.umd.min.js +0 -2
  101. package/dist/xstate-actions.umd.min.js.map +0 -1
  102. package/dist/xstate-dev.cjs.d.mts +0 -2
  103. package/dist/xstate-dev.cjs.d.ts +0 -2
  104. package/dist/xstate-dev.cjs.js +0 -48
  105. package/dist/xstate-dev.cjs.mjs +0 -5
  106. package/dist/xstate-dev.development.cjs.js +0 -51
  107. package/dist/xstate-dev.development.cjs.mjs +0 -5
  108. package/dist/xstate-dev.development.esm.js +0 -45
  109. package/dist/xstate-dev.esm.js +0 -42
  110. package/dist/xstate-dev.umd.min.js +0 -2
  111. package/dist/xstate-dev.umd.min.js.map +0 -1
  112. package/dist/xstate-guards.cjs.d.mts +0 -2
  113. package/dist/xstate-guards.cjs.d.ts +0 -2
  114. package/dist/xstate-guards.cjs.js +0 -14
  115. package/dist/xstate-guards.cjs.mjs +0 -7
  116. package/dist/xstate-guards.development.cjs.js +0 -14
  117. package/dist/xstate-guards.development.cjs.mjs +0 -7
  118. package/dist/xstate-guards.development.esm.js +0 -2
  119. package/dist/xstate-guards.esm.js +0 -2
  120. package/dist/xstate-guards.umd.min.js +0 -2
  121. package/dist/xstate-guards.umd.min.js.map +0 -1
@@ -1,8 +1,18 @@
1
+ import { StandardSchemaV1 } from "../schema.types.js";
1
2
  import { AnyActorSystem } from "../system.js";
2
- import { ActorLogic, ActorRefFromLogic, EventObject, NonReducibleUnknown, Snapshot, Subscribable, Subscription } from "../types.js";
3
+ import { ActorLogic, ActorFromLogic, ActorRefFromLogic, EventObject, NonReducibleUnknown, Snapshot, Subscribable, Subscription } from "../types.js";
3
4
  export type ObservableSnapshot<TContext, TInput extends NonReducibleUnknown> = Snapshot<undefined> & {
4
5
  context: TContext | undefined;
5
6
  input: TInput | undefined;
7
+ effects?: Record<string, {
8
+ status: 'active';
9
+ } | {
10
+ status: 'done';
11
+ output?: unknown;
12
+ } | {
13
+ status: 'error';
14
+ error: unknown;
15
+ }>;
6
16
  _subscription: Subscription | undefined;
7
17
  };
8
18
  export type ObservableActorLogic<TContext, TInput extends NonReducibleUnknown, TEmitted extends EventObject = EventObject> = ActorLogic<ObservableSnapshot<TContext, TInput>, {
@@ -10,14 +20,15 @@ export type ObservableActorLogic<TContext, TInput extends NonReducibleUnknown, T
10
20
  [k: string]: unknown;
11
21
  }, TInput, AnyActorSystem, TEmitted>;
12
22
  /**
13
- * Represents an actor created by `fromObservable` or `fromEventObservable`.
23
+ * Represents an actor created by `createObservableLogic` or
24
+ * `createEventObservableLogic`.
14
25
  *
15
26
  * The type of `self` within the actor's logic.
16
27
  *
17
28
  * @example
18
29
  *
19
30
  * ```ts
20
- * import { fromObservable, createActor } from 'xstate';
31
+ * import { createObservableLogic, createActor } from 'xstate';
21
32
  * import { interval } from 'rxjs';
22
33
  *
23
34
  * // The type of the value observed by the actor's logic.
@@ -27,21 +38,48 @@ export type ObservableActorLogic<TContext, TInput extends NonReducibleUnknown, T
27
38
  *
28
39
  * // Actor logic that observes a number incremented every `input.period`
29
40
  * // milliseconds (default: 1_000).
30
- * const logic = fromObservable<Context, Input>(({ input, self }) => {
31
- * self;
32
- * // ^? ObservableActorRef<Event, Input>
41
+ * const logic = createObservableLogic<Context, Input>(
42
+ * ({ input, self }) => {
43
+ * self;
44
+ * // ^? ObservableActor<Event, Input>
33
45
  *
34
- * return interval(input.period ?? 1_000);
35
- * });
46
+ * return interval(input.period ?? 1_000);
47
+ * }
48
+ * );
36
49
  *
37
50
  * const actor = createActor(logic, { input: { period: 2_000 } });
38
- * // ^? ObservableActorRef<Event, Input>
51
+ * // ^? ObservableActor<Event, Input>
39
52
  * ```
40
53
  *
41
- * @see {@link fromObservable}
42
- * @see {@link fromEventObservable}
54
+ * @see {@link createObservableLogic}
55
+ * @see {@link createEventObservableLogic}
43
56
  */
44
57
  export type ObservableActorRef<TContext> = ActorRefFromLogic<ObservableActorLogic<TContext, any>>;
58
+ type ObservableActor<TContext, TInput extends NonReducibleUnknown = any, TEmitted extends EventObject = EventObject> = ActorFromLogic<ObservableActorLogic<TContext, TInput, TEmitted>>;
59
+ export type ObservableLogicFunction<TContext, TInput extends NonReducibleUnknown, TEmitted extends EventObject = EventObject> = ({ input, system, self, emit }: {
60
+ input: TInput;
61
+ system: AnyActorSystem;
62
+ self: ObservableActor<TContext, TInput, TEmitted>;
63
+ emit: (emitted: TEmitted) => void;
64
+ }) => Subscribable<TContext>;
65
+ export interface ObservableLogicConfig<TContext, TInput extends NonReducibleUnknown, TEmitted extends EventObject = EventObject, TInputSchema extends StandardSchemaV1 = StandardSchemaV1> {
66
+ schemas?: {
67
+ input?: TInputSchema;
68
+ };
69
+ run: ObservableLogicFunction<TContext, TInput, TEmitted>;
70
+ }
71
+ export type EventObservableLogicFunction<TEvent extends EventObject, TInput extends NonReducibleUnknown, TEmitted extends EventObject = EventObject> = ({ input, system, self, emit }: {
72
+ input: TInput;
73
+ system: AnyActorSystem;
74
+ self: ObservableActor<TEvent, TInput, TEmitted>;
75
+ emit: (emitted: TEmitted) => void;
76
+ }) => Subscribable<TEvent>;
77
+ export interface EventObservableLogicConfig<TEvent extends EventObject, TInput extends NonReducibleUnknown, TEmitted extends EventObject = EventObject, TInputSchema extends StandardSchemaV1 = StandardSchemaV1> {
78
+ schemas?: {
79
+ input?: TInputSchema;
80
+ };
81
+ run: EventObservableLogicFunction<TEvent, TInput, TEmitted>;
82
+ }
45
83
  /**
46
84
  * Observable actor logic is described by an observable stream of values. Actors
47
85
  * created from observable logic (“observable actors”) can:
@@ -55,10 +93,10 @@ export type ObservableActorRef<TContext> = ActorRefFromLogic<ObservableActorLogi
55
93
  * @example
56
94
  *
57
95
  * ```ts
58
- * import { fromObservable, createActor } from 'xstate';
96
+ * import { createObservableLogic, createActor } from 'xstate';
59
97
  * import { interval } from 'rxjs';
60
98
  *
61
- * const logic = fromObservable((obj) => interval(1000));
99
+ * const logic = createObservableLogic((obj) => interval(1000));
62
100
  *
63
101
  * const actor = createActor(logic);
64
102
  *
@@ -86,12 +124,15 @@ export type ObservableActorRef<TContext> = ActorRefFromLogic<ObservableActorLogi
86
124
  * @see {@link https://rxjs.dev} for documentation on RxJS Observable and observable creators.
87
125
  * @see {@link Subscribable} interface in XState, which is based on and compatible with RxJS Observable.
88
126
  */
89
- export declare function fromObservable<TContext, TInput extends NonReducibleUnknown, TEmitted extends EventObject = EventObject>(observableCreator: ({ input, system, self }: {
90
- input: TInput;
91
- system: AnyActorSystem;
92
- self: ObservableActorRef<TContext>;
93
- emit: (emitted: TEmitted) => void;
94
- }) => Subscribable<TContext>): ObservableActorLogic<TContext, TInput, TEmitted>;
127
+ export declare function createObservableLogic<TContext, const TInputSchema extends StandardSchemaV1, TEmitted extends EventObject = EventObject>(config: ObservableLogicConfig<TContext, StandardSchemaV1.InferOutput<TInputSchema>, TEmitted, TInputSchema> & {
128
+ schemas: {
129
+ input: TInputSchema;
130
+ };
131
+ }): ObservableActorLogic<TContext, StandardSchemaV1.InferOutput<TInputSchema>, TEmitted>;
132
+ export declare function createObservableLogic<TContext, TInput extends NonReducibleUnknown, TEmitted extends EventObject = EventObject>(config: ObservableLogicConfig<TContext, TInput, TEmitted> & {
133
+ schemas?: undefined;
134
+ }): ObservableActorLogic<TContext, TInput, TEmitted>;
135
+ export declare function createObservableLogic<TContext, TInput extends NonReducibleUnknown, TEmitted extends EventObject = EventObject>(observableCreator: ObservableLogicFunction<TContext, TInput, TEmitted>): ObservableActorLogic<TContext, TInput, TEmitted>;
95
136
  /**
96
137
  * Creates event observable logic that listens to an observable that delivers
97
138
  * event objects.
@@ -109,7 +150,7 @@ export declare function fromObservable<TContext, TInput extends NonReducibleUnkn
109
150
  *
110
151
  * ```ts
111
152
  * import {
112
- * fromEventObservable,
153
+ * createEventObservableLogic,
113
154
  * Subscribable,
114
155
  * EventObject,
115
156
  * createMachine,
@@ -117,7 +158,7 @@ export declare function fromObservable<TContext, TInput extends NonReducibleUnkn
117
158
  * } from 'xstate';
118
159
  * import { fromEvent } from 'rxjs';
119
160
  *
120
- * const mouseClickLogic = fromEventObservable(
161
+ * const mouseClickLogic = createEventObservableLogic(
121
162
  * () => fromEvent(document.body, 'click') as Subscribable<EventObject>
122
163
  * );
123
164
  *
@@ -143,9 +184,13 @@ export declare function fromObservable<TContext, TInput extends NonReducibleUnkn
143
184
  * It should return a {@link Subscribable}, which is compatible with an RxJS
144
185
  * Observable, although RxJS is not required to create them.
145
186
  */
146
- export declare function fromEventObservable<TEvent extends EventObject, TInput extends NonReducibleUnknown, TEmitted extends EventObject = EventObject>(lazyObservable: ({ input, system, self, emit }: {
147
- input: TInput;
148
- system: AnyActorSystem;
149
- self: ObservableActorRef<TEvent>;
150
- emit: (emitted: TEmitted) => void;
151
- }) => Subscribable<TEvent>): ObservableActorLogic<TEvent, TInput, TEmitted>;
187
+ export declare function createEventObservableLogic<TEvent extends EventObject, const TInputSchema extends StandardSchemaV1, TEmitted extends EventObject = EventObject>(config: EventObservableLogicConfig<TEvent, StandardSchemaV1.InferOutput<TInputSchema>, TEmitted, TInputSchema> & {
188
+ schemas: {
189
+ input: TInputSchema;
190
+ };
191
+ }): ObservableActorLogic<TEvent, StandardSchemaV1.InferOutput<TInputSchema>, TEmitted>;
192
+ export declare function createEventObservableLogic<TEvent extends EventObject, TInput extends NonReducibleUnknown, TEmitted extends EventObject = EventObject>(config: EventObservableLogicConfig<TEvent, TInput, TEmitted> & {
193
+ schemas?: undefined;
194
+ }): ObservableActorLogic<TEvent, TInput, TEmitted>;
195
+ export declare function createEventObservableLogic<TEvent extends EventObject, TInput extends NonReducibleUnknown, TEmitted extends EventObject = EventObject>(lazyObservable: EventObservableLogicFunction<TEvent, TInput, TEmitted>): ObservableActorLogic<TEvent, TInput, TEmitted>;
196
+ export {};
@@ -1,22 +1,74 @@
1
+ import { StandardSchemaV1 } from "../schema.types.js";
1
2
  import { AnyActorSystem } from "../system.js";
2
- import { ActorLogic, ActorRefFromLogic, EventObject, NonReducibleUnknown, Snapshot } from "../types.js";
3
- export type PromiseSnapshot<TOutput, TInput> = Snapshot<TOutput> & {
3
+ import { ActorLogic, ActorFromLogic, ActorRefFromLogic, EventObject, NonReducibleUnknown, Snapshot } from "../types.js";
4
+ export type AsyncSnapshot<TOutput, TInput> = Snapshot<TOutput> & {
4
5
  input: TInput | undefined;
6
+ effects?: Record<string, {
7
+ status: 'active';
8
+ } | {
9
+ status: 'done';
10
+ output?: unknown;
11
+ } | {
12
+ status: 'error';
13
+ error: unknown;
14
+ }>;
5
15
  };
6
- export type PromiseActorLogic<TOutput, TInput = unknown, TEmitted extends EventObject = EventObject> = ActorLogic<PromiseSnapshot<TOutput, TInput>, {
16
+ export type AsyncActorLogic<TOutput, TInput = unknown, TEmitted extends EventObject = EventObject> = ActorLogic<AsyncSnapshot<TOutput, TInput>, {
7
17
  type: string;
8
18
  [k: string]: unknown;
9
- }, TInput, // input
10
- AnyActorSystem, TEmitted>;
19
+ }, TInput, AnyActorSystem, TEmitted>;
20
+ export type AsyncActorRef<TOutput> = ActorRefFromLogic<AsyncActorLogic<TOutput, unknown>>;
21
+ type AsyncActor<TOutput, TInput = unknown, TEmitted extends EventObject = EventObject> = ActorFromLogic<AsyncActorLogic<TOutput, TInput, TEmitted>>;
22
+ export interface LogicArgs<TOutput, TInput> {
23
+ /** Data that was provided to the async actor. */
24
+ input: TInput;
25
+ /** The actor system to which the async actor belongs. */
26
+ system: AnyActorSystem;
27
+ /** The async actor. */
28
+ self: AsyncActor<TOutput, TInput>;
29
+ /** Aborted when the async actor is stopped or times out. */
30
+ signal: AbortSignal;
31
+ }
32
+ export interface LogicEnqueue<TEmitted extends EventObject> {
33
+ /** Emits an event that can be observed with `actor.on(...)`. */
34
+ emit: (emitted: TEmitted) => void;
35
+ /**
36
+ * Executes async work as a durable effect keyed by `key`.
37
+ *
38
+ * @experimental The durability semantics (step journaling, replay, and
39
+ * resumption across persistence) are not finalized and may change.
40
+ */
41
+ step: <TStepOutput>(key: string, exec: () => TStepOutput | PromiseLike<TStepOutput>) => Promise<TStepOutput>;
42
+ }
43
+ export type LogicFunction<TOutput, TInput = NonReducibleUnknown, TEmitted extends EventObject = EventObject> = (args: LogicArgs<TOutput, TInput>, enq: LogicEnqueue<TEmitted>) => PromiseLike<TOutput>;
44
+ export interface LogicConfig<TOutput, TInput = NonReducibleUnknown, TEmitted extends EventObject = EventObject, TInputSchema extends StandardSchemaV1 = StandardSchemaV1, TOutputSchema extends StandardSchemaV1 = StandardSchemaV1> {
45
+ /**
46
+ * Stable identifier for this async logic. This identifies the logic, not a
47
+ * particular actor instance.
48
+ */
49
+ id?: string;
50
+ /** Schemas for inferring async logic types. */
51
+ schemas?: {
52
+ input?: TInputSchema;
53
+ output?: TOutputSchema;
54
+ };
55
+ /** Maximum time this async logic may run before it is aborted and errors. */
56
+ timeout?: number | string;
57
+ /** The async work to execute when the actor starts. */
58
+ run: LogicFunction<TOutput, TInput, TEmitted>;
59
+ }
60
+ export declare class TimeoutError extends Error {
61
+ constructor(timeout: number | string);
62
+ }
11
63
  /**
12
- * Represents an actor created by `fromPromise`.
64
+ * Represents an actor created by `createAsyncLogic`.
13
65
  *
14
66
  * The type of `self` within the actor's logic.
15
67
  *
16
68
  * @example
17
69
  *
18
70
  * ```ts
19
- * import { fromPromise, createActor } from 'xstate';
71
+ * import { createAsyncLogic, createActor } from 'xstate';
20
72
  *
21
73
  * // The actor's resolved output
22
74
  * type Output = string;
@@ -24,51 +76,59 @@ AnyActorSystem, TEmitted>;
24
76
  * type Input = { message: string };
25
77
  *
26
78
  * // Actor logic that fetches the url of an image of a cat saying `input.message`.
27
- * const logic = fromPromise<Output, Input>(async ({ input, self }) => {
28
- * self;
29
- * // ^? PromiseActorRef<Output, Input>
30
- *
31
- * const data = await fetch(
32
- * `https://cataas.com/cat/says/${input.message}`
33
- * );
34
- * const url = await data.json();
35
- * return url;
79
+ * const logic = createAsyncLogic<Output, Input>({
80
+ * run: async ({ input, self }, enq) => {
81
+ * self;
82
+ * // ^? AsyncActor<Output, Input>
83
+ * enq.emit({ type: 'request.start' });
84
+ *
85
+ * const data = await fetch(
86
+ * `https://cataas.com/cat/says/${input.message}`
87
+ * );
88
+ * const url = await data.json();
89
+ * return url;
90
+ * }
36
91
  * });
37
92
  *
38
93
  * const actor = createActor(logic, { input: { message: 'hello world' } });
39
- * // ^? PromiseActorRef<Output, Input>
94
+ * // ^? AsyncActor<Output, Input>
40
95
  * ```
41
96
  *
42
- * @see {@link fromPromise}
97
+ * @see {@link createAsyncLogic}
43
98
  */
44
- export type PromiseActorRef<TOutput> = ActorRefFromLogic<PromiseActorLogic<TOutput, unknown>>;
45
99
  /**
46
- * An actor logic creator which returns promise logic as defined by an async
100
+ * An actor logic creator which returns async logic as defined by an async
47
101
  * process that resolves or rejects after some time.
48
102
  *
49
- * Actors created from promise actor logic (“promise actors”) can:
103
+ * Actors created from async actor logic can:
50
104
  *
51
- * - Emit the resolved value of the promise
52
- * - Output the resolved value of the promise
105
+ * - Output the resolved value of the async process
106
+ * - Error with the rejected value of the async process
107
+ * - Abort when stopped or timed out
53
108
  *
54
- * Sending events to promise actors will have no effect.
109
+ * Sending events to async actors will have no effect.
55
110
  *
56
111
  * @example
57
112
  *
58
113
  * ```ts
59
- * const promiseLogic = fromPromise(async () => {
60
- * const result = await fetch('https://example.com/...').then((data) =>
61
- * data.json()
62
- * );
63
- *
64
- * return result;
114
+ * const asyncLogic = createAsyncLogic({
115
+ * id: 'fetch-user',
116
+ * timeout: '30s',
117
+ * run: async ({ signal }, enq) => {
118
+ * enq.emit({ type: 'request.start' });
119
+ * const result = await fetch('https://example.com/...', {
120
+ * signal
121
+ * }).then((data) => data.json());
122
+ *
123
+ * return result;
124
+ * }
65
125
  * });
66
126
  *
67
- * const promiseActor = createActor(promiseLogic);
68
- * promiseActor.subscribe((snapshot) => {
127
+ * const asyncActor = createActor(asyncLogic);
128
+ * asyncActor.subscribe((snapshot) => {
69
129
  * console.log(snapshot);
70
130
  * });
71
- * promiseActor.start();
131
+ * asyncActor.start();
72
132
  * // => {
73
133
  * // output: undefined,
74
134
  * // status: 'active'
@@ -83,22 +143,47 @@ export type PromiseActorRef<TOutput> = ActorRefFromLogic<PromiseActorLogic<TOutp
83
143
  * // }
84
144
  * ```
85
145
  *
86
- * @param promiseCreator A function which returns a Promise, and accepts an
87
- * object with the following properties:
146
+ * @param asyncLogic A config object with a `run` function which returns a
147
+ * Promise, and accepts an object with the following properties:
148
+ *
149
+ * - `input` - Data that was provided to the async actor
150
+ * - `self` - The async actor ref
151
+ * - `system` - The actor system to which the async actor belongs
152
+ * - `signal` - An abort signal for cancellation
88
153
  *
89
- * - `input` - Data that was provided to the promise actor
90
- * - `self` - The parent actor of the promise actor
91
- * - `system` - The actor system to which the promise actor belongs
154
+ * `run` also receives an `enq` object with the following properties:
155
+ *
156
+ * - `emit` - Emits an event that can be observed with `actor.on(...)`
92
157
  *
93
158
  * @see {@link https://stately.ai/docs/input | Input docs} for more information about how input is passed
94
159
  */
95
- export declare function fromPromise<TOutput, TInput = NonReducibleUnknown, TEmitted extends EventObject = EventObject>(promiseCreator: ({ input, system, self, signal, emit }: {
96
- /** Data that was provided to the promise actor */
97
- input: TInput;
98
- /** The actor system to which the promise actor belongs */
99
- system: AnyActorSystem;
100
- /** The parent actor of the promise actor */
101
- self: PromiseActorRef<TOutput>;
102
- signal: AbortSignal;
103
- emit: (emitted: TEmitted) => void;
104
- }) => PromiseLike<TOutput>): PromiseActorLogic<TOutput, TInput, TEmitted>;
160
+ export declare function createAsyncLogic<const TInputSchema extends StandardSchemaV1, const TOutputSchema extends StandardSchemaV1, TEmitted extends EventObject = EventObject>(asyncLogic: LogicConfig<StandardSchemaV1.InferOutput<TOutputSchema>, StandardSchemaV1.InferOutput<TInputSchema>, TEmitted, TInputSchema, TOutputSchema> & {
161
+ schemas: {
162
+ input: TInputSchema;
163
+ output: TOutputSchema;
164
+ };
165
+ }): AsyncActorLogic<StandardSchemaV1.InferOutput<TOutputSchema>, StandardSchemaV1.InferOutput<TInputSchema>, TEmitted> & {
166
+ id?: string;
167
+ };
168
+ export declare function createAsyncLogic<TOutput, const TInputSchema extends StandardSchemaV1, TEmitted extends EventObject = EventObject>(asyncLogic: LogicConfig<TOutput, StandardSchemaV1.InferOutput<TInputSchema>, TEmitted, TInputSchema> & {
169
+ schemas: {
170
+ input: TInputSchema;
171
+ output?: never;
172
+ };
173
+ }): AsyncActorLogic<TOutput, StandardSchemaV1.InferOutput<TInputSchema>, TEmitted> & {
174
+ id?: string;
175
+ };
176
+ export declare function createAsyncLogic<const TOutputSchema extends StandardSchemaV1, TInput = NonReducibleUnknown, TEmitted extends EventObject = EventObject>(asyncLogic: LogicConfig<StandardSchemaV1.InferOutput<TOutputSchema>, TInput, TEmitted, StandardSchemaV1, TOutputSchema> & {
177
+ schemas: {
178
+ input?: never;
179
+ output: TOutputSchema;
180
+ };
181
+ }): AsyncActorLogic<StandardSchemaV1.InferOutput<TOutputSchema>, TInput, TEmitted> & {
182
+ id?: string;
183
+ };
184
+ export declare function createAsyncLogic<TOutput, TInput = NonReducibleUnknown, TEmitted extends EventObject = EventObject>(asyncLogic: Omit<LogicConfig<TOutput, TInput, TEmitted>, 'schemas'> & {
185
+ schemas?: undefined;
186
+ }): AsyncActorLogic<TOutput, TInput, TEmitted> & {
187
+ id?: string;
188
+ };
189
+ export {};
@@ -0,0 +1,22 @@
1
+ import { AnyActorSystem } from "../system.js";
2
+ import { ActorLogic, ActorRefFromLogic, AnyActorRef, EventObject, Snapshot } from "../types.js";
3
+ export type SubscriptionSnapshot = Snapshot<undefined> & {
4
+ input: SubscriptionInput<any, any, any, any>;
5
+ };
6
+ export interface SubscriptionMappers<TSnapshot extends Snapshot<unknown>, TOutput, TMappedEvent extends EventObject> {
7
+ snapshot?: (snapshot: TSnapshot) => TMappedEvent;
8
+ done?: (output: TOutput) => TMappedEvent;
9
+ error?: (error: unknown) => TMappedEvent;
10
+ }
11
+ export interface SubscriptionInput<TSnapshot extends Snapshot<unknown>, TOutput, TMappedEvent extends EventObject, TMappers extends SubscriptionMappers<TSnapshot, TOutput, TMappedEvent>> {
12
+ actor: AnyActorRef;
13
+ mappers: TMappers;
14
+ }
15
+ export type SubscriptionActorLogic<TSnapshot extends Snapshot<unknown> = Snapshot<unknown>, TOutput = unknown, TMappedEvent extends EventObject = EventObject> = ActorLogic<SubscriptionSnapshot, EventObject, SubscriptionInput<TSnapshot, TOutput, TMappedEvent, SubscriptionMappers<TSnapshot, TOutput, TMappedEvent>>, AnyActorSystem, EventObject>;
16
+ export type SubscriptionActorRef<TSnapshot extends Snapshot<unknown> = Snapshot<unknown>, TOutput = unknown, TMappedEvent extends EventObject = EventObject> = ActorRefFromLogic<SubscriptionActorLogic<TSnapshot, TOutput, TMappedEvent>>;
17
+ /**
18
+ * Creates actor logic for subscribing to lifecycle events (done/error/snapshot)
19
+ * from another actor. Used internally by `enq.subscribeTo()`.
20
+ */
21
+ export declare function createSubscriptionLogic<TSnapshot extends Snapshot<unknown> = Snapshot<unknown>, TOutput = unknown, TMappedEvent extends EventObject = EventObject>(): SubscriptionActorLogic<TSnapshot, TOutput, TMappedEvent>;
22
+ export declare const subscriptionLogic: SubscriptionActorLogic<Snapshot<unknown>, unknown, EventObject>;
@@ -1,8 +1,7 @@
1
1
  import { symbolObservable } from "./symbolObservable.js";
2
2
  import { AnyActorSystem, Clock } from "./system.js";
3
- export declare let executingCustomAction: boolean;
4
- import type { AnyActorLogic, AnyActorRef, ConditionalRequired, EmittedFrom, EventFromLogic, InputFrom, IsNotNever, Readable, Snapshot, SnapshotFrom } from "./types.js";
5
- import { ActorOptions, ActorRef, InteropSubscribable, Observer, Subscription } from "./types.js";
3
+ import type { AnyActor, AnyActorLogic, EmittedFrom, EventFromLogic, SendableEventFromLogic, InputFrom, Snapshot, SnapshotFrom, Readable } from "./types.js";
4
+ import { ActorOptions, ActorInstance, ActorRef, InteropSubscribable, Observer, Subscription } from "./types.js";
6
5
  export declare const $$ACTOR_TYPE = 1;
7
6
  export declare enum ProcessingStatus {
8
7
  NotStarted = 0,
@@ -13,8 +12,13 @@ export declare enum ProcessingStatus {
13
12
  * An Actor is a running process that can receive events, send events and change
14
13
  * its behavior based on the events it receives, which can cause effects outside
15
14
  * of the actor. When you run a state machine, it becomes an actor.
15
+ *
16
+ * An `Actor` is the concrete runtime instance with lifecycle methods and
17
+ * system-owned internals. It also satisfies the narrower `ActorRef` contract,
18
+ * so consumer APIs should accept `ActorRef` when they only need to send events
19
+ * or read snapshots.
16
20
  */
17
- export declare class Actor<TLogic extends AnyActorLogic> implements ActorRef<SnapshotFrom<TLogic>, EventFromLogic<TLogic>, EmittedFrom<TLogic>> {
21
+ export declare class Actor<TLogic extends AnyActorLogic> implements ActorInstance<SnapshotFrom<TLogic>, EventFromLogic<TLogic>, EmittedFrom<TLogic>, SendableEventFromLogic<TLogic>> {
18
22
  logic: TLogic;
19
23
  /** The current internal state of the actor. */
20
24
  private _snapshot;
@@ -26,19 +30,28 @@ export declare class Actor<TLogic extends AnyActorLogic> implements ActorRef<Sna
26
30
  options: Readonly<ActorOptions<TLogic>>;
27
31
  /** The unique identifier for this actor relative to its parent. */
28
32
  id: string;
33
+ private readonly _boundProcess;
29
34
  private mailbox;
30
35
  private observers;
31
36
  private eventListeners;
32
37
  private logger;
33
- _parent?: AnyActorRef;
34
- ref: ActorRef<SnapshotFrom<TLogic>, EventFromLogic<TLogic>, EmittedFrom<TLogic>>;
38
+ private _forceDeferredActions;
39
+ _parent?: AnyActor;
40
+ ref: ActorRef<SnapshotFrom<TLogic>, EventFromLogic<TLogic>, EmittedFrom<TLogic>, SendableEventFromLogic<TLogic>>;
35
41
  private _actorScope;
36
- systemId: string | undefined;
42
+ private _initialEffects;
43
+ registryKey: string | undefined;
37
44
  /** The globally unique process ID for this invocation. */
38
45
  sessionId: string;
39
46
  /** The system to which this actor belongs. */
40
47
  system: AnyActorSystem;
41
- private _doneEvent?;
48
+ trigger: {
49
+ [K in SendableEventFromLogic<TLogic>['type']]: {} extends Omit<Extract<SendableEventFromLogic<TLogic>, {
50
+ type: K;
51
+ }>, 'type'> ? () => void : (payload: Omit<Extract<SendableEventFromLogic<TLogic>, {
52
+ type: K;
53
+ }>, 'type'>) => void;
54
+ };
42
55
  src: string | AnyActorLogic;
43
56
  /**
44
57
  * Creates a new actor instance for the given logic with the provided options,
@@ -48,9 +61,12 @@ export declare class Actor<TLogic extends AnyActorLogic> implements ActorRef<Sna
48
61
  * @param options Actor options
49
62
  */
50
63
  constructor(logic: TLogic, options?: ActorOptions<TLogic>);
51
- private _initState;
52
64
  private _deferred;
65
+ private _pendingEffects?;
66
+ private _setErrorSnapshot;
67
+ private _next;
53
68
  private update;
69
+ private _flushInitialEffects;
54
70
  /**
55
71
  * Subscribe an observer to an actor’s snapshot values.
56
72
  *
@@ -119,11 +135,9 @@ export declare class Actor<TLogic extends AnyActorLogic> implements ActorRef<Sna
119
135
  /** Starts the Actor from the initial state */
120
136
  start(): this;
121
137
  private _process;
122
- private _stop;
123
138
  /** Stops the Actor and unsubscribe all listeners. */
124
139
  stop(): this;
125
140
  private _complete;
126
- private _reportError;
127
141
  private _error;
128
142
  private _stopProcedure;
129
143
  /**
@@ -131,8 +145,7 @@ export declare class Actor<TLogic extends AnyActorLogic> implements ActorRef<Sna
131
145
  *
132
146
  * @param event The event to send
133
147
  */
134
- send(event: EventFromLogic<TLogic>): void;
135
- private attachDevTools;
148
+ send(event: SendableEventFromLogic<TLogic>): void;
136
149
  toJSON(): {
137
150
  xstate$$type: number;
138
151
  id: string;
@@ -162,7 +175,7 @@ export declare class Actor<TLogic extends AnyActorLogic> implements ActorRef<Sna
162
175
  * may emit a snapshot when a state transition occurs.
163
176
  *
164
177
  * Note that some actors, such as callback actors generated with
165
- * `fromCallback`, will not emit snapshots.
178
+ * `createCallbackLogic`, will not emit snapshots.
166
179
  * @see {@link Actor.subscribe} to subscribe to an actor’s snapshot values.
167
180
  * @see {@link Actor.getPersistedSnapshot} to persist the internal state of an actor (which is more than just a snapshot).
168
181
  */
@@ -203,25 +216,11 @@ export type RequiredActorOptionsKeys<TLogic extends AnyActorLogic> = undefined e
203
216
  *
204
217
  * @param logic - The actor logic to create an actor from. For a state machine
205
218
  * actor logic creator, see {@link createMachine}. Other actor logic creators
206
- * include {@link fromCallback}, {@link fromEventObservable},
207
- * {@link fromObservable}, {@link fromPromise}, and {@link fromTransition}.
219
+ * include {@link createCallbackLogic}, {@link createEventObservableLogic},
220
+ * {@link createObservableLogic}, {@link createLogic}, and
221
+ * {@link createAsyncLogic}.
208
222
  * @param options - Actor options
209
223
  */
210
- export declare function createActor<TLogic extends AnyActorLogic>(logic: TLogic, ...[options]: ConditionalRequired<[
211
- options?: ActorOptions<TLogic> & {
212
- [K in RequiredActorOptionsKeys<TLogic>]: unknown;
213
- }
214
- ], IsNotNever<RequiredActorOptionsKeys<TLogic>>>): Actor<TLogic>;
215
- /**
216
- * Creates a new Interpreter instance for the given machine with the provided
217
- * options, if any.
218
- *
219
- * @deprecated Use `createActor` instead
220
- * @alias
221
- */
222
- export declare const interpret: typeof createActor;
223
- /**
224
- * @deprecated Use `Actor` instead.
225
- * @alias
226
- */
227
- export type Interpreter = typeof Actor;
224
+ export declare function createActor<TLogic extends AnyActorLogic>(logic: TLogic, options?: ActorOptions<TLogic> & {
225
+ [K in RequiredActorOptionsKeys<TLogic>]: unknown;
226
+ }): Actor<TLogic>;
@@ -1,5 +1,8 @@
1
+ import { StandardSchemaV1 } from "./schema.types.js";
1
2
  import { StateMachine } from "./StateMachine.js";
2
- import { ResolvedStateMachineTypes, TODO, AnyActorRef, EventObject, AnyEventObject, Cast, InternalMachineImplementations, MachineConfig, MachineContext, MachineTypes, NonReducibleUnknown, ParameterizedObject, ProvidedActor, StateValue, ToChildren, MetaObject } from "./types.js";
3
+ import { AnyActorRef, EventObject, AnyEventObject, Cast, MachineContext, ProvidedActor, StateValue, ToChildren, MetaObject, StateSchema, DoNotInfer, RoutableStateId, Compute } from "./types.js";
4
+ import { Implementations, DelayMapFromNames, InferChildren, InferOutput, InferEvents, Next_MachineConfig, Next_StateNodeConfig, ValidateDelayReferences, WidenLiterals, WithDefault } from "./types.v6.js";
5
+ type MergeChildren<TChildren extends Record<string, AnyActorRef | undefined>, TActor extends ProvidedActor> = [keyof TChildren] extends [never] ? Compute<ToChildren<TActor>> : Compute<TChildren>;
3
6
  /**
4
7
  * Creates a state machine (statechart) with the given configuration.
5
8
  *
@@ -42,9 +45,37 @@ import { ResolvedStateMachineTypes, TODO, AnyActorRef, EventObject, AnyEventObje
42
45
  * @param options DEPRECATED: use `setup({ ... })` or `machine.provide({ ... })`
43
46
  * to provide machine implementations instead.
44
47
  */
45
- export declare function createMachine<TContext extends MachineContext, TEvent extends AnyEventObject, // TODO: consider using a stricter `EventObject` here
46
- TActor extends ProvidedActor, TAction extends ParameterizedObject, TGuard extends ParameterizedObject, TDelay extends string, TTag extends string, TInput, TOutput extends NonReducibleUnknown, TEmitted extends EventObject, TMeta extends MetaObject, _ = any>(config: {
47
- types?: MachineTypes<TContext, TEvent, TActor, TAction, TGuard, TDelay, TTag, TInput, TOutput, TEmitted, TMeta>;
48
- schemas?: unknown;
49
- } & MachineConfig<TContext, TEvent, TActor, TAction, TGuard, TDelay, TTag, TInput, TOutput, TEmitted, TMeta>, implementations?: InternalMachineImplementations<ResolvedStateMachineTypes<TContext, TEvent, TActor, TAction, TGuard, TDelay, TTag, TEmitted>>): StateMachine<TContext, TEvent, Cast<ToChildren<TActor>, Record<string, AnyActorRef | undefined>>, TActor, TAction, TGuard, TDelay, StateValue, TTag & string, TInput, TOutput, TEmitted, TMeta, // TMeta
50
- TODO>;
48
+ export declare function createMachine<TContextSchema extends StandardSchemaV1, const TEventSchemaMap extends Record<string, StandardSchemaV1>, TEmittedSchemaMap extends Record<string, StandardSchemaV1>, TInputSchema extends StandardSchemaV1, TOutputSchema extends StandardSchemaV1, TMetaSchema extends StandardSchemaV1, TTagSchema extends StandardSchemaV1, const TChildrenSchemaMap extends Record<string, StandardSchemaV1>, _TEvent extends EventObject, TActor extends ProvidedActor, TActionMap extends Implementations['actions'], TActorMap extends Implementations['actorSources'], TGuardMap extends Implementations['guards'], TDelayMap extends Implementations['delays'], TDelays extends string, TTag extends StandardSchemaV1.InferOutput<TTagSchema> & string, TInput, const TSS extends StateSchema>(config: TSS & ValidateDelayReferences<TSS> & Next_MachineConfig<TContextSchema, TEventSchemaMap, TEmittedSchemaMap, TInputSchema, TOutputSchema, TMetaSchema, TTagSchema, TChildrenSchemaMap, InferOutput<TContextSchema, MachineContext>, InferEvents<TEventSchemaMap>, Cast<MergeChildren<InferChildren<TChildrenSchemaMap>, TActor>, Record<string, AnyActorRef | undefined>>, TDelays, TTag, TActionMap, TActorMap, TGuardMap, TDelayMap> & {
49
+ schemas: {
50
+ context: TContextSchema;
51
+ children?: TChildrenSchemaMap;
52
+ };
53
+ }): StateMachine<InferOutput<TContextSchema, MachineContext>, InferEvents<TEventSchemaMap> | ([RoutableStateId<TSS>] extends [never] ? never : {
54
+ type: 'xstate.route';
55
+ to: RoutableStateId<TSS>;
56
+ }), Cast<MergeChildren<InferChildren<TChildrenSchemaMap>, TActor>, Record<string, AnyActorRef | undefined>>, StateValue, TTag & string, TInput, InferOutput<TOutputSchema, unknown>, WithDefault<InferEvents<TEmittedSchemaMap>, AnyEventObject>, InferOutput<TMetaSchema, MetaObject>, // TMeta
57
+ TSS, // TStateSchema
58
+ TActionMap, TActorMap, TGuardMap, DelayMapFromNames<TDelays, TDelayMap>> & {
59
+ states: TSS;
60
+ };
61
+ export declare function createMachine<TContext extends MachineContext = never, const TEventSchemaMap extends Record<string, StandardSchemaV1> = Record<string, StandardSchemaV1>, TEmittedSchemaMap extends Record<string, StandardSchemaV1> = Record<string, StandardSchemaV1>, TInputSchema extends StandardSchemaV1 = StandardSchemaV1, TOutputSchema extends StandardSchemaV1 = StandardSchemaV1, TMetaSchema extends StandardSchemaV1 = StandardSchemaV1, TTagSchema extends StandardSchemaV1 = StandardSchemaV1, const TChildrenSchemaMap extends Record<string, StandardSchemaV1> = Record<string, StandardSchemaV1>, _TEvent extends EventObject = EventObject, TActor extends ProvidedActor = ProvidedActor, TActionMap extends Implementations['actions'] = Implementations['actions'], TActorMap extends Implementations['actorSources'] = Implementations['actorSources'], TGuardMap extends Implementations['guards'] = Implementations['guards'], TDelayMap extends Implementations['delays'] = Implementations['delays'], TDelays extends string = string, TTag extends StandardSchemaV1.InferOutput<TTagSchema> & string = StandardSchemaV1.InferOutput<TTagSchema> & string, TInput = unknown, const TSS extends StateSchema = StateSchema>(config: TSS & ValidateDelayReferences<TSS> & Next_MachineConfig<StandardSchemaV1, TEventSchemaMap, TEmittedSchemaMap, TInputSchema, TOutputSchema, TMetaSchema, TTagSchema, TChildrenSchemaMap, WidenLiterals<TContext>, InferEvents<TEventSchemaMap>, Cast<MergeChildren<InferChildren<TChildrenSchemaMap>, TActor>, Record<string, AnyActorRef | undefined>>, TDelays, TTag, TActionMap, TActorMap, TGuardMap, TDelayMap, false> & {
62
+ schemas?: {
63
+ context?: never;
64
+ };
65
+ context?: TContext | ((_: {
66
+ spawn: any;
67
+ actorSources: TActorMap;
68
+ input: InferOutput<TInputSchema, unknown>;
69
+ self: any;
70
+ }) => TContext);
71
+ }): StateMachine<WidenLiterals<TContext>, InferEvents<TEventSchemaMap> | ([RoutableStateId<TSS>] extends [never] ? never : {
72
+ type: 'xstate.route';
73
+ to: RoutableStateId<TSS>;
74
+ }), Cast<MergeChildren<InferChildren<TChildrenSchemaMap>, TActor>, Record<string, AnyActorRef | undefined>>, StateValue, TTag & string, TInput, InferOutput<TOutputSchema, unknown>, WithDefault<InferEvents<TEmittedSchemaMap>, AnyEventObject>, InferOutput<TMetaSchema, MetaObject>, // TMeta
75
+ TSS, // TStateSchema
76
+ TActionMap, TActorMap, TGuardMap, DelayMapFromNames<TDelays, TDelayMap>> & {
77
+ states: TSS;
78
+ };
79
+ export declare function createStateConfig<TContextSchema extends StandardSchemaV1, TEventSchema extends StandardSchemaV1, TEmittedSchema extends StandardSchemaV1, _TInputSchema extends StandardSchemaV1, TOutputSchema extends StandardSchemaV1, TMetaSchema extends StandardSchemaV1, TTagSchema extends StandardSchemaV1, _TEvent extends StandardSchemaV1.InferOutput<TEventSchema> & EventObject, // TODO: consider using a stricter `EventObject` here
80
+ _TActor extends ProvidedActor, TActionMap extends Implementations['actions'], TActorMap extends Implementations['actorSources'], TGuardMap extends Implementations['guards'], TDelayMap extends Implementations['delays'], TDelays extends string, _TTag extends StandardSchemaV1.InferOutput<TTagSchema> & string, _TInput, const TSS extends StateSchema>(config: TSS & Next_StateNodeConfig<InferOutput<TContextSchema, MachineContext>, DoNotInfer<StandardSchemaV1.InferOutput<TEventSchema> & EventObject>, DoNotInfer<TDelays>, DoNotInfer<StandardSchemaV1.InferOutput<TTagSchema> & string>, DoNotInfer<StandardSchemaV1.InferOutput<TOutputSchema>>, DoNotInfer<StandardSchemaV1.InferOutput<TEmittedSchema> & EventObject>, DoNotInfer<InferOutput<TMetaSchema, MetaObject>>, DoNotInfer<Record<string, AnyActorRef | undefined>>, DoNotInfer<TActionMap>, DoNotInfer<TActorMap>, DoNotInfer<TGuardMap>, DoNotInfer<TDelayMap>>): typeof config;
81
+ export {};