/** * Purpose: Shared wrapper functions for chrome.storage supporting persistent (local) and ephemeral (session) storage with graceful degradation. * Why: Abstracts Chrome storage API differences and provides a single facade usable from both background and popup contexts. */ /** * Fire-and-forget a storage write whose result the caller intentionally does not * await, logging (never throwing) if it fails. Keeps non-critical writes honest * without leaking unhandled rejections — a mutating write must not fail *silently* * (CLAUDE.md rule 25), so we surface the failure in the log instead of swallowing it. */ export declare function persist(write: Promise, context: string): void; /** * Get a persistent value from local storage (async) */ export declare function getLocal(key: string): Promise; /** * Get multiple persistent values from local storage (async) */ export declare function getLocals(keys: string[]): Promise>; /** * Set a persistent value in local storage (async) */ export declare function setLocal(key: string, value: unknown): Promise; /** * Set multiple persistent values in local storage (async) */ export declare function setLocals(items: Record): Promise; /** * Remove a persistent value from local storage (async) */ export declare function removeLocal(key: string): Promise; /** * Remove multiple persistent values from local storage (async) */ export declare function removeLocals(keys: string[]): Promise; /** * Get an ephemeral value from session storage (async) */ export declare function getSession(key: string): Promise; /** * Set an ephemeral value in session storage (async) */ export declare function setSession(key: string, value: unknown): Promise; /** * Remove an ephemeral value from session storage (async) */ export declare function removeSession(key: string): Promise; /** * Remove multiple ephemeral values from session storage (async) */ export declare function removeSessions(keys: string[]): Promise; type StorageChange = { oldValue?: unknown; newValue?: unknown; }; type StorageChangeListener = (changes: { [key: string]: StorageChange; }, areaName: string) => void; /** * Register a storage change listener. Returns an unsubscribe function. */ export declare function onStorageChanged(listener: StorageChangeListener): () => void; /** * Set session storage access level (e.g., to allow content scripts access). * Required for terminal state persistence in content scripts. */ export declare function setSessionAccessLevel(accessLevel: 'TRUSTED_CONTEXTS' | 'TRUSTED_AND_UNTRUSTED_CONTEXTS'): Promise; /** * Get diagnostic info about storage availability */ export declare function getStorageDiagnostics(): { sessionStorageAvailable: boolean; localStorageAvailable: boolean; browserVersion: string; }; /** * Check if service worker was restarted (state version mismatch) * Returns true if state was lost/cleared */ export declare function wasServiceWorkerRestarted(): Promise; /** * Mark the current state version (call on init) */ export declare function markStateVersion(): Promise; export {}; //# sourceMappingURL=storage-utils.d.ts.map