import { TransitionLabel } from "./label_ast"; export type AbstractState = { uid: string; children: ConcreteState[]; } export type AndState = { kind: "and"; } & AbstractState; export type OrState = { kind: "or"; // array of tuples: (uid of Arrow indicating initial state, initial state) // in a valid AST, there must be one initial state, but we allow the user to draw crazy shit initial: [string, ConcreteState][]; } & AbstractState; export type ConcreteState = AndState | OrState; export type Transition = { uid: string; src: ConcreteState; tgt: ConcreteState; label: TransitionLabel[]; } export type Statechart = { root: OrState; transitions: Map; // key: source state uid variables: Set; inputEvents: Set; internalEvents: Set; outputEvents: Set; }