Files
sousa-gecko/testing/web-platform/tests/interfaces/push-api.idl
T
github-actions[bot] 264cdcfc06 Bug 1990225 [wpt PR 55010] - Sync interfaces/ with @webref/idl 3.68.0, a=testonly
Automatic update from web-platform-tests
Sync interfaces/ with @webref/idl 3.68.0 (#55010)

Co-authored-by: wpt-pr-bot <wpt-pr-bot@users.noreply.github.com>
--

wpt-commits: e1e2034e8acaf44ae716aaf43ae3027d2dc0d10b
wpt-pr: 55010
2025-09-26 12:08:23 +00:00

99 lines
2.9 KiB
Plaintext

// 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]
interface mixin PushManagerAttribute {
readonly attribute PushManager pushManager;
};
Window includes PushManagerAttribute;
ServiceWorkerRegistration includes PushManagerAttribute;
[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();
Uint8Array bytes();
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;
readonly attribute Notification? notification;
};
dictionary PushEventInit : ExtendableEventInit {
PushMessageDataInit? data = null;
Notification? notification = null;
};
typedef (BufferSource or USVString) PushMessageDataInit;
[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;
};