web_sys/features/
gen_NotificationAction.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 = NotificationAction)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `NotificationAction` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"]
12    pub type NotificationAction;
13    #[doc = "Get the `action` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"]
16    #[wasm_bindgen(method, getter = "action")]
17    pub fn get_action(this: &NotificationAction) -> ::alloc::string::String;
18    #[doc = "Change the `action` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"]
21    #[wasm_bindgen(method, setter = "action")]
22    pub fn set_action(this: &NotificationAction, val: &str);
23    #[doc = "Get the `icon` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"]
26    #[wasm_bindgen(method, getter = "icon")]
27    pub fn get_icon(this: &NotificationAction) -> Option<::alloc::string::String>;
28    #[doc = "Change the `icon` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"]
31    #[wasm_bindgen(method, setter = "icon")]
32    pub fn set_icon(this: &NotificationAction, val: &str);
33    #[doc = "Get the `title` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"]
36    #[wasm_bindgen(method, getter = "title")]
37    pub fn get_title(this: &NotificationAction) -> ::alloc::string::String;
38    #[doc = "Change the `title` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"]
41    #[wasm_bindgen(method, setter = "title")]
42    pub fn set_title(this: &NotificationAction, val: &str);
43}
44impl NotificationAction {
45    #[doc = "Construct a new `NotificationAction`."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `NotificationAction`*"]
48    pub fn new(action: &str, title: &str) -> Self {
49        #[allow(unused_mut)]
50        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
51        ret.set_action(action);
52        ret.set_title(title);
53        ret
54    }
55    #[deprecated = "Use `set_action()` instead."]
56    pub fn action(&mut self, val: &str) -> &mut Self {
57        self.set_action(val);
58        self
59    }
60    #[deprecated = "Use `set_icon()` instead."]
61    pub fn icon(&mut self, val: &str) -> &mut Self {
62        self.set_icon(val);
63        self
64    }
65    #[deprecated = "Use `set_title()` instead."]
66    pub fn title(&mut self, val: &str) -> &mut Self {
67        self.set_title(val);
68        self
69    }
70}