/** * Async check for file existence. Replaces blocking existsSync(). */ export declare function fileExists(filePath: string): Promise; export interface AtomicWriteOptions { /** File mode for the destination file. Default 0o644. */ mode?: number; /** * Called when tmp-file cleanup fails after a write/rename error. * Receives the cleanup error so the caller can log it. Default: ignore. */ onCleanupError?: (err: unknown) => void; } /** * Atomically write a file via mkdtemp-style tmp + rename. Crash-safe: * the destination either contains the previous bytes or the new bytes, * never a partial write. */ export declare function atomicWrite(filePath: string, contents: string | Uint8Array, options?: AtomicWriteOptions): void; /** * `atomicWrite` for callers already on the async fs API. * * Exists so async writers do not hand-roll their own tmp+rename: before it, * three writers of the per-checkout state file each invented a different * temp-name shape, and both the `.gitignore` rule and the destroy-time * cleanup sweep were written against only one of them. */ export declare function atomicWriteAsync(filePath: string, contents: string | Uint8Array, options?: AtomicWriteOptions): Promise;