/** * Synchronizes state with localStorage, providing persistent storage across sessions. * Automatically serializes/deserializes JSON values. * * @template T - The type of the stored value * @param key - The localStorage key * @param initialValue - The initial value if no stored value exists * @returns A tuple containing [storedValue, setValue, removeValue] * * @example * ```tsx * function ThemeSelector() { * const [theme, setTheme, resetTheme] = useLocalStorage('theme', 'light'); * * return ( *
* * * *
* ); * } * ``` * * @example * ```tsx * function UserPreferences() { * const [prefs, setPrefs] = useLocalStorage('preferences', { * notifications: true, * autoSave: false * }); * * // Update with function * const toggleNotifications = () => { * setPrefs(prev => ({ ...prev, notifications: !prev.notifications })); * }; * } * ``` */ export declare function useLocalStorage(key: string, initialValue: T): [T, (value: T | ((prev: T) => T)) => void, () => void]; //# sourceMappingURL=useLocalStorage.d.ts.map