web_sys/features/
gen_L10nElement.rs

1#![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 = L10nElement)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `L10nElement` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"]
12    pub type L10nElement;
13    #[doc = "Get the `l10nArgs` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"]
16    #[wasm_bindgen(method, getter = "l10nArgs")]
17    pub fn get_l10n_args(this: &L10nElement) -> Option<::js_sys::Object>;
18    #[doc = "Change the `l10nArgs` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"]
21    #[wasm_bindgen(method, setter = "l10nArgs")]
22    pub fn set_l10n_args(this: &L10nElement, val: Option<&::js_sys::Object>);
23    #[doc = "Get the `l10nAttrs` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"]
26    #[wasm_bindgen(method, getter = "l10nAttrs")]
27    pub fn get_l10n_attrs(this: &L10nElement) -> Option<::alloc::string::String>;
28    #[doc = "Change the `l10nAttrs` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"]
31    #[wasm_bindgen(method, setter = "l10nAttrs")]
32    pub fn set_l10n_attrs(this: &L10nElement, val: Option<&str>);
33    #[doc = "Get the `l10nId` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"]
36    #[wasm_bindgen(method, getter = "l10nId")]
37    pub fn get_l10n_id(this: &L10nElement) -> ::alloc::string::String;
38    #[doc = "Change the `l10nId` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"]
41    #[wasm_bindgen(method, setter = "l10nId")]
42    pub fn set_l10n_id(this: &L10nElement, val: &str);
43    #[doc = "Get the `localName` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"]
46    #[wasm_bindgen(method, getter = "localName")]
47    pub fn get_local_name(this: &L10nElement) -> ::alloc::string::String;
48    #[doc = "Change the `localName` field of this object."]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"]
51    #[wasm_bindgen(method, setter = "localName")]
52    pub fn set_local_name(this: &L10nElement, val: &str);
53    #[doc = "Get the `namespaceURI` field of this object."]
54    #[doc = ""]
55    #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"]
56    #[wasm_bindgen(method, getter = "namespaceURI")]
57    pub fn get_namespace_uri(this: &L10nElement) -> ::alloc::string::String;
58    #[doc = "Change the `namespaceURI` field of this object."]
59    #[doc = ""]
60    #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"]
61    #[wasm_bindgen(method, setter = "namespaceURI")]
62    pub fn set_namespace_uri(this: &L10nElement, val: &str);
63    #[doc = "Get the `type` field of this object."]
64    #[doc = ""]
65    #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"]
66    #[wasm_bindgen(method, getter = "type")]
67    pub fn get_type(this: &L10nElement) -> Option<::alloc::string::String>;
68    #[doc = "Change the `type` field of this object."]
69    #[doc = ""]
70    #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"]
71    #[wasm_bindgen(method, setter = "type")]
72    pub fn set_type(this: &L10nElement, val: Option<&str>);
73}
74impl L10nElement {
75    #[doc = "Construct a new `L10nElement`."]
76    #[doc = ""]
77    #[doc = "*This API requires the following crate features to be activated: `L10nElement`*"]
78    pub fn new(l10n_id: &str, local_name: &str, namespace_uri: &str) -> Self {
79        #[allow(unused_mut)]
80        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
81        ret.set_l10n_id(l10n_id);
82        ret.set_local_name(local_name);
83        ret.set_namespace_uri(namespace_uri);
84        ret
85    }
86    #[deprecated = "Use `set_l10n_args()` instead."]
87    pub fn l10n_args(&mut self, val: Option<&::js_sys::Object>) -> &mut Self {
88        self.set_l10n_args(val);
89        self
90    }
91    #[deprecated = "Use `set_l10n_attrs()` instead."]
92    pub fn l10n_attrs(&mut self, val: Option<&str>) -> &mut Self {
93        self.set_l10n_attrs(val);
94        self
95    }
96    #[deprecated = "Use `set_l10n_id()` instead."]
97    pub fn l10n_id(&mut self, val: &str) -> &mut Self {
98        self.set_l10n_id(val);
99        self
100    }
101    #[deprecated = "Use `set_local_name()` instead."]
102    pub fn local_name(&mut self, val: &str) -> &mut Self {
103        self.set_local_name(val);
104        self
105    }
106    #[deprecated = "Use `set_namespace_uri()` instead."]
107    pub fn namespace_uri(&mut self, val: &str) -> &mut Self {
108        self.set_namespace_uri(val);
109        self
110    }
111    #[deprecated = "Use `set_type()` instead."]
112    pub fn type_(&mut self, val: Option<&str>) -> &mut Self {
113        self.set_type(val);
114        self
115    }
116}