next-shared-state
Version:
Enhanced state sharing for Next.js with IndexedDB persistence and URL data transfer between pages and components.
12 lines (11 loc) • 777 B
TypeScript
import { enhancedIndexedDB } from "./enhancedIndexedDB";
import { TTL } from "./ttlPresets";
import { SharedDataReturn, StoreOptions } from "./types";
export declare function useSharedData<T>(key: string, initialValue?: T, options?: StoreOptions): SharedDataReturn<T>;
export declare function setSharedData<T>(key: string, value: T, options?: StoreOptions): void;
export declare function createTransferURL(path: string, data: Record<string, any>): string;
export declare function clearPersistedData(category?: string): Promise<void>;
export declare function getPersistedKeys(): Promise<string[]>;
export declare function exportAllData(): Promise<string>;
export declare function importData(jsonData: string): Promise<void>;
export { enhancedIndexedDB as indexedDBStore, TTL };