web_sys/features/
gen_NotificationOptions.rs1#![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 = NotificationOptions)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `NotificationOptions` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
12 pub type NotificationOptions;
13 #[doc = "Get the `actions` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
16 #[wasm_bindgen(method, getter = "actions")]
17 pub fn get_actions(this: &NotificationOptions) -> Option<::js_sys::Array>;
18 #[doc = "Change the `actions` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
21 #[wasm_bindgen(method, setter = "actions")]
22 pub fn set_actions(this: &NotificationOptions, val: &::wasm_bindgen::JsValue);
23 #[doc = "Get the `badge` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
26 #[wasm_bindgen(method, getter = "badge")]
27 pub fn get_badge(this: &NotificationOptions) -> Option<::alloc::string::String>;
28 #[doc = "Change the `badge` field of this object."]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
31 #[wasm_bindgen(method, setter = "badge")]
32 pub fn set_badge(this: &NotificationOptions, val: &str);
33 #[doc = "Get the `body` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
36 #[wasm_bindgen(method, getter = "body")]
37 pub fn get_body(this: &NotificationOptions) -> Option<::alloc::string::String>;
38 #[doc = "Change the `body` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
41 #[wasm_bindgen(method, setter = "body")]
42 pub fn set_body(this: &NotificationOptions, val: &str);
43 #[doc = "Get the `data` field of this object."]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
46 #[wasm_bindgen(method, getter = "data")]
47 pub fn get_data(this: &NotificationOptions) -> ::wasm_bindgen::JsValue;
48 #[doc = "Change the `data` field of this object."]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
51 #[wasm_bindgen(method, setter = "data")]
52 pub fn set_data(this: &NotificationOptions, val: &::wasm_bindgen::JsValue);
53 #[cfg(feature = "NotificationDirection")]
54 #[doc = "Get the `dir` field of this object."]
55 #[doc = ""]
56 #[doc = "*This API requires the following crate features to be activated: `NotificationDirection`, `NotificationOptions`*"]
57 #[wasm_bindgen(method, getter = "dir")]
58 pub fn get_dir(this: &NotificationOptions) -> Option<NotificationDirection>;
59 #[cfg(feature = "NotificationDirection")]
60 #[doc = "Change the `dir` field of this object."]
61 #[doc = ""]
62 #[doc = "*This API requires the following crate features to be activated: `NotificationDirection`, `NotificationOptions`*"]
63 #[wasm_bindgen(method, setter = "dir")]
64 pub fn set_dir(this: &NotificationOptions, val: NotificationDirection);
65 #[doc = "Get the `icon` field of this object."]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
68 #[wasm_bindgen(method, getter = "icon")]
69 pub fn get_icon(this: &NotificationOptions) -> Option<::alloc::string::String>;
70 #[doc = "Change the `icon` field of this object."]
71 #[doc = ""]
72 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
73 #[wasm_bindgen(method, setter = "icon")]
74 pub fn set_icon(this: &NotificationOptions, val: &str);
75 #[doc = "Get the `image` field of this object."]
76 #[doc = ""]
77 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
78 #[wasm_bindgen(method, getter = "image")]
79 pub fn get_image(this: &NotificationOptions) -> Option<::alloc::string::String>;
80 #[doc = "Change the `image` field of this object."]
81 #[doc = ""]
82 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
83 #[wasm_bindgen(method, setter = "image")]
84 pub fn set_image(this: &NotificationOptions, val: &str);
85 #[doc = "Get the `lang` field of this object."]
86 #[doc = ""]
87 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
88 #[wasm_bindgen(method, getter = "lang")]
89 pub fn get_lang(this: &NotificationOptions) -> Option<::alloc::string::String>;
90 #[doc = "Change the `lang` field of this object."]
91 #[doc = ""]
92 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
93 #[wasm_bindgen(method, setter = "lang")]
94 pub fn set_lang(this: &NotificationOptions, val: &str);
95 #[doc = "Get the `renotify` field of this object."]
96 #[doc = ""]
97 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
98 #[wasm_bindgen(method, getter = "renotify")]
99 pub fn get_renotify(this: &NotificationOptions) -> Option<bool>;
100 #[doc = "Change the `renotify` field of this object."]
101 #[doc = ""]
102 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
103 #[wasm_bindgen(method, setter = "renotify")]
104 pub fn set_renotify(this: &NotificationOptions, val: bool);
105 #[doc = "Get the `requireInteraction` field of this object."]
106 #[doc = ""]
107 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
108 #[wasm_bindgen(method, getter = "requireInteraction")]
109 pub fn get_require_interaction(this: &NotificationOptions) -> Option<bool>;
110 #[doc = "Change the `requireInteraction` field of this object."]
111 #[doc = ""]
112 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
113 #[wasm_bindgen(method, setter = "requireInteraction")]
114 pub fn set_require_interaction(this: &NotificationOptions, val: bool);
115 #[doc = "Get the `silent` field of this object."]
116 #[doc = ""]
117 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
118 #[wasm_bindgen(method, getter = "silent")]
119 pub fn get_silent(this: &NotificationOptions) -> Option<bool>;
120 #[doc = "Change the `silent` field of this object."]
121 #[doc = ""]
122 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
123 #[wasm_bindgen(method, setter = "silent")]
124 pub fn set_silent(this: &NotificationOptions, val: Option<bool>);
125 #[doc = "Get the `tag` field of this object."]
126 #[doc = ""]
127 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
128 #[wasm_bindgen(method, getter = "tag")]
129 pub fn get_tag(this: &NotificationOptions) -> Option<::alloc::string::String>;
130 #[doc = "Change the `tag` field of this object."]
131 #[doc = ""]
132 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
133 #[wasm_bindgen(method, setter = "tag")]
134 pub fn set_tag(this: &NotificationOptions, val: &str);
135 #[doc = "Get the `timestamp` field of this object."]
136 #[doc = ""]
137 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
138 #[wasm_bindgen(method, getter = "timestamp")]
139 pub fn get_timestamp(this: &NotificationOptions) -> Option<f64>;
140 #[doc = "Change the `timestamp` field of this object."]
141 #[doc = ""]
142 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
143 #[wasm_bindgen(method, setter = "timestamp")]
144 pub fn set_timestamp(this: &NotificationOptions, val: f64);
145 #[doc = "Get the `vibrate` field of this object."]
146 #[doc = ""]
147 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
148 #[wasm_bindgen(method, getter = "vibrate")]
149 pub fn get_vibrate(this: &NotificationOptions) -> ::wasm_bindgen::JsValue;
150 #[doc = "Change the `vibrate` field of this object."]
151 #[doc = ""]
152 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
153 #[wasm_bindgen(method, setter = "vibrate")]
154 pub fn set_vibrate(this: &NotificationOptions, val: &::wasm_bindgen::JsValue);
155}
156impl NotificationOptions {
157 #[doc = "Construct a new `NotificationOptions`."]
158 #[doc = ""]
159 #[doc = "*This API requires the following crate features to be activated: `NotificationOptions`*"]
160 pub fn new() -> Self {
161 #[allow(unused_mut)]
162 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
163 ret
164 }
165 #[deprecated = "Use `set_actions()` instead."]
166 pub fn actions(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
167 self.set_actions(val);
168 self
169 }
170 #[deprecated = "Use `set_badge()` instead."]
171 pub fn badge(&mut self, val: &str) -> &mut Self {
172 self.set_badge(val);
173 self
174 }
175 #[deprecated = "Use `set_body()` instead."]
176 pub fn body(&mut self, val: &str) -> &mut Self {
177 self.set_body(val);
178 self
179 }
180 #[deprecated = "Use `set_data()` instead."]
181 pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
182 self.set_data(val);
183 self
184 }
185 #[cfg(feature = "NotificationDirection")]
186 #[deprecated = "Use `set_dir()` instead."]
187 pub fn dir(&mut self, val: NotificationDirection) -> &mut Self {
188 self.set_dir(val);
189 self
190 }
191 #[deprecated = "Use `set_icon()` instead."]
192 pub fn icon(&mut self, val: &str) -> &mut Self {
193 self.set_icon(val);
194 self
195 }
196 #[deprecated = "Use `set_image()` instead."]
197 pub fn image(&mut self, val: &str) -> &mut Self {
198 self.set_image(val);
199 self
200 }
201 #[deprecated = "Use `set_lang()` instead."]
202 pub fn lang(&mut self, val: &str) -> &mut Self {
203 self.set_lang(val);
204 self
205 }
206 #[deprecated = "Use `set_renotify()` instead."]
207 pub fn renotify(&mut self, val: bool) -> &mut Self {
208 self.set_renotify(val);
209 self
210 }
211 #[deprecated = "Use `set_require_interaction()` instead."]
212 pub fn require_interaction(&mut self, val: bool) -> &mut Self {
213 self.set_require_interaction(val);
214 self
215 }
216 #[deprecated = "Use `set_silent()` instead."]
217 pub fn silent(&mut self, val: Option<bool>) -> &mut Self {
218 self.set_silent(val);
219 self
220 }
221 #[deprecated = "Use `set_tag()` instead."]
222 pub fn tag(&mut self, val: &str) -> &mut Self {
223 self.set_tag(val);
224 self
225 }
226 #[deprecated = "Use `set_timestamp()` instead."]
227 pub fn timestamp(&mut self, val: f64) -> &mut Self {
228 self.set_timestamp(val);
229 self
230 }
231 #[deprecated = "Use `set_vibrate()` instead."]
232 pub fn vibrate(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
233 self.set_vibrate(val);
234 self
235 }
236}
237impl Default for NotificationOptions {
238 fn default() -> Self {
239 Self::new()
240 }
241}