export type MermaidView = "flow" | "sequence"; export interface CheckResult { ok: boolean; error?: string; } export interface CommandResult { stdout: string; stderr: string; code: number; killed: boolean; } export type RunCommand = (command: string, args: string[], options?: { timeout?: number; }) => Promise; /** * Cheap, dependency-free validation that catches the failure modes we care * about: wrong diagram type, unbalanced blocks, unbalanced quotes, reserved * node names, and absurdly large output. It cannot prove Mermaid correctness. */ export declare function structuralCheck(code: string, view: MermaidView): CheckResult; export declare function findChrome(run: RunCommand): Promise; export declare function chromeMermaidCheck(code: string, chrome: string, vendorDir: string, run: RunCommand): Promise; export interface ValidateOptions { run?: RunCommand; vendorDir?: string; chrome?: string | null; } export interface ValidationOutcome { result: CheckResult; gate: "structural" | "chrome"; } /** * Structural check always runs. When a Chrome binary and a vendored Mermaid * copy are available, the real Mermaid parser is used as a second gate. */ export declare function validateMermaid(code: string, view: MermaidView, options?: ValidateOptions): Promise;