/** Manifest member the fleet generator stamps with the per-project push config. */ export declare const WEB_PUSH_MANIFEST_KEY = "burdenoff_push"; export interface WebPushManifestConfig { /** VAPID application-server public key, base64url, client-safe. */ vapid_public_key?: string; /** Firebase project the product routes through, e.g. `burdenoff-push-4`. */ fcm_project?: string; } /** True when this browser can subscribe to Web Push at all. */ export declare function isWebPushSupported(): boolean; /** * Read the generated manifest's push block. Cached for the page: the manifest * is a static asset and one fetch per session is plenty. */ export declare function getWebPushManifestConfig(): Promise; /** Resolve the VAPID public key for this shell, or null when push is unconfigured. */ export declare function resolveVapidPublicKey(explicit?: string): Promise; /** * base64url (what the routing table stores) → the `BufferSource` * `pushManager.subscribe()` wants. * * Backed by an explicit `ArrayBuffer` rather than `new Uint8Array(length)`: * the latter is typed `Uint8Array`, which could be a * `SharedArrayBuffer` and so is not a `BufferSource`. */ export declare function urlBase64ToUint8Array(base64Url: string): Uint8Array; /** * The device identity we register for a browser: the endpoint plus the two * client keys a sender needs to encrypt a payload (RFC 8291). Stable for the * life of the subscription and re-issued by the service worker's * `pushsubscriptionchange` handler when the browser rotates it. */ export declare function serializeWebPushSubscription(subscription: PushSubscription): string; /** The current subscription, if this browser already has one. */ export declare function getWebPushSubscription(): Promise; export interface WebPushSubscribeOptions { /** Overrides the manifest-resolved key. */ vapidPublicKey?: string; } /** * Subscribe (or reuse an existing subscription) and publish it as a push token. * Assumes permission is ALREADY granted — it never prompts, so it is safe to * call on a returning session to refresh the registration. */ export declare function subscribeWebPush(options?: WebPushSubscribeOptions): Promise; /** * Ask for notification permission and subscribe on grant. * * CALL THIS FROM A USER GESTURE, IN CONTEXT — never at boot. See the module * docblock: the prompt is one-shot on iOS and sticky everywhere. * * ```ts * { * if (on) await requestWebPushPermission(); * else await unsubscribeWebPush(); * }} /> * ``` */ export declare function requestWebPushPermission(options?: WebPushSubscribeOptions): Promise; /** Sent by the generated `sw.js` when a notification is tapped. */ export declare const SW_NOTIFICATION_CLICK_MESSAGE = "BURDENOFF_NOTIFICATION_CLICK"; /** Sent by the generated `sw.js` after the browser rotated the subscription. */ export declare const SW_PUSH_SUBSCRIPTION_CHANGE_MESSAGE = "BURDENOFF_PUSH_SUBSCRIPTION_CHANGE"; /** * Listen for the messages the generated service worker posts. Idempotent, and * installed automatically by `subscribeWebPush()`; call it directly from a * shell that wants notification taps routed before any subscribe happens. */ export declare function installWebPushMessageBridge(): void; /** Drop the browser subscription (push opt-out). Does not revoke permission. */ export declare function unsubscribeWebPush(): Promise; /** Test seam — clears the cached manifest lookup and the bridge guard. */ export declare function resetWebPushForTests(): void; //# sourceMappingURL=web-push.d.ts.map