web_sys/features/
gen_HitRegionOptions.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 = HitRegionOptions)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `HitRegionOptions` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `HitRegionOptions`*"]
12    pub type HitRegionOptions;
13    #[cfg(feature = "Element")]
14    #[doc = "Get the `control` field of this object."]
15    #[doc = ""]
16    #[doc = "*This API requires the following crate features to be activated: `Element`, `HitRegionOptions`*"]
17    #[wasm_bindgen(method, getter = "control")]
18    pub fn get_control(this: &HitRegionOptions) -> Option<Element>;
19    #[cfg(feature = "Element")]
20    #[doc = "Change the `control` field of this object."]
21    #[doc = ""]
22    #[doc = "*This API requires the following crate features to be activated: `Element`, `HitRegionOptions`*"]
23    #[wasm_bindgen(method, setter = "control")]
24    pub fn set_control(this: &HitRegionOptions, val: Option<&Element>);
25    #[doc = "Get the `id` field of this object."]
26    #[doc = ""]
27    #[doc = "*This API requires the following crate features to be activated: `HitRegionOptions`*"]
28    #[wasm_bindgen(method, getter = "id")]
29    pub fn get_id(this: &HitRegionOptions) -> Option<::alloc::string::String>;
30    #[doc = "Change the `id` field of this object."]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `HitRegionOptions`*"]
33    #[wasm_bindgen(method, setter = "id")]
34    pub fn set_id(this: &HitRegionOptions, val: &str);
35    #[cfg(feature = "Path2d")]
36    #[doc = "Get the `path` field of this object."]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `HitRegionOptions`, `Path2d`*"]
39    #[wasm_bindgen(method, getter = "path")]
40    pub fn get_path(this: &HitRegionOptions) -> Option<Path2d>;
41    #[cfg(feature = "Path2d")]
42    #[doc = "Change the `path` field of this object."]
43    #[doc = ""]
44    #[doc = "*This API requires the following crate features to be activated: `HitRegionOptions`, `Path2d`*"]
45    #[wasm_bindgen(method, setter = "path")]
46    pub fn set_path(this: &HitRegionOptions, val: Option<&Path2d>);
47}
48impl HitRegionOptions {
49    #[doc = "Construct a new `HitRegionOptions`."]
50    #[doc = ""]
51    #[doc = "*This API requires the following crate features to be activated: `HitRegionOptions`*"]
52    pub fn new() -> Self {
53        #[allow(unused_mut)]
54        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
55        ret
56    }
57    #[cfg(feature = "Element")]
58    #[deprecated = "Use `set_control()` instead."]
59    pub fn control(&mut self, val: Option<&Element>) -> &mut Self {
60        self.set_control(val);
61        self
62    }
63    #[deprecated = "Use `set_id()` instead."]
64    pub fn id(&mut self, val: &str) -> &mut Self {
65        self.set_id(val);
66        self
67    }
68    #[cfg(feature = "Path2d")]
69    #[deprecated = "Use `set_path()` instead."]
70    pub fn path(&mut self, val: Option<&Path2d>) -> &mut Self {
71        self.set_path(val);
72        self
73    }
74}
75impl Default for HitRegionOptions {
76    fn default() -> Self {
77        Self::new()
78    }
79}