xstate 6.0.0-alpha.47 → 6.0.0-alpha.49

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 (84) hide show
  1. package/README.md +30 -1
  2. package/dist/{StateMachine-7046f677.cjs.js → StateMachine-0adb3a70.cjs.js} +15 -12
  3. package/dist/{StateMachine-70c06bdd.development.cjs.js → StateMachine-29450e6d.development.cjs.js} +15 -12
  4. package/dist/{StateMachine-74929087.esm.js → StateMachine-2af31c11.esm.js} +10 -7
  5. package/dist/{StateMachine-ee10f67e.development.esm.js → StateMachine-faf50c5c.development.esm.js} +10 -7
  6. package/dist/{createActor-915ea40c.esm.js → createActor-268165d4.esm.js} +79 -23
  7. package/dist/{createActor-ff132afa.development.esm.js → createActor-88709f74.development.esm.js} +79 -23
  8. package/dist/{createActor-6736cbbe.development.cjs.js → createActor-a1e0dffb.development.cjs.js} +78 -25
  9. package/dist/{createActor-bfe8b6bd.cjs.js → createActor-b4dd05ae.cjs.js} +78 -25
  10. package/dist/declarations/src/createMachineFromConfig.d.ts +5 -77
  11. package/dist/declarations/src/fsm/createFSMActor.d.ts +67 -0
  12. package/dist/declarations/src/fsm/index.d.ts +2 -0
  13. package/dist/declarations/src/fsm.d.ts +5 -4
  14. package/dist/declarations/src/scxml/index.d.ts +1 -0
  15. package/dist/declarations/src/scxml/runtime.d.ts +251 -0
  16. package/dist/declarations/src/scxml/scxml.d.ts +19 -0
  17. package/dist/declarations/src/types.d.ts +1 -0
  18. package/dist/{effectDescriptor-8be60443.esm.js → effectDescriptor-30c9a744.esm.js} +1 -1
  19. package/dist/{effectDescriptor-fbe67d5a.development.esm.js → effectDescriptor-39d22100.development.esm.js} +1 -1
  20. package/dist/{effectDescriptor-3c699328.development.cjs.js → effectDescriptor-7ff6802f.development.cjs.js} +1 -1
  21. package/dist/{effectDescriptor-a7e2d4d1.cjs.js → effectDescriptor-be348e50.cjs.js} +1 -1
  22. package/dist/fsm-7a2e9697.cjs.js +777 -0
  23. package/dist/fsm-b804b3e9.esm.js +775 -0
  24. package/dist/fsm-c1316948.development.cjs.js +777 -0
  25. package/dist/fsm-e18a7cb4.development.esm.js +775 -0
  26. package/dist/types-3c3455f7.esm.js +185 -0
  27. package/dist/types-adda3842.development.esm.js +185 -0
  28. package/dist/types-b3fea5bd.development.cjs.js +189 -0
  29. package/dist/types-fbabaeee.cjs.js +189 -0
  30. package/dist/validation-05f1d517.esm.js +8 -0
  31. package/dist/validation-4561b43c.cjs.js +10 -0
  32. package/dist/validation-e69470ad.development.esm.js +8 -0
  33. package/dist/validation-f2714a35.development.cjs.js +10 -0
  34. package/dist/xstate-actors.cjs.js +934 -9
  35. package/dist/xstate-actors.development.cjs.js +934 -9
  36. package/dist/xstate-actors.development.esm.js +932 -2
  37. package/dist/xstate-actors.esm.js +932 -2
  38. package/dist/xstate-durable.cjs.js +2 -2
  39. package/dist/xstate-durable.development.cjs.js +2 -2
  40. package/dist/xstate-durable.development.esm.js +2 -2
  41. package/dist/xstate-durable.esm.js +2 -2
  42. package/dist/xstate-fsm.cjs.d.mts +2 -0
  43. package/dist/xstate-fsm.cjs.d.ts +2 -0
  44. package/dist/xstate-fsm.cjs.js +409 -0
  45. package/dist/xstate-fsm.cjs.mjs +5 -0
  46. package/dist/xstate-fsm.development.cjs.js +409 -0
  47. package/dist/xstate-fsm.development.cjs.mjs +5 -0
  48. package/dist/xstate-fsm.development.esm.js +403 -0
  49. package/dist/xstate-fsm.esm.js +403 -0
  50. package/dist/xstate-fsm.umd.min.js +2 -0
  51. package/dist/xstate-fsm.umd.min.js.map +1 -0
  52. package/dist/xstate-graph.cjs.js +4 -3
  53. package/dist/xstate-graph.development.cjs.js +4 -3
  54. package/dist/xstate-graph.development.esm.js +4 -3
  55. package/dist/xstate-graph.esm.js +4 -3
  56. package/dist/xstate-graph.umd.min.js +1 -1
  57. package/dist/xstate-graph.umd.min.js.map +1 -1
  58. package/dist/xstate-scxml.cjs.d.mts +2 -0
  59. package/dist/xstate-scxml.cjs.d.ts +2 -0
  60. package/dist/xstate-scxml.cjs.js +2387 -0
  61. package/dist/xstate-scxml.cjs.mjs +3 -0
  62. package/dist/xstate-scxml.development.cjs.js +2387 -0
  63. package/dist/xstate-scxml.development.cjs.mjs +3 -0
  64. package/dist/xstate-scxml.development.esm.js +2383 -0
  65. package/dist/xstate-scxml.esm.js +2383 -0
  66. package/dist/xstate-scxml.umd.min.js +26 -0
  67. package/dist/xstate-scxml.umd.min.js.map +1 -0
  68. package/dist/xstate-validation.cjs.js +1 -1
  69. package/dist/xstate-validation.development.cjs.js +1 -1
  70. package/dist/xstate-validation.development.esm.js +1 -1
  71. package/dist/xstate-validation.esm.js +1 -1
  72. package/dist/xstate.cjs.js +143 -1412
  73. package/dist/xstate.development.cjs.js +143 -1412
  74. package/dist/xstate.development.esm.js +143 -1411
  75. package/dist/xstate.esm.js +143 -1411
  76. package/dist/xstate.umd.min.js +1 -1
  77. package/dist/xstate.umd.min.js.map +1 -1
  78. package/fsm/package.json +8 -0
  79. package/package.json +37 -3
  80. package/scxml/package.json +8 -0
  81. package/dist/index-0f498ef2.development.cjs.js +0 -946
  82. package/dist/index-70d56425.development.esm.js +0 -937
  83. package/dist/index-b051c924.esm.js +0 -937
  84. package/dist/index-b3fe59bc.cjs.js +0 -946
