mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-19 23:04:46 +00:00
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
31 lines
673 B
TypeScript
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>;
|
|
}
|