UNPKG

@httpc/kit

Version:

httpc toolbox for building function-based API with minimal code and end-to-end type safety

17 lines (16 loc) 552 B
import { ICache } from "../types"; import LRU from "lru-cache"; export type LruCacheOptions = { size?: number; ttl?: number; }; export declare class LruCache implements ICache { constructor(options: LruCacheOptions); readonly provider: InstanceType<typeof LRU<string, any>>; keys(): Generator<string, any, unknown>; has(key: string): boolean; get<T extends any = any>(key: string): T | undefined; set<T extends any = any>(key: string, value: T): void; delete(key: string): void; clear(): void; }