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 #[cfg(feature = "FileSystemHandle")]
39 # [wasm_bindgen (method , structural , js_class = "DataTransferItem" , js_name = getAsFileSystemHandle)]
40 #[doc = "The `getAsFileSystemHandle()` method."]
41 #[doc = ""]
42 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/getAsFileSystemHandle)"]
43 #[doc = ""]
44 #[doc = "*This API requires the following crate features to be activated: `DataTransferItem`, `FileSystemHandle`*"]
45 #[doc = ""]
46 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
47 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
48 pub fn get_as_file_system_handle(
49 this: &DataTransferItem,
50 ) -> ::js_sys::Promise<::js_sys::JsOption<FileSystemHandle>>;
51 # [wasm_bindgen (catch , method , structural , js_class = "DataTransferItem" , js_name = getAsString)]
52 #[doc = "The `getAsString()` method."]
53 #[doc = ""]
54 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/getAsString)"]
55 #[doc = ""]
56 #[doc = "*This API requires the following crate features to be activated: `DataTransferItem`*"]
57 pub fn get_as_string(
58 this: &DataTransferItem,
59 callback: Option<&::js_sys::Function>,
60 ) -> Result<(), JsValue>;
61 #[cfg(feature = "FileSystemEntry")]
62 # [wasm_bindgen (catch , method , structural , js_class = "DataTransferItem" , js_name = webkitGetAsEntry)]
63 #[doc = "The `webkitGetAsEntry()` method."]
64 #[doc = ""]
65 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry)"]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `DataTransferItem`, `FileSystemEntry`*"]
68 pub fn webkit_get_as_entry(this: &DataTransferItem)
69 -> Result<Option<FileSystemEntry>, JsValue>;
70}