Skip to main content

web_sys/features/
gen_StaticRangeInit.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 = StaticRangeInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `StaticRangeInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `StaticRangeInit`*"]
12    pub type StaticRangeInit;
13    #[cfg(feature = "Node")]
14    #[doc = "Get the `endContainer` field of this object."]
15    #[doc = ""]
16    #[doc = "*This API requires the following crate features to be activated: `Node`, `StaticRangeInit`*"]
17    #[wasm_bindgen(method, getter = "endContainer")]
18    pub fn get_end_container(this: &StaticRangeInit) -> Node;
19    #[cfg(feature = "Node")]
20    #[doc = "Change the `endContainer` field of this object."]
21    #[doc = ""]
22    #[doc = "*This API requires the following crate features to be activated: `Node`, `StaticRangeInit`*"]
23    #[wasm_bindgen(method, setter = "endContainer")]
24    pub fn set_end_container(this: &StaticRangeInit, val: &Node);
25    #[doc = "Get the `endOffset` field of this object."]
26    #[doc = ""]
27    #[doc = "*This API requires the following crate features to be activated: `StaticRangeInit`*"]
28    #[wasm_bindgen(method, getter = "endOffset")]
29    pub fn get_end_offset(this: &StaticRangeInit) -> u32;
30    #[doc = "Change the `endOffset` field of this object."]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `StaticRangeInit`*"]
33    #[wasm_bindgen(method, setter = "endOffset")]
34    pub fn set_end_offset(this: &StaticRangeInit, val: u32);
35    #[cfg(feature = "Node")]
36    #[doc = "Get the `startContainer` field of this object."]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `Node`, `StaticRangeInit`*"]
39    #[wasm_bindgen(method, getter = "startContainer")]
40    pub fn get_start_container(this: &StaticRangeInit) -> Node;
41    #[cfg(feature = "Node")]
42    #[doc = "Change the `startContainer` field of this object."]
43    #[doc = ""]
44    #[doc = "*This API requires the following crate features to be activated: `Node`, `StaticRangeInit`*"]
45    #[wasm_bindgen(method, setter = "startContainer")]
46    pub fn set_start_container(this: &StaticRangeInit, val: &Node);
47    #[doc = "Get the `startOffset` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `StaticRangeInit`*"]
50    #[wasm_bindgen(method, getter = "startOffset")]
51    pub fn get_start_offset(this: &StaticRangeInit) -> u32;
52    #[doc = "Change the `startOffset` field of this object."]
53    #[doc = ""]
54    #[doc = "*This API requires the following crate features to be activated: `StaticRangeInit`*"]
55    #[wasm_bindgen(method, setter = "startOffset")]
56    pub fn set_start_offset(this: &StaticRangeInit, val: u32);
57}
58impl StaticRangeInit {
59    #[cfg(feature = "Node")]
60    #[doc = "Construct a new `StaticRangeInit`."]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `Node`, `StaticRangeInit`*"]
63    pub fn new(
64        end_container: &Node,
65        end_offset: u32,
66        start_container: &Node,
67        start_offset: u32,
68    ) -> Self {
69        #[allow(unused_mut)]
70        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
71        ret.set_end_container(end_container);
72        ret.set_end_offset(end_offset);
73        ret.set_start_container(start_container);
74        ret.set_start_offset(start_offset);
75        ret
76    }
77    #[cfg(feature = "Node")]
78    #[deprecated = "Use `set_end_container()` instead."]
79    pub fn end_container(&mut self, val: &Node) -> &mut Self {
80        self.set_end_container(val);
81        self
82    }
83    #[deprecated = "Use `set_end_offset()` instead."]
84    pub fn end_offset(&mut self, val: u32) -> &mut Self {
85        self.set_end_offset(val);
86        self
87    }
88    #[cfg(feature = "Node")]
89    #[deprecated = "Use `set_start_container()` instead."]
90    pub fn start_container(&mut self, val: &Node) -> &mut Self {
91        self.set_start_container(val);
92        self
93    }
94    #[deprecated = "Use `set_start_offset()` instead."]
95    pub fn start_offset(&mut self, val: u32) -> &mut Self {
96        self.set_start_offset(val);
97        self
98    }
99}