/** * IndexedDB Storage Adapter * * Browser-compatible storage using the IndexedDB API. * Persistent, supports larger data than localStorage (~50MB+ per origin). * * Suitable for key persistence in browser environments where * larger storage capacity is needed. */ import { BaseStorageAdapter } from './base'; import type { SetOptions } from '../types'; /** * Options for the IndexedDB adapter. */ export interface IndexedDBAdapterOptions { /** * Database name. * @default 'frontmcp' */ dbName?: string; /** * Object store name. * @default 'kv' */ storeName?: string; /** * Key prefix for namespacing. * @default 'frontmcp:' */ prefix?: string; } /** * Browser IndexedDB-based storage adapter. * * Features: * - Persistent across page reloads and browser restarts * - Asynchronous API matching StorageAdapter contract * - TTL support via stored expiration timestamps * - Larger storage limit than localStorage (~50MB+) * * Limitations: * - No pub/sub support * - Browser-only (requires globalThis.indexedDB) * - Pattern matching uses simple iteration over all keys */ export declare class IndexedDBStorageAdapter extends BaseStorageAdapter { protected readonly backendName = "indexeddb"; private readonly dbName; private readonly storeName; private readonly prefix; private db; constructor(options?: IndexedDBAdapterOptions); private assertAvailable; private key; private stripPrefix; connect(): Promise; disconnect(): Promise; ping(): Promise; private getStore; private idbRequest; private idbTransaction; get(key: string): Promise; protected doSet(key: string, value: string, options?: SetOptions): Promise; delete(key: string): Promise; exists(key: string): Promise; expire(key: string, ttlSeconds: number): Promise; ttl(key: string): Promise; keys(pattern?: string): Promise; incr(key: string): Promise; decr(key: string): Promise; /** * Increment by amount. NOT atomic — uses read-then-write which can race * under concurrent access (e.g., multiple browser tabs). */ incrBy(key: string, amount: number): Promise; private matchPattern; }