maxcountryman_web_sys/features/
gen_PushSubscription.rs

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