diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-21 20:56:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-21 20:56:19 +0000 |
commit | 0b6210cd37b68b94252cb798598b12974a20e1c1 (patch) | |
tree | e371686554a877842d95aa94f100bee552ff2a8e /test/wpt/tests/interfaces/push-api.idl | |
parent | Initial commit. (diff) | |
download | node-undici-0b6210cd37b68b94252cb798598b12974a20e1c1.tar.xz node-undici-0b6210cd37b68b94252cb798598b12974a20e1c1.zip |
Adding upstream version 5.28.2+dfsg1+~cs23.11.12.3.upstream/5.28.2+dfsg1+_cs23.11.12.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/wpt/tests/interfaces/push-api.idl')
-rw-r--r-- | test/wpt/tests/interfaces/push-api.idl | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/test/wpt/tests/interfaces/push-api.idl b/test/wpt/tests/interfaces/push-api.idl new file mode 100644 index 0000000..f582788 --- /dev/null +++ b/test/wpt/tests/interfaces/push-api.idl @@ -0,0 +1,93 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into webref +// (https://github.com/w3c/webref) +// Source: Push API (https://w3c.github.io/push-api/) + +dictionary PushPermissionDescriptor : PermissionDescriptor { + boolean userVisibleOnly = false; +}; + +[SecureContext] +partial interface ServiceWorkerRegistration { + readonly attribute PushManager pushManager; +}; + +[Exposed=(Window,Worker), SecureContext] +interface PushManager { + [SameObject] static readonly attribute FrozenArray<DOMString> supportedContentEncodings; + + Promise<PushSubscription> subscribe(optional PushSubscriptionOptionsInit options = {}); + Promise<PushSubscription?> getSubscription(); + Promise<PermissionState> permissionState(optional PushSubscriptionOptionsInit options = {}); +}; + +[Exposed=(Window,Worker), SecureContext] +interface PushSubscriptionOptions { + readonly attribute boolean userVisibleOnly; + [SameObject] readonly attribute ArrayBuffer? applicationServerKey; +}; + +dictionary PushSubscriptionOptionsInit { + boolean userVisibleOnly = false; + (BufferSource or DOMString)? applicationServerKey = null; +}; + +[Exposed=(Window,Worker), SecureContext] +interface PushSubscription { + readonly attribute USVString endpoint; + readonly attribute EpochTimeStamp? expirationTime; + [SameObject] readonly attribute PushSubscriptionOptions options; + ArrayBuffer? getKey(PushEncryptionKeyName name); + Promise<boolean> unsubscribe(); + + PushSubscriptionJSON toJSON(); +}; + +dictionary PushSubscriptionJSON { + USVString endpoint; + EpochTimeStamp? expirationTime = null; + record<DOMString, USVString> keys; +}; + +enum PushEncryptionKeyName { + "p256dh", + "auth" +}; + +[Exposed=ServiceWorker, SecureContext] +interface PushMessageData { + ArrayBuffer arrayBuffer(); + Blob blob(); + any json(); + USVString text(); +}; + +[Exposed=ServiceWorker, SecureContext] +partial interface ServiceWorkerGlobalScope { + attribute EventHandler onpush; + attribute EventHandler onpushsubscriptionchange; +}; + +[Exposed=ServiceWorker, SecureContext] +interface PushEvent : ExtendableEvent { + constructor(DOMString type, optional PushEventInit eventInitDict = {}); + readonly attribute PushMessageData? data; +}; + +typedef (BufferSource or USVString) PushMessageDataInit; + +dictionary PushEventInit : ExtendableEventInit { + PushMessageDataInit data; +}; + +[Exposed=ServiceWorker, SecureContext] +interface PushSubscriptionChangeEvent : ExtendableEvent { + constructor(DOMString type, optional PushSubscriptionChangeEventInit eventInitDict = {}); + readonly attribute PushSubscription? newSubscription; + readonly attribute PushSubscription? oldSubscription; +}; + +dictionary PushSubscriptionChangeEventInit : ExtendableEventInit { + PushSubscription newSubscription = null; + PushSubscription oldSubscription = null; +}; |