export interface RawLink { raw: string; display: string | null; } /** * Extract wiki links from markdown, ignoring code blocks and embedded images. */ export declare function extractWikiLinks(markdown: string): RawLink[]; /** * Build a lookup table mapping filename stems to their full paths. */ export declare function buildStemLookup(allPaths: string[]): Map; /** * Rewrite every wiki-link targeting `oldPath` (as either a bare stem or a * path-qualified reference) to point at `newPath`. * * `oldPath` and `newPath` are vault-relative `.md` paths — e.g. * `"notes/BMW.md"` and `"cars/BMW & Audi.md"`. The function handles three * match shapes in priority order: * * 1. Bare-stem reference `[[BMW]]` → `[[BMW & Audi]]` * Preserves the author's shortest-path style. Output uses the new * basename, not the new folder-qualified path. * * 2. Path-qualified reference without `.md` `[[notes/BMW]]` * → `[[cars/BMW & Audi]]` * Emits the full new path (no `.md`) so a cross-folder rename works * end-to-end without leaving the link pointing at a defunct folder. * * 3. Path-qualified reference with `.md` `[[notes/BMW.md]]` * → `[[cars/BMW & Audi]]` * Rare but canonical Obsidian syntax; normalised to without-`.md` form * for consistency with (2). * * Preserves the four decoration forms in all cases: * `[[x|alias]]`, `![[x]]`, `[[x#heading]]`, `[[x^block]]`. */ export declare function rewriteWikiLinks(markdown: string, oldPath: string, newPath: string): { text: string; occurrences: number; }; /** * Resolve a wiki link reference to a vault-relative path. * Returns null for unresolvable links (these become stub nodes). * * `referrerPath` (vault-relative, optional): when provided, prefer a * candidate in the same folder as the referrer over arbitrary alternatives. * Mirrors Obsidian's own resolver, which prefers same-folder-then-mtime. * mtime-tiebreak is a follow-up — it requires DB plumbing into the parser. * * `warnedAmbiguous` (optional): a Set the caller threads through one * `parseVault` invocation. The first time an ambiguous stem fires, we * emit the warning and add it to the set; subsequent occurrences in the * same parse pass stay silent. Drops ~1224 stderr lines on a 10k vault to * one line per distinct ambiguous target. */ export declare function resolveLink(raw: string, stemLookup: Map, allPathsSet?: Set, referrerPath?: string, warnedAmbiguous?: Set): string | null;