/** * Cache policy helpers — parse human-friendly byte budgets into raw numbers. * * Accepted shapes (case-insensitive on suffix): * number — interpreted as raw bytes * '1024' — string of digits, raw bytes * '50KB' — kilobytes (×1024) * '50MB' — megabytes (×1024²) * '1GB' — gigabytes (×1024³) * * Decimals are accepted (`'1.5GB'` → 1610612736 bytes). * * Anything else throws — better to fail loud at construction time than * to silently treat a typo as 0 bytes (which would evict everything). */ /** Parse a byte budget into a positive integer number of bytes. */ export declare function parseBytes(input: number | string): number; /** * Estimate the in-memory byte size of a decrypted record. * * Uses `JSON.stringify().length` as a stand-in for actual heap usage. * It's a deliberate approximation: real V8 heap size includes pointer * overhead, hidden classes, and string interning that we can't measure * from JavaScript. The JSON length is a stable, monotonic proxy that * costs O(record size) per insert — fine when records are typically * < 1 KB and the cache eviction is the slow path anyway. * * Returns `0` (and the caller must treat it as 1 for accounting) if * stringification throws on circular references; this is documented * but in practice records always come from JSON-decoded envelopes. */ export declare function estimateRecordBytes(record: unknown): number;