/** * Vercel KV Storage Adapter * * Vercel KV (REST-based) storage implementation for edge deployment. * NOTE: Vercel KV does NOT support pub/sub. Use Upstash adapter instead. */ import { BaseStorageAdapter } from './base'; import type { VercelKvAdapterOptions, SetOptions } from '../types'; /** * Vercel KV storage adapter. * * Features: * - REST-based storage for edge deployment * - Native TTL support * - Pattern matching via keys() command * * Limitations: * - NO pub/sub support (use Upstash instead) * - keys() may be slow for large datasets * * @example * ```typescript * const adapter = new VercelKvStorageAdapter({ * url: process.env.KV_REST_API_URL, * token: process.env.KV_REST_API_TOKEN, * }); * * await adapter.connect(); * await adapter.set('key', 'value', { ttlSeconds: 300 }); * const value = await adapter.get('key'); * await adapter.disconnect(); * ``` */ export declare class VercelKvStorageAdapter extends BaseStorageAdapter { protected readonly backendName = "vercel-kv"; private client?; private readonly options; private readonly keyPrefix; constructor(options?: VercelKvAdapterOptions); connect(): Promise; disconnect(): Promise; ping(): Promise; /** * Get the connected Vercel KV client, throwing if not connected. */ private getConnectedClient; 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)[]>; 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; protected getPubSubSuggestion(): string; /** * Add prefix to a key. */ private prefixKey; /** * Remove prefix from a key. */ private unprefixKey; }