export interface MermaidBlock { index: number; startLine: number; endLine: number; content: string; } export interface MermaidValidationError { blockIndex: number; startLine: number; message: string; diagramSnippet: string; } export interface MermaidValidationResult { valid: boolean; errors: MermaidValidationError[]; structuralErrors: string[]; blockCount: number; } export interface ExtractionResult { blocks: MermaidBlock[]; structuralErrors: string[]; } /** * Extracts mermaid code blocks from markdown content. * Also detects structural issues like unclosed fences and empty blocks. */ export declare function extractMermaidBlocks(markdown: string): ExtractionResult; /** * Validates all mermaid diagrams in the given markdown. * Uses the mermaid package's parse() function for syntax validation. * Falls back gracefully if mermaid is unavailable. */ export declare function validateMermaidDiagrams(markdown: string): Promise; /** * Formats validation errors into a string suitable for returning to the AI agent. */ export declare function formatValidationErrors(result: MermaidValidationResult): string; export interface SaveValidationOptions { content: string; attemptCount: number; } export interface SaveValidationResult { accepted: boolean; errorMessage?: string; } /** * Validates document content for mermaid diagram errors before saving. * After MAX_VALIDATION_ATTEMPTS failed attempts, accepts the document anyway. */ export declare function validateDocumentForSave(options: SaveValidationOptions): Promise; /** * Resets the mermaid loader state. Used for testing. */ export declare function _resetMermaidLoader(): void; //# sourceMappingURL=mermaid.d.ts.map