xstate 4.35.2 → 5.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/README.md +25 -16
  2. package/actions/dist/xstate-actions.cjs.d.ts +1 -0
  3. package/actions/dist/xstate-actions.cjs.dev.js +30 -0
  4. package/actions/dist/xstate-actions.cjs.js +7 -0
  5. package/actions/dist/xstate-actions.cjs.prod.js +30 -0
  6. package/actions/dist/xstate-actions.esm.js +2 -0
  7. package/actions/dist/xstate-actions.umd.min.js +2 -0
  8. package/actions/dist/xstate-actions.umd.min.js.map +1 -0
  9. package/actions/dynamicAction.ts +34 -0
  10. package/actions/package.json +8 -0
  11. package/actors/dist/xstate-actors.cjs.d.ts +1 -0
  12. package/actors/dist/xstate-actors.cjs.dev.js +20 -0
  13. package/actors/dist/xstate-actors.cjs.js +7 -0
  14. package/actors/dist/xstate-actors.cjs.prod.js +20 -0
  15. package/actors/dist/xstate-actors.esm.js +2 -0
  16. package/actors/dist/xstate-actors.umd.min.js +2 -0
  17. package/actors/dist/xstate-actors.umd.min.js.map +1 -0
  18. package/actors/package.json +8 -0
  19. package/dev/dist/xstate-dev.cjs.d.ts +1 -0
  20. package/dev/dist/xstate-dev.cjs.dev.js +11 -0
  21. package/dev/dist/xstate-dev.cjs.js +7 -0
  22. package/{lib/devTools.js → dev/dist/xstate-dev.cjs.prod.js} +17 -10
  23. package/dev/dist/xstate-dev.esm.js +1 -0
  24. package/dev/dist/xstate-dev.umd.min.js +2 -0
  25. package/dev/dist/xstate-dev.umd.min.js.map +1 -0
  26. package/dev/package.json +8 -0
  27. package/dist/actions-7ea9280f.cjs.prod.js +4674 -0
  28. package/dist/actions-b08d0da8.cjs.dev.js +4718 -0
  29. package/dist/actions-b673cb13.esm.js +4660 -0
  30. package/dist/declarations/actions/dynamicAction.d.ts +5 -0
  31. package/dist/declarations/src/Machine.d.ts +4 -0
  32. package/dist/declarations/src/Mailbox.d.ts +12 -0
  33. package/{es → dist/declarations/src}/SimulatedClock.d.ts +16 -17
  34. package/dist/declarations/src/State.d.ts +97 -0
  35. package/dist/declarations/src/StateMachine.d.ts +120 -0
  36. package/dist/declarations/src/StateNode.d.ts +127 -0
  37. package/{es → dist/declarations/src}/actionTypes.d.ts +16 -20
  38. package/dist/declarations/src/actions/assign.d.ts +7 -0
  39. package/dist/declarations/src/actions/cancel.d.ts +10 -0
  40. package/dist/declarations/src/actions/choose.d.ts +3 -0
  41. package/dist/declarations/src/actions/invoke.d.ts +3 -0
  42. package/dist/declarations/src/actions/log.d.ts +11 -0
  43. package/dist/declarations/src/actions/pure.d.ts +3 -0
  44. package/dist/declarations/src/actions/raise.d.ts +9 -0
  45. package/dist/declarations/src/actions/send.d.ts +51 -0
  46. package/dist/declarations/src/actions/stop.d.ts +7 -0
  47. package/dist/declarations/src/actions.d.ts +43 -0
  48. package/dist/declarations/src/actors.d.ts +37 -0
  49. package/dist/declarations/src/constants.d.ts +5 -0
  50. package/{lib/devTools.d.ts → dist/declarations/src/dev/index.d.ts} +14 -14
  51. package/{es → dist/declarations/src}/environment.d.ts +1 -2
  52. package/dist/declarations/src/guards.d.ts +8 -0
  53. package/dist/declarations/src/index.d.ts +44 -0
  54. package/dist/declarations/src/interpreter.d.ts +108 -0
  55. package/{es → dist/declarations/src}/mapState.d.ts +3 -4
  56. package/dist/declarations/src/memo.d.ts +2 -0
  57. package/dist/declarations/src/registry.d.ts +8 -0
  58. package/{es → dist/declarations/src}/schema.d.ts +2 -3
  59. package/dist/declarations/src/spawn.d.ts +2 -0
  60. package/dist/declarations/src/stateUtils.d.ts +70 -0
  61. package/dist/declarations/src/symbolObservable.d.ts +1 -0
  62. package/{lib → dist/declarations/src}/typegenTypes.d.ts +132 -133
  63. package/dist/declarations/src/types.d.ts +1001 -0
  64. package/dist/declarations/src/utils.d.ts +54 -0
  65. package/{es/devTools.js → dist/index-20b364c4.esm.js} +18 -6
  66. package/dist/index-2a564d03.cjs.dev.js +64 -0
  67. package/dist/xstate.cjs.d.ts +1 -0
  68. package/dist/xstate.cjs.dev.js +993 -0
  69. package/dist/xstate.cjs.js +7 -0
  70. package/dist/xstate.cjs.prod.js +993 -0
  71. package/dist/xstate.esm.js +952 -0
  72. package/dist/xstate.umd.min.js +2 -0
  73. package/dist/xstate.umd.min.js.map +1 -0
  74. package/guards/dist/xstate-guards.cjs.d.ts +1 -0
  75. package/guards/dist/xstate-guards.cjs.dev.js +15 -0
  76. package/guards/dist/xstate-guards.cjs.js +7 -0
  77. package/guards/dist/xstate-guards.cjs.prod.js +15 -0
  78. package/guards/dist/xstate-guards.esm.js +2 -0
  79. package/guards/dist/xstate-guards.umd.min.js +2 -0
  80. package/guards/dist/xstate-guards.umd.min.js.map +1 -0
  81. package/guards/package.json +8 -0
  82. package/invoke/package.json +4 -0
  83. package/package.json +44 -30
  84. package/dist/xstate.interpreter.js +0 -15
  85. package/dist/xstate.js +0 -15
  86. package/dist/xstate.web.js +0 -15
  87. package/es/Actor.d.ts +0 -25
  88. package/es/Actor.js +0 -99
  89. package/es/Machine.d.ts +0 -12
  90. package/es/Machine.js +0 -21
  91. package/es/SimulatedClock.js +0 -81
  92. package/es/State.d.ts +0 -123
  93. package/es/State.js +0 -274
  94. package/es/StateNode.d.ts +0 -282
  95. package/es/StateNode.js +0 -1587
  96. package/es/_virtual/_tslib.js +0 -78
  97. package/es/actionTypes.js +0 -22
  98. package/es/actions.d.ts +0 -157
  99. package/es/actions.js +0 -630
  100. package/es/behaviors.d.ts +0 -37
  101. package/es/behaviors.js +0 -131
  102. package/es/constants.d.ts +0 -6
  103. package/es/constants.js +0 -6
  104. package/es/devTools.d.ts +0 -14
  105. package/es/each.d.ts +0 -4
  106. package/es/each.js +0 -13
  107. package/es/environment.js +0 -3
  108. package/es/index.d.ts +0 -22
  109. package/es/index.js +0 -25
  110. package/es/interpreter.d.ts +0 -217
  111. package/es/interpreter.js +0 -1488
  112. package/es/invoke.d.ts +0 -11
  113. package/es/invokeUtils.d.ts +0 -7
  114. package/es/invokeUtils.js +0 -40
  115. package/es/json.d.ts +0 -31
  116. package/es/json.js +0 -86
  117. package/es/mapState.js +0 -32
  118. package/es/match.d.ts +0 -9
  119. package/es/match.js +0 -34
  120. package/es/model.d.ts +0 -8
  121. package/es/model.js +0 -50
  122. package/es/model.types.d.ts +0 -56
  123. package/es/patterns.d.ts +0 -14
  124. package/es/patterns.js +0 -48
  125. package/es/registry.d.ts +0 -9
  126. package/es/registry.js +0 -19
  127. package/es/scheduler.d.ts +0 -17
  128. package/es/scheduler.js +0 -79
  129. package/es/schema.js +0 -6
  130. package/es/scxml.d.ts +0 -6
  131. package/es/serviceScope.d.ts +0 -4
  132. package/es/serviceScope.js +0 -16
  133. package/es/stateUtils.d.ts +0 -18
  134. package/es/stateUtils.js +0 -262
  135. package/es/typegenTypes.d.ts +0 -133
  136. package/es/types.d.ts +0 -1040
  137. package/es/types.js +0 -33
  138. package/es/utils.d.ts +0 -72
  139. package/es/utils.js +0 -622
  140. package/es/waitFor.d.ts +0 -34
  141. package/es/waitFor.js +0 -73
  142. package/lib/Actor.d.ts +0 -25
  143. package/lib/Actor.js +0 -108
  144. package/lib/Machine.d.ts +0 -12
  145. package/lib/Machine.js +0 -26
  146. package/lib/SimulatedClock.d.ts +0 -17
  147. package/lib/SimulatedClock.js +0 -85
  148. package/lib/State.d.ts +0 -123
  149. package/lib/State.js +0 -282
  150. package/lib/StateNode.d.ts +0 -282
  151. package/lib/StateNode.js +0 -1591
  152. package/lib/_virtual/_tslib.js +0 -85
  153. package/lib/actionTypes.d.ts +0 -20
  154. package/lib/actionTypes.js +0 -43
  155. package/lib/actions.d.ts +0 -157
  156. package/lib/actions.js +0 -662
  157. package/lib/behaviors.d.ts +0 -37
  158. package/lib/behaviors.js +0 -137
  159. package/lib/constants.d.ts +0 -6
  160. package/lib/constants.js +0 -13
  161. package/lib/each.d.ts +0 -4
  162. package/lib/each.js +0 -17
  163. package/lib/environment.d.ts +0 -2
  164. package/lib/environment.js +0 -7
  165. package/lib/index.d.ts +0 -22
  166. package/lib/index.js +0 -64
  167. package/lib/interpreter.d.ts +0 -217
  168. package/lib/interpreter.js +0 -1494
  169. package/lib/invoke.d.ts +0 -11
  170. package/lib/invoke.js +0 -20
  171. package/lib/invokeUtils.d.ts +0 -7
  172. package/lib/invokeUtils.js +0 -45
  173. package/lib/json.d.ts +0 -31
  174. package/lib/json.js +0 -94
  175. package/lib/mapState.d.ts +0 -4
  176. package/lib/mapState.js +0 -36
  177. package/lib/match.d.ts +0 -9
  178. package/lib/match.js +0 -38
  179. package/lib/model.d.ts +0 -8
  180. package/lib/model.js +0 -54
  181. package/lib/model.types.d.ts +0 -56
  182. package/lib/model.types.js +0 -2
  183. package/lib/patterns.d.ts +0 -14
  184. package/lib/patterns.js +0 -53
  185. package/lib/registry.d.ts +0 -9
  186. package/lib/registry.js +0 -23
  187. package/lib/scheduler.d.ts +0 -17
  188. package/lib/scheduler.js +0 -83
  189. package/lib/schema.d.ts +0 -3
  190. package/lib/schema.js +0 -11
  191. package/lib/scxml.d.ts +0 -6
  192. package/lib/scxml.js +0 -350
  193. package/lib/serviceScope.d.ts +0 -4
  194. package/lib/serviceScope.js +0 -21
  195. package/lib/stateUtils.d.ts +0 -18
  196. package/lib/stateUtils.js +0 -277
  197. package/lib/typegenTypes.js +0 -2
  198. package/lib/types.d.ts +0 -1040
  199. package/lib/types.js +0 -35
  200. package/lib/utils.d.ts +0 -72
  201. package/lib/utils.js +0 -669
  202. package/lib/waitFor.d.ts +0 -34
  203. package/lib/waitFor.js +0 -77
