import type { CacheStrategy } from '@nestjs-crud/core/cache'; import { type RedisLike } from '@nestjs-crud/core/cache'; /** * BYO Redis-backed `CacheStrategy` for the Prisma adapter. * * Accepts a `redis@5+` (node-redis) client, an `ioredis` client, or any object * implementing the `RedisLike` interface from `@nestjs-crud/core/cache`. * Auto-detection picks the right adapter; lazy-once auto-connect means you do * not need to call `await redis.connect()` before passing the client. * * Same SCAN+DEL invalidation pattern as `TypeOrmCacheStrategy`, * `MikroOrmCacheStrategy`, `DrizzleCacheStrategy`. Use this when you do not * want or have Prisma Accelerate (a managed cache layer) — a Redis cluster * gives you the same TTL + entity-prefix invalidation surface against your * own infra. * * `invalidate(prefix)` uses non-blocking `scanPrefix` — NEVER `client.keys()`. * * **TTL units:** `ttl` is MILLISECONDS. * * **Single-flight:** the `inflight` Map prevents thundering-herd amplification on * cold cache. * * `redis` and `ioredis` are optional peerDependencies. * * @since 2.2.0 */ export declare class PrismaRedisCacheStrategy implements CacheStrategy { private readonly redis; /** Single-flight de-dup map. Cleared on settle (resolve OR reject). */ private readonly inflight; constructor(client: RedisLike | unknown); wrap(key: string, fetchFn: () => Promise, ttl: number): Promise; get(key: string): Promise; set(key: string, value: T, ttl: number): Promise; invalidate(prefix: string): Promise; }