* 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
14 lines
445 B
TypeScript
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>;
|
|
}
|