1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = Notification , typescript_type = "Notification")]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `Notification` class."]
10 #[doc = ""]
11 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification)"]
12 #[doc = ""]
13 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
14 pub type Notification;
15 #[cfg(feature = "NotificationPermission")]
16 # [wasm_bindgen (structural , static_method_of = Notification , getter , js_class = "Notification" , js_name = permission)]
17 #[doc = "Getter for the `permission` field of this object."]
18 #[doc = ""]
19 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/permission)"]
20 #[doc = ""]
21 #[doc = "*This API requires the following crate features to be activated: `Notification`, `NotificationPermission`*"]
22 pub fn permission() -> NotificationPermission;
23 # [wasm_bindgen (structural , static_method_of = Notification , getter , js_class = "Notification" , js_name = maxActions)]
24 #[doc = "Getter for the `maxActions` field of this object."]
25 #[doc = ""]
26 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/maxActions)"]
27 #[doc = ""]
28 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
29 pub fn max_actions() -> u32;
30 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = onclick)]
31 #[doc = "Getter for the `onclick` field of this object."]
32 #[doc = ""]
33 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/onclick)"]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
36 pub fn onclick(this: &Notification) -> Option<::js_sys::Function>;
37 # [wasm_bindgen (structural , method , setter , js_class = "Notification" , js_name = onclick)]
38 #[doc = "Setter for the `onclick` field of this object."]
39 #[doc = ""]
40 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/onclick)"]
41 #[doc = ""]
42 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
43 pub fn set_onclick(this: &Notification, value: Option<&::js_sys::Function>);
44 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = onshow)]
45 #[doc = "Getter for the `onshow` field of this object."]
46 #[doc = ""]
47 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/onshow)"]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
50 pub fn onshow(this: &Notification) -> Option<::js_sys::Function>;
51 # [wasm_bindgen (structural , method , setter , js_class = "Notification" , js_name = onshow)]
52 #[doc = "Setter for the `onshow` field of this object."]
53 #[doc = ""]
54 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/onshow)"]
55 #[doc = ""]
56 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
57 pub fn set_onshow(this: &Notification, value: Option<&::js_sys::Function>);
58 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = onerror)]
59 #[doc = "Getter for the `onerror` field of this object."]
60 #[doc = ""]
61 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/onerror)"]
62 #[doc = ""]
63 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
64 pub fn onerror(this: &Notification) -> Option<::js_sys::Function>;
65 # [wasm_bindgen (structural , method , setter , js_class = "Notification" , js_name = onerror)]
66 #[doc = "Setter for the `onerror` field of this object."]
67 #[doc = ""]
68 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/onerror)"]
69 #[doc = ""]
70 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
71 pub fn set_onerror(this: &Notification, value: Option<&::js_sys::Function>);
72 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = onclose)]
73 #[doc = "Getter for the `onclose` field of this object."]
74 #[doc = ""]
75 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/onclose)"]
76 #[doc = ""]
77 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
78 pub fn onclose(this: &Notification) -> Option<::js_sys::Function>;
79 # [wasm_bindgen (structural , method , setter , js_class = "Notification" , js_name = onclose)]
80 #[doc = "Setter for the `onclose` field of this object."]
81 #[doc = ""]
82 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/onclose)"]
83 #[doc = ""]
84 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
85 pub fn set_onclose(this: &Notification, value: Option<&::js_sys::Function>);
86 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = title)]
87 #[doc = "Getter for the `title` field of this object."]
88 #[doc = ""]
89 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/title)"]
90 #[doc = ""]
91 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
92 pub fn title(this: &Notification) -> ::alloc::string::String;
93 #[cfg(feature = "NotificationDirection")]
94 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = dir)]
95 #[doc = "Getter for the `dir` field of this object."]
96 #[doc = ""]
97 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/dir)"]
98 #[doc = ""]
99 #[doc = "*This API requires the following crate features to be activated: `Notification`, `NotificationDirection`*"]
100 pub fn dir(this: &Notification) -> NotificationDirection;
101 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = lang)]
102 #[doc = "Getter for the `lang` field of this object."]
103 #[doc = ""]
104 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/lang)"]
105 #[doc = ""]
106 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
107 pub fn lang(this: &Notification) -> Option<::alloc::string::String>;
108 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = body)]
109 #[doc = "Getter for the `body` field of this object."]
110 #[doc = ""]
111 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/body)"]
112 #[doc = ""]
113 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
114 pub fn body(this: &Notification) -> Option<::alloc::string::String>;
115 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = tag)]
116 #[doc = "Getter for the `tag` field of this object."]
117 #[doc = ""]
118 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/tag)"]
119 #[doc = ""]
120 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
121 pub fn tag(this: &Notification) -> Option<::alloc::string::String>;
122 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = image)]
123 #[doc = "Getter for the `image` field of this object."]
124 #[doc = ""]
125 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/image)"]
126 #[doc = ""]
127 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
128 pub fn image(this: &Notification) -> ::alloc::string::String;
129 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = icon)]
130 #[doc = "Getter for the `icon` field of this object."]
131 #[doc = ""]
132 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/icon)"]
133 #[doc = ""]
134 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
135 pub fn icon(this: &Notification) -> Option<::alloc::string::String>;
136 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = badge)]
137 #[doc = "Getter for the `badge` field of this object."]
138 #[doc = ""]
139 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/badge)"]
140 #[doc = ""]
141 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
142 pub fn badge(this: &Notification) -> ::alloc::string::String;
143 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = vibrate)]
144 #[doc = "Getter for the `vibrate` field of this object."]
145 #[doc = ""]
146 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/vibrate)"]
147 #[doc = ""]
148 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
149 pub fn vibrate(this: &Notification) -> ::js_sys::Array;
150 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = timestamp)]
151 #[doc = "Getter for the `timestamp` field of this object."]
152 #[doc = ""]
153 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/timestamp)"]
154 #[doc = ""]
155 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
156 pub fn timestamp(this: &Notification) -> f64;
157 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = renotify)]
158 #[doc = "Getter for the `renotify` field of this object."]
159 #[doc = ""]
160 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/renotify)"]
161 #[doc = ""]
162 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
163 pub fn renotify(this: &Notification) -> bool;
164 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = silent)]
165 #[doc = "Getter for the `silent` field of this object."]
166 #[doc = ""]
167 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/silent)"]
168 #[doc = ""]
169 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
170 pub fn silent(this: &Notification) -> Option<bool>;
171 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = requireInteraction)]
172 #[doc = "Getter for the `requireInteraction` field of this object."]
173 #[doc = ""]
174 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/requireInteraction)"]
175 #[doc = ""]
176 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
177 pub fn require_interaction(this: &Notification) -> bool;
178 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = data)]
179 #[doc = "Getter for the `data` field of this object."]
180 #[doc = ""]
181 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/data)"]
182 #[doc = ""]
183 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
184 pub fn data(this: &Notification) -> ::wasm_bindgen::JsValue;
185 # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = actions)]
186 #[doc = "Getter for the `actions` field of this object."]
187 #[doc = ""]
188 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/actions)"]
189 #[doc = ""]
190 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
191 pub fn actions(this: &Notification) -> ::js_sys::Array;
192 #[wasm_bindgen(catch, constructor, js_class = "Notification")]
193 #[doc = "The `new Notification(..)` constructor, creating a new instance of `Notification`."]
194 #[doc = ""]
195 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/Notification)"]
196 #[doc = ""]
197 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
198 pub fn new(title: &str) -> Result<Notification, JsValue>;
199 #[cfg(feature = "NotificationOptions")]
200 #[wasm_bindgen(catch, constructor, js_class = "Notification")]
201 #[doc = "The `new Notification(..)` constructor, creating a new instance of `Notification`."]
202 #[doc = ""]
203 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/Notification)"]
204 #[doc = ""]
205 #[doc = "*This API requires the following crate features to be activated: `Notification`, `NotificationOptions`*"]
206 pub fn new_with_options(
207 title: &str,
208 options: &NotificationOptions,
209 ) -> Result<Notification, JsValue>;
210 # [wasm_bindgen (method , structural , js_class = "Notification" , js_name = close)]
211 #[doc = "The `close()` method."]
212 #[doc = ""]
213 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/close)"]
214 #[doc = ""]
215 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
216 pub fn close(this: &Notification);
217 # [wasm_bindgen (catch , static_method_of = Notification , js_class = "Notification" , js_name = requestPermission)]
218 #[doc = "The `requestPermission()` method."]
219 #[doc = ""]
220 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission_static)"]
221 #[doc = ""]
222 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
223 pub fn request_permission() -> Result<::js_sys::Promise, JsValue>;
224 # [wasm_bindgen (catch , static_method_of = Notification , js_class = "Notification" , js_name = requestPermission)]
225 #[doc = "The `requestPermission()` method."]
226 #[doc = ""]
227 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission_static)"]
228 #[doc = ""]
229 #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
230 pub fn request_permission_with_permission_callback(
231 permission_callback: &::js_sys::Function,
232 ) -> Result<::js_sys::Promise, JsValue>;
233}