/** * Redis Database Adapter * For session state, caching, and pub/sub */ export interface RedisConfig { url?: string; host?: string; port?: number; password?: string; db?: number; keyPrefix?: string; } export interface RedisAdapter { get(key: string): Promise; set(key: string, value: T, ttl?: number): Promise; delete(key: string): Promise; exists(key: string): Promise; keys(pattern: string): Promise; expire(key: string, seconds: number): Promise; ttl(key: string): Promise; hget(key: string, field: string): Promise; hset(key: string, field: string, value: T): Promise; hgetall(key: string): Promise>; hdel(key: string, ...fields: string[]): Promise; lpush(key: string, ...values: T[]): Promise; rpush(key: string, ...values: T[]): Promise; lrange(key: string, start: number, stop: number): Promise; llen(key: string): Promise; publish(channel: string, message: string): Promise; subscribe(channel: string, callback: (message: string) => void): Promise; unsubscribe(channel: string): Promise; connect(): Promise; disconnect(): Promise; isConnected(): boolean; } /** * Redis Adapter using native fetch (for Upstash REST API) */ export declare class UpstashRedisAdapter implements RedisAdapter { private url; private token; private keyPrefix; private connected; constructor(config: { url: string; token: string; keyPrefix?: string; }); private prefixKey; private request; get(key: string): Promise; set(key: string, value: T, ttl?: number): Promise; delete(key: string): Promise; exists(key: string): Promise; keys(pattern: string): Promise; expire(key: string, seconds: number): Promise; ttl(key: string): Promise; hget(key: string, field: string): Promise; hset(key: string, field: string, value: T): Promise; hgetall(key: string): Promise>; hdel(key: string, ...fields: string[]): Promise; lpush(key: string, ...values: T[]): Promise; rpush(key: string, ...values: T[]): Promise; lrange(key: string, start: number, stop: number): Promise; llen(key: string): Promise; publish(channel: string, message: string): Promise; subscribe(_channel: string, _callback: (message: string) => void): Promise; unsubscribe(_channel: string): Promise; connect(): Promise; disconnect(): Promise; isConnected(): boolean; } /** * In-memory Redis-like adapter for testing */ export declare class MemoryRedisAdapter implements RedisAdapter { private store; private hashes; private lists; private subscribers; private connected; get(key: string): Promise; set(key: string, value: T, ttl?: number): Promise; delete(key: string): Promise; exists(key: string): Promise; keys(pattern: string): Promise; expire(key: string, seconds: number): Promise; ttl(key: string): Promise; hget(key: string, field: string): Promise; hset(key: string, field: string, value: T): Promise; hgetall(key: string): Promise>; hdel(key: string, ...fields: string[]): Promise; lpush(key: string, ...values: T[]): Promise; rpush(key: string, ...values: T[]): Promise; lrange(key: string, start: number, stop: number): Promise; llen(key: string): Promise; publish(channel: string, message: string): Promise; subscribe(channel: string, callback: (message: string) => void): Promise; unsubscribe(channel: string): Promise; connect(): Promise; disconnect(): Promise; isConnected(): boolean; } export declare function createUpstashRedis(config: { url: string; token: string; keyPrefix?: string; }): UpstashRedisAdapter; export declare function createMemoryRedis(): MemoryRedisAdapter;