/** * JsonFileStore, generic JSON file persistence with atomic writes. * * Handles lazy loading, atomic writes via a temporary file, and ensures the * directory hierarchy exists. Invalid JSON and write failures are thrown so * callers do not mistake corrupted state for an empty store or persisted write. */ export declare class JsonFileStore { private readonly filePath; constructor(filePath: string); /** Load JSON data from disk, or return null if the file does not exist. */ load(): Promise; /** * Atomically and durably persist data to disk. * * `rename(2)` alone only makes the swap atomic for concurrent readers; it * does not make it survive a power loss. Both fsyncs are what turn the * temp+rename into a crash-safe write: the first flushes the temp file's * bytes before it is ever named, the second flushes the directory entry so * the rename itself is durable. Without them a hard crash can leave the * renamed file with unwritten (zero-filled or truncated) contents, which the * next `load()` sees as unparseable JSON. */ save(data: T): Promise; } //# sourceMappingURL=json-file-store.d.ts.map