/** * Hook that syncs state with sessionStorage */ import type { StorageHookResult } from './storage/types.js'; /** * Hook that syncs state with sessionStorage * * @template T - The type of the stored value * @param key - sessionStorage key * @param initialValue - Initial value if key doesn't exist * @returns Tuple of [storedValue, setValue] * * @example * ```tsx * const Component = () => { * const [theme, setTheme] = useSessionStorage('theme', 'light'); * return
Theme: {theme}
; * }; * ``` * * @remarks * SSR-safe: This hook safely handles server-side rendering by checking for window availability. * In SSR environments, it returns the initialValue and skips sessionStorage operations. * Storage events are also safely handled with proper environment checks. * Automatically syncs across tabs/windows via storage events. */ export declare function useSessionStorage(key: string, initialValue: T): StorageHookResult; //# sourceMappingURL=useSessionStorage.d.ts.map