UNPKG

@graphql-hive/core

Version:
37 lines 903 B
export default MemoryCache; /** * Simple in-memory cache implementation * @class MemoryCache * @property {Map} cache Cache map */ declare class MemoryCache { constructor(maxEntries: any); cache: Map<any, any>; maxEntries: any; /** * Get cache value by key * @param {string} key Cache key * @return {any} Response from cache */ get(key: string): any; /** * Set cache key with value and ttl * @param {string} key Cache key * @param {any} value Value to cache * @param {number} ttl Time to live in milliseconds * @return {void} */ set(key: string, value: any, ttl: number): void; /** * Delete cache key * @param {string} key Cache key * @return {void} */ delete(key: string): void; /** * Clear cache * @returns {void} */ flush(): void; } //# sourceMappingURL=cache.d.ts.map