web_sys/features/
gen_DataTransferItem.rs1#![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 = DataTransferItem , typescript_type = "DataTransferItem")]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `DataTransferItem` class."]
10 #[doc = ""]
11 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem)"]
12 #[doc = ""]
13 #[doc = "*This API requires the following crate features to be activated: `DataTransferItem`*"]
14 pub type DataTransferItem;
15 # [wasm_bindgen (structural , method , getter , js_class = "DataTransferItem" , js_name = kind)]
16 #[doc = "Getter for the `kind` field of this object."]
17 #[doc = ""]
18 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/kind)"]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `DataTransferItem`*"]
21 pub fn kind(this: &DataTransferItem) -> ::alloc::string::String;
22 # [wasm_bindgen (structural , method , getter , js_class = "DataTransferItem" , js_name = type)]
23 #[doc = "Getter for the `type` field of this object."]
24 #[doc = ""]
25 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/type)"]
26 #[doc = ""]
27 #[doc = "*This API requires the following crate features to be activated: `DataTransferItem`*"]
28 pub fn type_(this: &DataTransferItem) -> ::alloc::string::String;
29 #[cfg(feature = "File")]
30 # [wasm_bindgen (catch , method , structural , js_class = "DataTransferItem" , js_name = getAsFile)]
31 #[doc = "The `getAsFile()` method."]
32 #[doc = ""]
33 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/getAsFile)"]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `DataTransferItem`, `File`*"]
36 pub fn get_as_file(this: &DataTransferItem) -> Result<Option<File>, JsValue>;
37 #[cfg(web_sys_unstable_apis)]
38 # [wasm_bindgen (method , structural , js_class = "DataTransferItem" , js_name = getAsFileSystemHandle)]
39 #[doc = "The `getAsFileSystemHandle()` method."]
40 #[doc = ""]
41 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/getAsFileSystemHandle)"]
42 #[doc = ""]
43 #[doc = "*This API requires the following crate features to be activated: `DataTransferItem`*"]
44 #[doc = ""]
45 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
46 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
47 pub fn get_as_file_system_handle(this: &DataTransferItem) -> ::js_sys::Promise;
48 # [wasm_bindgen (catch , method , structural , js_class = "DataTransferItem" , js_name = getAsString)]
49 #[doc = "The `getAsString()` method."]
50 #[doc = ""]
51 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/getAsString)"]
52 #[doc = ""]
53 #[doc = "*This API requires the following crate features to be activated: `DataTransferItem`*"]
54 pub fn get_as_string(
55 this: &DataTransferItem,
56 callback: Option<&::js_sys::Function>,
57 ) -> Result<(), JsValue>;
58 #[cfg(feature = "FileSystemEntry")]
59 # [wasm_bindgen (catch , method , structural , js_class = "DataTransferItem" , js_name = webkitGetAsEntry)]
60 #[doc = "The `webkitGetAsEntry()` method."]
61 #[doc = ""]
62 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry)"]
63 #[doc = ""]
64 #[doc = "*This API requires the following crate features to be activated: `DataTransferItem`, `FileSystemEntry`*"]
65 pub fn webkit_get_as_entry(this: &DataTransferItem)
66 -> Result<Option<FileSystemEntry>, JsValue>;
67}