UNPKG

@aplus-frontend/ui

Version:

17 lines (16 loc) 698 B
import { CacheInterface, PropertyKeyType, cacheDataArrType } from '../interface'; export declare class LruCacher implements CacheInterface { store: Map<PropertyKeyType, Map<PropertyKeyType, any>>; maxSize: number; isExpired: boolean; expiredTimer: ReturnType<typeof setTimeout> | null; constructor(max?: number); changeMaxSize(maxSize: number): void; expireCheck(): void; has(ModelKey: PropertyKeyType): boolean; get(ModelKey: PropertyKeyType): Map<PropertyKey, any> | null | undefined; set(ModelKey: PropertyKeyType, value: Map<string, any> | cacheDataArrType): void; del(ModelKey: PropertyKeyType): void; clear(): void; } export default LruCacher;