fix browser notifications + make them work when browser is closed

This commit is contained in:
unknown
2026-03-23 20:24:35 +01:00
parent 17b88cb160
commit c33f6d4108
10 changed files with 480 additions and 36 deletions
+17
View File
@@ -0,0 +1,17 @@
declare module "web-push" {
interface VapidKeys {
publicKey: string;
privateKey: string;
}
interface PushSubscription {
endpoint: string;
keys: { p256dh: string; auth: string };
}
interface RequestOptions {
TTL?: number;
}
function generateVAPIDKeys(): VapidKeys;
function setVapidDetails(subject: string, publicKey: string, privateKey: string): void;
function sendNotification(subscription: PushSubscription, payload: string | Buffer | null, options?: RequestOptions): Promise<any>;
export { generateVAPIDKeys, setVapidDetails, sendNotification };
}