import { type HygieneCommonOptions } from "../shared.js"; import { type SiteResidueKind } from "../audit/site-residue.js"; import { type ReferenceKind } from "../reference-kind.js"; export interface CleanupSiteResidueOptions extends HygieneCommonOptions { root?: string[]; contentRoot?: string; index?: string; concurrency?: number; whatIf?: boolean; allowWrite?: boolean; /** * Delete orphans even when the pre-flight finds inbound refs from * active content. Default false — refs cause the orphan to be * skipped with `inboundRefs` populated in the report. */ force?: boolean; /** * Skip the inbound-ref pre-flight entirely. Faster but loses the * safety net — pair with a separate `audit broken-links` run if you * use this. */ skipRefCheck?: boolean; baseline?: boolean; output?: string; format?: "json" | "csv" | "markdown"; } export interface InboundRef { fromItemId: string; fromPath: string; fieldName: string; /** * Structured reference category derived from `fieldName`. "base-template" * means an active template inherits from an item in the doomed tree — * catastrophic. "field-value" means a generic field reference — usually * recoverable. See [./reference-kind](./reference-kind.ts) for the full * mapping. */ referenceKind: ReferenceKind; /** itemId inside the doomed tree that the active-content ref pointed at. */ refItemId: string; } export interface SiteResidueCleanupAction { kind: SiteResidueKind; root: string; tenant: string; site: string | null; itemId: string; path: string; descendantCount: number; status: "deleted" | "what-if" | "skipped" | "failed"; /** Populated when the pre-flight ran. Empty array = no inbound refs found. */ inboundRefs?: InboundRef[]; error?: string; } export declare const runCleanupSiteResidue: (options: CleanupSiteResidueOptions) => Promise;