export interface NavPayloadCacheDeps { /** Fetch a page, resolving to its HTML or null when it shouldn't be reused. */ fetchPage: (target: string) => Promise; /** Injected so tests drive expiry without sleeping. */ now: () => number; /** Long enough to cover hover-to-click, short enough that nobody reads a * page rendered from data this old. */ ttlMs?: number; /** Cap on retained payloads; the oldest is evicted first. Pages are whole * HTML documents, so this bounds memory on a link-dense page. */ max?: number; } export interface NavPayloadCache { /** Warm `target`, unless a fresh entry is already present or in flight. */ prefetch(target: string): void; /** Hand over `target`'s payload, or null. Single-use: a prefetch * accelerates the NEXT click, and holding it past that would serve * navigations from an increasingly stale render. */ take(target: string): Promise | null; /** Drop everything — called when a navigation commits, since entries were * rendered against the page the user just left. */ clear(): void; /** Retained entry count (tests + diagnostics). */ size(): number; } export declare function createNavPayloadCache(deps: NavPayloadCacheDeps): NavPayloadCache;