export type MermaidValidationResult = { status: "valid"; } | { status: "invalid"; error: string; } | { status: "unavailable"; reason: string; }; export interface ValidateMermaidOptions { /** * Overrides the resolved `mmdc` script path. Test-only seam: lets * test/validate-mermaid.test.ts force the "unavailable" branch * deterministically (a bogus path) without needing to actually * uninstall @mermaid-js/mermaid-cli from this repo's own node_modules. */ mmdcBinPath?: string; } /** * Renders `mermaidText` with mermaid-cli (`mmdc`) to a throwaway SVG and * reports whether it actually rendered — the "写出即验证" enforcement * from Decision record 004 技术点 5. A generated diagram nobody opens * until much later isn't validated, it's just written; this is the * module that makes "validated" mean something. * * Deliberately NOT on loopgraph's default `view` CLI path (see * src/cli/commands/view.ts): mmdc needs a real puppeteer-launched * browser (~300MB Chromium download on first install), which the * project's own lightness principle (proposal 001 §6: views generation * isn't in the CI gating path) says shouldn't be a hard runtime * requirement for every consumer that installs loopgraph. It's a * devDependency here so loopgraph's OWN test suite can prove the * generator produces valid mermaid (test/validate-mermaid.test.ts, * test/view-cli.test.ts), and available to end users only when they * opt in with `loopgraph view --validate` AND have separately installed * `@mermaid-js/mermaid-cli` themselves. */ export declare function validateMermaid(mermaidText: string, options?: ValidateMermaidOptions): Promise; //# sourceMappingURL=validate-mermaid.d.ts.map