/** * Run `operation` exclusively for the given store key. Subsequent calls with * the same key wait until the in-flight operation settles (regardless of * success or failure). */ export declare function withLock(key: string, operation: () => Promise): Promise; /** * Write `data` to `path` atomically: * 1. Ensure the parent directory exists * 2. Write to a temp file with a random suffix * 3. Rename onto the final path (single syscall, atomic on POSIX) * * Renames are inherently atomic at the FS level, so a partial write or a * crash between writeFile and rename never leaves the destination in a * corrupt state — it's either the old contents or the fully-new contents. */ export declare function writeAtomically(path: string, data: string | Buffer): Promise;