export type StorageBackend = 'local' | 'session'; export interface UseStorageOptions { /** Serialize a value to its stored string form. Defaults to `JSON.stringify`. */ serializer?: (value: T) => string; /** Parse the stored string back into a value. Defaults to `JSON.parse`. */ deserializer?: (raw: string) => T; } export type UseStorageReturn = readonly [T, (value: T | ((prev: T) => T)) => void, () => void]; /** * SSR-safe `localStorage`/`sessionStorage` hook. Reads via `useSyncExternalStore` * (server and first client render return `defaultValue`), syncs across tabs via * the `storage` event, and syncs other components in the same tab via an internal * registry. Returns `[value, setValue, remove]`. * * Values are JSON-serialized by default; pass a `serializer`/`deserializer` to * store raw strings (e.g. a theme name the no-flash script reads directly). * * Prefer the `useLocalStorage` / `useSessionStorage` wrappers unless the backend * is chosen at runtime. */ export declare function useStorage(backend: StorageBackend, key: string, defaultValue: T, options?: UseStorageOptions): UseStorageReturn; export declare function useLocalStorage(key: string, defaultValue: T, options?: UseStorageOptions): UseStorageReturn; export declare function useSessionStorage(key: string, defaultValue: T, options?: UseStorageOptions): UseStorageReturn; //# sourceMappingURL=use-local-storage.d.ts.map