import type { WriteOptions } from '../../types/safety.js';
/**
 * Write JSON data atomically with backup rotation.
 *
 * 1. Rotate existing backups (if target exists).
 * 2. Write to a `.tmp` sibling file.
 * 3. Optionally verify the `.tmp` contents parse correctly.
 * 4. Atomically rename `.tmp` to the target path.
 *
 * On failure during steps 2-4, the `.tmp` file is cleaned up silently.
 */
export declare function writeJsonSafe(filePath: string, data: unknown, opts?: WriteOptions): Promise<void>;
/**
 * Attempt to recover a file from its most recent backup.
 *
 * Checks `.bak.1`, `.bak.2`, `.bak.3` in order and copies the first
 * one found back to the target path.
 *
 * @returns `true` if recovery succeeded, `false` if no backup exists.
 */
export declare function recoverFromBackup(filePath: string, backupCount?: number): Promise<boolean>;
//# sourceMappingURL=atomic-writer.d.ts.map