]> git.proxmox.com Git - rustc.git/blame - vendor/web-sys/src/features/gen_CompositionEventInit.rs
New upstream version 1.72.1+dfsg1
[rustc.git] / vendor / web-sys / src / features / gen_CompositionEventInit.rs
CommitLineData
49aad941 1#![allow(unused_imports)]
fe692bf9 2#![allow(clippy::all)]
49aad941
FG
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CompositionEventInit)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `CompositionEventInit` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"]
12 pub type CompositionEventInit;
13}
14impl CompositionEventInit {
15 #[doc = "Construct a new `CompositionEventInit`."]
16 #[doc = ""]
17 #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"]
18 pub fn new() -> Self {
19 #[allow(unused_mut)]
20 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
21 ret
22 }
23 #[doc = "Change the `bubbles` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"]
26 pub fn bubbles(&mut self, val: bool) -> &mut Self {
27 use wasm_bindgen::JsValue;
28 let r = ::js_sys::Reflect::set(
29 self.as_ref(),
30 &JsValue::from("bubbles"),
31 &JsValue::from(val),
32 );
33 debug_assert!(
34 r.is_ok(),
35 "setting properties should never fail on our dictionary objects"
36 );
37 let _ = r;
38 self
39 }
40 #[doc = "Change the `cancelable` field of this object."]
41 #[doc = ""]
42 #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"]
43 pub fn cancelable(&mut self, val: bool) -> &mut Self {
44 use wasm_bindgen::JsValue;
45 let r = ::js_sys::Reflect::set(
46 self.as_ref(),
47 &JsValue::from("cancelable"),
48 &JsValue::from(val),
49 );
50 debug_assert!(
51 r.is_ok(),
52 "setting properties should never fail on our dictionary objects"
53 );
54 let _ = r;
55 self
56 }
57 #[doc = "Change the `composed` field of this object."]
58 #[doc = ""]
59 #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"]
60 pub fn composed(&mut self, val: bool) -> &mut Self {
61 use wasm_bindgen::JsValue;
62 let r = ::js_sys::Reflect::set(
63 self.as_ref(),
64 &JsValue::from("composed"),
65 &JsValue::from(val),
66 );
67 debug_assert!(
68 r.is_ok(),
69 "setting properties should never fail on our dictionary objects"
70 );
71 let _ = r;
72 self
73 }
74 #[doc = "Change the `detail` field of this object."]
75 #[doc = ""]
76 #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"]
77 pub fn detail(&mut self, val: i32) -> &mut Self {
78 use wasm_bindgen::JsValue;
79 let r =
80 ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val));
81 debug_assert!(
82 r.is_ok(),
83 "setting properties should never fail on our dictionary objects"
84 );
85 let _ = r;
86 self
87 }
88 #[cfg(feature = "Window")]
89 #[doc = "Change the `view` field of this object."]
90 #[doc = ""]
91 #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`, `Window`*"]
92 pub fn view(&mut self, val: Option<&Window>) -> &mut Self {
93 use wasm_bindgen::JsValue;
94 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val));
95 debug_assert!(
96 r.is_ok(),
97 "setting properties should never fail on our dictionary objects"
98 );
99 let _ = r;
100 self
101 }
102 #[doc = "Change the `data` field of this object."]
103 #[doc = ""]
104 #[doc = "*This API requires the following crate features to be activated: `CompositionEventInit`*"]
105 pub fn data(&mut self, val: &str) -> &mut Self {
106 use wasm_bindgen::JsValue;
107 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("data"), &JsValue::from(val));
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}
116impl Default for CompositionEventInit {
117 fn default() -> Self {
118 Self::new()
119 }
120}