Backed out 2 changesets (bug 1908320) for causing wr failures on align-items-baseline...
[gecko.git] / dom / webidl / PushSubscription.webidl
blob25edfd4d55990d5ed85e0743de7ade2134848d1b
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is
7 * https://w3c.github.io/push-api/
8 */
10 interface Principal;
12 enum PushEncryptionKeyName
14   "p256dh",
15   "auth"
18 dictionary PushSubscriptionKeys
20   ByteString p256dh;
21   ByteString auth;
24 dictionary PushSubscriptionJSON
26   USVString endpoint;
27   // FIXME: bug 1493860: should this "= {}" be here?  For that matter, this
28   // PushSubscriptionKeys thing is not even in the spec; "keys" is a record
29   // there.
30   PushSubscriptionKeys keys = {};
31   EpochTimeStamp? expirationTime;
34 dictionary PushSubscriptionInit
36   required USVString endpoint;
37   required USVString scope;
38   ArrayBuffer? p256dhKey = null;
39   ArrayBuffer? authSecret = null;
40   BufferSource? appServerKey = null;
41   EpochTimeStamp? expirationTime = null;
44 [Exposed=(Window,Worker), Func="ServiceWorkerVisible"]
45 interface PushSubscription
47   [Throws, ChromeOnly]
48   constructor(PushSubscriptionInit initDict);
50   readonly attribute USVString endpoint;
51   readonly attribute PushSubscriptionOptions options;
52   readonly attribute EpochTimeStamp? expirationTime;
53   [Throws]
54   ArrayBuffer? getKey(PushEncryptionKeyName name);
55   [NewObject, UseCounter]
56   Promise<boolean> unsubscribe();
58   // Implements the custom serializer specified in Push API, section 9.
59   [Throws]
60   PushSubscriptionJSON toJSON();