web_sys/features/
gen_NotificationEvent.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 #[wasm_bindgen(
8 extends = "ExtendableEvent",
9 extends = "Event",
10 extends = "::js_sys::Object",
11 js_name = "NotificationEvent",
12 typescript_type = "NotificationEvent"
13 )]
14 #[derive(Debug, Clone, PartialEq, Eq)]
15 #[doc = "The `NotificationEvent` class."]
16 #[doc = ""]
17 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/NotificationEvent)"]
18 #[doc = ""]
19 #[doc = "*This API requires the following crate features to be activated: `NotificationEvent`*"]
20 pub type NotificationEvent;
21 #[cfg(feature = "Notification")]
22 #[wasm_bindgen(
23 method,
24 getter,
25 js_class = "NotificationEvent",
26 js_name = "notification"
27 )]
28 #[doc = "Getter for the `notification` field of this object."]
29 #[doc = ""]
30 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/NotificationEvent/notification)"]
31 #[doc = ""]
32 #[doc = "*This API requires the following crate features to be activated: `Notification`, `NotificationEvent`*"]
33 pub fn notification(this: &NotificationEvent) -> Notification;
34 #[cfg(feature = "NotificationEventInit")]
35 #[wasm_bindgen(catch, constructor, js_class = "NotificationEvent")]
36 #[doc = "The `new NotificationEvent(..)` constructor, creating a new instance of `NotificationEvent`."]
37 #[doc = ""]
38 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/NotificationEvent/NotificationEvent)"]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `NotificationEvent`, `NotificationEventInit`*"]
41 pub fn new(
42 type_: &str,
43 event_init_dict: &NotificationEventInit,
44 ) -> Result<NotificationEvent, JsValue>;
45}