web_sys/features/
gen_DataTransferItemList.rs1#![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 = "DataTransferItemList",
10 typescript_type = "DataTransferItemList"
11 )]
12 #[derive(Debug, Clone, PartialEq, Eq)]
13 #[doc = "The `DataTransferItemList` class."]
14 #[doc = ""]
15 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList)"]
16 #[doc = ""]
17 #[doc = "*This API requires the following crate features to be activated: `DataTransferItemList`*"]
18 pub type DataTransferItemList;
19 #[wasm_bindgen(method, getter, js_class = "DataTransferItemList", js_name = "length")]
20 #[doc = "Getter for the `length` field of this object."]
21 #[doc = ""]
22 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList/length)"]
23 #[doc = ""]
24 #[doc = "*This API requires the following crate features to be activated: `DataTransferItemList`*"]
25 pub fn length(this: &DataTransferItemList) -> u32;
26 #[cfg(feature = "DataTransferItem")]
27 #[wasm_bindgen(catch, method, js_class = "DataTransferItemList", js_name = "add")]
28 #[doc = "The `add()` method."]
29 #[doc = ""]
30 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList/add)"]
31 #[doc = ""]
32 #[doc = "*This API requires the following crate features to be activated: `DataTransferItem`, `DataTransferItemList`*"]
33 pub fn add_with_str_and_type(
34 this: &DataTransferItemList,
35 data: &str,
36 type_: &str,
37 ) -> Result<Option<DataTransferItem>, JsValue>;
38 #[cfg(all(feature = "DataTransferItem", feature = "File",))]
39 #[wasm_bindgen(catch, method, js_class = "DataTransferItemList", js_name = "add")]
40 #[doc = "The `add()` method."]
41 #[doc = ""]
42 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList/add)"]
43 #[doc = ""]
44 #[doc = "*This API requires the following crate features to be activated: `DataTransferItem`, `DataTransferItemList`, `File`*"]
45 pub fn add_with_file(
46 this: &DataTransferItemList,
47 data: &File,
48 ) -> Result<Option<DataTransferItem>, JsValue>;
49 #[wasm_bindgen(catch, method, js_class = "DataTransferItemList")]
50 #[doc = "The `clear()` method."]
51 #[doc = ""]
52 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList/clear)"]
53 #[doc = ""]
54 #[doc = "*This API requires the following crate features to be activated: `DataTransferItemList`*"]
55 pub fn clear(this: &DataTransferItemList) -> Result<(), JsValue>;
56 #[wasm_bindgen(catch, method, js_class = "DataTransferItemList")]
57 #[doc = "The `remove()` method."]
58 #[doc = ""]
59 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList/remove)"]
60 #[doc = ""]
61 #[doc = "*This API requires the following crate features to be activated: `DataTransferItemList`*"]
62 pub fn remove(this: &DataTransferItemList, index: u32) -> Result<(), JsValue>;
63 #[cfg(feature = "DataTransferItem")]
64 #[wasm_bindgen(method, js_class = "DataTransferItemList", indexing_getter)]
65 #[doc = "Indexing getter. As in the literal Javascript `this[key]`."]
66 #[doc = ""]
67 #[doc = ""]
68 #[doc = "*This API requires the following crate features to be activated: `DataTransferItem`, `DataTransferItemList`*"]
69 pub fn get(this: &DataTransferItemList, index: u32) -> Option<DataTransferItem>;
70}