service-worker-mock
Advanced tools
Comparing version 1.10.2 to 1.11.0
@@ -11,2 +11,3 @@ // If the WHATWG URL implementation is available via the first-party `url` | ||
const Client = require('./models/Client'); | ||
const WindowClient = require('./models/WindowClient'); | ||
const Clients = require('./models/Clients'); | ||
@@ -58,2 +59,3 @@ const ExtendableEvent = require('./models/ExtendableEvent'); | ||
this.Client = Client; | ||
this.WindowClient = WindowClient; | ||
this.Event = ExtendableEvent; | ||
@@ -60,0 +62,0 @@ this.ExtendableEvent = ExtendableEvent; |
@@ -5,5 +5,6 @@ const generateRandomId = require('../utils/generateRandomId'); | ||
class Client { | ||
constructor(url, frameType) { | ||
constructor(url, type, frameType) { | ||
this.id = generateRandomId(); | ||
this.url = url; | ||
this.type = type || 'worker'; | ||
this.frameType = frameType; | ||
@@ -19,2 +20,3 @@ } | ||
url: this.url, | ||
type: this.type, | ||
frameType: this.frameType | ||
@@ -21,0 +23,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
const Client = require('./Client'); | ||
const WindowClient = require('./WindowClient'); | ||
@@ -19,5 +19,5 @@ // https://developer.mozilla.org/en-US/docs/Web/API/Clients | ||
openWindow(url) { | ||
const client = new Client(url); | ||
this.clients.push(client); | ||
return Promise.resolve(client); | ||
const windowClient = new WindowClient(url); | ||
this.clients.push(windowClient); | ||
return Promise.resolve(windowClient); | ||
} | ||
@@ -24,0 +24,0 @@ |
{ | ||
"name": "service-worker-mock", | ||
"version": "1.10.2", | ||
"version": "1.11.0", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -12,2 +12,3 @@ const ExtendableEvent = require('../models/ExtendableEvent'); | ||
case 'notificationclick': | ||
case 'notificationclose': | ||
return new NotificationEvent(args); | ||
@@ -14,0 +15,0 @@ case 'push': |
24159
26
640