Skip to main content

web_sys/features/
gen_DataTransferItem.rs

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