maxcountryman_web_sys/features/
gen_CaretStateChangedEventInit.rs

1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CaretStateChangedEventInit)]
7    #[derive(Debug, Clone, PartialEq, Eq)]
8    #[doc = "The `CaretStateChangedEventInit` dictionary."]
9    #[doc = ""]
10    #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"]
11    pub type CaretStateChangedEventInit;
12}
13impl CaretStateChangedEventInit {
14    #[doc = "Construct a new `CaretStateChangedEventInit`."]
15    #[doc = ""]
16    #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"]
17    pub fn new() -> Self {
18        #[allow(unused_mut)]
19        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
20        ret
21    }
22    #[doc = "Change the `bubbles` field of this object."]
23    #[doc = ""]
24    #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"]
25    pub fn bubbles(&mut self, val: bool) -> &mut Self {
26        use wasm_bindgen::JsValue;
27        let r = ::js_sys::Reflect::set(
28            self.as_ref(),
29            &JsValue::from("bubbles"),
30            &JsValue::from(val),
31        );
32        debug_assert!(
33            r.is_ok(),
34            "setting properties should never fail on our dictionary objects"
35        );
36        let _ = r;
37        self
38    }
39    #[doc = "Change the `cancelable` field of this object."]
40    #[doc = ""]
41    #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"]
42    pub fn cancelable(&mut self, val: bool) -> &mut Self {
43        use wasm_bindgen::JsValue;
44        let r = ::js_sys::Reflect::set(
45            self.as_ref(),
46            &JsValue::from("cancelable"),
47            &JsValue::from(val),
48        );
49        debug_assert!(
50            r.is_ok(),
51            "setting properties should never fail on our dictionary objects"
52        );
53        let _ = r;
54        self
55    }
56    #[doc = "Change the `composed` field of this object."]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"]
59    pub fn composed(&mut self, val: bool) -> &mut Self {
60        use wasm_bindgen::JsValue;
61        let r = ::js_sys::Reflect::set(
62            self.as_ref(),
63            &JsValue::from("composed"),
64            &JsValue::from(val),
65        );
66        debug_assert!(
67            r.is_ok(),
68            "setting properties should never fail on our dictionary objects"
69        );
70        let _ = r;
71        self
72    }
73    #[cfg(feature = "DomRectReadOnly")]
74    #[doc = "Change the `boundingClientRect` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`, `DomRectReadOnly`*"]
77    pub fn bounding_client_rect(&mut self, val: Option<&DomRectReadOnly>) -> &mut Self {
78        use wasm_bindgen::JsValue;
79        let r = ::js_sys::Reflect::set(
80            self.as_ref(),
81            &JsValue::from("boundingClientRect"),
82            &JsValue::from(val),
83        );
84        debug_assert!(
85            r.is_ok(),
86            "setting properties should never fail on our dictionary objects"
87        );
88        let _ = r;
89        self
90    }
91    #[doc = "Change the `caretVisible` field of this object."]
92    #[doc = ""]
93    #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"]
94    pub fn caret_visible(&mut self, val: bool) -> &mut Self {
95        use wasm_bindgen::JsValue;
96        let r = ::js_sys::Reflect::set(
97            self.as_ref(),
98            &JsValue::from("caretVisible"),
99            &JsValue::from(val),
100        );
101        debug_assert!(
102            r.is_ok(),
103            "setting properties should never fail on our dictionary objects"
104        );
105        let _ = r;
106        self
107    }
108    #[doc = "Change the `caretVisuallyVisible` field of this object."]
109    #[doc = ""]
110    #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"]
111    pub fn caret_visually_visible(&mut self, val: bool) -> &mut Self {
112        use wasm_bindgen::JsValue;
113        let r = ::js_sys::Reflect::set(
114            self.as_ref(),
115            &JsValue::from("caretVisuallyVisible"),
116            &JsValue::from(val),
117        );
118        debug_assert!(
119            r.is_ok(),
120            "setting properties should never fail on our dictionary objects"
121        );
122        let _ = r;
123        self
124    }
125    #[doc = "Change the `collapsed` field of this object."]
126    #[doc = ""]
127    #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"]
128    pub fn collapsed(&mut self, val: bool) -> &mut Self {
129        use wasm_bindgen::JsValue;
130        let r = ::js_sys::Reflect::set(
131            self.as_ref(),
132            &JsValue::from("collapsed"),
133            &JsValue::from(val),
134        );
135        debug_assert!(
136            r.is_ok(),
137            "setting properties should never fail on our dictionary objects"
138        );
139        let _ = r;
140        self
141    }
142    #[cfg(feature = "CaretChangedReason")]
143    #[doc = "Change the `reason` field of this object."]
144    #[doc = ""]
145    #[doc = "*This API requires the following crate features to be activated: `CaretChangedReason`, `CaretStateChangedEventInit`*"]
146    pub fn reason(&mut self, val: CaretChangedReason) -> &mut Self {
147        use wasm_bindgen::JsValue;
148        let r =
149            ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reason"), &JsValue::from(val));
150        debug_assert!(
151            r.is_ok(),
152            "setting properties should never fail on our dictionary objects"
153        );
154        let _ = r;
155        self
156    }
157    #[doc = "Change the `selectedTextContent` field of this object."]
158    #[doc = ""]
159    #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"]
160    pub fn selected_text_content(&mut self, val: &str) -> &mut Self {
161        use wasm_bindgen::JsValue;
162        let r = ::js_sys::Reflect::set(
163            self.as_ref(),
164            &JsValue::from("selectedTextContent"),
165            &JsValue::from(val),
166        );
167        debug_assert!(
168            r.is_ok(),
169            "setting properties should never fail on our dictionary objects"
170        );
171        let _ = r;
172        self
173    }
174    #[doc = "Change the `selectionEditable` field of this object."]
175    #[doc = ""]
176    #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"]
177    pub fn selection_editable(&mut self, val: bool) -> &mut Self {
178        use wasm_bindgen::JsValue;
179        let r = ::js_sys::Reflect::set(
180            self.as_ref(),
181            &JsValue::from("selectionEditable"),
182            &JsValue::from(val),
183        );
184        debug_assert!(
185            r.is_ok(),
186            "setting properties should never fail on our dictionary objects"
187        );
188        let _ = r;
189        self
190    }
191    #[doc = "Change the `selectionVisible` field of this object."]
192    #[doc = ""]
193    #[doc = "*This API requires the following crate features to be activated: `CaretStateChangedEventInit`*"]
194    pub fn selection_visible(&mut self, val: bool) -> &mut Self {
195        use wasm_bindgen::JsValue;
196        let r = ::js_sys::Reflect::set(
197            self.as_ref(),
198            &JsValue::from("selectionVisible"),
199            &JsValue::from(val),
200        );
201        debug_assert!(
202            r.is_ok(),
203            "setting properties should never fail on our dictionary objects"
204        );
205        let _ = r;
206        self
207    }
208}
209impl Default for CaretStateChangedEventInit {
210    fn default() -> Self {
211        Self::new()
212    }
213}