maxcountryman_web_sys/features/
gen_Node.rs

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