1 | #![allow (unused_imports)] |
2 | #![allow (clippy::all)] |
3 | use super::*; |
4 | use wasm_bindgen::prelude::*; |
5 | #[wasm_bindgen ] |
6 | extern "C" { |
7 | # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = Node , typescript_type = "Node" )] |
8 | #[derive (Debug, Clone, PartialEq, Eq)] |
9 | #[doc = "The `Node` class." ] |
10 | #[doc = "" ] |
11 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node)" ] |
12 | #[doc = "" ] |
13 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
14 | pub type Node; |
15 | # [wasm_bindgen (structural , method , getter , js_class = "Node" , js_name = nodeType)] |
16 | #[doc = "Getter for the `nodeType` field of this object." ] |
17 | #[doc = "" ] |
18 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType)" ] |
19 | #[doc = "" ] |
20 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
21 | pub fn node_type(this: &Node) -> u16; |
22 | # [wasm_bindgen (structural , method , getter , js_class = "Node" , js_name = nodeName)] |
23 | #[doc = "Getter for the `nodeName` field of this object." ] |
24 | #[doc = "" ] |
25 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeName)" ] |
26 | #[doc = "" ] |
27 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
28 | pub fn node_name(this: &Node) -> String; |
29 | # [wasm_bindgen (structural , catch , method , getter , js_class = "Node" , js_name = baseURI)] |
30 | #[doc = "Getter for the `baseURI` field of this object." ] |
31 | #[doc = "" ] |
32 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/baseURI)" ] |
33 | #[doc = "" ] |
34 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
35 | pub fn base_uri(this: &Node) -> Result<Option<String>, JsValue>; |
36 | # [wasm_bindgen (structural , method , getter , js_class = "Node" , js_name = isConnected)] |
37 | #[doc = "Getter for the `isConnected` field of this object." ] |
38 | #[doc = "" ] |
39 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected)" ] |
40 | #[doc = "" ] |
41 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
42 | pub fn is_connected(this: &Node) -> bool; |
43 | #[cfg (feature = "Document" )] |
44 | # [wasm_bindgen (structural , method , getter , js_class = "Node" , js_name = ownerDocument)] |
45 | #[doc = "Getter for the `ownerDocument` field of this object." ] |
46 | #[doc = "" ] |
47 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/ownerDocument)" ] |
48 | #[doc = "" ] |
49 | #[doc = "*This API requires the following crate features to be activated: `Document`, `Node`*" ] |
50 | pub fn owner_document(this: &Node) -> Option<Document>; |
51 | # [wasm_bindgen (structural , method , getter , js_class = "Node" , js_name = parentNode)] |
52 | #[doc = "Getter for the `parentNode` field of this object." ] |
53 | #[doc = "" ] |
54 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/parentNode)" ] |
55 | #[doc = "" ] |
56 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
57 | pub fn parent_node(this: &Node) -> Option<Node>; |
58 | #[cfg (feature = "Element" )] |
59 | # [wasm_bindgen (structural , method , getter , js_class = "Node" , js_name = parentElement)] |
60 | #[doc = "Getter for the `parentElement` field of this object." ] |
61 | #[doc = "" ] |
62 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/parentElement)" ] |
63 | #[doc = "" ] |
64 | #[doc = "*This API requires the following crate features to be activated: `Element`, `Node`*" ] |
65 | pub fn parent_element(this: &Node) -> Option<Element>; |
66 | #[cfg (feature = "NodeList" )] |
67 | # [wasm_bindgen (structural , method , getter , js_class = "Node" , js_name = childNodes)] |
68 | #[doc = "Getter for the `childNodes` field of this object." ] |
69 | #[doc = "" ] |
70 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/childNodes)" ] |
71 | #[doc = "" ] |
72 | #[doc = "*This API requires the following crate features to be activated: `Node`, `NodeList`*" ] |
73 | pub fn child_nodes(this: &Node) -> NodeList; |
74 | # [wasm_bindgen (structural , method , getter , js_class = "Node" , js_name = firstChild)] |
75 | #[doc = "Getter for the `firstChild` field of this object." ] |
76 | #[doc = "" ] |
77 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/firstChild)" ] |
78 | #[doc = "" ] |
79 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
80 | pub fn first_child(this: &Node) -> Option<Node>; |
81 | # [wasm_bindgen (structural , method , getter , js_class = "Node" , js_name = lastChild)] |
82 | #[doc = "Getter for the `lastChild` field of this object." ] |
83 | #[doc = "" ] |
84 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/lastChild)" ] |
85 | #[doc = "" ] |
86 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
87 | pub fn last_child(this: &Node) -> Option<Node>; |
88 | # [wasm_bindgen (structural , method , getter , js_class = "Node" , js_name = previousSibling)] |
89 | #[doc = "Getter for the `previousSibling` field of this object." ] |
90 | #[doc = "" ] |
91 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/previousSibling)" ] |
92 | #[doc = "" ] |
93 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
94 | pub fn previous_sibling(this: &Node) -> Option<Node>; |
95 | # [wasm_bindgen (structural , method , getter , js_class = "Node" , js_name = nextSibling)] |
96 | #[doc = "Getter for the `nextSibling` field of this object." ] |
97 | #[doc = "" ] |
98 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/nextSibling)" ] |
99 | #[doc = "" ] |
100 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
101 | pub fn next_sibling(this: &Node) -> Option<Node>; |
102 | # [wasm_bindgen (structural , method , getter , js_class = "Node" , js_name = nodeValue)] |
103 | #[doc = "Getter for the `nodeValue` field of this object." ] |
104 | #[doc = "" ] |
105 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeValue)" ] |
106 | #[doc = "" ] |
107 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
108 | pub fn node_value(this: &Node) -> Option<String>; |
109 | # [wasm_bindgen (structural , method , setter , js_class = "Node" , js_name = nodeValue)] |
110 | #[doc = "Setter for the `nodeValue` field of this object." ] |
111 | #[doc = "" ] |
112 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeValue)" ] |
113 | #[doc = "" ] |
114 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
115 | pub fn set_node_value(this: &Node, value: Option<&str>); |
116 | # [wasm_bindgen (structural , method , getter , js_class = "Node" , js_name = textContent)] |
117 | #[doc = "Getter for the `textContent` field of this object." ] |
118 | #[doc = "" ] |
119 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent)" ] |
120 | #[doc = "" ] |
121 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
122 | pub fn text_content(this: &Node) -> Option<String>; |
123 | # [wasm_bindgen (structural , method , setter , js_class = "Node" , js_name = textContent)] |
124 | #[doc = "Setter for the `textContent` field of this object." ] |
125 | #[doc = "" ] |
126 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent)" ] |
127 | #[doc = "" ] |
128 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
129 | pub fn set_text_content(this: &Node, value: Option<&str>); |
130 | # [wasm_bindgen (catch , method , structural , js_class = "Node" , js_name = appendChild)] |
131 | #[doc = "The `appendChild()` method." ] |
132 | #[doc = "" ] |
133 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild)" ] |
134 | #[doc = "" ] |
135 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
136 | pub fn append_child(this: &Node, node: &Node) -> Result<Node, JsValue>; |
137 | # [wasm_bindgen (catch , method , structural , js_class = "Node" , js_name = cloneNode)] |
138 | #[doc = "The `cloneNode()` method." ] |
139 | #[doc = "" ] |
140 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/cloneNode)" ] |
141 | #[doc = "" ] |
142 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
143 | pub fn clone_node(this: &Node) -> Result<Node, JsValue>; |
144 | # [wasm_bindgen (catch , method , structural , js_class = "Node" , js_name = cloneNode)] |
145 | #[doc = "The `cloneNode()` method." ] |
146 | #[doc = "" ] |
147 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/cloneNode)" ] |
148 | #[doc = "" ] |
149 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
150 | pub fn clone_node_with_deep(this: &Node, deep: bool) -> Result<Node, JsValue>; |
151 | # [wasm_bindgen (method , structural , js_class = "Node" , js_name = compareDocumentPosition)] |
152 | #[doc = "The `compareDocumentPosition()` method." ] |
153 | #[doc = "" ] |
154 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition)" ] |
155 | #[doc = "" ] |
156 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
157 | pub fn compare_document_position(this: &Node, other: &Node) -> u16; |
158 | # [wasm_bindgen (method , structural , js_class = "Node" , js_name = contains)] |
159 | #[doc = "The `contains()` method." ] |
160 | #[doc = "" ] |
161 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/contains)" ] |
162 | #[doc = "" ] |
163 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
164 | pub fn contains(this: &Node, other: Option<&Node>) -> bool; |
165 | # [wasm_bindgen (method , structural , js_class = "Node" , js_name = getRootNode)] |
166 | #[doc = "The `getRootNode()` method." ] |
167 | #[doc = "" ] |
168 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/getRootNode)" ] |
169 | #[doc = "" ] |
170 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
171 | pub fn get_root_node(this: &Node) -> Node; |
172 | #[cfg (feature = "GetRootNodeOptions" )] |
173 | # [wasm_bindgen (method , structural , js_class = "Node" , js_name = getRootNode)] |
174 | #[doc = "The `getRootNode()` method." ] |
175 | #[doc = "" ] |
176 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/getRootNode)" ] |
177 | #[doc = "" ] |
178 | #[doc = "*This API requires the following crate features to be activated: `GetRootNodeOptions`, `Node`*" ] |
179 | pub fn get_root_node_with_options(this: &Node, options: &GetRootNodeOptions) -> Node; |
180 | # [wasm_bindgen (method , structural , js_class = "Node" , js_name = hasChildNodes)] |
181 | #[doc = "The `hasChildNodes()` method." ] |
182 | #[doc = "" ] |
183 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/hasChildNodes)" ] |
184 | #[doc = "" ] |
185 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
186 | pub fn has_child_nodes(this: &Node) -> bool; |
187 | # [wasm_bindgen (catch , method , structural , js_class = "Node" , js_name = insertBefore)] |
188 | #[doc = "The `insertBefore()` method." ] |
189 | #[doc = "" ] |
190 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/insertBefore)" ] |
191 | #[doc = "" ] |
192 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
193 | pub fn insert_before(this: &Node, node: &Node, child: Option<&Node>) -> Result<Node, JsValue>; |
194 | # [wasm_bindgen (method , structural , js_class = "Node" , js_name = isDefaultNamespace)] |
195 | #[doc = "The `isDefaultNamespace()` method." ] |
196 | #[doc = "" ] |
197 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/isDefaultNamespace)" ] |
198 | #[doc = "" ] |
199 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
200 | pub fn is_default_namespace(this: &Node, namespace: Option<&str>) -> bool; |
201 | # [wasm_bindgen (method , structural , js_class = "Node" , js_name = isEqualNode)] |
202 | #[doc = "The `isEqualNode()` method." ] |
203 | #[doc = "" ] |
204 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/isEqualNode)" ] |
205 | #[doc = "" ] |
206 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
207 | pub fn is_equal_node(this: &Node, node: Option<&Node>) -> bool; |
208 | # [wasm_bindgen (method , structural , js_class = "Node" , js_name = isSameNode)] |
209 | #[doc = "The `isSameNode()` method." ] |
210 | #[doc = "" ] |
211 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/isSameNode)" ] |
212 | #[doc = "" ] |
213 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
214 | pub fn is_same_node(this: &Node, node: Option<&Node>) -> bool; |
215 | # [wasm_bindgen (method , structural , js_class = "Node" , js_name = lookupNamespaceURI)] |
216 | #[doc = "The `lookupNamespaceURI()` method." ] |
217 | #[doc = "" ] |
218 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/lookupNamespaceURI)" ] |
219 | #[doc = "" ] |
220 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
221 | pub fn lookup_namespace_uri(this: &Node, prefix: Option<&str>) -> Option<String>; |
222 | # [wasm_bindgen (method , structural , js_class = "Node" , js_name = lookupPrefix)] |
223 | #[doc = "The `lookupPrefix()` method." ] |
224 | #[doc = "" ] |
225 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/lookupPrefix)" ] |
226 | #[doc = "" ] |
227 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
228 | pub fn lookup_prefix(this: &Node, namespace: Option<&str>) -> Option<String>; |
229 | # [wasm_bindgen (method , structural , js_class = "Node" , js_name = normalize)] |
230 | #[doc = "The `normalize()` method." ] |
231 | #[doc = "" ] |
232 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/normalize)" ] |
233 | #[doc = "" ] |
234 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
235 | pub fn normalize(this: &Node); |
236 | # [wasm_bindgen (catch , method , structural , js_class = "Node" , js_name = removeChild)] |
237 | #[doc = "The `removeChild()` method." ] |
238 | #[doc = "" ] |
239 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/removeChild)" ] |
240 | #[doc = "" ] |
241 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
242 | pub fn remove_child(this: &Node, child: &Node) -> Result<Node, JsValue>; |
243 | # [wasm_bindgen (catch , method , structural , js_class = "Node" , js_name = replaceChild)] |
244 | #[doc = "The `replaceChild()` method." ] |
245 | #[doc = "" ] |
246 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/replaceChild)" ] |
247 | #[doc = "" ] |
248 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
249 | pub fn replace_child(this: &Node, node: &Node, child: &Node) -> Result<Node, JsValue>; |
250 | } |
251 | impl Node { |
252 | #[doc = "The `Node.ELEMENT_NODE` const." ] |
253 | #[doc = "" ] |
254 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
255 | pub const ELEMENT_NODE: u16 = 1u64 as u16; |
256 | #[doc = "The `Node.ATTRIBUTE_NODE` const." ] |
257 | #[doc = "" ] |
258 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
259 | pub const ATTRIBUTE_NODE: u16 = 2u64 as u16; |
260 | #[doc = "The `Node.TEXT_NODE` const." ] |
261 | #[doc = "" ] |
262 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
263 | pub const TEXT_NODE: u16 = 3u64 as u16; |
264 | #[doc = "The `Node.CDATA_SECTION_NODE` const." ] |
265 | #[doc = "" ] |
266 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
267 | pub const CDATA_SECTION_NODE: u16 = 4u64 as u16; |
268 | #[doc = "The `Node.ENTITY_REFERENCE_NODE` const." ] |
269 | #[doc = "" ] |
270 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
271 | pub const ENTITY_REFERENCE_NODE: u16 = 5u64 as u16; |
272 | #[doc = "The `Node.ENTITY_NODE` const." ] |
273 | #[doc = "" ] |
274 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
275 | pub const ENTITY_NODE: u16 = 6u64 as u16; |
276 | #[doc = "The `Node.PROCESSING_INSTRUCTION_NODE` const." ] |
277 | #[doc = "" ] |
278 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
279 | pub const PROCESSING_INSTRUCTION_NODE: u16 = 7u64 as u16; |
280 | #[doc = "The `Node.COMMENT_NODE` const." ] |
281 | #[doc = "" ] |
282 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
283 | pub const COMMENT_NODE: u16 = 8u64 as u16; |
284 | #[doc = "The `Node.DOCUMENT_NODE` const." ] |
285 | #[doc = "" ] |
286 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
287 | pub const DOCUMENT_NODE: u16 = 9u64 as u16; |
288 | #[doc = "The `Node.DOCUMENT_TYPE_NODE` const." ] |
289 | #[doc = "" ] |
290 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
291 | pub const DOCUMENT_TYPE_NODE: u16 = 10u64 as u16; |
292 | #[doc = "The `Node.DOCUMENT_FRAGMENT_NODE` const." ] |
293 | #[doc = "" ] |
294 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
295 | pub const DOCUMENT_FRAGMENT_NODE: u16 = 11u64 as u16; |
296 | #[doc = "The `Node.NOTATION_NODE` const." ] |
297 | #[doc = "" ] |
298 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
299 | pub const NOTATION_NODE: u16 = 12u64 as u16; |
300 | #[doc = "The `Node.DOCUMENT_POSITION_DISCONNECTED` const." ] |
301 | #[doc = "" ] |
302 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
303 | pub const DOCUMENT_POSITION_DISCONNECTED: u16 = 1u64 as u16; |
304 | #[doc = "The `Node.DOCUMENT_POSITION_PRECEDING` const." ] |
305 | #[doc = "" ] |
306 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
307 | pub const DOCUMENT_POSITION_PRECEDING: u16 = 2u64 as u16; |
308 | #[doc = "The `Node.DOCUMENT_POSITION_FOLLOWING` const." ] |
309 | #[doc = "" ] |
310 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
311 | pub const DOCUMENT_POSITION_FOLLOWING: u16 = 4u64 as u16; |
312 | #[doc = "The `Node.DOCUMENT_POSITION_CONTAINS` const." ] |
313 | #[doc = "" ] |
314 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
315 | pub const DOCUMENT_POSITION_CONTAINS: u16 = 8u64 as u16; |
316 | #[doc = "The `Node.DOCUMENT_POSITION_CONTAINED_BY` const." ] |
317 | #[doc = "" ] |
318 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
319 | pub const DOCUMENT_POSITION_CONTAINED_BY: u16 = 16u64 as u16; |
320 | #[doc = "The `Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC` const." ] |
321 | #[doc = "" ] |
322 | #[doc = "*This API requires the following crate features to be activated: `Node`*" ] |
323 | pub const DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: u16 = 32u64 as u16; |
324 | } |
325 | |