import type { ScriptNode } from "../ast/types.js"; interface ASTCacheOptions { maxEntries?: number; } interface ASTCacheStats { size: number; hits: number; misses: number; } /** * LRU cache for parsed Bash ASTs keyed by script source text. * * Uses a 64-bit FNV-1a hash for fast, non-cryptographic cache key generation. * The 64-bit width is computed as two independent 32-bit FNV-1a streams (each * seeded with a different offset basis) combined into a 16-hex-char digest, * making collisions astronomically unlikely compared to a single 32-bit hash * (a 32-bit hash returns the WRONG parsed program on collision — a correctness * bug). All inputs are hashed uniformly; the key includes the input length as * a prefix for additional disambiguation. Hashing is fully synchronous and * dependency-free because `getKey()` runs on the parse hot path and must never * await. * * Eviction follows true LRU order: accessed entries are promoted to the * tail of the internal Map, and the least-recently-used entry (head) is * evicted when the cache exceeds `maxEntries` (default 1000). * * Can be reconfigured at runtime via `configure()`. */ export declare class ASTCache { private cache; private maxEntries; private hits; private misses; configure(opts: ASTCacheOptions): void; private getKey; get(input: string): ScriptNode | null; set(input: string, ast: ScriptNode): void; clear(): void; stats(): ASTCacheStats; } export {};