maxcountryman_web_sys/features/
gen_ClipboardEventInit.rs

1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[cfg(web_sys_unstable_apis)]
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ClipboardEventInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `ClipboardEventInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"]
12    #[doc = ""]
13    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
14    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
15    pub type ClipboardEventInit;
16}
17#[cfg(web_sys_unstable_apis)]
18impl ClipboardEventInit {
19    #[doc = "Construct a new `ClipboardEventInit`."]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"]
22    #[doc = ""]
23    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
24    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
25    pub fn new() -> Self {
26        #[allow(unused_mut)]
27        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
28        ret
29    }
30    #[cfg(web_sys_unstable_apis)]
31    #[doc = "Change the `bubbles` field of this object."]
32    #[doc = ""]
33    #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"]
34    #[doc = ""]
35    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
36    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
37    pub fn bubbles(&mut self, val: bool) -> &mut Self {
38        use wasm_bindgen::JsValue;
39        let r = ::js_sys::Reflect::set(
40            self.as_ref(),
41            &JsValue::from("bubbles"),
42            &JsValue::from(val),
43        );
44        debug_assert!(
45            r.is_ok(),
46            "setting properties should never fail on our dictionary objects"
47        );
48        let _ = r;
49        self
50    }
51    #[cfg(web_sys_unstable_apis)]
52    #[doc = "Change the `cancelable` field of this object."]
53    #[doc = ""]
54    #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"]
55    #[doc = ""]
56    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
57    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
58    pub fn cancelable(&mut self, val: bool) -> &mut Self {
59        use wasm_bindgen::JsValue;
60        let r = ::js_sys::Reflect::set(
61            self.as_ref(),
62            &JsValue::from("cancelable"),
63            &JsValue::from(val),
64        );
65        debug_assert!(
66            r.is_ok(),
67            "setting properties should never fail on our dictionary objects"
68        );
69        let _ = r;
70        self
71    }
72    #[cfg(web_sys_unstable_apis)]
73    #[doc = "Change the `composed` field of this object."]
74    #[doc = ""]
75    #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`*"]
76    #[doc = ""]
77    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
78    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
79    pub fn composed(&mut self, val: bool) -> &mut Self {
80        use wasm_bindgen::JsValue;
81        let r = ::js_sys::Reflect::set(
82            self.as_ref(),
83            &JsValue::from("composed"),
84            &JsValue::from(val),
85        );
86        debug_assert!(
87            r.is_ok(),
88            "setting properties should never fail on our dictionary objects"
89        );
90        let _ = r;
91        self
92    }
93    #[cfg(web_sys_unstable_apis)]
94    #[cfg(feature = "DataTransfer")]
95    #[doc = "Change the `clipboardData` field of this object."]
96    #[doc = ""]
97    #[doc = "*This API requires the following crate features to be activated: `ClipboardEventInit`, `DataTransfer`*"]
98    #[doc = ""]
99    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
100    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
101    pub fn clipboard_data(&mut self, val: Option<&DataTransfer>) -> &mut Self {
102        use wasm_bindgen::JsValue;
103        let r = ::js_sys::Reflect::set(
104            self.as_ref(),
105            &JsValue::from("clipboardData"),
106            &JsValue::from(val),
107        );
108        debug_assert!(
109            r.is_ok(),
110            "setting properties should never fail on our dictionary objects"
111        );
112        let _ = r;
113        self
114    }
115}
116#[cfg(web_sys_unstable_apis)]
117impl Default for ClipboardEventInit {
118    fn default() -> Self {
119        Self::new()
120    }
121}