web_sys/features/
gen_IdbDatabase.rs

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