@hkdigital/lib-core 0.4.23 → 0.4.25

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 (42) hide show
  1. package/dist/logging/internal/adapters/pino.d.ts +7 -3
  2. package/dist/logging/internal/adapters/pino.js +200 -67
  3. package/dist/logging/internal/transports/pretty-transport.d.ts +17 -0
  4. package/dist/logging/internal/transports/pretty-transport.js +104 -0
  5. package/dist/logging/internal/transports/test-transport.d.ts +19 -0
  6. package/dist/logging/internal/transports/test-transport.js +79 -0
  7. package/dist/network/loaders/audio/AudioScene.svelte.js +2 -2
  8. package/dist/network/loaders/image/ImageScene.svelte.js +18 -28
  9. package/dist/network/states/NetworkLoader.svelte.d.ts +7 -1
  10. package/dist/network/states/NetworkLoader.svelte.js +17 -4
  11. package/dist/services/README.md +23 -0
  12. package/dist/services/service-base/ServiceBase.d.ts +12 -8
  13. package/dist/services/service-base/ServiceBase.js +8 -6
  14. package/dist/state/classes.d.ts +0 -2
  15. package/dist/state/classes.js +0 -2
  16. package/dist/state/{classes → machines}/finite-state-machine/FiniteStateMachine.svelte.d.ts +13 -7
  17. package/dist/state/machines/finite-state-machine/FiniteStateMachine.svelte.js +181 -0
  18. package/dist/state/machines/finite-state-machine/README.md +547 -0
  19. package/dist/state/machines/finite-state-machine/constants.d.ts +13 -0
  20. package/dist/state/machines/finite-state-machine/constants.js +15 -0
  21. package/dist/state/{classes → machines}/finite-state-machine/index.d.ts +2 -1
  22. package/dist/state/{classes → machines}/finite-state-machine/index.js +2 -1
  23. package/dist/state/machines/finite-state-machine/typedef.d.ts +29 -0
  24. package/dist/state/machines/finite-state-machine/typedef.js +28 -0
  25. package/dist/state/machines/loading-state-machine/LoadingStateMachine.svelte.d.ts +22 -0
  26. package/dist/state/{classes → machines}/loading-state-machine/LoadingStateMachine.svelte.js +34 -29
  27. package/dist/state/machines/loading-state-machine/README.md +592 -0
  28. package/dist/state/{classes → machines}/loading-state-machine/constants.d.ts +2 -0
  29. package/dist/state/{classes → machines}/loading-state-machine/constants.js +2 -0
  30. package/dist/state/machines/typedef.d.ts +1 -0
  31. package/dist/state/machines/typedef.js +1 -0
  32. package/dist/state/machines.d.ts +2 -0
  33. package/dist/state/machines.js +2 -0
  34. package/dist/state/typedef.d.ts +1 -0
  35. package/dist/state/typedef.js +1 -0
  36. package/dist/ui/components/game-box/README.md +245 -0
  37. package/package.json +1 -1
  38. package/dist/logging/internal/adapters/pino.js__ +0 -260
  39. package/dist/state/classes/finite-state-machine/FiniteStateMachine.svelte.js +0 -133
  40. package/dist/state/classes/loading-state-machine/LoadingStateMachine.svelte.d.ts +0 -12
  41. /package/dist/state/{classes → machines}/loading-state-machine/index.d.ts +0 -0
  42. /package/dist/state/{classes → machines}/loading-state-machine/index.js +0 -0
