import { type SourceLine } from "./lines.js"; export interface InitialStatement { kind: "initial"; line: number; target: string; targetColumn: number; } export interface TransitionStatement { kind: "transition"; line: number; source: string; sourceColumn: number; /** `null` = `[*]` (the final pseudo-state of the enclosing block). */ target: string | null; targetColumn: number; /** Text after `:`; `null` when absent or empty. */ label: string | null; labelColumn: number; } export interface DescriptionStatement { kind: "description"; line: number; id: string; idColumn: number; description: string; } export interface ChoiceStatement { kind: "choice"; line: number; id: string; idColumn: number; } export interface BlockStatement { kind: "block"; line: number; endLine: number; id: string; idColumn: number; /** From `state "desc" as X {`. */ description: string | null; /** One entry without `--`; two or more with `--` (parallel regions), in source order. */ regions: Statement[][]; hasDividers: boolean; } export interface NoteStatement { kind: "note"; line: number; id: string; idColumn: number; } /** A bare id on its own line — mermaid's plain state statement (declares the state in the scope). */ export interface DeclarationStatement { kind: "declaration"; line: number; id: string; idColumn: number; } export interface IgnoredStatement { kind: "ignored"; line: number; keyword: "direction" | "classDef" | "class"; } export type Statement = InitialStatement | TransitionStatement | DescriptionStatement | ChoiceStatement | BlockStatement | NoteStatement | DeclarationStatement | IgnoredStatement; export interface Diagram { headerLine: number; statements: Statement[]; } export declare function parseDiagram(lines: SourceLine[]): Diagram;