web_sys/features/
gen_ShareData.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 = ShareData)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `ShareData` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `ShareData`*"]
12    pub type ShareData;
13    #[doc = "Get the `files` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `ShareData`*"]
16    #[wasm_bindgen(method, getter = "files")]
17    pub fn get_files(this: &ShareData) -> Option<::js_sys::Array>;
18    #[doc = "Change the `files` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `ShareData`*"]
21    #[wasm_bindgen(method, setter = "files")]
22    pub fn set_files(this: &ShareData, val: &::wasm_bindgen::JsValue);
23    #[doc = "Get the `text` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `ShareData`*"]
26    #[wasm_bindgen(method, getter = "text")]
27    pub fn get_text(this: &ShareData) -> Option<::alloc::string::String>;
28    #[doc = "Change the `text` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `ShareData`*"]
31    #[wasm_bindgen(method, setter = "text")]
32    pub fn set_text(this: &ShareData, val: &str);
33    #[doc = "Get the `title` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `ShareData`*"]
36    #[wasm_bindgen(method, getter = "title")]
37    pub fn get_title(this: &ShareData) -> Option<::alloc::string::String>;
38    #[doc = "Change the `title` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `ShareData`*"]
41    #[wasm_bindgen(method, setter = "title")]
42    pub fn set_title(this: &ShareData, val: &str);
43    #[doc = "Get the `url` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `ShareData`*"]
46    #[wasm_bindgen(method, getter = "url")]
47    pub fn get_url(this: &ShareData) -> Option<::alloc::string::String>;
48    #[doc = "Change the `url` field of this object."]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `ShareData`*"]
51    #[wasm_bindgen(method, setter = "url")]
52    pub fn set_url(this: &ShareData, val: &str);
53}
54impl ShareData {
55    #[doc = "Construct a new `ShareData`."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `ShareData`*"]
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_files()` instead."]
64    pub fn files(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
65        self.set_files(val);
66        self
67    }
68    #[deprecated = "Use `set_text()` instead."]
69    pub fn text(&mut self, val: &str) -> &mut Self {
70        self.set_text(val);
71        self
72    }
73    #[deprecated = "Use `set_title()` instead."]
74    pub fn title(&mut self, val: &str) -> &mut Self {
75        self.set_title(val);
76        self
77    }
78    #[deprecated = "Use `set_url()` instead."]
79    pub fn url(&mut self, val: &str) -> &mut Self {
80        self.set_url(val);
81        self
82    }
83}
84impl Default for ShareData {
85    fn default() -> Self {
86        Self::new()
87    }
88}