/** Preserve truncated JSON as truncated, while templating complete flat records. * Never repairs a missing range, infers a missing value, or discards a visible one. */ import type { CompressionResult, Stamp } from './types.js'; export declare function looksLikeJsonFragments(text: string): boolean; export declare function compressJsonFragments(text: string, stamp?: Stamp): CompressionResult; /** Exact full-array encoding, admitted only when every record was recognized. */ export declare function compressJsonArray(text: string, stamp?: Stamp, minimumRows?: number): CompressionResult; /** * An OBJECT MAP of flat records -- `{"/route-0": {..}, "/route-1": {..}}`. * * The array encoder cannot see this shape: it requires `Array.isArray`, so a * map of forty identical-shaped entries fell through to plain minification at * 20.8% while the same forty records in an ARRAY reach the seventies. Keyed * maps are how route tables, per-host metrics and config-by-name are written, * so the gap is a common shape rather than an exotic one. * * THE KEY IS JUST COLUMN ZERO. Once each entry is split into literal chunks * and varying values with the key first, `compressRecords` does the rest -- * grouping by shape, factoring shared prefixes and suffixes per column, and * emitting one template with a row per entry. Nothing here re-implements that. * * EVERY ENTRY SURVIVES. The competitor's `lossless_only=True` on this shape * returns valid JSON holding 15 of 40 keys with no marker of any kind -- their * own info string reads `object:adaptive(40->15 keys)` -- so a reader cannot * tell anything was removed. This keeps all forty and says how to rebuild them. */ export declare function compressJsonObjectMap(text: string, stamp?: Stamp, minimumEntries?: number): CompressionResult; export declare function tokenCost(text: string): number; /** * How much the cache above is holding. * * Exported for the same reason `tokenCost` itself is: so the gate scores the * real thing rather than a copy. The bound is an invariant, and the first * attempt to test it compared `process.memoryUsage().heapUsed` either side of * the loop, which passed alone and failed inside the full suite -- with no * forced collection that delta measures whatever else the worker was doing. * Occupancy is the quantity the bound is actually about. */ export declare function tokenCostCacheOccupancy(): { entries: number; bytes: number; maxEntries: number; maxBytes: number; }; //# sourceMappingURL=json-fragments.d.ts.map