import type { CacheBackend } from "../types.js"; /** * Persistent local cache using the bounded VFCACHE4 binary frame. * * Keys name files by SHA-256 and are also stored inside the frame so a digest * mismatch remains a cache miss. Strings are stored as UTF-16 code units to * preserve every ECMAScript string, including lone surrogates; the frame also * records the logical UTF-8 byte length used by `getWithinLimit()`. * * Cache files written by the former JSON format are intentionally ignored as * cold misses. Cache data is disposable, so no in-place migration is required. */ export declare class DiskCacheBackend implements CacheBackend { readonly type: "disk"; private readonly dir; private readonly globCache; private readonly maxValueBytes; private readonly maxFileBytes; private mutationTail; private writesUntilExpiryPrune; private expiryPruneOffset; constructor(baseDir?: string, keyPrefix?: string, maxValueBytes?: number); private filePath; private ensureDir; private withMutation; private readFramedFile; private readEnvelopeWithinValueLimit; /** * Remove a cache file, but only while it still holds the expired entry. * * Dev servers and build steps share a project cache, so another process can * replace the pathname between the expiry check and the deletion. Deleting by * pathname would then remove that fresh entry. The file is claimed with an * atomic rename and revalidated on the claimed inode instead, and a claim * that turns out to hold a fresh entry is linked back under its original * name. Both the write-time sweep and the read-time cleanup go through this, * so neither can delete a write that won the race. */ private removeExpiredEntryFile; /** * Drop an entry a read found expired. * * Queued on the mutation tail so it cannot interleave with this instance's * own writes, and so a caller can flush it by awaiting any later operation. */ private expireEntry; private pruneExpiredEntries; private maybePruneExpiredEntries; get(key: string): Promise; getWithinLimit(key: string, maximumBytes: number): Promise; getRemainingTtlSeconds(key: string): Promise; set(key: string, value: string, ttlSeconds?: number): Promise; del(key: string): Promise; delByPattern(pattern: string): Promise; } //# sourceMappingURL=disk.d.ts.map