1 #![allow(unused_imports)]
2 use super::*;
3 use wasm_bindgen::prelude::*;
4 #[wasm_bindgen]
5 extern "C" {
6     # [wasm_bindgen (extends = :: js_sys :: Object , js_name = Range , typescript_type = "Range")]
7     #[derive(Debug, Clone, PartialEq, Eq)]
8     #[doc = "The `Range` class."]
9     #[doc = ""]
10     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range)"]
11     #[doc = ""]
12     #[doc = "*This API requires the following crate features to be activated: `Range`*"]
13     pub type Range;
14     #[cfg(feature = "Node")]
15     # [wasm_bindgen (structural , catch , method , getter , js_class = "Range" , js_name = startContainer)]
16     #[doc = "Getter for the `startContainer` field of this object."]
17     #[doc = ""]
18     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/startContainer)"]
19     #[doc = ""]
20     #[doc = "*This API requires the following crate features to be activated: `Node`, `Range`*"]
start_container(this: &Range) -> Result<Node, JsValue>21     pub fn start_container(this: &Range) -> Result<Node, JsValue>;
22     # [wasm_bindgen (structural , catch , method , getter , js_class = "Range" , js_name = startOffset)]
23     #[doc = "Getter for the `startOffset` field of this object."]
24     #[doc = ""]
25     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/startOffset)"]
26     #[doc = ""]
27     #[doc = "*This API requires the following crate features to be activated: `Range`*"]
start_offset(this: &Range) -> Result<u32, JsValue>28     pub fn start_offset(this: &Range) -> Result<u32, JsValue>;
29     #[cfg(feature = "Node")]
30     # [wasm_bindgen (structural , catch , method , getter , js_class = "Range" , js_name = endContainer)]
31     #[doc = "Getter for the `endContainer` field of this object."]
32     #[doc = ""]
33     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/endContainer)"]
34     #[doc = ""]
35     #[doc = "*This API requires the following crate features to be activated: `Node`, `Range`*"]
end_container(this: &Range) -> Result<Node, JsValue>36     pub fn end_container(this: &Range) -> Result<Node, JsValue>;
37     # [wasm_bindgen (structural , catch , method , getter , js_class = "Range" , js_name = endOffset)]
38     #[doc = "Getter for the `endOffset` field of this object."]
39     #[doc = ""]
40     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/endOffset)"]
41     #[doc = ""]
42     #[doc = "*This API requires the following crate features to be activated: `Range`*"]
end_offset(this: &Range) -> Result<u32, JsValue>43     pub fn end_offset(this: &Range) -> Result<u32, JsValue>;
44     # [wasm_bindgen (structural , method , getter , js_class = "Range" , js_name = collapsed)]
45     #[doc = "Getter for the `collapsed` field of this object."]
46     #[doc = ""]
47     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/collapsed)"]
48     #[doc = ""]
49     #[doc = "*This API requires the following crate features to be activated: `Range`*"]
collapsed(this: &Range) -> bool50     pub fn collapsed(this: &Range) -> bool;
51     #[cfg(feature = "Node")]
52     # [wasm_bindgen (structural , catch , method , getter , js_class = "Range" , js_name = commonAncestorContainer)]
53     #[doc = "Getter for the `commonAncestorContainer` field of this object."]
54     #[doc = ""]
55     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/commonAncestorContainer)"]
56     #[doc = ""]
57     #[doc = "*This API requires the following crate features to be activated: `Node`, `Range`*"]
common_ancestor_container(this: &Range) -> Result<Node, JsValue>58     pub fn common_ancestor_container(this: &Range) -> Result<Node, JsValue>;
59     #[wasm_bindgen(catch, constructor, js_class = "Range")]
60     #[doc = "The `new Range(..)` constructor, creating a new instance of `Range`."]
61     #[doc = ""]
62     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/Range)"]
63     #[doc = ""]
64     #[doc = "*This API requires the following crate features to be activated: `Range`*"]
new() -> Result<Range, JsValue>65     pub fn new() -> Result<Range, JsValue>;
66     #[cfg(feature = "DocumentFragment")]
67     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = cloneContents)]
68     #[doc = "The `cloneContents()` method."]
69     #[doc = ""]
70     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/cloneContents)"]
71     #[doc = ""]
72     #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`, `Range`*"]
clone_contents(this: &Range) -> Result<DocumentFragment, JsValue>73     pub fn clone_contents(this: &Range) -> Result<DocumentFragment, JsValue>;
74     # [wasm_bindgen (method , structural , js_class = "Range" , js_name = cloneRange)]
75     #[doc = "The `cloneRange()` method."]
76     #[doc = ""]
77     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/cloneRange)"]
78     #[doc = ""]
79     #[doc = "*This API requires the following crate features to be activated: `Range`*"]
clone_range(this: &Range) -> Range80     pub fn clone_range(this: &Range) -> Range;
81     # [wasm_bindgen (method , structural , js_class = "Range" , js_name = collapse)]
82     #[doc = "The `collapse()` method."]
83     #[doc = ""]
84     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/collapse)"]
85     #[doc = ""]
86     #[doc = "*This API requires the following crate features to be activated: `Range`*"]
collapse(this: &Range)87     pub fn collapse(this: &Range);
88     # [wasm_bindgen (method , structural , js_class = "Range" , js_name = collapse)]
89     #[doc = "The `collapse()` method."]
90     #[doc = ""]
91     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/collapse)"]
92     #[doc = ""]
93     #[doc = "*This API requires the following crate features to be activated: `Range`*"]
collapse_with_to_start(this: &Range, to_start: bool)94     pub fn collapse_with_to_start(this: &Range, to_start: bool);
95     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = compareBoundaryPoints)]
96     #[doc = "The `compareBoundaryPoints()` method."]
97     #[doc = ""]
98     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/compareBoundaryPoints)"]
99     #[doc = ""]
100     #[doc = "*This API requires the following crate features to be activated: `Range`*"]
compare_boundary_points( this: &Range, how: u16, source_range: &Range, ) -> Result<i16, JsValue>101     pub fn compare_boundary_points(
102         this: &Range,
103         how: u16,
104         source_range: &Range,
105     ) -> Result<i16, JsValue>;
106     #[cfg(feature = "Node")]
107     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = comparePoint)]
108     #[doc = "The `comparePoint()` method."]
109     #[doc = ""]
110     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/comparePoint)"]
111     #[doc = ""]
112     #[doc = "*This API requires the following crate features to be activated: `Node`, `Range`*"]
compare_point(this: &Range, node: &Node, offset: u32) -> Result<i16, JsValue>113     pub fn compare_point(this: &Range, node: &Node, offset: u32) -> Result<i16, JsValue>;
114     #[cfg(feature = "DocumentFragment")]
115     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = createContextualFragment)]
116     #[doc = "The `createContextualFragment()` method."]
117     #[doc = ""]
118     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/createContextualFragment)"]
119     #[doc = ""]
120     #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`, `Range`*"]
create_contextual_fragment( this: &Range, fragment: &str, ) -> Result<DocumentFragment, JsValue>121     pub fn create_contextual_fragment(
122         this: &Range,
123         fragment: &str,
124     ) -> Result<DocumentFragment, JsValue>;
125     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = deleteContents)]
126     #[doc = "The `deleteContents()` method."]
127     #[doc = ""]
128     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/deleteContents)"]
129     #[doc = ""]
130     #[doc = "*This API requires the following crate features to be activated: `Range`*"]
delete_contents(this: &Range) -> Result<(), JsValue>131     pub fn delete_contents(this: &Range) -> Result<(), JsValue>;
132     # [wasm_bindgen (method , structural , js_class = "Range" , js_name = detach)]
133     #[doc = "The `detach()` method."]
134     #[doc = ""]
135     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/detach)"]
136     #[doc = ""]
137     #[doc = "*This API requires the following crate features to be activated: `Range`*"]
detach(this: &Range)138     pub fn detach(this: &Range);
139     #[cfg(feature = "DocumentFragment")]
140     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = extractContents)]
141     #[doc = "The `extractContents()` method."]
142     #[doc = ""]
143     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/extractContents)"]
144     #[doc = ""]
145     #[doc = "*This API requires the following crate features to be activated: `DocumentFragment`, `Range`*"]
extract_contents(this: &Range) -> Result<DocumentFragment, JsValue>146     pub fn extract_contents(this: &Range) -> Result<DocumentFragment, JsValue>;
147     #[cfg(feature = "DomRect")]
148     # [wasm_bindgen (method , structural , js_class = "Range" , js_name = getBoundingClientRect)]
149     #[doc = "The `getBoundingClientRect()` method."]
150     #[doc = ""]
151     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/getBoundingClientRect)"]
152     #[doc = ""]
153     #[doc = "*This API requires the following crate features to be activated: `DomRect`, `Range`*"]
get_bounding_client_rect(this: &Range) -> DomRect154     pub fn get_bounding_client_rect(this: &Range) -> DomRect;
155     #[cfg(feature = "DomRectList")]
156     # [wasm_bindgen (method , structural , js_class = "Range" , js_name = getClientRects)]
157     #[doc = "The `getClientRects()` method."]
158     #[doc = ""]
159     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/getClientRects)"]
160     #[doc = ""]
161     #[doc = "*This API requires the following crate features to be activated: `DomRectList`, `Range`*"]
get_client_rects(this: &Range) -> Option<DomRectList>162     pub fn get_client_rects(this: &Range) -> Option<DomRectList>;
163     #[cfg(feature = "Node")]
164     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = insertNode)]
165     #[doc = "The `insertNode()` method."]
166     #[doc = ""]
167     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/insertNode)"]
168     #[doc = ""]
169     #[doc = "*This API requires the following crate features to be activated: `Node`, `Range`*"]
insert_node(this: &Range, node: &Node) -> Result<(), JsValue>170     pub fn insert_node(this: &Range, node: &Node) -> Result<(), JsValue>;
171     #[cfg(feature = "Node")]
172     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = intersectsNode)]
173     #[doc = "The `intersectsNode()` method."]
174     #[doc = ""]
175     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/intersectsNode)"]
176     #[doc = ""]
177     #[doc = "*This API requires the following crate features to be activated: `Node`, `Range`*"]
intersects_node(this: &Range, node: &Node) -> Result<bool, JsValue>178     pub fn intersects_node(this: &Range, node: &Node) -> Result<bool, JsValue>;
179     #[cfg(feature = "Node")]
180     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = isPointInRange)]
181     #[doc = "The `isPointInRange()` method."]
182     #[doc = ""]
183     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/isPointInRange)"]
184     #[doc = ""]
185     #[doc = "*This API requires the following crate features to be activated: `Node`, `Range`*"]
is_point_in_range(this: &Range, node: &Node, offset: u32) -> Result<bool, JsValue>186     pub fn is_point_in_range(this: &Range, node: &Node, offset: u32) -> Result<bool, JsValue>;
187     #[cfg(feature = "Node")]
188     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = selectNode)]
189     #[doc = "The `selectNode()` method."]
190     #[doc = ""]
191     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/selectNode)"]
192     #[doc = ""]
193     #[doc = "*This API requires the following crate features to be activated: `Node`, `Range`*"]
select_node(this: &Range, ref_node: &Node) -> Result<(), JsValue>194     pub fn select_node(this: &Range, ref_node: &Node) -> Result<(), JsValue>;
195     #[cfg(feature = "Node")]
196     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = selectNodeContents)]
197     #[doc = "The `selectNodeContents()` method."]
198     #[doc = ""]
199     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/selectNodeContents)"]
200     #[doc = ""]
201     #[doc = "*This API requires the following crate features to be activated: `Node`, `Range`*"]
select_node_contents(this: &Range, ref_node: &Node) -> Result<(), JsValue>202     pub fn select_node_contents(this: &Range, ref_node: &Node) -> Result<(), JsValue>;
203     #[cfg(feature = "Node")]
204     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = setEnd)]
205     #[doc = "The `setEnd()` method."]
206     #[doc = ""]
207     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/setEnd)"]
208     #[doc = ""]
209     #[doc = "*This API requires the following crate features to be activated: `Node`, `Range`*"]
set_end(this: &Range, ref_node: &Node, offset: u32) -> Result<(), JsValue>210     pub fn set_end(this: &Range, ref_node: &Node, offset: u32) -> Result<(), JsValue>;
211     #[cfg(feature = "Node")]
212     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = setEndAfter)]
213     #[doc = "The `setEndAfter()` method."]
214     #[doc = ""]
215     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/setEndAfter)"]
216     #[doc = ""]
217     #[doc = "*This API requires the following crate features to be activated: `Node`, `Range`*"]
set_end_after(this: &Range, ref_node: &Node) -> Result<(), JsValue>218     pub fn set_end_after(this: &Range, ref_node: &Node) -> Result<(), JsValue>;
219     #[cfg(feature = "Node")]
220     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = setEndBefore)]
221     #[doc = "The `setEndBefore()` method."]
222     #[doc = ""]
223     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/setEndBefore)"]
224     #[doc = ""]
225     #[doc = "*This API requires the following crate features to be activated: `Node`, `Range`*"]
set_end_before(this: &Range, ref_node: &Node) -> Result<(), JsValue>226     pub fn set_end_before(this: &Range, ref_node: &Node) -> Result<(), JsValue>;
227     #[cfg(feature = "Node")]
228     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = setStart)]
229     #[doc = "The `setStart()` method."]
230     #[doc = ""]
231     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/setStart)"]
232     #[doc = ""]
233     #[doc = "*This API requires the following crate features to be activated: `Node`, `Range`*"]
set_start(this: &Range, ref_node: &Node, offset: u32) -> Result<(), JsValue>234     pub fn set_start(this: &Range, ref_node: &Node, offset: u32) -> Result<(), JsValue>;
235     #[cfg(feature = "Node")]
236     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = setStartAfter)]
237     #[doc = "The `setStartAfter()` method."]
238     #[doc = ""]
239     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/setStartAfter)"]
240     #[doc = ""]
241     #[doc = "*This API requires the following crate features to be activated: `Node`, `Range`*"]
set_start_after(this: &Range, ref_node: &Node) -> Result<(), JsValue>242     pub fn set_start_after(this: &Range, ref_node: &Node) -> Result<(), JsValue>;
243     #[cfg(feature = "Node")]
244     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = setStartBefore)]
245     #[doc = "The `setStartBefore()` method."]
246     #[doc = ""]
247     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/setStartBefore)"]
248     #[doc = ""]
249     #[doc = "*This API requires the following crate features to be activated: `Node`, `Range`*"]
set_start_before(this: &Range, ref_node: &Node) -> Result<(), JsValue>250     pub fn set_start_before(this: &Range, ref_node: &Node) -> Result<(), JsValue>;
251     #[cfg(feature = "Node")]
252     # [wasm_bindgen (catch , method , structural , js_class = "Range" , js_name = surroundContents)]
253     #[doc = "The `surroundContents()` method."]
254     #[doc = ""]
255     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Range/surroundContents)"]
256     #[doc = ""]
257     #[doc = "*This API requires the following crate features to be activated: `Node`, `Range`*"]
surround_contents(this: &Range, new_parent: &Node) -> Result<(), JsValue>258     pub fn surround_contents(this: &Range, new_parent: &Node) -> Result<(), JsValue>;
259 }
260 impl Range {
261     #[doc = "The `Range.START_TO_START` const."]
262     #[doc = ""]
263     #[doc = "*This API requires the following crate features to be activated: `Range`*"]
264     pub const START_TO_START: u16 = 0i64 as u16;
265     #[doc = "The `Range.START_TO_END` const."]
266     #[doc = ""]
267     #[doc = "*This API requires the following crate features to be activated: `Range`*"]
268     pub const START_TO_END: u16 = 1u64 as u16;
269     #[doc = "The `Range.END_TO_END` const."]
270     #[doc = ""]
271     #[doc = "*This API requires the following crate features to be activated: `Range`*"]
272     pub const END_TO_END: u16 = 2u64 as u16;
273     #[doc = "The `Range.END_TO_START` const."]
274     #[doc = ""]
275     #[doc = "*This API requires the following crate features to be activated: `Range`*"]
276     pub const END_TO_START: u16 = 3u64 as u16;
277 }
278