web_sys/features/
gen_LifecycleCallbacks.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = LifecycleCallbacks)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `LifecycleCallbacks` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"]
12 pub type LifecycleCallbacks;
13 #[doc = "Get the `adoptedCallback` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"]
16 #[wasm_bindgen(method, getter = "adoptedCallback")]
17 pub fn get_adopted_callback(this: &LifecycleCallbacks) -> Option<::js_sys::Function>;
18 #[doc = "Change the `adoptedCallback` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"]
21 #[wasm_bindgen(method, setter = "adoptedCallback")]
22 pub fn set_adopted_callback(this: &LifecycleCallbacks, val: &::js_sys::Function);
23 #[doc = "Get the `attributeChangedCallback` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"]
26 #[wasm_bindgen(method, getter = "attributeChangedCallback")]
27 pub fn get_attribute_changed_callback(this: &LifecycleCallbacks) -> Option<::js_sys::Function>;
28 #[doc = "Change the `attributeChangedCallback` field of this object."]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"]
31 #[wasm_bindgen(method, setter = "attributeChangedCallback")]
32 pub fn set_attribute_changed_callback(this: &LifecycleCallbacks, val: &::js_sys::Function);
33 #[doc = "Get the `connectedCallback` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"]
36 #[wasm_bindgen(method, getter = "connectedCallback")]
37 pub fn get_connected_callback(this: &LifecycleCallbacks) -> Option<::js_sys::Function>;
38 #[doc = "Change the `connectedCallback` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"]
41 #[wasm_bindgen(method, setter = "connectedCallback")]
42 pub fn set_connected_callback(this: &LifecycleCallbacks, val: &::js_sys::Function);
43 #[doc = "Get the `disconnectedCallback` field of this object."]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"]
46 #[wasm_bindgen(method, getter = "disconnectedCallback")]
47 pub fn get_disconnected_callback(this: &LifecycleCallbacks) -> Option<::js_sys::Function>;
48 #[doc = "Change the `disconnectedCallback` field of this object."]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"]
51 #[wasm_bindgen(method, setter = "disconnectedCallback")]
52 pub fn set_disconnected_callback(this: &LifecycleCallbacks, val: &::js_sys::Function);
53}
54impl LifecycleCallbacks {
55 #[doc = "Construct a new `LifecycleCallbacks`."]
56 #[doc = ""]
57 #[doc = "*This API requires the following crate features to be activated: `LifecycleCallbacks`*"]
58 pub fn new() -> Self {
59 #[allow(unused_mut)]
60 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
61 ret
62 }
63 #[deprecated = "Use `set_adopted_callback()` instead."]
64 pub fn adopted_callback(&mut self, val: &::js_sys::Function) -> &mut Self {
65 self.set_adopted_callback(val);
66 self
67 }
68 #[deprecated = "Use `set_attribute_changed_callback()` instead."]
69 pub fn attribute_changed_callback(&mut self, val: &::js_sys::Function) -> &mut Self {
70 self.set_attribute_changed_callback(val);
71 self
72 }
73 #[deprecated = "Use `set_connected_callback()` instead."]
74 pub fn connected_callback(&mut self, val: &::js_sys::Function) -> &mut Self {
75 self.set_connected_callback(val);
76 self
77 }
78 #[deprecated = "Use `set_disconnected_callback()` instead."]
79 pub fn disconnected_callback(&mut self, val: &::js_sys::Function) -> &mut Self {
80 self.set_disconnected_callback(val);
81 self
82 }
83}
84impl Default for LifecycleCallbacks {
85 fn default() -> Self {
86 Self::new()
87 }
88}