Skip to main content

web_sys/features/
gen_MutationEvent.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "Event",
9        extends = "::js_sys::Object",
10        js_name = "MutationEvent",
11        typescript_type = "MutationEvent"
12    )]
13    #[derive(Debug, Clone, PartialEq, Eq)]
14    #[doc = "The `MutationEvent` class."]
15    #[doc = ""]
16    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent)"]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `MutationEvent`*"]
19    pub type MutationEvent;
20    #[cfg(feature = "Node")]
21    #[wasm_bindgen(method, getter, js_class = "MutationEvent", js_name = "relatedNode")]
22    #[doc = "Getter for the `relatedNode` field of this object."]
23    #[doc = ""]
24    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent/relatedNode)"]
25    #[doc = ""]
26    #[doc = "*This API requires the following crate features to be activated: `MutationEvent`, `Node`*"]
27    pub fn related_node(this: &MutationEvent) -> Option<Node>;
28    #[wasm_bindgen(method, getter, js_class = "MutationEvent", js_name = "prevValue")]
29    #[doc = "Getter for the `prevValue` field of this object."]
30    #[doc = ""]
31    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent/prevValue)"]
32    #[doc = ""]
33    #[doc = "*This API requires the following crate features to be activated: `MutationEvent`*"]
34    pub fn prev_value(this: &MutationEvent) -> ::alloc::string::String;
35    #[wasm_bindgen(method, getter, js_class = "MutationEvent", js_name = "newValue")]
36    #[doc = "Getter for the `newValue` field of this object."]
37    #[doc = ""]
38    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent/newValue)"]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `MutationEvent`*"]
41    pub fn new_value(this: &MutationEvent) -> ::alloc::string::String;
42    #[wasm_bindgen(method, getter, js_class = "MutationEvent", js_name = "attrName")]
43    #[doc = "Getter for the `attrName` field of this object."]
44    #[doc = ""]
45    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent/attrName)"]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `MutationEvent`*"]
48    pub fn attr_name(this: &MutationEvent) -> ::alloc::string::String;
49    #[wasm_bindgen(method, getter, js_class = "MutationEvent", js_name = "attrChange")]
50    #[doc = "Getter for the `attrChange` field of this object."]
51    #[doc = ""]
52    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent/attrChange)"]
53    #[doc = ""]
54    #[doc = "*This API requires the following crate features to be activated: `MutationEvent`*"]
55    pub fn attr_change(this: &MutationEvent) -> u16;
56    #[wasm_bindgen(
57        catch,
58        method,
59        js_class = "MutationEvent",
60        js_name = "initMutationEvent"
61    )]
62    #[doc = "The `initMutationEvent()` method."]
63    #[doc = ""]
64    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent/initMutationEvent)"]
65    #[doc = ""]
66    #[doc = "*This API requires the following crate features to be activated: `MutationEvent`*"]
67    pub fn init_mutation_event(this: &MutationEvent, type_: &str) -> Result<(), JsValue>;
68    #[wasm_bindgen(
69        catch,
70        method,
71        js_class = "MutationEvent",
72        js_name = "initMutationEvent"
73    )]
74    #[doc = "The `initMutationEvent()` method."]
75    #[doc = ""]
76    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent/initMutationEvent)"]
77    #[doc = ""]
78    #[doc = "*This API requires the following crate features to be activated: `MutationEvent`*"]
79    pub fn init_mutation_event_with_can_bubble(
80        this: &MutationEvent,
81        type_: &str,
82        can_bubble: bool,
83    ) -> Result<(), JsValue>;
84    #[wasm_bindgen(
85        catch,
86        method,
87        js_class = "MutationEvent",
88        js_name = "initMutationEvent"
89    )]
90    #[doc = "The `initMutationEvent()` method."]
91    #[doc = ""]
92    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent/initMutationEvent)"]
93    #[doc = ""]
94    #[doc = "*This API requires the following crate features to be activated: `MutationEvent`*"]
95    pub fn init_mutation_event_with_can_bubble_and_cancelable(
96        this: &MutationEvent,
97        type_: &str,
98        can_bubble: bool,
99        cancelable: bool,
100    ) -> Result<(), JsValue>;
101    #[cfg(feature = "Node")]
102    #[wasm_bindgen(
103        catch,
104        method,
105        js_class = "MutationEvent",
106        js_name = "initMutationEvent"
107    )]
108    #[doc = "The `initMutationEvent()` method."]
109    #[doc = ""]
110    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent/initMutationEvent)"]
111    #[doc = ""]
112    #[doc = "*This API requires the following crate features to be activated: `MutationEvent`, `Node`*"]
113    pub fn init_mutation_event_with_can_bubble_and_cancelable_and_related_node(
114        this: &MutationEvent,
115        type_: &str,
116        can_bubble: bool,
117        cancelable: bool,
118        related_node: Option<&Node>,
119    ) -> Result<(), JsValue>;
120    #[cfg(feature = "Node")]
121    #[wasm_bindgen(
122        catch,
123        method,
124        js_class = "MutationEvent",
125        js_name = "initMutationEvent"
126    )]
127    #[doc = "The `initMutationEvent()` method."]
128    #[doc = ""]
129    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent/initMutationEvent)"]
130    #[doc = ""]
131    #[doc = "*This API requires the following crate features to be activated: `MutationEvent`, `Node`*"]
132    pub fn init_mutation_event_with_can_bubble_and_cancelable_and_related_node_and_prev_value(
133        this: &MutationEvent,
134        type_: &str,
135        can_bubble: bool,
136        cancelable: bool,
137        related_node: Option<&Node>,
138        prev_value: &str,
139    ) -> Result<(), JsValue>;
140    #[cfg(feature = "Node")]
141    #[wasm_bindgen(
142        catch,
143        method,
144        js_class = "MutationEvent",
145        js_name = "initMutationEvent"
146    )]
147    #[doc = "The `initMutationEvent()` method."]
148    #[doc = ""]
149    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent/initMutationEvent)"]
150    #[doc = ""]
151    #[doc = "*This API requires the following crate features to be activated: `MutationEvent`, `Node`*"]
152    pub fn init_mutation_event_with_can_bubble_and_cancelable_and_related_node_and_prev_value_and_new_value(
153        this: &MutationEvent,
154        type_: &str,
155        can_bubble: bool,
156        cancelable: bool,
157        related_node: Option<&Node>,
158        prev_value: &str,
159        new_value: &str,
160    ) -> Result<(), JsValue>;
161    #[cfg(feature = "Node")]
162    #[wasm_bindgen(
163        catch,
164        method,
165        js_class = "MutationEvent",
166        js_name = "initMutationEvent"
167    )]
168    #[doc = "The `initMutationEvent()` method."]
169    #[doc = ""]
170    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent/initMutationEvent)"]
171    #[doc = ""]
172    #[doc = "*This API requires the following crate features to be activated: `MutationEvent`, `Node`*"]
173    pub fn init_mutation_event_with_can_bubble_and_cancelable_and_related_node_and_prev_value_and_new_value_and_attr_name(
174        this: &MutationEvent,
175        type_: &str,
176        can_bubble: bool,
177        cancelable: bool,
178        related_node: Option<&Node>,
179        prev_value: &str,
180        new_value: &str,
181        attr_name: &str,
182    ) -> Result<(), JsValue>;
183    #[cfg(feature = "Node")]
184    #[wasm_bindgen(
185        catch,
186        method,
187        js_class = "MutationEvent",
188        js_name = "initMutationEvent"
189    )]
190    #[doc = "The `initMutationEvent()` method."]
191    #[doc = ""]
192    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MutationEvent/initMutationEvent)"]
193    #[doc = ""]
194    #[doc = "*This API requires the following crate features to be activated: `MutationEvent`, `Node`*"]
195    pub fn init_mutation_event_with_can_bubble_and_cancelable_and_related_node_and_prev_value_and_new_value_and_attr_name_and_attr_change(
196        this: &MutationEvent,
197        type_: &str,
198        can_bubble: bool,
199        cancelable: bool,
200        related_node: Option<&Node>,
201        prev_value: &str,
202        new_value: &str,
203        attr_name: &str,
204        attr_change: u16,
205    ) -> Result<(), JsValue>;
206}
207impl MutationEvent {
208    #[doc = "The `MutationEvent.MODIFICATION` const."]
209    #[doc = ""]
210    #[doc = "*This API requires the following crate features to be activated: `MutationEvent`*"]
211    pub const MODIFICATION: u16 = 1u64 as u16;
212    #[doc = "The `MutationEvent.ADDITION` const."]
213    #[doc = ""]
214    #[doc = "*This API requires the following crate features to be activated: `MutationEvent`*"]
215    pub const ADDITION: u16 = 2u64 as u16;
216    #[doc = "The `MutationEvent.REMOVAL` const."]
217    #[doc = ""]
218    #[doc = "*This API requires the following crate features to be activated: `MutationEvent`*"]
219    pub const REMOVAL: u16 = 3u64 as u16;
220}