cache-manager-ioredis-store
Version:
Redis store for node-cache-manager updated
19 lines (18 loc) • 726 B
TypeScript
import Redis, { Cluster, ClusterNode, ClusterOptions, RedisOptions } from 'ioredis';
import type { Cache, Store, Config } from 'cache-manager';
export type Options = Config & {
throwNoncacheable?: boolean;
};
export type RedisCache = Cache<RedisStore>;
export interface RedisStore extends Store {
readonly isCacheable: (value: unknown) => boolean;
get client(): Redis | Cluster;
}
export interface RedisClusterConfig {
nodes: ClusterNode[];
options?: ClusterOptions;
}
export declare function redisStore(options?: (RedisOptions | {
clusterConfig: RedisClusterConfig;
}) & Options): Promise<RedisStore>;
export declare function redisInsStore(redisCache: Redis | Cluster, options?: Options): RedisStore;