1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 #[wasm_bindgen(
8 extends = "EventTarget",
9 extends = "::js_sys::Object",
10 js_name = "IDBDatabase",
11 typescript_type = "IDBDatabase"
12 )]
13 #[derive(Debug, Clone, PartialEq, Eq)]
14 #[doc = "The `IdbDatabase` class."]
15 #[doc = ""]
16 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase)"]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`*"]
19 pub type IdbDatabase;
20 #[wasm_bindgen(method, getter, js_class = "IDBDatabase", js_name = "name")]
21 #[doc = "Getter for the `name` field of this object."]
22 #[doc = ""]
23 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/name)"]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`*"]
26 pub fn name(this: &IdbDatabase) -> ::alloc::string::String;
27 #[wasm_bindgen(method, getter, js_class = "IDBDatabase", js_name = "version")]
28 #[doc = "Getter for the `version` field of this object."]
29 #[doc = ""]
30 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/version)"]
31 #[doc = ""]
32 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`*"]
33 pub fn version(this: &IdbDatabase) -> f64;
34 #[cfg(feature = "DomStringList")]
35 #[wasm_bindgen(method, getter, js_class = "IDBDatabase", js_name = "objectStoreNames")]
36 #[doc = "Getter for the `objectStoreNames` field of this object."]
37 #[doc = ""]
38 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/objectStoreNames)"]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `DomStringList`, `IdbDatabase`*"]
41 pub fn object_store_names(this: &IdbDatabase) -> DomStringList;
42 #[wasm_bindgen(method, getter, js_class = "IDBDatabase", js_name = "onabort")]
43 #[doc = "Getter for the `onabort` field of this object."]
44 #[doc = ""]
45 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/onabort)"]
46 #[doc = ""]
47 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`*"]
48 pub fn onabort(this: &IdbDatabase) -> Option<::js_sys::Function>;
49 #[wasm_bindgen(method, setter, js_class = "IDBDatabase", js_name = "onabort")]
50 #[doc = "Setter for the `onabort` field of this object."]
51 #[doc = ""]
52 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/onabort)"]
53 #[doc = ""]
54 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`*"]
55 pub fn set_onabort(this: &IdbDatabase, value: Option<&::js_sys::Function>);
56 #[wasm_bindgen(method, getter, js_class = "IDBDatabase", js_name = "onclose")]
57 #[doc = "Getter for the `onclose` field of this object."]
58 #[doc = ""]
59 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/onclose)"]
60 #[doc = ""]
61 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`*"]
62 pub fn onclose(this: &IdbDatabase) -> Option<::js_sys::Function>;
63 #[wasm_bindgen(method, setter, js_class = "IDBDatabase", js_name = "onclose")]
64 #[doc = "Setter for the `onclose` field of this object."]
65 #[doc = ""]
66 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/onclose)"]
67 #[doc = ""]
68 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`*"]
69 pub fn set_onclose(this: &IdbDatabase, value: Option<&::js_sys::Function>);
70 #[wasm_bindgen(method, getter, js_class = "IDBDatabase", js_name = "onerror")]
71 #[doc = "Getter for the `onerror` field of this object."]
72 #[doc = ""]
73 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/onerror)"]
74 #[doc = ""]
75 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`*"]
76 pub fn onerror(this: &IdbDatabase) -> Option<::js_sys::Function>;
77 #[wasm_bindgen(method, setter, js_class = "IDBDatabase", js_name = "onerror")]
78 #[doc = "Setter for the `onerror` field of this object."]
79 #[doc = ""]
80 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/onerror)"]
81 #[doc = ""]
82 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`*"]
83 pub fn set_onerror(this: &IdbDatabase, value: Option<&::js_sys::Function>);
84 #[wasm_bindgen(method, getter, js_class = "IDBDatabase", js_name = "onversionchange")]
85 #[doc = "Getter for the `onversionchange` field of this object."]
86 #[doc = ""]
87 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/onversionchange)"]
88 #[doc = ""]
89 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`*"]
90 pub fn onversionchange(this: &IdbDatabase) -> Option<::js_sys::Function>;
91 #[wasm_bindgen(method, setter, js_class = "IDBDatabase", js_name = "onversionchange")]
92 #[doc = "Setter for the `onversionchange` field of this object."]
93 #[doc = ""]
94 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/onversionchange)"]
95 #[doc = ""]
96 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`*"]
97 pub fn set_onversionchange(this: &IdbDatabase, value: Option<&::js_sys::Function>);
98 #[cfg(feature = "StorageType")]
99 #[wasm_bindgen(method, getter, js_class = "IDBDatabase", js_name = "storage")]
100 #[doc = "Getter for the `storage` field of this object."]
101 #[doc = ""]
102 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/storage)"]
103 #[doc = ""]
104 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`, `StorageType`*"]
105 #[deprecated]
106 pub fn storage(this: &IdbDatabase) -> StorageType;
107 #[wasm_bindgen(method, js_class = "IDBDatabase")]
108 #[doc = "The `close()` method."]
109 #[doc = ""]
110 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/close)"]
111 #[doc = ""]
112 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`*"]
113 pub fn close(this: &IdbDatabase);
114 #[cfg(feature = "IdbRequest")]
115 #[wasm_bindgen(catch, method, js_class = "IDBDatabase", js_name = "createMutableFile")]
116 #[doc = "The `createMutableFile()` method."]
117 #[doc = ""]
118 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/createMutableFile)"]
119 #[doc = ""]
120 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`, `IdbRequest`*"]
121 #[deprecated]
122 pub fn create_mutable_file(this: &IdbDatabase, name: &str) -> Result<IdbRequest, JsValue>;
123 #[cfg(feature = "IdbRequest")]
124 #[wasm_bindgen(catch, method, js_class = "IDBDatabase", js_name = "createMutableFile")]
125 #[doc = "The `createMutableFile()` method."]
126 #[doc = ""]
127 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/createMutableFile)"]
128 #[doc = ""]
129 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`, `IdbRequest`*"]
130 #[deprecated]
131 pub fn create_mutable_file_with_type(
132 this: &IdbDatabase,
133 name: &str,
134 type_: &str,
135 ) -> Result<IdbRequest, JsValue>;
136 #[cfg(feature = "IdbObjectStore")]
137 #[wasm_bindgen(catch, method, js_class = "IDBDatabase", js_name = "createObjectStore")]
138 #[doc = "The `createObjectStore()` method."]
139 #[doc = ""]
140 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/createObjectStore)"]
141 #[doc = ""]
142 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`, `IdbObjectStore`*"]
143 pub fn create_object_store(this: &IdbDatabase, name: &str) -> Result<IdbObjectStore, JsValue>;
144 #[cfg(all(feature = "IdbObjectStore", feature = "IdbObjectStoreParameters",))]
145 #[wasm_bindgen(catch, method, js_class = "IDBDatabase", js_name = "createObjectStore")]
146 #[doc = "The `createObjectStore()` method."]
147 #[doc = ""]
148 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/createObjectStore)"]
149 #[doc = ""]
150 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`, `IdbObjectStore`, `IdbObjectStoreParameters`*"]
151 pub fn create_object_store_with_optional_parameters(
152 this: &IdbDatabase,
153 name: &str,
154 options: &IdbObjectStoreParameters,
155 ) -> Result<IdbObjectStore, JsValue>;
156 #[wasm_bindgen(catch, method, js_class = "IDBDatabase", js_name = "deleteObjectStore")]
157 #[doc = "The `deleteObjectStore()` method."]
158 #[doc = ""]
159 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/deleteObjectStore)"]
160 #[doc = ""]
161 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`*"]
162 pub fn delete_object_store(this: &IdbDatabase, name: &str) -> Result<(), JsValue>;
163 #[cfg(feature = "IdbTransaction")]
164 #[wasm_bindgen(catch, method, js_class = "IDBDatabase", js_name = "transaction")]
165 #[doc = "The `transaction()` method."]
166 #[doc = ""]
167 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/transaction)"]
168 #[doc = ""]
169 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`, `IdbTransaction`*"]
170 pub fn transaction_with_str(
171 this: &IdbDatabase,
172 store_names: &str,
173 ) -> Result<IdbTransaction, JsValue>;
174 #[cfg(feature = "IdbTransaction")]
175 #[wasm_bindgen(catch, method, js_class = "IDBDatabase", js_name = "transaction")]
176 #[doc = "The `transaction()` method."]
177 #[doc = ""]
178 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/transaction)"]
179 #[doc = ""]
180 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`, `IdbTransaction`*"]
181 pub fn transaction_with_str_sequence(
182 this: &IdbDatabase,
183 store_names: &::wasm_bindgen::JsValue,
184 ) -> Result<IdbTransaction, JsValue>;
185 #[cfg(all(feature = "IdbTransaction", feature = "IdbTransactionMode",))]
186 #[wasm_bindgen(catch, method, js_class = "IDBDatabase", js_name = "transaction")]
187 #[doc = "The `transaction()` method."]
188 #[doc = ""]
189 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/transaction)"]
190 #[doc = ""]
191 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`, `IdbTransaction`, `IdbTransactionMode`*"]
192 pub fn transaction_with_str_and_mode(
193 this: &IdbDatabase,
194 store_names: &str,
195 mode: IdbTransactionMode,
196 ) -> Result<IdbTransaction, JsValue>;
197 #[cfg(all(feature = "IdbTransaction", feature = "IdbTransactionMode",))]
198 #[wasm_bindgen(catch, method, js_class = "IDBDatabase", js_name = "transaction")]
199 #[doc = "The `transaction()` method."]
200 #[doc = ""]
201 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/transaction)"]
202 #[doc = ""]
203 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`, `IdbTransaction`, `IdbTransactionMode`*"]
204 pub fn transaction_with_str_sequence_and_mode(
205 this: &IdbDatabase,
206 store_names: &::wasm_bindgen::JsValue,
207 mode: IdbTransactionMode,
208 ) -> Result<IdbTransaction, JsValue>;
209 #[cfg(web_sys_unstable_apis)]
210 #[cfg(all(
211 feature = "IdbTransaction",
212 feature = "IdbTransactionMode",
213 feature = "IdbTransactionOptions",
214 ))]
215 #[wasm_bindgen(catch, method, js_class = "IDBDatabase", js_name = "transaction")]
216 #[doc = "The `transaction()` method."]
217 #[doc = ""]
218 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/transaction)"]
219 #[doc = ""]
220 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`, `IdbTransaction`, `IdbTransactionMode`, `IdbTransactionOptions`*"]
221 #[doc = ""]
222 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
223 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
224 pub fn transaction_with_str_and_mode_and_options(
225 this: &IdbDatabase,
226 store_names: &str,
227 mode: IdbTransactionMode,
228 options: &IdbTransactionOptions,
229 ) -> Result<IdbTransaction, JsValue>;
230 #[cfg(web_sys_unstable_apis)]
231 #[cfg(all(
232 feature = "IdbTransaction",
233 feature = "IdbTransactionMode",
234 feature = "IdbTransactionOptions",
235 ))]
236 #[wasm_bindgen(catch, method, js_class = "IDBDatabase", js_name = "transaction")]
237 #[doc = "The `transaction()` method."]
238 #[doc = ""]
239 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/transaction)"]
240 #[doc = ""]
241 #[doc = "*This API requires the following crate features to be activated: `IdbDatabase`, `IdbTransaction`, `IdbTransactionMode`, `IdbTransactionOptions`*"]
242 #[doc = ""]
243 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
244 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
245 pub fn transaction_with_str_sequence_and_mode_and_options(
246 this: &IdbDatabase,
247 store_names: &[::js_sys::JsString],
248 mode: IdbTransactionMode,
249 options: &IdbTransactionOptions,
250 ) -> Result<IdbTransaction, JsValue>;
251}