/**
 * Lightweight keyed cache that survives React component remounts.
 *
 * Designed to sit above remount boundaries (via {@link FetchCacheProvider})
 * so hooks backed by `useFetch` can seed their initial state from a
 * previous mount's result instead of showing a loading skeleton.
 *
 * This is **not** a query library. It intentionally omits deduplication,
 * automatic background refetch, retry, devtools, and suspense integration.
 * `useFetch` already provides stale-while-revalidate semantics — this
 * class only gives it memory across mounts.
 *
 * @internal Consumed by `useFetch` via context; not part of the public
 * `@stigmer/react` API surface. The `FetchCacheProvider` component is
 * the public entry point.
 */
/** Configuration for `FetchCache`. */
export interface FetchCacheOptions {
    /**
     * Maximum number of entries before the oldest are evicted.
     * @default 100
     */
    readonly maxEntries?: number;
    /**
     * Time-to-live in milliseconds. Entries older than this are
     * treated as missing on read and lazily purged.
     * @default 300_000 (5 minutes)
     */
    readonly ttl?: number;
}
export declare class FetchCache {
    private readonly _entries;
    private readonly _maxEntries;
    private readonly _ttl;
    constructor(options?: FetchCacheOptions);
    /**
     * Retrieve a cached value. Returns `undefined` when the key is
     * missing or the entry has expired.
     */
    get<T>(key: string): T | undefined;
    /** `true` when a non-expired entry exists for `key`. */
    has(key: string): boolean;
    /** Write (or overwrite) a cache entry and evict if over capacity. */
    set(key: string, data: unknown): void;
    /** Remove a single entry. */
    invalidate(key: string): void;
    /**
     * Remove all entries whose key starts with `prefix`.
     *
     * Useful for bulk invalidation scoped to a resource type
     * (e.g. `invalidatePrefix("session:")` on logout).
     */
    invalidatePrefix(prefix: string): void;
    /**
     * Fire-and-forget fetch that writes the result to the cache.
     * Errors are silently swallowed — the worst case is a cache miss.
     */
    prefetch<T>(key: string, fetchFn: () => Promise<T>): void;
    /** Drop all entries. */
    clear(): void;
    /** Number of live (non-expired) entries. Mainly useful in tests. */
    get size(): number;
    private _isExpired;
    /**
     * Evict the oldest entries (by insertion order) when the cache
     * exceeds `maxEntries`. Because `Map` preserves insertion order
     * and `set` always re-inserts at the tail, the iterator yields
     * entries from oldest to newest — giving us LRU eviction.
     */
    private _evict;
}
//# sourceMappingURL=fetch-cache.d.ts.map