import type { AtomicWriteOptions } from '../../types/safety.js';
/**
 * Error thrown when a write to a frozen spec.md is rejected.
 * SPEC-747: freeze-on-done enforcement.
 */
export declare class SpecFrozenError extends Error {
    readonly specId: string;
    readonly fixHint: string;
    readonly code: "SPEC_FROZEN";
    constructor(specId: string, fixHint: string);
}
/**
 * Atomically write `content` to `targetPath`.
 *
 * Sequence:
 *   1. SPEC-747 freeze check (if target is a frozen spec.md)
 *   2. mkdir -p dirname(targetPath)
 *   3. write content to `${targetPath}.tmp.<pid>.<nonce>` (exclusive create)
 *   4. fsync the tmp file descriptor
 *   5. rename tmp -> targetPath (POSIX-atomic on same fs)
 *   6. (optional) fsync parent directory fd
 *
 * On any error, the tmp file is unlinked best-effort and the original
 * `targetPath` is unchanged. Never returns with both target and tmp present.
 *
 * EXDEV: Cross-device rename is rejected with an explicit error. Callers must
 * keep tmp on the same filesystem as target.
 */
export declare function atomicWriteFile(targetPath: string, content: string | Buffer, opts?: AtomicWriteOptions): Promise<void>;
/**
 * Remove orphaned `.tmp.<pid>.<nonce>` files left by interrupted writes.
 * Called by `init_project`'s cleanup pass on startup.
 *
 * @param dir - Directory to scan recursively for orphan tmp files.
 */
export declare function cleanupOrphanTmps(dir: string): Promise<number>;
//# sourceMappingURL=atomic-write-file.d.ts.map