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)"]