Skip to main content

web_sys/features/
gen_PushManager.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "::js_sys::Object",
9        js_name = "PushManager",
10        typescript_type = "PushManager"
11    )]
12    #[derive(Debug, Clone, PartialEq, Eq)]
13    #[doc = "The `PushManager` class."]
14    #[doc = ""]
15    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushManager)"]
16    #[doc = ""]
17    #[doc = "*This API requires the following crate features to be activated: `PushManager`*"]
18    pub type PushManager;
19    #[wasm_bindgen(catch, method, js_class = "PushManager", js_name = "getSubscription")]
20    #[doc = "The `getSubscription()` method."]
21    #[doc = ""]
22    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushManager/getSubscription)"]
23    #[doc = ""]
24    #[doc = "*This API requires the following crate features to be activated: `PushManager`*"]
25    pub fn get_subscription(this: &PushManager) -> Result<::js_sys::Promise, JsValue>;
26    #[wasm_bindgen(catch, method, js_class = "PushManager", js_name = "permissionState")]
27    #[doc = "The `permissionState()` method."]
28    #[doc = ""]
29    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushManager/permissionState)"]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `PushManager`*"]
32    pub fn permission_state(this: &PushManager) -> Result<::js_sys::Promise, JsValue>;
33    #[cfg(feature = "PushSubscriptionOptionsInit")]
34    #[wasm_bindgen(catch, method, js_class = "PushManager", js_name = "permissionState")]
35    #[doc = "The `permissionState()` method."]
36    #[doc = ""]
37    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushManager/permissionState)"]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `PushManager`, `PushSubscriptionOptionsInit`*"]
40    pub fn permission_state_with_options(
41        this: &PushManager,
42        options: &PushSubscriptionOptionsInit,
43    ) -> Result<::js_sys::Promise, JsValue>;
44    #[wasm_bindgen(catch, method, js_class = "PushManager")]
45    #[doc = "The `subscribe()` method."]
46    #[doc = ""]
47    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushManager/subscribe)"]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `PushManager`*"]
50    pub fn subscribe(this: &PushManager) -> Result<::js_sys::Promise, JsValue>;
51    #[cfg(feature = "PushSubscriptionOptionsInit")]
52    #[wasm_bindgen(catch, method, js_class = "PushManager", js_name = "subscribe")]
53    #[doc = "The `subscribe()` method."]
54    #[doc = ""]
55    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushManager/subscribe)"]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `PushManager`, `PushSubscriptionOptionsInit`*"]
58    pub fn subscribe_with_options(
59        this: &PushManager,
60        options: &PushSubscriptionOptionsInit,
61    ) -> Result<::js_sys::Promise, JsValue>;
62}