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