/**
 * Markdown service for Studiograph
 *
 * Handles parsing and writing markdown files with YAML frontmatter,
 * extracting wikilinks, and validating relationships.
 */
export interface MarkdownDocument {
    frontmatter: Record<string, any>;
    content: string;
    wikilinks: string[];
}
export interface WikilinkValidation {
    valid: string[];
    broken: string[];
}
/**
 * Normalize a wikilink display name to a kebab-case entity ID for comparison.
 *
 * Wikilinks in Obsidian-style vaults use human-readable display names
 * (e.g. [[Richard Attias & Associates]]) while Studiograph entity IDs are
 * kebab-case slugs (richard-attias-and-associates).  This function converts
 * the display form so that backlink lookups can match both styles.
 */
export declare function slugifyWikilink(link: string): string;
export declare class MarkdownService {
    /**
     * Parse markdown file from path
     */
    parseFile(filePath: string): MarkdownDocument;
    /**
     * Parse markdown content string
     */
    parseContent(content: string): MarkdownDocument;
    /**
     * Extract wikilinks from markdown content and frontmatter
     */
    extractWikilinks(content: string, frontmatter: Record<string, any>): string[];
    /**
     * Recursively extract wikilinks from object (frontmatter)
     */
    private extractWikilinksFromObject;
    /**
     * Write markdown file with frontmatter.
     *
     * Atomic on POSIX: write to a tmp sibling, fsync, rename. ENOSPC or EIO
     * mid-write leaves the tmp file truncated and the target untouched — the
     * caller observes either the new content or the old, never a partial-write
     * with broken YAML. The Phase-2 disk-first ordering relies on this: if
     * step 2 (writeFile) fails, the disk MUST be unchanged so the Y.Doc isn't
     * applied to a corrupt baseline.
     *
     * Parent-dir fsync is best-effort — many filesystems reject fsync on a
     * directory handle. The rename is still durable enough on every platform
     * we ship to; the parent fsync just bounds the power-loss window.
     */
    writeFile(filePath: string, doc: MarkdownDocument): void;
    /**
     * Write markdown content from separate frontmatter and content
     */
    write(filePath: string, frontmatter: Record<string, any>, content: string): void;
    /**
     * Validate wikilinks against a repo or set of repos
     */
    validateWikilinks(wikilinks: string[], searchPaths: string[]): WikilinkValidation;
    /**
     * Find entity file by entity ID across multiple search paths
     */
    findEntity(entityId: string, searchPaths: string[]): string | null;
    /**
     * Find all entities of a given type in a directory
     */
    findEntitiesByType(searchPath: string, entityType: string): string[];
    /**
     * Find all markdown files in a directory (recursive)
     */
    findAllEntities(searchPath: string): string[];
    /**
     * Search entities by content or frontmatter
     */
    search(searchPaths: string[], query: string, options?: {
        entityType?: string;
        caseSensitive?: boolean;
        searchContent?: boolean;
        searchFrontmatter?: boolean;
        limit?: number;
    }): MarkdownDocument[];
    /**
     * Get entity relationships (entities that link to this entity)
     */
    findBacklinks(entityId: string, searchPaths: string[]): Array<{
        file: string;
        doc: MarkdownDocument;
    }>;
    /**
     * Update wikilinks in a file (useful for refactoring entity IDs)
     */
    updateWikilinks(filePath: string, oldEntityId: string, newEntityId: string): void;
    /**
     * Recursively update wikilinks in an object (frontmatter)
     */
    private updateWikilinksInObject;
}
