/** * Low-level atomic-write primitives shared by account storage, flagged * storage, and pre-import backups. * * Split out of `lib/storage.ts` in RC-2. These helpers intentionally contain * no business logic — every caller handles dedup/normalization above this * layer. The retry + timeout knobs here exist to tolerate Windows file-lock * contention from antivirus scanners and to keep a misbehaving disk from * hanging the plugin indefinitely. */ export declare const WINDOWS_RENAME_RETRY_ATTEMPTS = 5; export declare const WINDOWS_RENAME_RETRY_BASE_DELAY_MS = 10; export declare const PRE_IMPORT_BACKUP_WRITE_TIMEOUT_MS = 3000; export declare function isWindowsLockError(error: unknown): error is NodeJS.ErrnoException; /** * `fs.rename` with capped exponential retry on Windows EPERM/EBUSY. * * Windows reports transient lock contention (antivirus scanning the temp * file, indexer holding a handle open, etc.) as EPERM/EBUSY and surfaces it * to `rename`. A few short retries turn that into a successful atomic swap * without the caller needing to know anything about the platform. */ export declare function renameWithWindowsRetry(sourcePath: string, destinationPath: string): Promise; /** * `fs.writeFile` with a hard wall-clock timeout. * * Used by the pre-import backup writer so a stuck disk or hanging FS driver * cannot block the import transaction forever; every other write path uses * the normal, untimed `fs.writeFile`. */ export declare function writeFileWithTimeout(filePath: string, content: string, timeoutMs: number): Promise; //# sourceMappingURL=atomic-write.d.ts.map