import { type OpenDirectory } from "./directory-sync.js";
/** Injectable collaborators and per-call policy for {@link writeFileAtomically}. */
export interface AtomicWriteOptions {
    /**
     * Explicit POSIX permission bits for the published file. Omit to keep the
     * platform default (`0o666` minus umask) — the learnings ledger is a
     * committed, human-read file, and forcing `0o600` would silently tighten its
     * permissions on the next write.
     */
    readonly mode?: number;
    /**
     * Caller safety re-check run after the content is durably written but before
     * the rename publishes it. Used by every call site to re-assert that the
     * target's parents have not been swapped for a symlink mid-write; throwing
     * here aborts the publish and still removes the temp file.
     */
    readonly beforeRename?: () => Promise<void>;
    /** Test-only directory opener forwarded to {@link syncContainingDirectory}. */
    readonly openDirectory?: OpenDirectory;
    /** Test-only observer proving the file handle is fsynced before rename. */
    readonly onFileSync?: () => Promise<void>;
}
/**
 * Atomically and durably replace one file's contents.
 * @param target - Absolute path to publish
 * @param content - Full UTF-8 payload to write
 * @param options - Permission policy and injectable collaborators
 */
export declare function writeFileAtomically(target: string, content: string, options?: AtomicWriteOptions): Promise<void>;
//# sourceMappingURL=atomic-file-write.d.ts.map