/** * Redis Storage Adapter * * Redis-based storage implementation for production use. * Uses ioredis with dynamic import for browser compatibility. */ import { BaseStorageAdapter } from './base'; import type { RedisAdapterOptions, SetOptions, MessageHandler, Unsubscribe } from '../types'; type Redis = import('ioredis').Redis; /** * Redis storage adapter. * * Features: * - Native Redis TTL support * - SCAN for pattern matching (non-blocking) * - Pipeline for batch operations * - Pub/sub with separate subscriber connection * * @example * ```typescript * const adapter = new RedisStorageAdapter({ * url: 'redis://localhost:6379', * }); * * await adapter.connect(); * await adapter.set('key', 'value', { ttlSeconds: 300 }); * const value = await adapter.get('key'); * await adapter.disconnect(); * ``` */ export declare class RedisStorageAdapter extends BaseStorageAdapter { protected readonly backendName = "redis"; private client?; private subscriber?; private readonly options; private readonly ownsClient; private readonly keyPrefix; private readonly subscriptionHandlers; constructor(options?: RedisAdapterOptions); connect(): Promise; disconnect(): Promise; ping(): Promise; /** * Get the connected Redis client, throwing if not connected. */ private getConnectedClient; /** * Get the connected Redis subscriber, throwing if not created. */ private getConnectedSubscriber; get(key: string): Promise; protected doSet(key: string, value: string, options?: SetOptions): Promise; delete(key: string): Promise; exists(key: string): Promise; mget(keys: string[]): Promise<(string | null)[]>; mset(entries: import('../types').SetEntry[]): Promise; mdelete(keys: string[]): Promise; expire(key: string, ttlSeconds: number): Promise; ttl(key: string): Promise; keys(pattern?: string): Promise; incr(key: string): Promise; decr(key: string): Promise; incrBy(key: string, amount: number): Promise; supportsPubSub(): boolean; publish(channel: string, message: string): Promise; subscribe(channel: string, handler: MessageHandler): Promise; /** * Build Redis options from config. */ private buildRedisOptions; /** * Create subscriber connection. */ private createSubscriber; /** * Add prefix to a key. */ private prefixKey; /** * Remove prefix from a key. */ private unprefixKey; /** * Get the underlying Redis client (for advanced use). */ getClient(): Redis | undefined; } export {};