Bug 1885602 - Part 5: Implement navigating to the SUMO help topic from the menu heade...
[gecko.git] / dom / webidl / PushManager.webidl
blobff99e294b53529b187fdf40e2c97e14caae3a027
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 dictionary PushSubscriptionOptionsInit {
11   // boolean userVisibleOnly = false;
12   (BufferSource or DOMString)? applicationServerKey = null;
15 // The main thread JS implementation. Please see comments in
16 // dom/push/PushManager.h for the split between PushManagerImpl and PushManager.
17 [JSImplementation="@mozilla.org/push/PushManager;1",
18  ChromeOnly,
19  Exposed=Window]
20 interface PushManagerImpl {
21   [Throws]
22   constructor(DOMString scope);
24   Promise<PushSubscription>    subscribe(optional PushSubscriptionOptionsInit options = {});
25   Promise<PushSubscription?>   getSubscription();
26   Promise<PermissionState> permissionState(optional PushSubscriptionOptionsInit options = {});
29 [Exposed=(Window,Worker), Func="PushManager::IsEnabled"]
30 interface PushManager {
31   [Throws, ChromeOnly]
32   constructor(DOMString scope);
34   [Throws, UseCounter]
35   Promise<PushSubscription>    subscribe(optional PushSubscriptionOptionsInit options = {});
36   [Throws]
37   Promise<PushSubscription?>   getSubscription();
38   [Throws]
39   Promise<PermissionState> permissionState(optional PushSubscriptionOptionsInit options = {});