Skip to main content

web_sys/features/
gen_PushEvent.rs

1#![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 = "PushEvent",
12        typescript_type = "PushEvent"
13    )]
14    #[derive(Debug, Clone, PartialEq, Eq)]
15    #[doc = "The `PushEvent` class."]
16    #[doc = ""]
17    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushEvent)"]
18    #[doc = ""]
19    #[doc = "*This API requires the following crate features to be activated: `PushEvent`*"]
20    pub type PushEvent;
21    #[cfg(feature = "PushMessageData")]
22    #[wasm_bindgen(method, getter, js_class = "PushEvent", js_name = "data")]
23    #[doc = "Getter for the `data` field of this object."]
24    #[doc = ""]
25    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushEvent/data)"]
26    #[doc = ""]
27    #[doc = "*This API requires the following crate features to be activated: `PushEvent`, `PushMessageData`*"]
28    pub fn data(this: &PushEvent) -> Option<PushMessageData>;
29    #[wasm_bindgen(catch, constructor, js_class = "PushEvent")]
30    #[doc = "The `new PushEvent(..)` constructor, creating a new instance of `PushEvent`."]
31    #[doc = ""]
32    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushEvent/PushEvent)"]
33    #[doc = ""]
34    #[doc = "*This API requires the following crate features to be activated: `PushEvent`*"]
35    pub fn new(type_: &str) -> Result<PushEvent, JsValue>;
36    #[cfg(feature = "PushEventInit")]
37    #[wasm_bindgen(catch, constructor, js_class = "PushEvent")]
38    #[doc = "The `new PushEvent(..)` constructor, creating a new instance of `PushEvent`."]
39    #[doc = ""]
40    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/PushEvent/PushEvent)"]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `PushEvent`, `PushEventInit`*"]
43    pub fn new_with_event_init_dict(
44        type_: &str,
45        event_init_dict: &PushEventInit,
46    ) -> Result<PushEvent, JsValue>;
47}