/** * useLocalStorage * * A hook to persist state in localStorage. * * @param key The key to use when storing the state in localStorage. * @param initialValue The initial value of the state to be stored. * @param options An object with the following optional properties: * - serialize: A function to serialize the state. Defaults to JSON.stringify. * - deserialize: A function to deserialize the state. Defaults to JSON.parse. * @returns An object with the stored value, a setter function, and a remove function. */ export type UseLocalStorageReturn = { /** The stored value read from localStorage. */ value: T; /** * Update the stored value in localStorage. * Accepts either a direct value or a function that receives the previous value. */ setValue: (value: T | ((prev: T) => T)) => void; /** Remove the key from localStorage and reset to the initial value. */ remove: () => void; } & [T, (value: T | ((prev: T) => T)) => void, () => void]; export declare function useLocalStorage(key: string, initialValue: T, options?: { serialize?: (value: T) => string; deserialize?: (value: string) => T; }): UseLocalStorageReturn;