package/es/stateUtils.js DELETED
@@ -1,262 +0,0 @@
1
- import { __values, __spreadArray, __read } from './_virtual/_tslib.js';
2
- import { flatten } from './utils.js';
3
-
4
- var isLeafNode = function (stateNode) {
5
- return stateNode.type === 'atomic' || stateNode.type === 'final';
6
- };
7
- function getAllChildren(stateNode) {
8
- return Object.keys(stateNode.states).map(function (key) {
9
- return stateNode.states[key];
10
- });
11
- }
12
- function getChildren(stateNode) {
13
- return getAllChildren(stateNode).filter(function (sn) {
14
- return sn.type !== 'history';
15
- });
16
- }
17
- function getAllStateNodes(stateNode) {
18
- var stateNodes = [stateNode];
19
-
20
- if (isLeafNode(stateNode)) {
21
- return stateNodes;
22
- }
23
-
24
- return stateNodes.concat(flatten(getChildren(stateNode).map(getAllStateNodes)));
25
- }
26
- function getConfiguration(prevStateNodes, stateNodes) {
27
- var e_1, _a, e_2, _b, e_3, _c, e_4, _d;
28
-
29
- var prevConfiguration = new Set(prevStateNodes);
30
- var prevAdjList = getAdjList(prevConfiguration);
31
- var configuration = new Set(stateNodes);
32
-
33
- try {
34
- // add all ancestors
35
- for (var configuration_1 = __values(configuration), configuration_1_1 = configuration_1.next(); !configuration_1_1.done; configuration_1_1 = configuration_1.next()) {
36
- var s = configuration_1_1.value;
37
- var m = s.parent;
38
-
39
- while (m && !configuration.has(m)) {
40
- configuration.add(m);
41
- m = m.parent;
42
- }
43
- }
44
- } catch (e_1_1) {
45
- e_1 = {
46
- error: e_1_1
47
- };
48
- } finally {
49
- try {
50
- if (configuration_1_1 && !configuration_1_1.done && (_a = configuration_1.return)) _a.call(configuration_1);
51
- } finally {
52
- if (e_1) throw e_1.error;
53
- }
54
- }
55
-
56
- var adjList = getAdjList(configuration);
57
-
58
- try {
59
- // add descendants
60
- for (var configuration_2 = __values(configuration), configuration_2_1 = configuration_2.next(); !configuration_2_1.done; configuration_2_1 = configuration_2.next()) {
61
- var s = configuration_2_1.value; // if previously active, add existing child nodes
62
-
63
- if (s.type === 'compound' && (!adjList.get(s) || !adjList.get(s).length)) {
64
- if (prevAdjList.get(s)) {
65
- prevAdjList.get(s).forEach(function (sn) {
66
- return configuration.add(sn);
67
- });
68
- } else {
69
- s.initialStateNodes.forEach(function (sn) {
70
- return configuration.add(sn);
71
- });
72
- }
73
- } else {
74
- if (s.type === 'parallel') {
75
- try {
76
- for (var _e = (e_3 = void 0, __values(getChildren(s))), _f = _e.next(); !_f.done; _f = _e.next()) {
77
- var child = _f.value;
78
-
79
- if (!configuration.has(child)) {
80
- configuration.add(child);
81
-
82
- if (prevAdjList.get(child)) {
83
- prevAdjList.get(child).forEach(function (sn) {
84
- return configuration.add(sn);
85
- });
86
- } else {
87
- child.initialStateNodes.forEach(function (sn) {
88
- return configuration.add(sn);
89
- });
90
- }
91
- }
92
- }
93
- } catch (e_3_1) {
94
- e_3 = {
95
- error: e_3_1
96
- };
97
- } finally {
98
- try {
99
- if (_f && !_f.done && (_c = _e.return)) _c.call(_e);
100
- } finally {
101
- if (e_3) throw e_3.error;
102
- }
103
- }
104
- }
105
- }
106
- }
107
- } catch (e_2_1) {
108
- e_2 = {
109
- error: e_2_1
110
- };
111
- } finally {
112
- try {
113
- if (configuration_2_1 && !configuration_2_1.done && (_b = configuration_2.return)) _b.call(configuration_2);
114
- } finally {
115
- if (e_2) throw e_2.error;
116
- }
117
- }
118
-
119
- try {
120
- // add all ancestors
121
- for (var configuration_3 = __values(configuration), configuration_3_1 = configuration_3.next(); !configuration_3_1.done; configuration_3_1 = configuration_3.next()) {
122
- var s = configuration_3_1.value;
123
- var m = s.parent;
124
-
125
- while (m && !configuration.has(m)) {
126
- configuration.add(m);
127
- m = m.parent;
128
- }
129
- }
130
- } catch (e_4_1) {
131
- e_4 = {
132
- error: e_4_1
133
- };
134
- } finally {
135
- try {
136
- if (configuration_3_1 && !configuration_3_1.done && (_d = configuration_3.return)) _d.call(configuration_3);
137
- } finally {
138
- if (e_4) throw e_4.error;
139
- }
140
- }
141
-
142
- return configuration;
143
- }
144
-
145
- function getValueFromAdj(baseNode, adjList) {
146
- var childStateNodes = adjList.get(baseNode);
147
-
148
- if (!childStateNodes) {
149
- return {}; // todo: fix?
150
- }
151
-
152
- if (baseNode.type === 'compound') {
153
- var childStateNode = childStateNodes[0];
154
-
155
- if (childStateNode) {
156
- if (isLeafNode(childStateNode)) {
157
- return childStateNode.key;
158
- }
159
- } else {
160
- return {};
161
- }
162
- }
163
-
164
- var stateValue = {};
165
- childStateNodes.forEach(function (csn) {
166
- stateValue[csn.key] = getValueFromAdj(csn, adjList);
167
- });
168
- return stateValue;
169
- }
170
-
171
- function getAdjList(configuration) {
172
- var e_5, _a;
173
-
174
- var adjList = new Map();
175
-
176
- try {
177
- for (var configuration_4 = __values(configuration), configuration_4_1 = configuration_4.next(); !configuration_4_1.done; configuration_4_1 = configuration_4.next()) {
178
- var s = configuration_4_1.value;
179
-
180
- if (!adjList.has(s)) {
181
- adjList.set(s, []);
182
- }
183
-
184
- if (s.parent) {
185
- if (!adjList.has(s.parent)) {
186
- adjList.set(s.parent, []);
187
- }
188
-
189
- adjList.get(s.parent).push(s);
190
- }
191
- }
192
- } catch (e_5_1) {
193
- e_5 = {
194
- error: e_5_1
195
- };
196
- } finally {
197
- try {
198
- if (configuration_4_1 && !configuration_4_1.done && (_a = configuration_4.return)) _a.call(configuration_4);
199
- } finally {
200
- if (e_5) throw e_5.error;
201
- }
202
- }
203
-
204
- return adjList;
205
- }
206
- function getValue(rootNode, configuration) {
207
- var config = getConfiguration([rootNode], configuration);
208
- return getValueFromAdj(rootNode, getAdjList(config));
209
- }
210
- function has(iterable, item) {
211
- if (Array.isArray(iterable)) {
212
- return iterable.some(function (member) {
213
- return member === item;
214
- });
215
- }
216
-
217
- if (iterable instanceof Set) {
218
- return iterable.has(item);
219
- }
220
-
221
- return false; // TODO: fix
222
- }
223
- function nextEvents(configuration) {
224
- return __spreadArray([], __read(new Set(flatten(__spreadArray([], __read(configuration.map(function (sn) {
225
- return sn.ownEvents;
226
- })), false)))), false);
227
- }
228
- function isInFinalState(configuration, stateNode) {
229
- if (stateNode.type === 'compound') {
230
- return getChildren(stateNode).some(function (s) {
231
- return s.type === 'final' && has(configuration, s);
232
- });
233
- }
234
-
235
- if (stateNode.type === 'parallel') {
236
- return getChildren(stateNode).every(function (sn) {
237
- return isInFinalState(configuration, sn);
238
- });
239
- }
240
-
241
- return false;
242
- }
243
- function getMeta(configuration) {
244
- if (configuration === void 0) {
245
- configuration = [];
246
- }
247
-
248
- return configuration.reduce(function (acc, stateNode) {
249
- if (stateNode.meta !== undefined) {
250
- acc[stateNode.id] = stateNode.meta;
251
- }
252
-
253
- return acc;
254
- }, {});
255
- }
256
- function getTagsFromConfiguration(configuration) {
257
- return new Set(flatten(configuration.map(function (sn) {
258
- return sn.tags;
259
- })));
260
- }
261
-
262
- export { getAdjList, getAllChildren, getAllStateNodes, getChildren, getConfiguration, getMeta, getTagsFromConfiguration, getValue, has, isInFinalState, isLeafNode, nextEvents };
@@ -1,133 +0,0 @@
1
- import { BaseActionObject, EventObject, IndexByType, IsNever, Prop, Values, IsAny, ServiceMap, Cast } from './types';
2
- export interface TypegenDisabled {
3
- '@@xstate/typegen': false;
4
- }
5
- export interface TypegenEnabled {
6
- '@@xstate/typegen': true;
7
- }
8
- export interface TypegenMeta extends TypegenEnabled {
9
- /**
10
- * Allows you to specify all the results of state.matches
11
- */
12
- matchesStates: string | {};
13
- /**
14
- * Allows you to specify all tags used by the machine
15
- */
16
- tags: string;
17
- /**
18
- * Allows you to specify all the missing implementations
19
- * of the machine
20
- */
21
- missingImplementations: {
22
- actions: string;
23
- delays: string;
24
- guards: string;
25
- services: string;
26
- };
27
- /**
28
- * A map for the internal events of the machine.
29
- *
30
- * key: 'done.invoke.myService'
31
- * value: {
32
- * type: 'done.invoke.myService';
33
- * data: unknown;
34
- * __tip: 'Declare the type in event types!';
35
- * }
36
- */
37
- internalEvents: {};
38
- /**
39
- * Maps the name of the service to the event type
40
- * of the done.invoke action
41
- *
42
- * key: 'invokeSrc'
43
- * value: 'done.invoke.invokeName'
44
- */
45
- invokeSrcNameMap: Record<string, string>;
46
- /**
47
- * Keeps track of which events lead to which
48
- * actions.
49
- *
50
- * Key: 'EVENT_NAME'
51
- * Value: 'actionName' | 'otherActionName'
52
- */
53
- eventsCausingActions: Record<string, string>;
54
- /**
55
- * Keeps track of which events lead to which
56
- * delays.
57
- *
58
- * Key: 'EVENT_NAME'
59
- * Value: 'delayName' | 'otherDelayName'
60
- */
61
- eventsCausingDelays: Record<string, string>;
62
- /**
63
- * Keeps track of which events lead to which
64
- * guards.
65
- *
66
- * Key: 'EVENT_NAME'
67
- * Value: 'guardName' | 'otherGuardName'
68
- */
69
- eventsCausingGuards: Record<string, string>;
70
- /**
71
- * Keeps track of which events lead to which
72
- * services.
73
- *
74
- * Key: 'EVENT_NAME'
75
- * Value: 'serviceName' | 'otherServiceName'
76
- */
77
- eventsCausingServices: Record<string, string>;
78
- }
79
- export interface ResolvedTypegenMeta extends TypegenMeta {
80
- resolved: TypegenMeta & {
81
- indexedActions: Record<string, BaseActionObject>;
82
- indexedEvents: Record<string, EventObject>;
83
- };
84
- }
85
- export declare type TypegenConstraint = TypegenEnabled | TypegenDisabled;
86
- export declare type AreAllImplementationsAssumedToBeProvided<TResolvedTypesMeta, TMissingImplementations = Prop<Prop<TResolvedTypesMeta, 'resolved'>, 'missingImplementations'>> = IsAny<TResolvedTypesMeta> extends true ? true : TResolvedTypesMeta extends TypegenEnabled ? IsNever<Values<{
87
- [K in keyof TMissingImplementations]: TMissingImplementations[K];
88
- }>> extends true ? true : false : true;
89
- interface AllImplementationsProvided {
90
- missingImplementations: {
91
- actions: never;
92
- delays: never;
93
- guards: never;
94
- services: never;
95
- };
96
- }
97
- export interface MarkAllImplementationsAsProvided<TResolvedTypesMeta> {
98
- '@@xstate/typegen': Prop<TResolvedTypesMeta, '@@xstate/typegen'>;
99
- resolved: Prop<TResolvedTypesMeta, 'resolved'> & AllImplementationsProvided;
100
- }
101
- declare type GenerateServiceEvent<TServiceName, TEventType, TServiceMap extends ServiceMap> = TEventType extends any ? {
102
- type: TEventType;
103
- } & Prop<TServiceMap, TServiceName> : never;
104
- declare type GenerateServiceEvents<TServiceMap extends ServiceMap, TInvokeSrcNameMap> = string extends keyof TServiceMap ? never : Cast<{
105
- [K in keyof TInvokeSrcNameMap]: GenerateServiceEvent<K, TInvokeSrcNameMap[K], TServiceMap>;
106
- }[keyof TInvokeSrcNameMap], EventObject>;
107
- declare type MergeWithInternalEvents<TIndexedEvents, TInternalEvents> = TIndexedEvents & Pick<TInternalEvents, Exclude<keyof TInternalEvents, keyof TIndexedEvents>>;
108
- declare type AllowAllEvents = {
109
- eventsCausingActions: Record<string, string>;
110
- eventsCausingDelays: Record<string, string>;
111
- eventsCausingGuards: Record<string, string>;
112
- eventsCausingServices: Record<string, string>;
113
- };
114
- export interface ResolveTypegenMeta<TTypesMeta extends TypegenConstraint, TEvent extends EventObject, TAction extends BaseActionObject, TServiceMap extends ServiceMap> {
115
- '@@xstate/typegen': TTypesMeta['@@xstate/typegen'];
116
- resolved: {
117
- enabled: TTypesMeta & {
118
- indexedActions: IndexByType<TAction>;
119
- indexedEvents: MergeWithInternalEvents<IndexByType<(string extends TEvent['type'] ? never : TEvent) | GenerateServiceEvents<TServiceMap, Prop<TTypesMeta, 'invokeSrcNameMap'>>>, Prop<TTypesMeta, 'internalEvents'>>;
120
- };
121
- disabled: TypegenDisabled & AllImplementationsProvided & AllowAllEvents & {
122
- indexedActions: IndexByType<TAction>;
123
- indexedEvents: Record<string, TEvent> & {
124
- __XSTATE_ALLOW_ANY_INVOKE_DATA_HACK__: {
125
- data: any;
126
- };
127
- };
128
- invokeSrcNameMap: Record<string, '__XSTATE_ALLOW_ANY_INVOKE_DATA_HACK__'>;
129
- };
130
- }[IsNever<TTypesMeta> extends true ? 'disabled' : TTypesMeta extends TypegenEnabled ? 'enabled' : 'disabled'];
131
- }
132
- export {};
133
- //# sourceMappingURL=typegenTypes.d.ts.map