From b2222be876285c5b609726af5fec8e316ec32e8b Mon Sep 17 00:00:00 2001 From: Sebastian Schocke Date: Thu, 27 Jun 2019 18:21:35 +0200 Subject: [PATCH] Fix messageSW function signature (#36486) Fix `messageSW` function signature to have data being sent as a parameter Also updated the `activated` event to use the `WorkboxUpdatableEvent` as it's event type as it includes a `isUpdate` boolean as well --- types/workbox-window/Workbox.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/workbox-window/Workbox.d.ts b/types/workbox-window/Workbox.d.ts index f473715faf..6501c9f9b5 100644 --- a/types/workbox-window/Workbox.d.ts +++ b/types/workbox-window/Workbox.d.ts @@ -37,7 +37,7 @@ interface WokerboxEventMap { installed: WorkboxEvent; waiting: WorkboxWaitingEvent; controlling: WorkboxEvent; - activated: WorkboxEvent; + activated: WorkboxUpdatableEvent; redundant: WorkboxEvent; externalinstalled: WorkboxExtendableEvent; externalwaiting: WorkboxExtendableEvent; @@ -106,7 +106,7 @@ declare class Workbox extends EventTargetShim { * returned by `messageSW()`. If no response is set, the promise will never * resolve. */ - messageSW(): Promise; + messageSW(data: any): Promise; addEventListener(type: K, listener: (this: Workbox, ev: WokerboxEventMap[K]) => void): void; removeEventListener(type: K, listener: (this: Workbox, ev: WokerboxEventMap[K]) => void): void;