/**
 * Wiki Backlinks Service
 *
 * Given a target page in a vault, scan every other page for `[[wikilink]]`
 * references that resolve to it. Powers the UI's right-side "References"
 * panel.
 *
 * Phase 1: plain scan, no incremental index. Vaults are small enough that
 * a single regex pass per file is fine.
 *
 * @module services/wiki/wiki-backlinks.service
 */
/** Hard cap on scanned files to avoid pathological vaults. */
export declare const WIKI_BACKLINKS_MAX_FILES = 500;
/** Cap on per-file size to read; larger files are skipped. */
export declare const WIKI_BACKLINKS_MAX_FILE_BYTES: number;
/** Max snippets surfaced per source page. */
export declare const WIKI_BACKLINKS_MAX_SNIPPETS_PER_FILE = 2;
/** Total backlink rows returned. */
export declare const WIKI_BACKLINKS_MAX_RESULTS = 50;
export interface WikiBacklinkSnippet {
    lineNumber: number;
    text: string;
}
export interface WikiBacklink {
    /** Source page that links to the target. */
    relativePath: string;
    /** Up to N snippets where the link appears. */
    snippets: WikiBacklinkSnippet[];
}
export interface WikiBacklinksInput {
    vaultPath: string;
    /** The page being backlinked TO. */
    relativePath: string;
}
export interface WikiBacklinksResult {
    ok: true;
    vaultPath: string;
    relativePath: string;
    backlinks: WikiBacklink[];
    truncated: boolean;
}
export interface WikiBacklinksFailure {
    ok: false;
    reason: 'vault_missing' | 'invalid_input';
    message: string;
}
/**
 * Resolve a wikilink target string against a known target page.
 *
 * The matcher mirrors the frontend's `resolveWikilink` semantics so a
 * `[[customers/anthropic]]` reference matches the page at
 * `llm-curated/customers/anthropic.md`.
 *
 * @param wikilinkTarget - Raw target from `[[…]]` (no alias, trimmed).
 * @param normalizedTargetPath - The target page path, normalized (lowercase,
 *   forward slashes, with `.md` suffix).
 * @returns true when the wikilink would resolve to the target page.
 */
export declare function wikilinkMatchesTarget(wikilinkTarget: string, normalizedTargetPath: string): boolean;
/**
 * Backlinks service. Singleton pattern to match the other wiki services.
 */
export declare class WikiBacklinksService {
    private static instance;
    static getInstance(): WikiBacklinksService;
    static resetInstance(): void;
    find(input: WikiBacklinksInput): Promise<WikiBacklinksResult | WikiBacklinksFailure>;
    private collectMdFiles;
    private scanFile;
}
//# sourceMappingURL=wiki-backlinks.service.d.ts.map