/** * Synchronizes state with sessionStorage, providing persistent storage for the current session. * Data persists only for the duration of the page session (until the tab is closed). * Automatically serializes/deserializes JSON values. * * @template T - The type of the stored value * @param key - The sessionStorage key * @param initialValue - The initial value if no stored value exists * @returns A tuple containing [storedValue, setValue, removeValue] * * @example * ```tsx * function WizardForm() { * const [formData, setFormData, clearFormData] = useSessionStorage('wizardForm', { * step: 1, * data: {} * }); * * const nextStep = () => { * setFormData(prev => ({ ...prev, step: prev.step + 1 })); * }; * * return ( *
*

Step {formData.step}

* * *
* ); * } * ``` * * @example * ```tsx * function TemporaryFilter() { * const [filter, setFilter] = useSessionStorage('searchFilter', ''); * * // Filter persists across page refreshes but not after closing the tab * return setFilter(e.target.value)} />; * } * ``` */ export declare function useSessionStorage(key: string, initialValue: T): [T, (value: T | ((prev: T) => T)) => void, () => void]; //# sourceMappingURL=useSessionStorage.d.ts.map