UNPKG

next-shared-state

Version:

Enhanced state sharing for Next.js with IndexedDB persistence and URL data transfer between pages and components.

22 lines (21 loc) 744 B
import { EnhancedIndexedDBInterface } from "./types"; export declare class EnhancedIndexedDB implements EnhancedIndexedDBInterface { private dbName; private version; private db; private initPromise; private init; set(key: string, value: any, options?: { ttl?: number; category?: string; }): Promise<void>; get<T>(key: string): Promise<T | null>; getMany<T>(keys: string[]): Promise<Record<string, T>>; remove(key: string): Promise<void>; clear(category?: string): Promise<void>; getKeys(): Promise<string[]>; private cleanExpired; exportData(): Promise<string>; importData(jsonData: string): Promise<void>; } export declare const enhancedIndexedDB: EnhancedIndexedDB;