export type PathMapper = (oldRel: string) => string | null; /** Matches the entry `rel` and, for a folder, every path below it. */ export declare function entryMatcher(rel: string, isFolder: boolean): (candidate: string) => boolean; /** Maps the entry `from` → `to` and, for a folder, every path below it. */ export declare function entryMapper(from: string, to: string, isFolder: boolean): PathMapper; /** * Rewrites the inline links and reference definitions of a Markdown file * (fenced code excluded) whose target, or the file itself, changes path. */ export declare function rewriteMovedLinks(content: string, fileOldRel: string, mapPath: PathMapper): string; /** * Unlinks the inline links of a Markdown file (fenced code and images * excluded) whose target is deleted, keeping their text, and drops the * reference definitions that point at a deleted target. */ export declare function unlinkDeletedLinks(content: string, fileRel: string, isDeleted: (rel: string) => boolean): string; export interface LinkRewrite { /** POSIX path of the file before the paths change. */ oldRel: string; next: string; } /** Plans the link rewrites of every `.md` file, read before anything moves on disk. */ export declare function planLinkRewrites(docsPath: string, mapPath: PathMapper): LinkRewrite[]; /** Unlinks, in every remaining `.md` file, the links whose target is deleted. */ export declare function unlinkDeletedTargets(docsPath: string, isDeleted: (rel: string) => boolean): void; /** Writes planned rewrites once the paths changed on disk. */ export declare function applyLinkRewrites(docsPath: string, rewrites: LinkRewrite[], mapPath: PathMapper): void; /** * Source bindings are paths relative to `sourceRoot`; those that point at a * document of the docs folder follow its new path. */ export declare function migrateSourcePaths(docsPath: string, mapPath: PathMapper): void; //# sourceMappingURL=linkRewrite.d.ts.map