web_sys/features/
gen_PushSubscription.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = PushSubscription , typescript_type = "PushSubscription")]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `PushSubscription` class."]
10    #[doc = ""]
11    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushSubscription)"]
12    #[doc = ""]
13    #[doc = "*This API requires the following crate features to be activated: `PushSubscription`*"]
14    pub type PushSubscription;
15    # [wasm_bindgen (structural , method , getter , js_class = "PushSubscription" , js_name = endpoint)]
16    #[doc = "Getter for the `endpoint` field of this object."]
17    #[doc = ""]
18    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushSubscription/endpoint)"]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `PushSubscription`*"]
21    pub fn endpoint(this: &PushSubscription) -> ::alloc::string::String;
22    #[cfg(feature = "PushSubscriptionOptions")]
23    # [wasm_bindgen (structural , method , getter , js_class = "PushSubscription" , js_name = options)]
24    #[doc = "Getter for the `options` field of this object."]
25    #[doc = ""]
26    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushSubscription/options)"]
27    #[doc = ""]
28    #[doc = "*This API requires the following crate features to be activated: `PushSubscription`, `PushSubscriptionOptions`*"]
29    pub fn options(this: &PushSubscription) -> PushSubscriptionOptions;
30    #[cfg(feature = "PushEncryptionKeyName")]
31    # [wasm_bindgen (catch , method , structural , js_class = "PushSubscription" , js_name = getKey)]
32    #[doc = "The `getKey()` method."]
33    #[doc = ""]
34    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushSubscription/getKey)"]
35    #[doc = ""]
36    #[doc = "*This API requires the following crate features to be activated: `PushEncryptionKeyName`, `PushSubscription`*"]
37    pub fn get_key(
38        this: &PushSubscription,
39        name: PushEncryptionKeyName,
40    ) -> Result<Option<::js_sys::ArrayBuffer>, JsValue>;
41    #[cfg(feature = "PushSubscriptionJson")]
42    # [wasm_bindgen (catch , method , structural , js_class = "PushSubscription" , js_name = toJSON)]
43    #[doc = "The `toJSON()` method."]
44    #[doc = ""]
45    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushSubscription/toJSON)"]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `PushSubscription`, `PushSubscriptionJson`*"]
48    pub fn to_json(this: &PushSubscription) -> Result<PushSubscriptionJson, JsValue>;
49    # [wasm_bindgen (catch , method , structural , js_class = "PushSubscription" , js_name = unsubscribe)]
50    #[doc = "The `unsubscribe()` method."]
51    #[doc = ""]
52    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushSubscription/unsubscribe)"]
53    #[doc = ""]
54    #[doc = "*This API requires the following crate features to be activated: `PushSubscription`*"]
55    pub fn unsubscribe(this: &PushSubscription) -> Result<::js_sys::Promise, JsValue>;
56}