Skip to main content

web_sys/features/
gen_CommandEvent.rs

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