Files
openclaw/src/types/web-push.d.ts
Eduardo Cruz 21b7ad5805 feat: add Control UI PWA web push support (#44590)
Adds browser PWA manifest and service worker support for the Control UI, plus gateway RPC methods and persisted Web Push subscription handling.

Maintainer verification:
- OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test src/infra/push-web.test.ts src/gateway/server-methods/push.test.ts src/gateway/control-ui.test.ts src/gateway/protocol/push.test.ts
- pnpm check:changed passed before final GitHub update-branch merge commit
- pnpm build

Source head: 0720024368
2026-04-25 05:03:00 -05:00

31 lines
673 B
TypeScript

declare module "web-push" {
export type PushSubscription = {
endpoint: string;
keys: {
p256dh: string;
auth: string;
};
};
export type SendResult = {
statusCode: number;
body: string;
headers: Record<string, string>;
};
export type VAPIDKeys = {
publicKey: string;
privateKey: string;
};
export function generateVAPIDKeys(): VAPIDKeys;
export function setVapidDetails(subject: string, publicKey: string, privateKey: string): void;
export function sendNotification(
subscription: PushSubscription,
payload?: string | Buffer | null,
options?: Record<string, unknown>,
): Promise<SendResult>;
}