Files
openchamber/packages/web/src/pwa.d.ts
T
Bohdan Triapitsyn 1f23b63c0b feat: add Web Push API support and PWA integration (#189)
* feat: add Web Push API support and PWA integration

Add web Push API with subscribe/unsubscribe and visibility endpoints
Introduce usePushVisibilityBeacon and useSessionDeepLink hooks
Integrate PWA with service worker, registerSW, and VAPID key persistence

* feat: add heartbeat visibility beacon for web runtime

Add a 10s heartbeat to ping visibility while visible
Subscribe to visibilitychange, focus, blur, pageshow, and pagehide events to report state
Clear heartbeat interval on unmount to avoid leaks
2026-01-22 01:19:24 +02:00

14 lines
445 B
TypeScript

/// <reference types="vite/client" />
declare module 'virtual:pwa-register' {
export interface RegisterSWOptions {
immediate?: boolean;
onNeedRefresh?: () => void;
onOfflineReady?: () => void;
onRegistered?: (registration: ServiceWorkerRegistration | undefined) => void;
onRegisterError?: (error: unknown) => void;
}
export function registerSW(options?: RegisterSWOptions): (reloadPage?: boolean) => Promise<void>;
}