/** * Atomic, durable file writes for oh-my-claudecode. * Self-contained module with no external dependencies. */ /** * Create directory recursively (inline implementation). * Ensures parent directories exist before creating the target directory. * * @param dir Directory path to create */ export declare function ensureDirSync(dir: string): void; /** * Write JSON data atomically to a file. * Uses temp file + atomic rename pattern to ensure durability. * * @param filePath Target file path * @param data Data to serialize as JSON * @throws Error if JSON serialization fails or write operation fails */ export declare function atomicWriteJson(filePath: string, data: unknown): Promise; /** * Write text content atomically to a file (synchronous version). * Uses temp file + atomic rename pattern to ensure durability. * * @param filePath Target file path * @param content Text content to write * @throws Error if write operation fails */ export declare function atomicWriteSync(filePath: string, content: string): void; /** * Read and parse JSON file with error handling. * Returns null if file doesn't exist or on parse errors. * * @param filePath Path to JSON file * @returns Parsed JSON data or null on error */ /** * Write string data atomically to a file (synchronous version). * Uses temp file + atomic rename pattern with fsync for durability. * * @param filePath Target file path * @param content String content to write * @throws Error if write operation fails */ export declare function atomicWriteFileSync(filePath: string, content: string): void; /** * Write JSON data atomically to a file (synchronous version). * Uses temp file + atomic rename pattern with fsync for durability. * * @param filePath Target file path * @param data Data to serialize as JSON * @throws Error if JSON serialization fails or write operation fails */ export declare function atomicWriteJsonSync(filePath: string, data: unknown): void; export declare function safeReadJson(filePath: string): Promise; //# sourceMappingURL=atomic-write.d.ts.map