@@ -0,0 +1,547 @@
1
+ # FiniteStateMachine
2
+
3
+ A lightweight finite state machine implementation for JavaScript applications, designed to work seamlessly with Svelte 5 runes.
4
+
5
+ ## Overview
6
+
7
+ The `FiniteStateMachine` class provides a simple yet powerful way to manage application state through well-defined states and transitions. It supports enter/exit callbacks, event-driven transitions, and debounced events.
8
+
9
+ ## Basic Usage
10
+
11
+ ```javascript
12
+ import { FiniteStateMachine } from '$lib/state/classes.js';
13
+
14
+ const machine = new FiniteStateMachine('idle', {
15
+ idle: {
16
+ start: 'running'
17
+ },
18
+ running: {
19
+ pause: 'paused',
20
+ stop: 'idle'
21
+ },
22
+ paused: {
23
+ resume: 'running',
24
+ stop: 'idle'
25
+ }
26
+ });
27
+
28
+ // Check current state
29
+ console.log(machine.current); // 'idle'
30
+
31
+ // Send events to trigger transitions
32
+ machine.send('start');
33
+ console.log(machine.current); // 'running'
34
+
35
+ machine.send('pause');
36
+ console.log(machine.current); // 'paused'
37
+ ```
38
+
39
+ ## Constructor
40
+
41
+ ```javascript
42
+ new FiniteStateMachine(initialState, states);
43
+ ```
44
+
45
+ - `initialState`: The starting state (string)
46
+ - `states`: Object defining available states and their transitions
47
+
48
+ ## State Definition
49
+
50
+ Each state can define:
51
+
52
+ - **Transitions**: Event name → target state
53
+ - **Enter callback**: `_enter` function called when entering the state
54
+ - **Exit callback**: `_exit` function called when leaving the state
55
+
56
+ ```javascript
57
+ const machine = new FiniteStateMachine('idle', {
58
+ idle: {
59
+ _enter: (metadata) => {
60
+ console.log('Entered idle state');
61
+ },
62
+ _exit: (metadata) => {
63
+ console.log('Leaving idle state');
64
+ },
65
+ start: 'running'
66
+ },
67
+ running: {
68
+ _enter: (metadata) => {
69
+ console.log('Started running');
70
+ },
71
+ stop: 'idle'
72
+ }
73
+ });
74
+ ```
75
+
76
+ ## Callback Metadata
77
+
78
+ Enter and exit callbacks receive metadata about the transition:
79
+
80
+ ```javascript
81
+ /** @typedef {import('./typedef.js').StateTransitionMetadata} StateTransitionMetadata */
82
+
83
+ // Metadata structure:
84
+ {
85
+ from: 'previousState', // State being exited
86
+ to: 'newState', // State being entered
87
+ event: 'eventName', // Event that triggered transition
88
+ args: [] // Arguments passed to send()
89
+ }
90
+ ```
91
+
92
+ ### TypeScript/JSDoc Integration
93
+
94
+ For better type safety, import the type definitions:
95
+
96
+ ```javascript
97
+ /** @typedef {import('./typedef.js').StateTransitionMetadata} StateTransitionMetadata */
98
+ /** @typedef {import('./typedef.js').OnEnterCallback} OnEnterCallback */
99
+ /** @typedef {import('./typedef.js').OnExitCallback} OnExitCallback */
100
+
101
+ /** @type {OnEnterCallback} */
102
+ const handleEnter = (state, metadata) => {
103
+ console.log(`Entering ${state} from ${metadata.from}`);
104
+ };
105
+
106
+ /** @type {OnExitCallback} */
107
+ const handleExit = (state, metadata) => {
108
+ console.log(`Leaving ${state} to ${metadata.to}`);
109
+ };
110
+
111
+ machine.onenter = handleEnter;
112
+ machine.onexit = handleExit;
113
+ ```
114
+
115
+ ## Methods
116
+
117
+ ### `send(event, ...args)`
118
+
119
+ Triggers a state transition based on the event.
120
+
121
+ ```javascript
122
+ machine.send('start');
123
+ machine.send('error', new Error('Something went wrong'));
124
+ ```
125
+
126
+ Returns the current state after processing the event.
127
+
128
+ ### `debounce(wait, event, ...args)`
129
+
130
+ Debounces event sending to prevent rapid-fire transitions.
131
+
132
+ ```javascript
133
+ // Will only execute after 500ms of inactivity
134
+ await machine.debounce(500, 'search', query);
135
+ ```
136
+
137
+ ### `current` (getter)
138
+
139
+ Returns the current state as a string.
140
+
141
+ ```javascript
142
+ console.log(machine.current); // 'idle'
143
+ ```
144
+
145
+ ## Advanced Features
146
+
147
+ ### Wildcard States
148
+
149
+ Use `*` to define transitions available from any state:
150
+
151
+ ```javascript
152
+ const machine = new FiniteStateMachine('idle', {
153
+ idle: {
154
+ start: 'running'
155
+ },
156
+ running: {
157
+ pause: 'paused'
158
+ },
159
+ paused: {
160
+ resume: 'running'
161
+ },
162
+ '*': {
163
+ reset: 'idle', // Available from any state
164
+ error: 'error'
165
+ },
166
+ error: {
167
+ reset: 'idle'
168
+ }
169
+ });
170
+ ```
171
+
172
+ ### Same-State Transitions
173
+
174
+ Same-state transitions (e.g., `idle → idle`) do NOT trigger enter/exit
175
+ callbacks. The state remains unchanged.
176
+
177
+ ```javascript
178
+ machine.send('reset'); // If already in 'idle', no callbacks are called
179
+ ```
180
+
181
+ ### Function Actions
182
+
183
+ Instead of target states, you can define function actions:
184
+
185
+ ```javascript
186
+ const machine = new FiniteStateMachine('idle', {
187
+ idle: {
188
+ log: () => {
189
+ console.log('Logging from idle state');
190
+ return 'idle'; // Stay in same state
191
+ },
192
+ start: 'running'
193
+ },
194
+ running: {
195
+ stop: 'idle'
196
+ }
197
+ });
198
+ ```
199
+
200
+ ## onenter and onexit Callbacks
201
+
202
+ The `onenter` and `onexit` callbacks provide a unified way to react to all state changes, designed to work reliably with Svelte's reactivity system:
203
+
204
+ ```javascript
205
+ const machine = new FiniteStateMachine('idle', {
206
+ idle: { start: 'loading' },
207
+ loading: { complete: 'loaded', error: 'error' },
208
+ loaded: { reset: 'idle' },
209
+ error: { retry: 'loading', reset: 'idle' }
210
+ });
211
+
212
+ machine.onexit = (state, metadata) => {
213
+ switch (state) {
214
+ case 'loading':
215
+ console.log('Leaving loading state...');
216
+ // Cancel ongoing requests
217
+ abortController?.abort();
218
+ break;
219
+ case 'loaded':
220
+ console.log('Leaving loaded state...');
221
+ // Cleanup resources
222
+ releaseResources();
223
+ break;
224
+ }
225
+ };
226
+
227
+ machine.onenter = (state, metadata) => {
228
+ switch (state) {
229
+ case 'loading':
230
+ console.log('Started loading...');
231
+ showSpinner();
232
+ break;
233
+ case 'loaded':
234
+ console.log('Loading complete!');
235
+ hideSpinner();
236
+ break;
237
+ case 'error':
238
+ console.log('Loading failed');
239
+ showError(metadata.args[0]);
240
+ break;
241
+ }
242
+ };
243
+ ```
244
+
245
+ ### Callback Execution Order
246
+
247
+ The callbacks are executed in this specific order during state transitions:
248
+
249
+ 1. **`onexit`** - Called before leaving current state
250
+ 2. **`_exit`** - Individual state exit callback
251
+ 3. **`_enter`** - Individual state enter callback
252
+ 4. **`onenter`** - Called after entering new state
253
+
254
+ ```javascript
255
+ const machine = new FiniteStateMachine('idle', {
256
+ idle: {
257
+ _enter: () => console.log('2. idle _enter'),
258
+ _exit: () => console.log('4. idle _exit'),
259
+ start: 'loading'
260
+ },
261
+ loading: {
262
+ _enter: () => console.log('5. loading _enter'),
263
+ complete: 'loaded'
264
+ }
265
+ });
266
+
267
+ machine.onexit = (state) => console.log(`3. onexit ${state}`);
268
+ machine.onenter = (state) => console.log(`6. onenter ${state}`);
269
+
270
+ // Initial state triggers _enter and onenter
271
+ // Output:
272
+ // 2. idle _enter
273
+ // 6. onenter idle
274
+
275
+ machine.send('start');
276
+ // Output:
277
+ // 3. onexit idle
278
+ // 4. idle _exit
279
+ // 5. loading _enter
280
+ // 6. onenter loading
281
+ ```
282
+
283
+ ### onexit vs onenter
284
+
285
+ - **`onexit`**: Called when leaving a state - perfect for cleanup, cancellation, resource release
286
+ - **`onenter`**: Called when entering a state - perfect for initialization, setup, starting processes
287
+ - **`_exit`/`_enter`**: Individual per-state callbacks, called during transition
288
+ - **All callbacks are optional**: Set to null if not needed
289
+
290
+ ## Integration with Svelte Reactivity
291
+
292
+ When using FiniteStateMachine with Svelte's reactive derived state, use this pattern to avoid timing issues and ensure reliable state monitoring:
293
+
294
+ ### Pattern: Separate onenter from Reactive Monitoring
295
+
296
+ **✅ Use `onexit` and `onenter` for immediate state actions:**
297
+
298
+ ```javascript
299
+ const machine = new FiniteStateMachine('idle', {
300
+ idle: { start: 'loading' },
301
+ loading: { complete: 'loaded' },
302
+ loaded: { reset: 'idle' }
303
+ });
304
+
305
+ machine.onexit = (state) => {
306
+ switch (state) {
307
+ case 'loading':
308
+ this.#cancelProcess(); // Cancel ongoing operations
309
+ break;
310
+ case 'loaded':
311
+ this.#releaseResources(); // Cleanup when leaving
312
+ break;
313
+ }
314
+ };
315
+
316
+ machine.onenter = (state) => {
317
+ switch (state) {
318
+ case 'loading':
319
+ this.#startProcess(); // Start async process immediately
320
+ break;
321
+ case 'loaded':
322
+ this.#notifyComplete(); // Notify when complete
323
+ break;
324
+ }
325
+ this.state = state; // Update public state
326
+ };
327
+ ```
328
+
329
+ **✅ Use `$effect` for reactive state monitoring:**
330
+
331
+ ```javascript
332
+ // Monitor derived/computed values and trigger transitions when conditions are met
333
+ $effect(() => {
334
+ if (machine.current === 'loading') {
335
+ // Check completion based on reactive derived values
336
+ if (this.#itemsCompleted === this.#totalItems && this.#totalItems > 0) {
337
+ machine.send('complete'); // Trigger transition when condition met
338
+ }
339
+ }
340
+ });
341
+ ```
342
+
343
+ ### Why This Pattern?
344
+
345
+ - **`onexit`**: Handles cleanup and teardown when leaving states
346
+ - **`onenter`**: Handles setup and initialization when entering states
347
+ - **`$effect`**: Handles reactive monitoring of derived/computed values over time
348
+ - **Avoids timing issues**: Doesn't check completion status immediately on state entry
349
+ - **Leverages Svelte reactivity**: Automatically responds to changes in reactive variables
350
+ - **Clean separation**: State machine handles discrete transitions, effects handle continuous monitoring
351
+ - **Complete lifecycle**: Full control over state entry and exit
352
+
353
+ ### Use Cases for This Pattern:
354
+
355
+ - **Progress monitoring**: File uploads, multi-step processes
356
+ - **Derived state transitions**: Validation completion, multi-source loading
357
+ - **Real-time condition checking**: Monitoring reactive computed properties
358
+ - **Complex completion logic**: When completion depends on multiple reactive values
359
+
360
+ ### Example: Multi-Task Processor
361
+
362
+ ```javascript
363
+ export default class TaskProcessor {
364
+ #machine = new FiniteStateMachine('idle', {
365
+ idle: { start: 'processing' },
366
+ processing: { complete: 'finished', error: 'failed' },
367
+ finished: { reset: 'idle' },
368
+ failed: { retry: 'processing', reset: 'idle' }
369
+ });
370
+
371
+ #tasks = $state([]);
372
+
373
+ // Derived progress calculation
374
+ #progress = $derived.by(() => {
375
+ let completed = 0;
376
+ for (const task of this.#tasks) {
377
+ if (task.completed) completed++;
378
+ }
379
+ return { completed, total: this.#tasks.length };
380
+ });
381
+
382
+ constructor() {
383
+ // onexit: Handle cleanup when leaving states
384
+ this.#machine.onexit = (state) => {
385
+ switch (state) {
386
+ case 'processing':
387
+ this.#cancelTasks(); // Cancel ongoing tasks if interrupted
388
+ break;
389
+ }
390
+ };
391
+
392
+ // onenter: Handle immediate state actions
393
+ this.#machine.onenter = (state) => {
394
+ switch (state) {
395
+ case 'processing':
396
+ this.#startAllTasks(); // Start processing immediately
397
+ break;
398
+ case 'finished':
399
+ this.#notifyComplete(); // Cleanup/notify when done
400
+ break;
401
+ }
402
+ this.state = state;
403
+ };
404
+
405
+ // $effect: Monitor reactive completion
406
+ $effect(() => {
407
+ if (this.#machine.current === 'processing') {
408
+ const { completed, total } = this.#progress;
409
+ if (completed === total && total > 0) {
410
+ this.#machine.send('complete');
411
+ }
412
+ }
413
+ });
414
+ }
415
+ }
416
+ ```
417
+
418
+ ### Basic Component Integration
419
+
420
+ ```javascript
421
+ // Component.svelte
422
+ <script>
423
+ import { FiniteStateMachine } from '$lib/state/classes.js';
424
+
425
+ const machine = new FiniteStateMachine('idle', {
426
+ idle: { start: 'loading' },
427
+ loading: { complete: 'loaded', error: 'error' },
428
+ loaded: { reset: 'idle' },
429
+ error: { retry: 'loading', reset: 'idle' }
430
+ });
431
+
432
+ // Reactive state updates
433
+ $effect(() => {
434
+ console.log('State changed to:', machine.current);
435
+ });
436
+
437
+ // Handle state-specific actions
438
+ machine.onexit = (state) => {
439
+ switch (state) {
440
+ case 'loading':
441
+ // Cancel any ongoing requests
442
+ cancelRequests();
443
+ break;
444
+ }
445
+ };
446
+
447
+ machine.onenter = (state) => {
448
+ switch (state) {
449
+ case 'loading':
450
+ loadData();
451
+ break;
452
+ case 'error':
453
+ showErrorMessage();
454
+ break;
455
+ }
456
+ };
457
+ </script>
458
+
459
+ <button onclick={() => machine.send('start')}>
460
+ {machine.current === 'loading' ? 'Loading...' : 'Start'}
461
+ </button>
462
+ ```
463
+
464
+ ## Error Handling
465
+
466
+ Invalid transitions are handled gracefully with console warnings:
467
+
468
+ ```javascript
469
+ const machine = new FiniteStateMachine('idle', {
470
+ idle: { start: 'running' },
471
+ running: { stop: 'idle' }
472
+ });
473
+
474
+ machine.send('invalidEvent'); // Logs warning, stays in current state
475
+ console.log(machine.current); // Still 'idle'
476
+ ```
477
+
478
+ ## Best Practices
479
+
480
+ 1. **Clear state names**: Use descriptive state names like `loading`, `error`,
481
+ `authenticated` rather than generic ones
482
+ 2. **Minimal state count**: Keep the number of states manageable
483
+ 3. **Explicit transitions**: Define all valid transitions explicitly
484
+ 4. **Error states**: Include error states and recovery paths
485
+ 5. **Callback cleanup**: Use exit callbacks to clean up resources
486
+
487
+ ## Examples
488
+
489
+ ### Loading State Machine
490
+
491
+ ```javascript
492
+ const loader = new FiniteStateMachine('idle', {
493
+ idle: {
494
+ _enter: () => console.log('Ready to load'),
495
+ load: 'loading'
496
+ },
497
+ loading: {
498
+ _enter: () => console.log('Loading started'),
499
+ _exit: () => console.log('Loading finished'),
500
+ success: 'loaded',
501
+ error: 'error'
502
+ },
503
+ loaded: {
504
+ _enter: () => console.log('Data loaded successfully'),
505
+ reload: 'loading',
506
+ reset: 'idle'
507
+ },
508
+ error: {
509
+ _enter: ({ args }) => console.error('Load failed:', args[0]),
510
+ retry: 'loading',
511
+ reset: 'idle'
512
+ }
513
+ });
514
+ ```
515
+
516
+ ### Authentication State Machine
517
+
518
+ ```javascript
519
+ const auth = new FiniteStateMachine('anonymous', {
520
+ anonymous: {
521
+ login: 'authenticating'
522
+ },
523
+ authenticating: {
524
+ _enter: () => console.log('Checking credentials...'),
525
+ success: 'authenticated',
526
+ failure: 'anonymous'
527
+ },
528
+ authenticated: {
529
+ _enter: (meta) => console.log('Welcome!'),
530
+ logout: 'anonymous',
531
+ expire: 'anonymous'
532
+ }
533
+ });
534
+ ```
535
+
536
+ ## Testing
537
+
538
+ The state machine includes comprehensive tests covering:
539
+
540
+ - Basic state transitions
541
+ - Enter/exit callbacks
542
+ - Invalid transitions
543
+ - Same-state transitions
544
+ - Immediate state access
545
+ - Callback execution order
546
+
547
+ See `FiniteStateMachine.test.js` for detailed examples.
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @fileoverview Constants for FiniteStateMachine events
3
+ */
4
+ /**
5
+ * Event emitted when entering a state
6
+ * @type {string}
7
+ */
8
+ export const ENTER: string;
9
+ /**
10
+ * Event emitted when exiting a state
11
+ * @type {string}
12
+ */
13
+ export const EXIT: string;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @fileoverview Constants for FiniteStateMachine events
3
+ */
4
+
5
+ /**
6
+ * Event emitted when entering a state
7
+ * @type {string}
8
+ */
9
+ export const ENTER = 'enter';
10
+
11
+ /**
12
+ * Event emitted when exiting a state
13
+ * @type {string}
14
+ */
15
+ export const EXIT = 'exit';
@@ -1 +1,2 @@
1
- export { default as FiniteStateMachine } from "./FiniteStateMachine.svelte";
1
+ export { default as FiniteStateMachine } from "./FiniteStateMachine.svelte.js";
2
+ export * from "./constants.js";
@@ -1 +1,2 @@
1
- export { default as FiniteStateMachine } from './FiniteStateMachine.svelte';
1
+ export { default as FiniteStateMachine } from './FiniteStateMachine.svelte.js';
2
+ export * from './constants.js';
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Metadata object passed to state transition callbacks
3
+ */
4
+ export type StateTransitionMetadata = {
5
+ /**
6
+ * - The state being exited
7
+ */
8
+ from: string;
9
+ /**
10
+ * - The state being entered
11
+ */
12
+ to: string;
13
+ /**
14
+ * - The event that triggered the transition
15
+ */
16
+ event: string;
17
+ /**
18
+ * - Arguments passed to the send() method
19
+ */
20
+ args: any[];
21
+ };
22
+ /**
23
+ * Callback function called when entering a state
24
+ */
25
+ export type OnEnterCallback = (arg0: string, arg1: StateTransitionMetadata) => void;
26
+ /**
27
+ * Callback function called when exiting a state
28
+ */
29
+ export type OnExitCallback = (arg0: string, arg1: StateTransitionMetadata) => void;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @fileoverview Type definitions for FiniteStateMachine
3
+ */
4
+
5
+ /**
6
+ * Metadata object passed to state transition callbacks
7
+ *
8
+ * @typedef {object} StateTransitionMetadata
9
+ * @property {string} from - The state being exited
10
+ * @property {string} to - The state being entered
11
+ * @property {string} event - The event that triggered the transition
12
+ * @property {any[]} args - Arguments passed to the send() method
13
+ */
14
+
15
+ /**
16
+ * Callback function called when entering a state
17
+ *
18
+ * @typedef {function(string, StateTransitionMetadata): void} OnEnterCallback
19
+ */
20
+
21
+ /**
22
+ * Callback function called when exiting a state
23
+ *
24
+ * @typedef {function(string, StateTransitionMetadata): void} OnExitCallback
25
+ */
26
+
27
+ // Export types for external use (this is just for JSDoc, no actual exports needed)
28
+ export {};
@@ -0,0 +1,22 @@
1
+ /**
2
+ * extends FiniteStateMachine<StatesT, EventsT>
3
+ */
4
+ export default class LoadingStateMachine extends FiniteStateMachine {
5
+ constructor();
6
+ /** The last error */
7
+ get error(): Error;
8
+ /**
9
+ * Transition to timeout state
10
+ * - Only valid when currently loading
11
+ * - Useful for external timeout management
12
+ */
13
+ doTimeout(): void;
14
+ /**
15
+ * Transition to cancelled state
16
+ * - Only valid when currently loading
17
+ * - Useful for external cancellation management
18
+ */
19
+ doCancel(): void;
20
+ #private;
21
+ }
22
+ import FiniteStateMachine from '../finite-state-machine/FiniteStateMachine.svelte.js';