/**
 * Auto-301 planning for slug/path changes.
 *
 * When a *published* document's resolved URL changes, the old URL was already
 * crawled/linked/indexed and must not 404. This module computes — as a pure,
 * fully testable function — the redirect mutations needed to keep the old URL
 * alive without building chains or loops:
 *
 *   1. Drop any rule whose source is the new (now-live) path, which would
 *      otherwise redirect the page away from itself.
 *   2. Repoint any rule that pointed at the old path so it points at the new
 *      path directly (chain flattening — never old→mid→new).
 *   3. Add old→new, but only if the simulated post-mutation rule set stays
 *      loop-free (e.g. a pre-existing new→old rule we are not removing).
 *
 * The caller (actions.ts) applies the returned plan in a single transaction.
 */
import { type RedirectRecord } from './graph.js';
export interface SlugRedirectPlan {
    /** Redirect to create or upsert (source already normalized), or null to skip. */
    upsert: {
        source: string;
        destination: string;
    } | null;
    /** Existing redirect ids to delete (their source is the now-live new path). */
    deleteIds: string[];
    /** Existing redirects to repoint at the new path (chain flattening). */
    repoint: Array<{
        id: string;
        destination: string;
    }>;
}
/** True when the plan would make no database changes. */
export declare function isEmptyPlan(plan: SlugRedirectPlan): boolean;
/**
 * Compute the redirect mutations for a slug/path change. Both paths are
 * site-relative (e.g. `/old-about`); normalization (leading slash, no trailing
 * slash, lowercase) is applied internally and matches request-time matching.
 */
export declare function planSlugChangeRedirects(params: {
    oldPath: string;
    newPath: string;
    existing: RedirectRecord[];
}): SlugRedirectPlan;
//# sourceMappingURL=auto.d.ts.map