/** * Frontmatter handling utilities with validation. * Based on patterns from mcp-obsidian for safe YAML frontmatter parsing. */ /** * Parsed note with frontmatter and content separated. */ export interface ParsedNote { frontmatter: Record; content: string; originalContent: string; } /** * Result of frontmatter validation. */ export interface FrontmatterValidationResult { isValid: boolean; errors: string[]; warnings: string[]; } /** * Frontmatter handler with validation and safe parsing. * Prevents functions, symbols, and other dangerous objects in frontmatter. */ export declare class FrontmatterHandler { /** * Parse frontmatter from content. * Returns parsed frontmatter and content separated. * * @param content - Content with optional YAML frontmatter * @returns Parsed note with frontmatter and content */ parse(content: string): ParsedNote; /** * Stringify frontmatter and content back to markdown. * * @param frontmatterData - Frontmatter object * @param content - Content body * @returns Complete markdown with frontmatter */ stringify(frontmatterData: Record, content: string): string; /** * Validate frontmatter for security and correctness. * Prevents functions, symbols, and other dangerous objects. * * @param frontmatterData - Frontmatter object to validate * @returns Validation result with errors and warnings */ validate(frontmatterData: Record): FrontmatterValidationResult; /** * Recursively check for problematic values in frontmatter. * * @param obj - Object to check * @param result - Validation result to update * @param path - Current path in the object (for error messages) */ private checkForProblematicValues; /** * Extract only frontmatter from content without parsing body. * * @param content - Content with optional YAML frontmatter * @returns Frontmatter object */ extractFrontmatter(content: string): Record; /** * Update frontmatter in content, preserving body. * * @param content - Original content * @param updates - Frontmatter updates to merge * @returns Updated content with new frontmatter */ updateFrontmatter(content: string, updates: Record): string; } //# sourceMappingURL=frontmatter.d.ts.map