@@ -0,0 +1,185 @@
1
+ import { S as StateMachine } from './StateMachine-2af31c11.esm.js';
2
+
3
+ /**
4
+ * Creates a state machine (statechart) with the given configuration.
5
+ *
6
+ * The state machine represents the pure logic of a state machine actor.
7
+ *
8
+ * @example
9
+ *
10
+ * ```ts
11
+ * import { createMachine } from 'xstate';
12
+ *
13
+ * const lightMachine = createMachine({
14
+ * id: 'light',
15
+ * initial: 'green',
16
+ * states: {
17
+ * green: {
18
+ * on: {
19
+ * TIMER: { target: 'yellow' }
20
+ * }
21
+ * },
22
+ * yellow: {
23
+ * on: {
24
+ * TIMER: { target: 'red' }
25
+ * }
26
+ * },
27
+ * red: {
28
+ * on: {
29
+ * TIMER: { target: 'green' }
30
+ * }
31
+ * }
32
+ * }
33
+ * });
34
+ *
35
+ * const lightActor = createActor(lightMachine);
36
+ * lightActor.start();
37
+ *
38
+ * lightActor.send({ type: 'TIMER' });
39
+ * ```
40
+ *
41
+ * @param config The state machine configuration.
42
+ * @param options DEPRECATED: use `setup({ ... })` or `machine.provide({ ... })`
43
+ * to provide machine sources instead.
44
+ */
45
+ // Overload 1: With schemas.context — context type inferred from schema
46
+
47
+ // Overload 2: Without schemas.context — context type inferred from config.context
48
+
49
+ // Implementation
50
+ function createMachine(config) {
51
+ return new StateMachine(config);
52
+ }
53
+ function createStateConfig(config) {
54
+ return config;
55
+ }
56
+
57
+ // this is needed to make JSDoc `@link` work properly
58
+ // oxlint-disable-next-line no-unused-vars
59
+
60
+ /**
61
+ * @remarks
62
+ * `T | unknown` reduces to `unknown` and that can be problematic when it comes
63
+ * to contextual typing. It especially is a problem when the union has a
64
+ * function member, like here:
65
+ *
66
+ * ```ts
67
+ * declare function test(
68
+ * cbOrVal: ((arg: number) => unknown) | unknown
69
+ * ): void;
70
+ * test((arg) => {}); // oops, implicit any
71
+ * ```
72
+ *
73
+ * This type can be used to avoid this problem. This union represents the same
74
+ * value space as `unknown`.
75
+ */
76
+
77
+ // https://github.com/microsoft/TypeScript/issues/23182#issuecomment-379091887
78
+
79
+ // @TODO: we can't use native `NoInfer` as we need those:
80
+ // https://github.com/microsoft/TypeScript/pull/61092
81
+ // https://github.com/microsoft/TypeScript/pull/61077
82
+ // but even with those fixes native NoInfer still doesn't work - further issues have to be reproduced and fixed
83
+
84
+ /** @deprecated Use the built-in `NoInfer` type instead */
85
+
86
+ /** The full definition of an event, with a string `type`. */
87
+
88
+ /**
89
+ * The string or object representing the state value relative to the parent
90
+ * state node.
91
+ *
92
+ * @remarks
93
+ * - For a child atomic state node, this is a string, e.g., `"pending"`.
94
+ * - For complex state nodes, this is an object, e.g., `{ success:
95
+ * "someChildState" }`.
96
+ */
97
+
98
+ // Accept any StateNode instance regardless of generic parameters
99
+ // Using a union type to handle variance issues with machine.resolveState
100
+
101
+ let SpecialTargets = /*#__PURE__*/function (SpecialTargets) {
102
+ SpecialTargets["Internal"] = "#_internal";
103
+ return SpecialTargets;
104
+ }({});
105
+
106
+ /** A deterministic delayed-delivery declaration owned by a logic snapshot. */
107
+
108
+ /** The logical input delivered to a timer's source when its runtime delay ends. */
109
+
110
+ /** A persisted snapshot tied to a versioned actor logic identity. */
111
+
112
+ /**
113
+ * A persisted snapshot restorable into the given actor logic: any snapshot
114
+ * created by logic with the same machine `id` is accepted, regardless of
115
+ * version (version mismatches are handled at runtime, e.g. by `migrate`).
116
+ */
117
+
118
+ /** @deprecated Use `AnyActor` instead. */
119
+
120
+ // Based on RxJS types
121
+
122
+ /**
123
+ * A consumer-facing actor handle.
124
+ *
125
+ * `ActorRef` describes the contract a consumer needs: which events can be sent
126
+ * to the actor, which snapshot it publishes for observation, and which emitted
127
+ * events can be listened to. It intentionally does not expose lifecycle control
128
+ * or runtime internals. A concrete `Actor` satisfies this interface, so APIs
129
+ * should accept `ActorRef` whenever they only need to send events, read
130
+ * snapshots, or listen to emitted events.
131
+ */
132
+
133
+ /**
134
+ * Runtime-only actor capabilities.
135
+ *
136
+ * These members are needed by the interpreter, scheduler, inspection, and child
137
+ * management code. Public consumer APIs should prefer `ActorRef` unless they
138
+ * genuinely need lifecycle control such as starting, stopping, or accessing
139
+ * system-owned runtime state.
140
+ */
141
+
142
+ /**
143
+ * A concrete actor instance type.
144
+ *
145
+ * `ActorInstance` combines the consumer `ActorRef` contract with runtime
146
+ * lifecycle capabilities. Values returned by `createActor(...)` and
147
+ * `spawn(...)` naturally satisfy narrower `ActorRef` contracts.
148
+ */
149
+
150
+ /**
151
+ * The actor's own full self handle.
152
+ *
153
+ * Internals and action/guard sources receive this shape because `self` can
154
+ * participate in runtime-owned behavior while still being usable wherever an
155
+ * `ActorRef` is expected.
156
+ */
157
+
158
+ // TODO: in v6, this should only accept AnyActorLogic, like ActorRefFromLogic
159
+
160
+ /** The concrete actor instance type produced from actor logic. */
161
+
162
+ /**
163
+ * Represents logic which can be used by an actor.
164
+ *
165
+ * @template TSnapshot - The type of the snapshot.
166
+ * @template TEvent - The type of the event object.
167
+ * @template TInput - The type of the input.
168
+ * @template TSystem - The type of the actor system.
169
+ */
170
+
171
+ // Actors that don't have literal string IDs — these are the only ones
172
+ // that should appear in the index signature fallback, since actors with
173
+ // literal IDs are already covered by ToConcreteChildren.
174
+
175
+ /** Maps state IDs to their input types based on the StateSchema. */
176
+
177
+ /** @deprecated */
178
+
179
+ /** The terminal result published when an actor completes or errors. */
180
+
181
+ /** An executable effect that publishes an actor's terminal result. */
182
+
183
+ /** Mappers for subscribeTo - maps lifecycle events to machine events */
184
+
185
+ export { SpecialTargets as S, createStateConfig as a, createMachine as c };
@@ -0,0 +1,185 @@
1
+ import { S as StateMachine } from './StateMachine-faf50c5c.development.esm.js';
2
+
3
+ /**
4
+ * Creates a state machine (statechart) with the given configuration.
5
+ *
6
+ * The state machine represents the pure logic of a state machine actor.
7
+ *
8
+ * @example
9
+ *
10
+ * ```ts
11
+ * import { createMachine } from 'xstate';
12
+ *
13
+ * const lightMachine = createMachine({
14
+ * id: 'light',
15
+ * initial: 'green',
16
+ * states: {
17
+ * green: {
18
+ * on: {
19
+ * TIMER: { target: 'yellow' }
20
+ * }
21
+ * },
22
+ * yellow: {
23
+ * on: {
24
+ * TIMER: { target: 'red' }
25
+ * }
26
+ * },
27
+ * red: {
28
+ * on: {
29
+ * TIMER: { target: 'green' }
30
+ * }
31
+ * }
32
+ * }
33
+ * });
34
+ *
35
+ * const lightActor = createActor(lightMachine);
36
+ * lightActor.start();
37
+ *
38
+ * lightActor.send({ type: 'TIMER' });
39
+ * ```
40
+ *
41
+ * @param config The state machine configuration.
42
+ * @param options DEPRECATED: use `setup({ ... })` or `machine.provide({ ... })`
43
+ * to provide machine sources instead.
44
+ */
45
+ // Overload 1: With schemas.context — context type inferred from schema
46
+
47
+ // Overload 2: Without schemas.context — context type inferred from config.context
48
+
49
+ // Implementation
50
+ function createMachine(config) {
51
+ return new StateMachine(config);
52
+ }
53
+ function createStateConfig(config) {
54
+ return config;
55
+ }
56
+
57
+ // this is needed to make JSDoc `@link` work properly
58
+ // oxlint-disable-next-line no-unused-vars
59
+
60
+ /**
61
+ * @remarks
62
+ * `T | unknown` reduces to `unknown` and that can be problematic when it comes
63
+ * to contextual typing. It especially is a problem when the union has a
64
+ * function member, like here:
65
+ *
66
+ * ```ts
67
+ * declare function test(
68
+ * cbOrVal: ((arg: number) => unknown) | unknown
69
+ * ): void;
70
+ * test((arg) => {}); // oops, implicit any
71
+ * ```
72
+ *
73
+ * This type can be used to avoid this problem. This union represents the same
74
+ * value space as `unknown`.
75
+ */
76
+
77
+ // https://github.com/microsoft/TypeScript/issues/23182#issuecomment-379091887
78
+
79
+ // @TODO: we can't use native `NoInfer` as we need those:
80
+ // https://github.com/microsoft/TypeScript/pull/61092
81
+ // https://github.com/microsoft/TypeScript/pull/61077
82
+ // but even with those fixes native NoInfer still doesn't work - further issues have to be reproduced and fixed
83
+
84
+ /** @deprecated Use the built-in `NoInfer` type instead */
85
+
86
+ /** The full definition of an event, with a string `type`. */
87
+
88
+ /**
89
+ * The string or object representing the state value relative to the parent
90
+ * state node.
91
+ *
92
+ * @remarks
93
+ * - For a child atomic state node, this is a string, e.g., `"pending"`.
94
+ * - For complex state nodes, this is an object, e.g., `{ success:
95
+ * "someChildState" }`.
96
+ */
97
+
98
+ // Accept any StateNode instance regardless of generic parameters
99
+ // Using a union type to handle variance issues with machine.resolveState
100
+
101
+ let SpecialTargets = /*#__PURE__*/function (SpecialTargets) {
102
+ SpecialTargets["Internal"] = "#_internal";
103
+ return SpecialTargets;
104
+ }({});
105
+
106
+ /** A deterministic delayed-delivery declaration owned by a logic snapshot. */
107
+
108
+ /** The logical input delivered to a timer's source when its runtime delay ends. */
109
+
110
+ /** A persisted snapshot tied to a versioned actor logic identity. */
111
+
112
+ /**
113
+ * A persisted snapshot restorable into the given actor logic: any snapshot
114
+ * created by logic with the same machine `id` is accepted, regardless of
115
+ * version (version mismatches are handled at runtime, e.g. by `migrate`).
116
+ */
117
+
118
+ /** @deprecated Use `AnyActor` instead. */
119
+
120
+ // Based on RxJS types
121
+
122
+ /**
123
+ * A consumer-facing actor handle.
124
+ *
125
+ * `ActorRef` describes the contract a consumer needs: which events can be sent
126
+ * to the actor, which snapshot it publishes for observation, and which emitted
127
+ * events can be listened to. It intentionally does not expose lifecycle control
128
+ * or runtime internals. A concrete `Actor` satisfies this interface, so APIs
129
+ * should accept `ActorRef` whenever they only need to send events, read
130
+ * snapshots, or listen to emitted events.
131
+ */
132
+
133
+ /**
134
+ * Runtime-only actor capabilities.
135
+ *
136
+ * These members are needed by the interpreter, scheduler, inspection, and child
137
+ * management code. Public consumer APIs should prefer `ActorRef` unless they
138
+ * genuinely need lifecycle control such as starting, stopping, or accessing
139
+ * system-owned runtime state.
140
+ */
141
+
142
+ /**
143
+ * A concrete actor instance type.
144
+ *
145
+ * `ActorInstance` combines the consumer `ActorRef` contract with runtime
146
+ * lifecycle capabilities. Values returned by `createActor(...)` and
147
+ * `spawn(...)` naturally satisfy narrower `ActorRef` contracts.
148
+ */
149
+
150
+ /**
151
+ * The actor's own full self handle.
152
+ *
153
+ * Internals and action/guard sources receive this shape because `self` can
154
+ * participate in runtime-owned behavior while still being usable wherever an
155
+ * `ActorRef` is expected.
156
+ */
157
+
158
+ // TODO: in v6, this should only accept AnyActorLogic, like ActorRefFromLogic
159
+
160
+ /** The concrete actor instance type produced from actor logic. */
161
+
162
+ /**
163
+ * Represents logic which can be used by an actor.
164
+ *
165
+ * @template TSnapshot - The type of the snapshot.
166
+ * @template TEvent - The type of the event object.
167
+ * @template TInput - The type of the input.
168
+ * @template TSystem - The type of the actor system.
169
+ */
170
+
171
+ // Actors that don't have literal string IDs — these are the only ones
172
+ // that should appear in the index signature fallback, since actors with
173
+ // literal IDs are already covered by ToConcreteChildren.
174
+
175
+ /** Maps state IDs to their input types based on the StateSchema. */
176
+
177
+ /** @deprecated */
178
+
179
+ /** The terminal result published when an actor completes or errors. */
180
+
181
+ /** An executable effect that publishes an actor's terminal result. */
182
+
183
+ /** Mappers for subscribeTo - maps lifecycle events to machine events */
184
+
185
+ export { SpecialTargets as S, createStateConfig as a, createMachine as c };
@@ -0,0 +1,189 @@
1
+ 'use strict';
2
+
3
+ var StateMachine = require('./StateMachine-29450e6d.development.cjs.js');
4
+
5
+ /**
6
+ * Creates a state machine (statechart) with the given configuration.
7
+ *
8
+ * The state machine represents the pure logic of a state machine actor.
9
+ *
10
+ * @example
11
+ *
12
+ * ```ts
13
+ * import { createMachine } from 'xstate';
14
+ *
15
+ * const lightMachine = createMachine({
16
+ * id: 'light',
17
+ * initial: 'green',
18
+ * states: {
19
+ * green: {
20
+ * on: {
21
+ * TIMER: { target: 'yellow' }
22
+ * }
23
+ * },
24
+ * yellow: {
25
+ * on: {
26
+ * TIMER: { target: 'red' }
27
+ * }
28
+ * },
29
+ * red: {
30
+ * on: {
31
+ * TIMER: { target: 'green' }
32
+ * }
33
+ * }
34
+ * }
35
+ * });
36
+ *
37
+ * const lightActor = createActor(lightMachine);
38
+ * lightActor.start();
39
+ *
40
+ * lightActor.send({ type: 'TIMER' });
41
+ * ```
42
+ *
43
+ * @param config The state machine configuration.
44
+ * @param options DEPRECATED: use `setup({ ... })` or `machine.provide({ ... })`
45
+ * to provide machine sources instead.
46
+ */
47
+ // Overload 1: With schemas.context — context type inferred from schema
48
+
49
+ // Overload 2: Without schemas.context — context type inferred from config.context
50
+
51
+ // Implementation
52
+ function createMachine(config) {
53
+ return new StateMachine.StateMachine(config);
54
+ }
55
+ function createStateConfig(config) {
56
+ return config;
57
+ }
58
+
59
+ // this is needed to make JSDoc `@link` work properly
60
+ // oxlint-disable-next-line no-unused-vars
61
+
62
+ /**
63
+ * @remarks
64
+ * `T | unknown` reduces to `unknown` and that can be problematic when it comes
65
+ * to contextual typing. It especially is a problem when the union has a
66
+ * function member, like here:
67
+ *
68
+ * ```ts
69
+ * declare function test(
70
+ * cbOrVal: ((arg: number) => unknown) | unknown
71
+ * ): void;
72
+ * test((arg) => {}); // oops, implicit any
73
+ * ```
74
+ *
75
+ * This type can be used to avoid this problem. This union represents the same
76
+ * value space as `unknown`.
77
+ */
78
+
79
+ // https://github.com/microsoft/TypeScript/issues/23182#issuecomment-379091887
80
+
81
+ // @TODO: we can't use native `NoInfer` as we need those:
82
+ // https://github.com/microsoft/TypeScript/pull/61092
83
+ // https://github.com/microsoft/TypeScript/pull/61077
84
+ // but even with those fixes native NoInfer still doesn't work - further issues have to be reproduced and fixed
85
+
86
+ /** @deprecated Use the built-in `NoInfer` type instead */
87
+
88
+ /** The full definition of an event, with a string `type`. */
89
+
90
+ /**
91
+ * The string or object representing the state value relative to the parent
92
+ * state node.
93
+ *
94
+ * @remarks
95
+ * - For a child atomic state node, this is a string, e.g., `"pending"`.
96
+ * - For complex state nodes, this is an object, e.g., `{ success:
97
+ * "someChildState" }`.
98
+ */
99
+
100
+ // Accept any StateNode instance regardless of generic parameters
101
+ // Using a union type to handle variance issues with machine.resolveState
102
+
103
+ let SpecialTargets = /*#__PURE__*/function (SpecialTargets) {
104
+ SpecialTargets["Internal"] = "#_internal";
105
+ return SpecialTargets;
106
+ }({});
107
+
108
+ /** A deterministic delayed-delivery declaration owned by a logic snapshot. */
109
+
110
+ /** The logical input delivered to a timer's source when its runtime delay ends. */
111
+
112
+ /** A persisted snapshot tied to a versioned actor logic identity. */
113
+
114
+ /**
115
+ * A persisted snapshot restorable into the given actor logic: any snapshot
116
+ * created by logic with the same machine `id` is accepted, regardless of
117
+ * version (version mismatches are handled at runtime, e.g. by `migrate`).
118
+ */
119
+
120
+ /** @deprecated Use `AnyActor` instead. */
121
+
122
+ // Based on RxJS types
123
+
124
+ /**
125
+ * A consumer-facing actor handle.
126
+ *
127
+ * `ActorRef` describes the contract a consumer needs: which events can be sent
128
+ * to the actor, which snapshot it publishes for observation, and which emitted
129
+ * events can be listened to. It intentionally does not expose lifecycle control
130
+ * or runtime internals. A concrete `Actor` satisfies this interface, so APIs
131
+ * should accept `ActorRef` whenever they only need to send events, read
132
+ * snapshots, or listen to emitted events.
133
+ */
134
+
135
+ /**
136
+ * Runtime-only actor capabilities.
137
+ *
138
+ * These members are needed by the interpreter, scheduler, inspection, and child
139
+ * management code. Public consumer APIs should prefer `ActorRef` unless they
140
+ * genuinely need lifecycle control such as starting, stopping, or accessing
141
+ * system-owned runtime state.
142
+ */
143
+
144
+ /**
145
+ * A concrete actor instance type.
146
+ *
147
+ * `ActorInstance` combines the consumer `ActorRef` contract with runtime
148
+ * lifecycle capabilities. Values returned by `createActor(...)` and
149
+ * `spawn(...)` naturally satisfy narrower `ActorRef` contracts.
150
+ */
151
+
152
+ /**
153
+ * The actor's own full self handle.
154
+ *
155
+ * Internals and action/guard sources receive this shape because `self` can
156
+ * participate in runtime-owned behavior while still being usable wherever an
157
+ * `ActorRef` is expected.
158
+ */
159
+
160
+ // TODO: in v6, this should only accept AnyActorLogic, like ActorRefFromLogic
161
+
162
+ /** The concrete actor instance type produced from actor logic. */
163
+
164
+ /**
165
+ * Represents logic which can be used by an actor.
166
+ *
167
+ * @template TSnapshot - The type of the snapshot.
168
+ * @template TEvent - The type of the event object.
169
+ * @template TInput - The type of the input.
170
+ * @template TSystem - The type of the actor system.
171
+ */
172
+
173
+ // Actors that don't have literal string IDs — these are the only ones
174
+ // that should appear in the index signature fallback, since actors with
175
+ // literal IDs are already covered by ToConcreteChildren.
176
+
177
+ /** Maps state IDs to their input types based on the StateSchema. */
178
+
179
+ /** @deprecated */
180
+
181
+ /** The terminal result published when an actor completes or errors. */
182
+
183
+ /** An executable effect that publishes an actor's terminal result. */
184
+
185
+ /** Mappers for subscribeTo - maps lifecycle events to machine events */
186
+
187
+ exports.SpecialTargets = SpecialTargets;
188
+ exports.createMachine = createMachine;
189
+ exports.createStateConfig = createStateConfig;