From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../tests/interfaces/notifications.idl | 101 +++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 testing/web-platform/tests/interfaces/notifications.idl (limited to 'testing/web-platform/tests/interfaces/notifications.idl') diff --git a/testing/web-platform/tests/interfaces/notifications.idl b/testing/web-platform/tests/interfaces/notifications.idl new file mode 100644 index 0000000000..4300b17107 --- /dev/null +++ b/testing/web-platform/tests/interfaces/notifications.idl @@ -0,0 +1,101 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into webref +// (https://github.com/w3c/webref) +// Source: Notifications API Standard (https://notifications.spec.whatwg.org/) + +[Exposed=(Window,Worker)] +interface Notification : EventTarget { + constructor(DOMString title, optional NotificationOptions options = {}); + + static readonly attribute NotificationPermission permission; + [Exposed=Window] static Promise requestPermission(optional NotificationPermissionCallback deprecatedCallback); + + static readonly attribute unsigned long maxActions; + + attribute EventHandler onclick; + attribute EventHandler onshow; + attribute EventHandler onerror; + attribute EventHandler onclose; + + readonly attribute DOMString title; + readonly attribute NotificationDirection dir; + readonly attribute DOMString lang; + readonly attribute DOMString body; + readonly attribute DOMString tag; + readonly attribute USVString image; + readonly attribute USVString icon; + readonly attribute USVString badge; + [SameObject] readonly attribute FrozenArray vibrate; + readonly attribute EpochTimeStamp timestamp; + readonly attribute boolean renotify; + readonly attribute boolean? silent; + readonly attribute boolean requireInteraction; + [SameObject] readonly attribute any data; + [SameObject] readonly attribute FrozenArray actions; + + undefined close(); +}; + +dictionary NotificationOptions { + NotificationDirection dir = "auto"; + DOMString lang = ""; + DOMString body = ""; + DOMString tag = ""; + USVString image; + USVString icon; + USVString badge; + VibratePattern vibrate; + EpochTimeStamp timestamp; + boolean renotify = false; + boolean? silent = null; + boolean requireInteraction = false; + any data = null; + sequence actions = []; +}; + +enum NotificationPermission { + "default", + "denied", + "granted" +}; + +enum NotificationDirection { + "auto", + "ltr", + "rtl" +}; + +dictionary NotificationAction { + required DOMString action; + required DOMString title; + USVString icon; +}; + +callback NotificationPermissionCallback = undefined (NotificationPermission permission); + +dictionary GetNotificationOptions { + DOMString tag = ""; +}; + +partial interface ServiceWorkerRegistration { + Promise showNotification(DOMString title, optional NotificationOptions options = {}); + Promise> getNotifications(optional GetNotificationOptions filter = {}); +}; + +[Exposed=ServiceWorker] +interface NotificationEvent : ExtendableEvent { + constructor(DOMString type, NotificationEventInit eventInitDict); + + readonly attribute Notification notification; + readonly attribute DOMString action; +}; + +dictionary NotificationEventInit : ExtendableEventInit { + required Notification notification; + DOMString action = ""; +}; + +partial interface ServiceWorkerGlobalScope { + attribute EventHandler onnotificationclick; + attribute EventHandler onnotificationclose; +}; -- cgit v1.2.3