diff --git a/lib/serviceworkers.js b/lib/serviceworkers.js index 645b1c6db7d..24221aab94f 100644 --- a/lib/serviceworkers.js +++ b/lib/serviceworkers.js @@ -132,6 +132,11 @@ declare class PushManager { type ServiceWorkerUpdateViaCache = 'imports' | 'all' | 'none'; +type GetNotificationOptions = { + tag?: string, + ... +}; + declare class ServiceWorkerRegistration extends EventTarget { +installing: ?ServiceWorker, +waiting: ?ServiceWorker, @@ -141,6 +146,8 @@ declare class ServiceWorkerRegistration extends EventTarget { +updateViaCache: ServiceWorkerUpdateViaCache, +pushManager: PushManager, + getNotifications?: (filter?: GetNotificationOptions) => Promise<$ReadOnlyArray>, + showNotification?: (title: string, options?: NotificationOptions) => Promise, update(): Promise, unregister(): Promise,