/** Reads `key` as JSON from `storage` (`localStorage` by default), or `fallback` when it is missing, unreadable or storage is unavailable; never throws. */ export declare function getStorage(key: string, fallback: T, storage?: Storage): T; /** Stores `value` as JSON under `key` (`localStorage` by default); returns `false` when the write fails (quota, private mode, SSR, disabled storage), never throws. */ export declare function setStorage(key: string, value: T, storage?: Storage): boolean; /** Removes `key` (from `localStorage` by default); returns `false` when storage is unavailable, never throws. */ export declare function removeStorage(key: string, storage?: Storage): boolean; /** JSON-serializing wrapper bound to a single `Storage` (e.g. `localStorage`, `sessionStorage`); no method throws. */ export declare class JsonStorage { private readonly storage; constructor(storage: Storage); get(key: string, fallback: T): T; /** Stores the value; returns `false` if the write fails (e.g. quota exceeded, private mode). */ set(key: string, value: T): boolean; /** Removes the value; returns `false` if storage is unavailable. */ remove(key: string): boolean; /** Whether `key` holds a value; `false` if storage is unavailable. */ has(key: string): boolean; /** Reads the value; if absent or unparseable, computes it via `factory`, stores it, and returns it. */ getOrSet(key: string, factory: () => T): T; /** Reads then removes the value (one-shot handoff). */ consume(key: string): T | null; /** Read-modify-write: applies `fn` to the current value (or `fallback`) and stores the result; returns `false` if the write fails. */ update(key: string, fn: (prev: T) => T, fallback: T): boolean; } export declare const jsonLocalStorage: JsonStorage; export declare const jsonSessionStorage: JsonStorage; //# sourceMappingURL=storage.d.ts.map