import type { CacheHandler, CacheHandlerContext, CacheHandlerGetMeta, CacheHandlerGetResult, CacheHandlerOptions, CacheValue } from "../types.js"; export interface MemoryCacheHandlerOptions extends CacheHandlerOptions { /** * Maximum number of items to store (LRU eviction when exceeded) * @default 1000 */ maxItemsNumber?: number; /** * Maximum size in bytes for a single item * @default 104857600 (100MB) */ maxItemSizeBytes?: number; /** * Default TTL in seconds for entries without explicit revalidate * @default undefined (no expiration) */ defaultTTL?: number; } /** * In-memory LRU cache handler for Next.js 16+ * Suitable for development and single-instance deployments * * Features: * - LRU eviction based on item count and size * - Implicit tag tracking for ISR * - Proper expiration handling * - Tag-based revalidation * * @example * ```typescript * const handler = createMemoryCacheHandler({ * maxItemsNumber: 1000, * maxItemSizeBytes: 100 * 1024 * 1024, // 100MB * defaultTTL: 3600 // 1 hour * }); * ``` */ export declare class MemoryCacheHandler implements CacheHandler { readonly name = "local-lru"; private cache; private revalidatedTags; private readonly maxItemsNumber; private readonly maxItemSizeBytes; private readonly defaultTTL?; constructor(options?: MemoryCacheHandlerOptions); get(key: string, meta?: CacheHandlerGetMeta): Promise; set(key: string, value: CacheValue, context?: CacheHandlerContext): Promise; revalidateTag(tag: string, _profile?: string | { expire?: number; }): Promise; delete(key: string): Promise; /** * Clear all cache entries (useful for testing) */ clear(): Promise; /** * Get cache statistics */ getStats(): { size: number; maxSize: number; revalidatedTags: number; }; } /** * Create a memory cache handler instance * * @example * ```typescript * const handler = createMemoryCacheHandler({ * maxItemsNumber: 500, * defaultTTL: 3600 * }); * ``` */ export declare function createMemoryCacheHandler(options?: MemoryCacheHandlerOptions): MemoryCacheHandler; //# sourceMappingURL=memory.d.ts.map