web_sys/features/
gen_ShadowRootInit.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 = ShadowRootInit)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `ShadowRootInit` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `ShadowRootInit`*"]
12 pub type ShadowRootInit;
13 #[cfg(feature = "ShadowRootMode")]
14 #[doc = "Get the `mode` field of this object."]
15 #[doc = ""]
16 #[doc = "*This API requires the following crate features to be activated: `ShadowRootInit`, `ShadowRootMode`*"]
17 #[wasm_bindgen(method, getter = "mode")]
18 pub fn get_mode(this: &ShadowRootInit) -> ShadowRootMode;
19 #[cfg(feature = "ShadowRootMode")]
20 #[doc = "Change the `mode` field of this object."]
21 #[doc = ""]
22 #[doc = "*This API requires the following crate features to be activated: `ShadowRootInit`, `ShadowRootMode`*"]
23 #[wasm_bindgen(method, setter = "mode")]
24 pub fn set_mode(this: &ShadowRootInit, val: ShadowRootMode);
25}
26impl ShadowRootInit {
27 #[cfg(feature = "ShadowRootMode")]
28 #[doc = "Construct a new `ShadowRootInit`."]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `ShadowRootInit`, `ShadowRootMode`*"]
31 pub fn new(mode: ShadowRootMode) -> Self {
32 #[allow(unused_mut)]
33 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
34 ret.set_mode(mode);
35 ret
36 }
37 #[cfg(feature = "ShadowRootMode")]
38 #[deprecated = "Use `set_mode()` instead."]
39 pub fn mode(&mut self, val: ShadowRootMode) -> &mut Self {
40 self.set_mode(val);
41 self
42 }
43}