UNPKG

wxt-zustand

Version:

High-performance Zustand state management for WXT web extensions with seamless cross-tab synchronization and sub-10ms React re-renders

18 lines 857 B
/** * Detects the classic Chromium error thrown when the extension context is lost. * Uses standard pattern matching for extension context invalidation detection. */ export declare function isExtensionContextInvalidated(err: unknown): boolean; /** * Attempt to reload the page when the extension context is invalidated. * Guarded for environments where `window` is not defined (tests, SSR). */ export declare function reloadPageOnInvalidation(): void; /** * Installs global listeners to detect extension context invalidation and reload. * - Listens to `unhandledrejection` and `error` events for the known error. * - Uses standard WXT extension handling: message check + reload. * - Returns a cleanup function to remove the listeners. */ export declare function installContextInvalidationReload(): () => void; //# sourceMappingURL=errors.d.ts.map