web_sys/features/
gen_DirectoryPickerOptions.rs1#![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 #[doc = "Get the `startIn` field of this object."]
57 #[doc = ""]
58 #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`*"]
59 #[doc = ""]
60 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
61 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
62 #[wasm_bindgen(method, getter = "startIn")]
63 pub fn get_start_in(this: &DirectoryPickerOptions) -> ::wasm_bindgen::JsValue;
64 #[cfg(web_sys_unstable_apis)]
65 #[cfg(feature = "WellKnownDirectory")]
66 #[doc = "Change the `startIn` field of this object."]
67 #[doc = ""]
68 #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`*"]
69 #[doc = ""]
70 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
71 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
72 #[wasm_bindgen(method, setter = "startIn")]
73 pub fn set_start_in(this: &DirectoryPickerOptions, val: WellKnownDirectory);
74 #[cfg(web_sys_unstable_apis)]
75 #[cfg(feature = "FileSystemHandle")]
76 #[doc = "Change the `startIn` field of this object."]
77 #[doc = ""]
78 #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`*"]
79 #[doc = ""]
80 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
81 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
82 #[wasm_bindgen(method, setter = "startIn")]
83 pub fn set_start_in_file_system_handle(this: &DirectoryPickerOptions, val: &FileSystemHandle);
84}
85#[cfg(web_sys_unstable_apis)]
86impl DirectoryPickerOptions {
87 #[doc = "Construct a new `DirectoryPickerOptions`."]
88 #[doc = ""]
89 #[doc = "*This API requires the following crate features to be activated: `DirectoryPickerOptions`*"]
90 #[doc = ""]
91 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
92 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
93 pub fn new() -> Self {
94 #[allow(unused_mut)]
95 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
96 ret
97 }
98 #[cfg(web_sys_unstable_apis)]
99 #[deprecated = "Use `set_id()` instead."]
100 pub fn id(&mut self, val: &str) -> &mut Self {
101 self.set_id(val);
102 self
103 }
104 #[cfg(web_sys_unstable_apis)]
105 #[cfg(feature = "FileSystemPermissionMode")]
106 #[deprecated = "Use `set_mode()` instead."]
107 pub fn mode(&mut self, val: FileSystemPermissionMode) -> &mut Self {
108 self.set_mode(val);
109 self
110 }
111 #[cfg(web_sys_unstable_apis)]
112 #[deprecated = "Use `set_start_in()` instead."]
113 pub fn start_in(&mut self, val: WellKnownDirectory) -> &mut Self {
114 self.set_start_in(val);
115 self
116 }
117}
118#[cfg(web_sys_unstable_apis)]
119impl Default for DirectoryPickerOptions {
120 fn default() -> Self {
121 Self::new()
122 }
123}