Skip to main content

web_sys/features/
gen_SvgLength.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "::js_sys::Object",
9        js_name = "SVGLength",
10        typescript_type = "SVGLength"
11    )]
12    #[derive(Debug, Clone, PartialEq, Eq)]
13    #[doc = "The `SvgLength` class."]
14    #[doc = ""]
15    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGLength)"]
16    #[doc = ""]
17    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
18    pub type SvgLength;
19    #[wasm_bindgen(method, getter, js_class = "SVGLength", js_name = "unitType")]
20    #[doc = "Getter for the `unitType` field of this object."]
21    #[doc = ""]
22    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGLength/unitType)"]
23    #[doc = ""]
24    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
25    pub fn unit_type(this: &SvgLength) -> u16;
26    #[wasm_bindgen(catch, method, getter, js_class = "SVGLength", js_name = "value")]
27    #[doc = "Getter for the `value` field of this object."]
28    #[doc = ""]
29    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGLength/value)"]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
32    pub fn value(this: &SvgLength) -> Result<f32, JsValue>;
33    #[wasm_bindgen(catch, method, setter, js_class = "SVGLength", js_name = "value")]
34    #[doc = "Setter for the `value` field of this object."]
35    #[doc = ""]
36    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGLength/value)"]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
39    pub fn set_value(this: &SvgLength, value: f32) -> Result<(), JsValue>;
40    #[wasm_bindgen(
41        method,
42        getter,
43        js_class = "SVGLength",
44        js_name = "valueInSpecifiedUnits"
45    )]
46    #[doc = "Getter for the `valueInSpecifiedUnits` field of this object."]
47    #[doc = ""]
48    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGLength/valueInSpecifiedUnits)"]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
51    pub fn value_in_specified_units(this: &SvgLength) -> f32;
52    #[wasm_bindgen(
53        method,
54        setter,
55        js_class = "SVGLength",
56        js_name = "valueInSpecifiedUnits"
57    )]
58    #[doc = "Setter for the `valueInSpecifiedUnits` field of this object."]
59    #[doc = ""]
60    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGLength/valueInSpecifiedUnits)"]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
63    pub fn set_value_in_specified_units(this: &SvgLength, value: f32);
64    #[wasm_bindgen(method, getter, js_class = "SVGLength", js_name = "valueAsString")]
65    #[doc = "Getter for the `valueAsString` field of this object."]
66    #[doc = ""]
67    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGLength/valueAsString)"]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
70    pub fn value_as_string(this: &SvgLength) -> ::alloc::string::String;
71    #[wasm_bindgen(method, setter, js_class = "SVGLength", js_name = "valueAsString")]
72    #[doc = "Setter for the `valueAsString` field of this object."]
73    #[doc = ""]
74    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGLength/valueAsString)"]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
77    pub fn set_value_as_string(this: &SvgLength, value: &str);
78    #[wasm_bindgen(
79        catch,
80        method,
81        js_class = "SVGLength",
82        js_name = "convertToSpecifiedUnits"
83    )]
84    #[doc = "The `convertToSpecifiedUnits()` method."]
85    #[doc = ""]
86    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGLength/convertToSpecifiedUnits)"]
87    #[doc = ""]
88    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
89    pub fn convert_to_specified_units(this: &SvgLength, unit_type: u16) -> Result<(), JsValue>;
90    #[wasm_bindgen(
91        catch,
92        method,
93        js_class = "SVGLength",
94        js_name = "newValueSpecifiedUnits"
95    )]
96    #[doc = "The `newValueSpecifiedUnits()` method."]
97    #[doc = ""]
98    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SVGLength/newValueSpecifiedUnits)"]
99    #[doc = ""]
100    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
101    pub fn new_value_specified_units(
102        this: &SvgLength,
103        unit_type: u16,
104        value_in_specified_units: f32,
105    ) -> Result<(), JsValue>;
106}
107impl SvgLength {
108    #[doc = "The `SVGLength.SVG_LENGTHTYPE_UNKNOWN` const."]
109    #[doc = ""]
110    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
111    pub const SVG_LENGTHTYPE_UNKNOWN: u16 = 0i64 as u16;
112    #[doc = "The `SVGLength.SVG_LENGTHTYPE_NUMBER` const."]
113    #[doc = ""]
114    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
115    pub const SVG_LENGTHTYPE_NUMBER: u16 = 1u64 as u16;
116    #[doc = "The `SVGLength.SVG_LENGTHTYPE_PERCENTAGE` const."]
117    #[doc = ""]
118    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
119    pub const SVG_LENGTHTYPE_PERCENTAGE: u16 = 2u64 as u16;
120    #[doc = "The `SVGLength.SVG_LENGTHTYPE_EMS` const."]
121    #[doc = ""]
122    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
123    pub const SVG_LENGTHTYPE_EMS: u16 = 3u64 as u16;
124    #[doc = "The `SVGLength.SVG_LENGTHTYPE_EXS` const."]
125    #[doc = ""]
126    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
127    pub const SVG_LENGTHTYPE_EXS: u16 = 4u64 as u16;
128    #[doc = "The `SVGLength.SVG_LENGTHTYPE_PX` const."]
129    #[doc = ""]
130    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
131    pub const SVG_LENGTHTYPE_PX: u16 = 5u64 as u16;
132    #[doc = "The `SVGLength.SVG_LENGTHTYPE_CM` const."]
133    #[doc = ""]
134    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
135    pub const SVG_LENGTHTYPE_CM: u16 = 6u64 as u16;
136    #[doc = "The `SVGLength.SVG_LENGTHTYPE_MM` const."]
137    #[doc = ""]
138    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
139    pub const SVG_LENGTHTYPE_MM: u16 = 7u64 as u16;
140    #[doc = "The `SVGLength.SVG_LENGTHTYPE_IN` const."]
141    #[doc = ""]
142    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
143    pub const SVG_LENGTHTYPE_IN: u16 = 8u64 as u16;
144    #[doc = "The `SVGLength.SVG_LENGTHTYPE_PT` const."]
145    #[doc = ""]
146    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
147    pub const SVG_LENGTHTYPE_PT: u16 = 9u64 as u16;
148    #[doc = "The `SVGLength.SVG_LENGTHTYPE_PC` const."]
149    #[doc = ""]
150    #[doc = "*This API requires the following crate features to be activated: `SvgLength`*"]
151    pub const SVG_LENGTHTYPE_PC: u16 = 10u64 as u16;
152}