export type SafeDeleteResult = { success: boolean; message?: string; }; export declare function safeDeleteFile(targetPath: string, dryRun?: boolean): SafeDeleteResult; export declare function safeDeleteDirectory(targetPath: string, dryRun?: boolean): SafeDeleteResult; /** * Delete a directory only if it is a strict descendant of `root`. * * `safeDeleteDirectory` is anchored to the project root, which is the wrong * boundary for a run directory that can live anywhere. This one takes the * boundary as an argument: both paths are resolved through symlinks, `target` * must lie strictly inside `root` (never the root itself, never a sibling, * never `..`, never a symlink that escapes), and only then is it removed. */ /** True when `target` is inside `root` and is not `root` itself. Both must be * resolved paths. A first segment of exactly `..` is the escape; a name that * merely begins with two dots (`..cache`) is an ordinary child. */ export declare function isStrictDescendant(root: string, target: string): boolean; export declare function safeDeleteDirectoryWithin(root: string, target: string): SafeDeleteResult; export declare function escape(str: string): string; export declare function deepCopy(obj: T): T; export declare function zip(arr1: T[], arr2: U[]): Array<[T, U]>; export declare function uniq(arr: T[]): T[]; /** * Like `uniq`, but de-duplicates by a derived key. The first occurrence * of each key is kept; later duplicates are dropped. Useful for de-duping * structured values where identity-based Set comparison wouldn't work * (e.g. compare-by-JSON.stringify). */ export declare function uniqBy(arr: T[], keyFn: (item: T) => K): T[]; export declare function round(num: number, decimals?: number): number;