/** * Cloudflare KV Session Store * * Uses Cloudflare KV for fast, globally distributed session storage */ import type { Session, SessionCreateOptions } from '../types/index.js'; import type { SessionStore, SessionConfig } from './store.js'; /** * Cloudflare KV Namespace interface * Compatible with @cloudflare/workers-types KVNamespace */ export interface KVNamespace { get(key: string, options?: { type?: 'text' | 'json' | 'arrayBuffer' | 'stream'; }): Promise; get(key: string, options: { type: 'json'; }): Promise; put(key: string, value: string, options?: { expirationTtl?: number; metadata?: unknown; }): Promise; delete(key: string): Promise; list(options?: { prefix?: string; limit?: number; cursor?: string; }): Promise<{ keys: Array<{ name: string; expiration?: number; metadata?: unknown; }>; list_complete: boolean; cursor?: string; }>; } export declare class KVSessionStore implements SessionStore { private kv; private config; private keyPrefix; constructor(kv: KVNamespace, config?: Partial, keyPrefix?: string); private sessionKey; private userSessionsKey; create(options: SessionCreateOptions): Promise; get(sessionId: string): Promise; getByUser(tenantId: string, userId: string): Promise; touch(sessionId: string): Promise; destroy(sessionId: string): Promise; destroyByUser(tenantId: string, userId: string): Promise; cleanup(): Promise; close(): Promise; } //# sourceMappingURL=kv-store.d.ts.map