maxcountryman_web_sys/features/
gen_ClientRectsAndTexts.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ClientRectsAndTexts)]
7 #[derive(Debug, Clone, PartialEq, Eq)]
8 #[doc = "The `ClientRectsAndTexts` dictionary."]
9 #[doc = ""]
10 #[doc = "*This API requires the following crate features to be activated: `ClientRectsAndTexts`*"]
11 pub type ClientRectsAndTexts;
12}
13impl ClientRectsAndTexts {
14 #[cfg(feature = "DomRectList")]
15 #[doc = "Construct a new `ClientRectsAndTexts`."]
16 #[doc = ""]
17 #[doc = "*This API requires the following crate features to be activated: `ClientRectsAndTexts`, `DomRectList`*"]
18 pub fn new(rect_list: &DomRectList, text_list: &::wasm_bindgen::JsValue) -> Self {
19 #[allow(unused_mut)]
20 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
21 ret.rect_list(rect_list);
22 ret.text_list(text_list);
23 ret
24 }
25 #[cfg(feature = "DomRectList")]
26 #[doc = "Change the `rectList` field of this object."]
27 #[doc = ""]
28 #[doc = "*This API requires the following crate features to be activated: `ClientRectsAndTexts`, `DomRectList`*"]
29 pub fn rect_list(&mut self, val: &DomRectList) -> &mut Self {
30 use wasm_bindgen::JsValue;
31 let r = ::js_sys::Reflect::set(
32 self.as_ref(),
33 &JsValue::from("rectList"),
34 &JsValue::from(val),
35 );
36 debug_assert!(
37 r.is_ok(),
38 "setting properties should never fail on our dictionary objects"
39 );
40 let _ = r;
41 self
42 }
43 #[doc = "Change the `textList` field of this object."]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `ClientRectsAndTexts`*"]
46 pub fn text_list(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
47 use wasm_bindgen::JsValue;
48 let r = ::js_sys::Reflect::set(
49 self.as_ref(),
50 &JsValue::from("textList"),
51 &JsValue::from(val),
52 );
53 debug_assert!(
54 r.is_ok(),
55 "setting properties should never fail on our dictionary objects"
56 );
57 let _ = r;
58 self
59 }
60}