/** Tag in a parked entry's name: `..skillsmith-removing-<32 hex>`. */ export declare const PARK_TAG = ".skillsmith-removing-"; /** An entry's device and inode, to tell it apart from anything later put at its path. */ export interface EntryIdentity { dev: number; ino: number; } /** * Result of {@link removeIfSame}. `reason` reads after the path, e.g. * `${target} ${reason}`. */ export type CheckedRemoval = { removed: true; } | { removed: false; reason: string; }; /** What a parked-leftover scan found, and whether it could look at all. */ export interface ParkedScan { /** Entries a crashed or failed removal left parked beside the target. */ parked: string[]; /** Set when the folder holding them could not be listed. */ unreadable?: string; } /** Matches exactly the names {@link removeIfSame} parks `target` under. */ export declare function parkedPattern(target: string): RegExp; /** * Entries a crashed or failed removal left parked next to `target`, so a * caller can report them. Round 16 (both reviewers): away from a fan-out * destination nothing swept these, so a failed removal's leftover was named * once, in one error, and never again. */ export declare function listParkedLeftovers(target: string): Promise; /** * User-facing warning for what {@link listParkedLeftovers} found. Round 18 * (cross-model review): who owns a parked entry is not known. It is whatever * was at the path when a removal moved it aside, which in a race can belong * to another program, so the wording says that instead of calling it ours. */ export declare function parkedLeftoverWarning(parked: string): string; /** * Remove `target` (a folder recursively, anything else with `unlink`) only if * it is still the entry `expected` describes. An entry that is already gone * counts as removed. Anything else is left alone, and whatever this call * moved aside is reported with its exact path. * * Round 17 (cross-model review): nothing is ever renamed back. `rename` * replaces what is at the destination — measured on macOS and Linux, a * directory replaces an empty directory and a file or symlink replaces a file * or symlink — so putting an entry back could destroy something created at * that path in the meantime, and a check first only narrows that window * rather than closing it. The two failure modes are not equal: a put-back can * destroy an entry, while leaving one parked merely moves it, recoverably, * and says where it went. The identity is also checked once BEFORE the entry * is parked, so the ordinary mismatch moves nothing at all. */ export declare function removeIfSame(target: string, expected: EntryIdentity): Promise; //# sourceMappingURL=remove-if-same.d.ts.map