Skip to main content

web_sys/features/
gen_DirectoryPickerOptions.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = DirectoryPickerOptions)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `DirectoryPickerOptions` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`*"]
13    #[doc = ""]
14    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type DirectoryPickerOptions;
17    #[cfg(web_sys_unstable_apis)]
18    #[doc = "Get the `id` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`*"]
21    #[doc = ""]
22    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
24    #[wasm_bindgen(method, getter = "id")]
25    pub fn get_id(this: &DirectoryPickerOptions) -> Option<::alloc::string::String>;
26    #[cfg(web_sys_unstable_apis)]
27    #[doc = "Change the `id` field of this object."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`*"]
30    #[doc = ""]
31    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
32    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
33    #[wasm_bindgen(method, setter = "id")]
34    pub fn set_id(this: &DirectoryPickerOptions, val: &str);
35    #[cfg(web_sys_unstable_apis)]
36    #[cfg(feature = "FileSystemPermissionMode")]
37    #[doc = "Get the `mode` field of this object."]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`, `FileSystemPermissionMode`*"]
40    #[doc = ""]
41    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
42    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
43    #[wasm_bindgen(method, getter = "mode")]
44    pub fn get_mode(this: &DirectoryPickerOptions) -> Option<FileSystemPermissionMode>;
45    #[cfg(web_sys_unstable_apis)]
46    #[cfg(feature = "FileSystemPermissionMode")]
47    #[doc = "Change the `mode` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`, `FileSystemPermissionMode`*"]
50    #[doc = ""]
51    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
53    #[wasm_bindgen(method, setter = "mode")]
54    pub fn set_mode(this: &DirectoryPickerOptions, val: FileSystemPermissionMode);
55    #[cfg(web_sys_unstable_apis)]
56    #[cfg(feature = "WellKnownDirectory")]
57    #[doc = "Get the `startIn` field of this object."]
58    #[doc = ""]
59    #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`, `WellKnownDirectory`*"]
60    #[doc = ""]
61    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
62    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
63    #[wasm_bindgen(method, getter = "startIn")]
64    pub fn get_start_in(this: &DirectoryPickerOptions) -> ::wasm_bindgen::JsValue;
65    #[cfg(web_sys_unstable_apis)]
66    #[cfg(feature = "WellKnownDirectory")]
67    #[doc = "Change the `startIn` field of this object."]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`, `WellKnownDirectory`*"]
70    #[doc = ""]
71    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
72    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
73    #[wasm_bindgen(method, setter = "startIn")]
74    pub fn set_start_in(this: &DirectoryPickerOptions, val: WellKnownDirectory);
75    #[cfg(web_sys_unstable_apis)]
76    #[cfg(feature = "FileSystemHandle")]
77    #[doc = "Change the `startIn` field of this object."]
78    #[doc = ""]
79    #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`, `FileSystemHandle`*"]
80    #[doc = ""]
81    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
82    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
83    #[wasm_bindgen(method, setter = "startIn")]
84    pub fn set_start_in_file_system_handle(this: &DirectoryPickerOptions, val: &FileSystemHandle);
85}
86#[cfg(web_sys_unstable_apis)]
87impl DirectoryPickerOptions {
88    #[doc = "Construct a new `DirectoryPickerOptions`."]
89    #[doc = ""]
90    #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`*"]
91    #[doc = ""]
92    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
93    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
94    pub fn new() -> Self {
95        #[allow(unused_mut)]
96        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
97        ret
98    }
99    #[cfg(web_sys_unstable_apis)]
100    #[deprecated = "Use `set_id()` instead."]
101    pub fn id(&mut self, val: &str) -> &mut Self {
102        self.set_id(val);
103        self
104    }
105    #[cfg(web_sys_unstable_apis)]
106    #[cfg(feature = "FileSystemPermissionMode")]
107    #[deprecated = "Use `set_mode()` instead."]
108    pub fn mode(&mut self, val: FileSystemPermissionMode) -> &mut Self {
109        self.set_mode(val);
110        self
111    }
112    #[cfg(web_sys_unstable_apis)]
113    #[cfg(feature = "WellKnownDirectory")]
114    #[deprecated = "Use `set_start_in()` instead."]
115    pub fn start_in(&mut self, val: WellKnownDirectory) -> &mut Self {
116        self.set_start_in(val);
117        self
118    }
119}
120#[cfg(web_sys_unstable_apis)]
121impl Default for DirectoryPickerOptions {
122    fn default() -> Self {
123        Self::new()
124    }
125}