import { ICacheService } from "@medusajs/framework/types"; import { Redis } from "ioredis"; import { RedisCacheModuleOptions } from "../types"; type InjectedDependencies = { cacheRedisConnection: Redis; }; declare class RedisCacheService implements ICacheService { protected readonly TTL: number; protected readonly redis: Redis; private readonly namespace; constructor({ cacheRedisConnection }: InjectedDependencies, options?: RedisCacheModuleOptions); __hooks: { onApplicationShutdown: () => Promise; }; /** * Set a key/value pair to the cache. * If the ttl is 0 it will act like the value should not be cached at all. * @param key * @param data * @param ttl */ set(key: string, data: Record, ttl?: number): Promise; /** * Retrieve a cached value belonging to the given key. * @param cacheKey */ get(cacheKey: string): Promise; /** * Invalidate cache for a specific key. a key can be either a specific key or more global such as "ps:*". * @param key */ invalidate(key: string): Promise; /** * Returns namespaced cache key * @param key */ private getCacheKey; } export default RedisCacheService; //# sourceMappingURL=redis-cache.d.ts.map