web_sys/features/
gen_DomRectInit.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = DOMRectInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `DomRectInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"]
12    pub type DomRectInit;
13    #[doc = "Get the `height` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"]
16    #[wasm_bindgen(method, getter = "height")]
17    pub fn get_height(this: &DomRectInit) -> Option<f64>;
18    #[doc = "Change the `height` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"]
21    #[wasm_bindgen(method, setter = "height")]
22    pub fn set_height(this: &DomRectInit, val: f64);
23    #[doc = "Get the `width` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"]
26    #[wasm_bindgen(method, getter = "width")]
27    pub fn get_width(this: &DomRectInit) -> Option<f64>;
28    #[doc = "Change the `width` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"]
31    #[wasm_bindgen(method, setter = "width")]
32    pub fn set_width(this: &DomRectInit, val: f64);
33    #[doc = "Get the `x` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"]
36    #[wasm_bindgen(method, getter = "x")]
37    pub fn get_x(this: &DomRectInit) -> Option<f64>;
38    #[doc = "Change the `x` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"]
41    #[wasm_bindgen(method, setter = "x")]
42    pub fn set_x(this: &DomRectInit, val: f64);
43    #[doc = "Get the `y` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"]
46    #[wasm_bindgen(method, getter = "y")]
47    pub fn get_y(this: &DomRectInit) -> Option<f64>;
48    #[doc = "Change the `y` field of this object."]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"]
51    #[wasm_bindgen(method, setter = "y")]
52    pub fn set_y(this: &DomRectInit, val: f64);
53}
54impl DomRectInit {
55    #[doc = "Construct a new `DomRectInit`."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `DomRectInit`*"]
58    pub fn new() -> Self {
59        #[allow(unused_mut)]
60        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
61        ret
62    }
63    #[deprecated = "Use `set_height()` instead."]
64    pub fn height(&mut self, val: f64) -> &mut Self {
65        self.set_height(val);
66        self
67    }
68    #[deprecated = "Use `set_width()` instead."]
69    pub fn width(&mut self, val: f64) -> &mut Self {
70        self.set_width(val);
71        self
72    }
73    #[deprecated = "Use `set_x()` instead."]
74    pub fn x(&mut self, val: f64) -> &mut Self {
75        self.set_x(val);
76        self
77    }
78    #[deprecated = "Use `set_y()` instead."]
79    pub fn y(&mut self, val: f64) -> &mut Self {
80        self.set_y(val);
81        self
82    }
83}
84impl Default for DomRectInit {
85    fn default() -> Self {
86        Self::new()
87    }
88}