cachified-redis-json-adapter
Version:
A redis-json adapter for usage with @epic-web/cachified
20 lines (19 loc) • 707 B
TypeScript
import type { Cache } from '@epic-web/cachified';
interface RedisLikeCache {
name?: string;
set(key: string, value: string, options?: {
EXAT: number;
}): Promise<string | null>;
get(key: string): Promise<string | null>;
del(key: string): Promise<unknown>;
}
export interface RedisJsonLikeCache extends RedisLikeCache {
json: {
set(key: string, path: string, value: Record<string, any>): Promise<unknown>;
get(key: string): Promise<unknown>;
del(key: string): Promise<unknown>;
};
expireAt(key: string, timestamp: number): Promise<unknown>;
}
export declare function redisJsonCacheAdapter(redisJsonCache: RedisJsonLikeCache): Cache;
export {};