/** * Gzip utilities — addresses issue #126. * * `gzipString` / `gunzipBuffer` are thin UTF-8 wrappers around node:zlib. * `saveGzippedFile` writes `.gz` atomically (tmp + rename) so a * crash mid-write can't produce a corrupt gzip. `loadFile` transparently * reads `.gz` if present and falls back to the plaintext path — * that gives us backward compatibility with sessions.json files written * before this change. */ export interface GzipStats { originalBytes: number; compressedBytes: number; ratio: number; percentSaved: number; } export declare function gzipString(text: string, level?: number): Buffer; export declare function gunzipBuffer(buffer: Buffer): string; export declare function computeStats(text: string, compressed: Buffer): GzipStats; /** * Write gzipped text to `${path}.gz` using atomic tmp + rename so a * crash mid-write never produces a half-written file. Also removes any * stale uncompressed plaintext at `path` once the gzip lands (backward * compat cleanup). */ export declare function saveGzippedFile(path: string, text: string, level?: number): GzipStats; /** * Load either `${path}.gz` or `${path}` — whichever exists. Returns * null if neither is present. If the `.gz` sibling exists but can't * be decompressed (corrupt, partially-written), falls back to the * plaintext path so the backward-compat migration still works. */ export declare function loadMaybeGzippedFile(path: string): string | null; //# sourceMappingURL=gzip.d.ts.map