1 | import { AnyActorRef, AnyEventObject, AnyTransitionDefinition, Snapshot } from "./types.js";
|
2 | export type InspectionEvent = InspectedSnapshotEvent | InspectedEventEvent | InspectedActorEvent | InspectedMicrostepEvent | InspectedActionEvent;
|
3 | export interface BaseInspectionEventProperties {
|
4 | rootId: string;
|
5 | |
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | actorRef: AnyActorRef;
|
12 | }
|
13 | export interface InspectedSnapshotEvent extends BaseInspectionEventProperties {
|
14 | type: '@xstate.snapshot';
|
15 | event: AnyEventObject;
|
16 | snapshot: Snapshot<unknown>;
|
17 | }
|
18 | export interface InspectedMicrostepEvent extends BaseInspectionEventProperties {
|
19 | type: '@xstate.microstep';
|
20 | event: AnyEventObject;
|
21 | snapshot: Snapshot<unknown>;
|
22 | _transitions: AnyTransitionDefinition[];
|
23 | }
|
24 | export interface InspectedActionEvent extends BaseInspectionEventProperties {
|
25 | type: '@xstate.action';
|
26 | action: {
|
27 | type: string;
|
28 | params: Record<string, unknown>;
|
29 | };
|
30 | }
|
31 | export interface InspectedEventEvent extends BaseInspectionEventProperties {
|
32 | type: '@xstate.event';
|
33 | sourceRef: AnyActorRef | undefined;
|
34 | event: AnyEventObject;
|
35 | }
|
36 | export interface InspectedActorEvent extends BaseInspectionEventProperties {
|
37 | type: '@xstate.actor';
|
38 | }
|