mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-09 21:00:42 +02:00
Automatic update from web-platform-tests Update interfaces/push-api.idl (#18954) Source: https://github.com/tidoust/reffy-reports/blob/d6ebeec/whatwg/idl/push-api.idl Build: https://travis-ci.org/tidoust/reffy-reports/builds/583016313 -- wpt-commits: 40ca0893dc71bb94bb770c9be9ec67a2cbb4afc8 wpt-pr: 18954
95 lines
2.7 KiB
Text
95 lines
2.7 KiB
Text
// GENERATED CONTENT - DO NOT EDIT
|
|
// Content was automatically extracted by Reffy into reffy-reports
|
|
// (https://github.com/tidoust/reffy-reports)
|
|
// Source: Push API (https://w3c.github.io/push-api/)
|
|
|
|
[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<PushPermissionState> 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 DOMTimeStamp? expirationTime;
|
|
[SameObject] readonly attribute PushSubscriptionOptions options;
|
|
ArrayBuffer? getKey(PushEncryptionKeyName name);
|
|
Promise<boolean> unsubscribe();
|
|
|
|
PushSubscriptionJSON toJSON();
|
|
};
|
|
|
|
dictionary PushSubscriptionJSON {
|
|
USVString endpoint;
|
|
DOMTimeStamp? expirationTime;
|
|
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;
|
|
};
|
|
|
|
enum PushPermissionState {
|
|
"denied",
|
|
"granted",
|
|
"prompt",
|
|
};
|