UNPKG

globalping-ts

Version:

Typescript library for the Globalping API

16 lines (15 loc) 592 B
import { CacheEntry } from './types'; export declare class Cache { private maxCacheSize; cache: Map<string, CacheEntry>; constructor(maxCacheSize: number); get(key: string): CacheEntry | undefined; generateCacheKey(endpoint: string, params: Record<string, any>): string; addToCache(key: string, entry: CacheEntry): void; updateCacheEntryTimestamp(key: string): void; private findOldestCacheEntry; clearCache(): void; getCacheSize(): number; removeCacheEntry(endpoint: string, params: Record<string, any>): boolean; getCachedKeys(): string[]; }