@@ -4,7 +4,9 @@ import scala.scalajs.js
4
4
import scala .scalajs .js .annotation ._
5
5
import scala .scalajs .js .|
6
6
7
- import org .scalajs .dom .experimental .{Request , RequestInfo , Response , Sequence }
7
+ import org .scalajs .dom .experimental .{
8
+ Notification , NotificationOptions , Request , RequestInfo , Response , Sequence
9
+ }
8
10
import org .scalajs .dom .raw .{WorkerGlobalScope , ErrorEvent }
9
11
import org .scalajs .dom .webgl .RenderingContext
10
12
import org .scalajs .dom .{Event , EventTarget , MessagePort }
@@ -246,6 +248,45 @@ trait ServiceWorkerRegistration extends EventTarget {
246
248
* MDN
247
249
*/
248
250
var onupdatefound : js.Function1 [Event , _] = js.native
251
+
252
+ /**
253
+ * The getNotifications() method of the ServiceWorkerRegistration interface
254
+ * returns a list of the notifications in the order that they were created
255
+ * from the current origin via the current service worker registration.
256
+ * Origins can have many active but differently-scoped service worker
257
+ * registrations. Notifications created by one service worker on the same
258
+ * origin will not be available to other active services workers on that same
259
+ * origin.
260
+ *
261
+ * MDN
262
+ */
263
+ def getNotifications (
264
+ options : GetNotificationOptions = ??? ): js.Promise [Sequence [Notification ]] = js.native
265
+
266
+ /**
267
+ * The showNotification() method of the ServiceWorkerRegistration interface
268
+ * creates a notification on an active service worker.
269
+ *
270
+ * MDN
271
+ */
272
+ def showNotification (title : String ,
273
+ options : NotificationOptions = ??? ): js.Promise [Unit ] = js.native
274
+ }
275
+
276
+ /**
277
+ * An object containing options to filter the notifications returned.
278
+ *
279
+ * MDN
280
+ */
281
+ trait GetNotificationOptions extends js.Object {
282
+
283
+ /**
284
+ * A DOMString representing a notification tag. If specified, only
285
+ * notifications that have this tag will be returned.
286
+ *
287
+ * MDN
288
+ */
289
+ var tag : js.UndefOr [String ] = js.undefined
249
290
}
250
291
251
292
/**
0 commit comments