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