web_sys/features/
gen_Node.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "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) -> ::alloc::string::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<::alloc::string::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<::alloc::string::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<::alloc::string::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(
222        this: &Node,
223        prefix: Option<&str>,
224    ) -> Option<::alloc::string::String>;
225    # [wasm_bindgen (method , structural , js_class = "Node" , js_name = lookupPrefix)]
226    #[doc = "The `lookupPrefix()` method."]
227    #[doc = ""]
228    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/lookupPrefix)"]
229    #[doc = ""]
230    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
231    pub fn lookup_prefix(this: &Node, namespace: Option<&str>) -> Option<::alloc::string::String>;
232    # [wasm_bindgen (method , structural , js_class = "Node" , js_name = normalize)]
233    #[doc = "The `normalize()` method."]
234    #[doc = ""]
235    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/normalize)"]
236    #[doc = ""]
237    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
238    pub fn normalize(this: &Node);
239    # [wasm_bindgen (catch , method , structural , js_class = "Node" , js_name = removeChild)]
240    #[doc = "The `removeChild()` method."]
241    #[doc = ""]
242    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/removeChild)"]
243    #[doc = ""]
244    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
245    pub fn remove_child(this: &Node, child: &Node) -> Result<Node, JsValue>;
246    # [wasm_bindgen (catch , method , structural , js_class = "Node" , js_name = replaceChild)]
247    #[doc = "The `replaceChild()` method."]
248    #[doc = ""]
249    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Node/replaceChild)"]
250    #[doc = ""]
251    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
252    pub fn replace_child(this: &Node, node: &Node, child: &Node) -> Result<Node, JsValue>;
253}
254impl Node {
255    #[doc = "The `Node.ELEMENT_NODE` const."]
256    #[doc = ""]
257    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
258    pub const ELEMENT_NODE: u16 = 1u64 as u16;
259    #[doc = "The `Node.ATTRIBUTE_NODE` const."]
260    #[doc = ""]
261    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
262    pub const ATTRIBUTE_NODE: u16 = 2u64 as u16;
263    #[doc = "The `Node.TEXT_NODE` const."]
264    #[doc = ""]
265    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
266    pub const TEXT_NODE: u16 = 3u64 as u16;
267    #[doc = "The `Node.CDATA_SECTION_NODE` const."]
268    #[doc = ""]
269    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
270    pub const CDATA_SECTION_NODE: u16 = 4u64 as u16;
271    #[doc = "The `Node.ENTITY_REFERENCE_NODE` const."]
272    #[doc = ""]
273    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
274    pub const ENTITY_REFERENCE_NODE: u16 = 5u64 as u16;
275    #[doc = "The `Node.ENTITY_NODE` const."]
276    #[doc = ""]
277    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
278    pub const ENTITY_NODE: u16 = 6u64 as u16;
279    #[doc = "The `Node.PROCESSING_INSTRUCTION_NODE` const."]
280    #[doc = ""]
281    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
282    pub const PROCESSING_INSTRUCTION_NODE: u16 = 7u64 as u16;
283    #[doc = "The `Node.COMMENT_NODE` const."]
284    #[doc = ""]
285    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
286    pub const COMMENT_NODE: u16 = 8u64 as u16;
287    #[doc = "The `Node.DOCUMENT_NODE` const."]
288    #[doc = ""]
289    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
290    pub const DOCUMENT_NODE: u16 = 9u64 as u16;
291    #[doc = "The `Node.DOCUMENT_TYPE_NODE` const."]
292    #[doc = ""]
293    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
294    pub const DOCUMENT_TYPE_NODE: u16 = 10u64 as u16;
295    #[doc = "The `Node.DOCUMENT_FRAGMENT_NODE` const."]
296    #[doc = ""]
297    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
298    pub const DOCUMENT_FRAGMENT_NODE: u16 = 11u64 as u16;
299    #[doc = "The `Node.NOTATION_NODE` const."]
300    #[doc = ""]
301    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
302    pub const NOTATION_NODE: u16 = 12u64 as u16;
303    #[doc = "The `Node.DOCUMENT_POSITION_DISCONNECTED` const."]
304    #[doc = ""]
305    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
306    pub const DOCUMENT_POSITION_DISCONNECTED: u16 = 1u64 as u16;
307    #[doc = "The `Node.DOCUMENT_POSITION_PRECEDING` const."]
308    #[doc = ""]
309    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
310    pub const DOCUMENT_POSITION_PRECEDING: u16 = 2u64 as u16;
311    #[doc = "The `Node.DOCUMENT_POSITION_FOLLOWING` const."]
312    #[doc = ""]
313    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
314    pub const DOCUMENT_POSITION_FOLLOWING: u16 = 4u64 as u16;
315    #[doc = "The `Node.DOCUMENT_POSITION_CONTAINS` const."]
316    #[doc = ""]
317    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
318    pub const DOCUMENT_POSITION_CONTAINS: u16 = 8u64 as u16;
319    #[doc = "The `Node.DOCUMENT_POSITION_CONTAINED_BY` const."]
320    #[doc = ""]
321    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
322    pub const DOCUMENT_POSITION_CONTAINED_BY: u16 = 16u64 as u16;
323    #[doc = "The `Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC` const."]
324    #[doc = ""]
325    #[doc = "*This API requires the following crate features to be activated: `Node`*"]
326    pub const DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: u16 = 32u64 as u16;
327}