web_sys/features/
gen_DataTransferItemList.rs

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