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