This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #264 from riccardo-forina/new-version-notification
- Loading branch information
Showing
8 changed files
with
118 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
declare module 'workbox-window' { | ||
class Workbox { | ||
constructor(scriptURL: string, registerOptions?: object); | ||
|
||
register(immediate?: boolean): Promise<any>; | ||
active(): Promise<ServiceWorker>; | ||
controlling(): Promise<ServiceWorker>; | ||
getSW(): Promise<ServiceWorker>; | ||
messageSW(data: object): Promise<object>; | ||
|
||
addEventListener(event: 'message', callback: (data: IWorkboxEventMessage) => void): void; | ||
addEventListener(event: 'installed', callback: (data: IWorkboxEvent) => void): void; | ||
addEventListener(event: 'waiting', callback: (data: IWorkboxEventWaiting) => void): void; | ||
addEventListener(event: 'controlling', callback: (data: IWorkboxEvent) => void): void; | ||
addEventListener(event: 'activated', callback: (data: IWorkboxEvent) => void): void; | ||
addEventListener(event: 'redundant', callback: (data: IWorkboxEvent) => void): void; | ||
addEventListener(event: 'externalinstalled', callback: (data: IWorkboxEventExternal) => void): void; | ||
addEventListener(event: 'externalwaiting', callback: (data: IWorkboxEventExternal) => void): void; | ||
addEventListener(event: 'externalactivated', callback: (data: IWorkboxEventExternal) => void): void; | ||
} | ||
|
||
type WorkboxEvent = 'message' | 'installed' | 'waiting' | 'controlling' | 'activated' | 'redundant' | 'externalinstalled' | 'externalwaiting' | 'externalactivated'; | ||
|
||
interface IWorkboxEventBase { | ||
originalEvent: Event; | ||
type: WorkboxEvent; | ||
target: Workbox; | ||
} | ||
|
||
interface IWorkboxEventMessage extends IWorkboxEventBase { | ||
data: any; | ||
} | ||
|
||
interface IWorkboxEvent extends IWorkboxEventBase { | ||
sw: ServiceWorker; | ||
isUpdate: boolean|undefined; | ||
} | ||
|
||
interface IWorkboxEventWaiting extends IWorkboxEvent { | ||
wasWaitingBeforeRegister: boolean|undefined; | ||
} | ||
|
||
interface IWorkboxEventExternal extends IWorkboxEventBase { | ||
sw: ServiceWorker; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "@types/workbox-window", | ||
"version": "1.0.0", | ||
"license": "MIT" | ||
} |