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 = Selection , typescript_type = "Selection")]
7     #[derive(Debug, Clone, PartialEq, Eq)]
8     #[doc = "The `Selection` class."]
9     #[doc = ""]
10     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection)"]
11     #[doc = ""]
12     #[doc = "*This API requires the following crate features to be activated: `Selection`*"]
13     pub type Selection;
14     #[cfg(feature = "Node")]
15     # [wasm_bindgen (structural , method , getter , js_class = "Selection" , js_name = anchorNode)]
16     #[doc = "Getter for the `anchorNode` field of this object."]
17     #[doc = ""]
18     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/anchorNode)"]
19     #[doc = ""]
20     #[doc = "*This API requires the following crate features to be activated: `Node`, `Selection`*"]
anchor_node(this: &Selection) -> Option<Node>21     pub fn anchor_node(this: &Selection) -> Option<Node>;
22     # [wasm_bindgen (structural , method , getter , js_class = "Selection" , js_name = anchorOffset)]
23     #[doc = "Getter for the `anchorOffset` field of this object."]
24     #[doc = ""]
25     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/anchorOffset)"]
26     #[doc = ""]
27     #[doc = "*This API requires the following crate features to be activated: `Selection`*"]
anchor_offset(this: &Selection) -> u3228     pub fn anchor_offset(this: &Selection) -> u32;
29     #[cfg(feature = "Node")]
30     # [wasm_bindgen (structural , method , getter , js_class = "Selection" , js_name = focusNode)]
31     #[doc = "Getter for the `focusNode` field of this object."]
32     #[doc = ""]
33     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/focusNode)"]
34     #[doc = ""]
35     #[doc = "*This API requires the following crate features to be activated: `Node`, `Selection`*"]
focus_node(this: &Selection) -> Option<Node>36     pub fn focus_node(this: &Selection) -> Option<Node>;
37     # [wasm_bindgen (structural , method , getter , js_class = "Selection" , js_name = focusOffset)]
38     #[doc = "Getter for the `focusOffset` field of this object."]
39     #[doc = ""]
40     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/focusOffset)"]
41     #[doc = ""]
42     #[doc = "*This API requires the following crate features to be activated: `Selection`*"]
focus_offset(this: &Selection) -> u3243     pub fn focus_offset(this: &Selection) -> u32;
44     # [wasm_bindgen (structural , method , getter , js_class = "Selection" , js_name = isCollapsed)]
45     #[doc = "Getter for the `isCollapsed` field of this object."]
46     #[doc = ""]
47     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/isCollapsed)"]
48     #[doc = ""]
49     #[doc = "*This API requires the following crate features to be activated: `Selection`*"]
is_collapsed(this: &Selection) -> bool50     pub fn is_collapsed(this: &Selection) -> bool;
51     # [wasm_bindgen (structural , method , getter , js_class = "Selection" , js_name = rangeCount)]
52     #[doc = "Getter for the `rangeCount` field of this object."]
53     #[doc = ""]
54     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/rangeCount)"]
55     #[doc = ""]
56     #[doc = "*This API requires the following crate features to be activated: `Selection`*"]
range_count(this: &Selection) -> u3257     pub fn range_count(this: &Selection) -> u32;
58     # [wasm_bindgen (structural , method , getter , js_class = "Selection" , js_name = type)]
59     #[doc = "Getter for the `type` field of this object."]
60     #[doc = ""]
61     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/type)"]
62     #[doc = ""]
63     #[doc = "*This API requires the following crate features to be activated: `Selection`*"]
type_(this: &Selection) -> String64     pub fn type_(this: &Selection) -> String;
65     # [wasm_bindgen (structural , catch , method , getter , js_class = "Selection" , js_name = caretBidiLevel)]
66     #[doc = "Getter for the `caretBidiLevel` field of this object."]
67     #[doc = ""]
68     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/caretBidiLevel)"]
69     #[doc = ""]
70     #[doc = "*This API requires the following crate features to be activated: `Selection`*"]
caret_bidi_level(this: &Selection) -> Result<Option<i16>, JsValue>71     pub fn caret_bidi_level(this: &Selection) -> Result<Option<i16>, JsValue>;
72     # [wasm_bindgen (structural , catch , method , setter , js_class = "Selection" , js_name = caretBidiLevel)]
73     #[doc = "Setter for the `caretBidiLevel` field of this object."]
74     #[doc = ""]
75     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/caretBidiLevel)"]
76     #[doc = ""]
77     #[doc = "*This API requires the following crate features to be activated: `Selection`*"]
set_caret_bidi_level(this: &Selection, value: Option<i16>) -> Result<(), JsValue>78     pub fn set_caret_bidi_level(this: &Selection, value: Option<i16>) -> Result<(), JsValue>;
79     #[cfg(feature = "Range")]
80     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = addRange)]
81     #[doc = "The `addRange()` method."]
82     #[doc = ""]
83     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/addRange)"]
84     #[doc = ""]
85     #[doc = "*This API requires the following crate features to be activated: `Range`, `Selection`*"]
add_range(this: &Selection, range: &Range) -> Result<(), JsValue>86     pub fn add_range(this: &Selection, range: &Range) -> Result<(), JsValue>;
87     #[cfg(feature = "Node")]
88     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = collapse)]
89     #[doc = "The `collapse()` method."]
90     #[doc = ""]
91     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/collapse)"]
92     #[doc = ""]
93     #[doc = "*This API requires the following crate features to be activated: `Node`, `Selection`*"]
collapse(this: &Selection, node: Option<&Node>) -> Result<(), JsValue>94     pub fn collapse(this: &Selection, node: Option<&Node>) -> Result<(), JsValue>;
95     #[cfg(feature = "Node")]
96     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = collapse)]
97     #[doc = "The `collapse()` method."]
98     #[doc = ""]
99     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/collapse)"]
100     #[doc = ""]
101     #[doc = "*This API requires the following crate features to be activated: `Node`, `Selection`*"]
collapse_with_offset( this: &Selection, node: Option<&Node>, offset: u32, ) -> Result<(), JsValue>102     pub fn collapse_with_offset(
103         this: &Selection,
104         node: Option<&Node>,
105         offset: u32,
106     ) -> Result<(), JsValue>;
107     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = collapseToEnd)]
108     #[doc = "The `collapseToEnd()` method."]
109     #[doc = ""]
110     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/collapseToEnd)"]
111     #[doc = ""]
112     #[doc = "*This API requires the following crate features to be activated: `Selection`*"]
collapse_to_end(this: &Selection) -> Result<(), JsValue>113     pub fn collapse_to_end(this: &Selection) -> Result<(), JsValue>;
114     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = collapseToStart)]
115     #[doc = "The `collapseToStart()` method."]
116     #[doc = ""]
117     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/collapseToStart)"]
118     #[doc = ""]
119     #[doc = "*This API requires the following crate features to be activated: `Selection`*"]
collapse_to_start(this: &Selection) -> Result<(), JsValue>120     pub fn collapse_to_start(this: &Selection) -> Result<(), JsValue>;
121     #[cfg(feature = "Node")]
122     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = containsNode)]
123     #[doc = "The `containsNode()` method."]
124     #[doc = ""]
125     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/containsNode)"]
126     #[doc = ""]
127     #[doc = "*This API requires the following crate features to be activated: `Node`, `Selection`*"]
contains_node(this: &Selection, node: &Node) -> Result<bool, JsValue>128     pub fn contains_node(this: &Selection, node: &Node) -> Result<bool, JsValue>;
129     #[cfg(feature = "Node")]
130     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = containsNode)]
131     #[doc = "The `containsNode()` method."]
132     #[doc = ""]
133     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/containsNode)"]
134     #[doc = ""]
135     #[doc = "*This API requires the following crate features to be activated: `Node`, `Selection`*"]
contains_node_with_allow_partial_containment( this: &Selection, node: &Node, allow_partial_containment: bool, ) -> Result<bool, JsValue>136     pub fn contains_node_with_allow_partial_containment(
137         this: &Selection,
138         node: &Node,
139         allow_partial_containment: bool,
140     ) -> Result<bool, JsValue>;
141     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = deleteFromDocument)]
142     #[doc = "The `deleteFromDocument()` method."]
143     #[doc = ""]
144     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/deleteFromDocument)"]
145     #[doc = ""]
146     #[doc = "*This API requires the following crate features to be activated: `Selection`*"]
delete_from_document(this: &Selection) -> Result<(), JsValue>147     pub fn delete_from_document(this: &Selection) -> Result<(), JsValue>;
148     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = empty)]
149     #[doc = "The `empty()` method."]
150     #[doc = ""]
151     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/empty)"]
152     #[doc = ""]
153     #[doc = "*This API requires the following crate features to be activated: `Selection`*"]
empty(this: &Selection) -> Result<(), JsValue>154     pub fn empty(this: &Selection) -> Result<(), JsValue>;
155     #[cfg(feature = "Node")]
156     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = extend)]
157     #[doc = "The `extend()` method."]
158     #[doc = ""]
159     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/extend)"]
160     #[doc = ""]
161     #[doc = "*This API requires the following crate features to be activated: `Node`, `Selection`*"]
extend(this: &Selection, node: &Node) -> Result<(), JsValue>162     pub fn extend(this: &Selection, node: &Node) -> Result<(), JsValue>;
163     #[cfg(feature = "Node")]
164     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = extend)]
165     #[doc = "The `extend()` method."]
166     #[doc = ""]
167     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/extend)"]
168     #[doc = ""]
169     #[doc = "*This API requires the following crate features to be activated: `Node`, `Selection`*"]
extend_with_offset(this: &Selection, node: &Node, offset: u32) -> Result<(), JsValue>170     pub fn extend_with_offset(this: &Selection, node: &Node, offset: u32) -> Result<(), JsValue>;
171     #[cfg(feature = "Range")]
172     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = getRangeAt)]
173     #[doc = "The `getRangeAt()` method."]
174     #[doc = ""]
175     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/getRangeAt)"]
176     #[doc = ""]
177     #[doc = "*This API requires the following crate features to be activated: `Range`, `Selection`*"]
get_range_at(this: &Selection, index: u32) -> Result<Range, JsValue>178     pub fn get_range_at(this: &Selection, index: u32) -> Result<Range, JsValue>;
179     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = modify)]
180     #[doc = "The `modify()` method."]
181     #[doc = ""]
182     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/modify)"]
183     #[doc = ""]
184     #[doc = "*This API requires the following crate features to be activated: `Selection`*"]
modify( this: &Selection, alter: &str, direction: &str, granularity: &str, ) -> Result<(), JsValue>185     pub fn modify(
186         this: &Selection,
187         alter: &str,
188         direction: &str,
189         granularity: &str,
190     ) -> Result<(), JsValue>;
191     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = removeAllRanges)]
192     #[doc = "The `removeAllRanges()` method."]
193     #[doc = ""]
194     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/removeAllRanges)"]
195     #[doc = ""]
196     #[doc = "*This API requires the following crate features to be activated: `Selection`*"]
remove_all_ranges(this: &Selection) -> Result<(), JsValue>197     pub fn remove_all_ranges(this: &Selection) -> Result<(), JsValue>;
198     #[cfg(feature = "Range")]
199     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = removeRange)]
200     #[doc = "The `removeRange()` method."]
201     #[doc = ""]
202     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/removeRange)"]
203     #[doc = ""]
204     #[doc = "*This API requires the following crate features to be activated: `Range`, `Selection`*"]
remove_range(this: &Selection, range: &Range) -> Result<(), JsValue>205     pub fn remove_range(this: &Selection, range: &Range) -> Result<(), JsValue>;
206     #[cfg(feature = "Node")]
207     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = selectAllChildren)]
208     #[doc = "The `selectAllChildren()` method."]
209     #[doc = ""]
210     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/selectAllChildren)"]
211     #[doc = ""]
212     #[doc = "*This API requires the following crate features to be activated: `Node`, `Selection`*"]
select_all_children(this: &Selection, node: &Node) -> Result<(), JsValue>213     pub fn select_all_children(this: &Selection, node: &Node) -> Result<(), JsValue>;
214     #[cfg(feature = "Node")]
215     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = setBaseAndExtent)]
216     #[doc = "The `setBaseAndExtent()` method."]
217     #[doc = ""]
218     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/setBaseAndExtent)"]
219     #[doc = ""]
220     #[doc = "*This API requires the following crate features to be activated: `Node`, `Selection`*"]
set_base_and_extent( this: &Selection, anchor_node: &Node, anchor_offset: u32, focus_node: &Node, focus_offset: u32, ) -> Result<(), JsValue>221     pub fn set_base_and_extent(
222         this: &Selection,
223         anchor_node: &Node,
224         anchor_offset: u32,
225         focus_node: &Node,
226         focus_offset: u32,
227     ) -> Result<(), JsValue>;
228     #[cfg(feature = "Node")]
229     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = setPosition)]
230     #[doc = "The `setPosition()` method."]
231     #[doc = ""]
232     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/setPosition)"]
233     #[doc = ""]
234     #[doc = "*This API requires the following crate features to be activated: `Node`, `Selection`*"]
set_position(this: &Selection, node: Option<&Node>) -> Result<(), JsValue>235     pub fn set_position(this: &Selection, node: Option<&Node>) -> Result<(), JsValue>;
236     #[cfg(feature = "Node")]
237     # [wasm_bindgen (catch , method , structural , js_class = "Selection" , js_name = setPosition)]
238     #[doc = "The `setPosition()` method."]
239     #[doc = ""]
240     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Selection/setPosition)"]
241     #[doc = ""]
242     #[doc = "*This API requires the following crate features to be activated: `Node`, `Selection`*"]
set_position_with_offset( this: &Selection, node: Option<&Node>, offset: u32, ) -> Result<(), JsValue>243     pub fn set_position_with_offset(
244         this: &Selection,
245         node: Option<&Node>,
246         offset: u32,
247     ) -> Result<(), JsValue>;
248 }
249