Skip to main content

web_sys/features/
gen_BrowserElementDownloadOptions.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 = "::js_sys::Object",
9        js_name = "BrowserElementDownloadOptions"
10    )]
11    #[derive(Debug, Clone, PartialEq, Eq)]
12    #[doc = "The `BrowserElementDownloadOptions` dictionary."]
13    #[doc = ""]
14    #[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"]
15    pub type BrowserElementDownloadOptions;
16    #[doc = "Get the `filename` field of this object."]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"]
19    #[wasm_bindgen(method, getter = "filename")]
20    pub fn get_filename(this: &BrowserElementDownloadOptions) -> Option<::alloc::string::String>;
21    #[doc = "Change the `filename` field of this object."]
22    #[doc = ""]
23    #[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"]
24    #[wasm_bindgen(method, setter = "filename")]
25    pub fn set_filename(this: &BrowserElementDownloadOptions, val: Option<&str>);
26    #[doc = "Get the `referrer` field of this object."]
27    #[doc = ""]
28    #[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"]
29    #[wasm_bindgen(method, getter = "referrer")]
30    pub fn get_referrer(this: &BrowserElementDownloadOptions) -> Option<::alloc::string::String>;
31    #[doc = "Change the `referrer` field of this object."]
32    #[doc = ""]
33    #[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"]
34    #[wasm_bindgen(method, setter = "referrer")]
35    pub fn set_referrer(this: &BrowserElementDownloadOptions, val: Option<&str>);
36}
37impl BrowserElementDownloadOptions {
38    #[doc = "Construct a new `BrowserElementDownloadOptions`."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `BrowserElementDownloadOptions`*"]
41    pub fn new() -> Self {
42        #[allow(unused_mut)]
43        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
44        ret
45    }
46    #[deprecated = "Use `set_filename()` instead."]
47    pub fn filename(&mut self, val: Option<&str>) -> &mut Self {
48        self.set_filename(val);
49        self
50    }
51    #[deprecated = "Use `set_referrer()` instead."]
52    pub fn referrer(&mut self, val: Option<&str>) -> &mut Self {
53        self.set_referrer(val);
54        self
55    }
56}
57impl Default for BrowserElementDownloadOptions {
58    fn default() -> Self {
59        Self::new()
60    }
61}