web_sys/features/
gen_DataTransfer.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 = "DataTransfer",
10 typescript_type = "DataTransfer"
11 )]
12 #[derive(Debug, Clone, PartialEq, Eq)]
13 #[doc = "The `DataTransfer` class."]
14 #[doc = ""]
15 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer)"]
16 #[doc = ""]
17 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`*"]
18 pub type DataTransfer;
19 #[wasm_bindgen(method, getter, js_class = "DataTransfer", js_name = "dropEffect")]
20 #[doc = "Getter for the `dropEffect` field of this object."]
21 #[doc = ""]
22 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/dropEffect)"]
23 #[doc = ""]
24 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`*"]
25 pub fn drop_effect(this: &DataTransfer) -> ::alloc::string::String;
26 #[wasm_bindgen(method, setter, js_class = "DataTransfer", js_name = "dropEffect")]
27 #[doc = "Setter for the `dropEffect` field of this object."]
28 #[doc = ""]
29 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/dropEffect)"]
30 #[doc = ""]
31 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`*"]
32 pub fn set_drop_effect(this: &DataTransfer, value: &str);
33 #[wasm_bindgen(method, getter, js_class = "DataTransfer", js_name = "effectAllowed")]
34 #[doc = "Getter for the `effectAllowed` field of this object."]
35 #[doc = ""]
36 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/effectAllowed)"]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`*"]
39 pub fn effect_allowed(this: &DataTransfer) -> ::alloc::string::String;
40 #[wasm_bindgen(method, setter, js_class = "DataTransfer", js_name = "effectAllowed")]
41 #[doc = "Setter for the `effectAllowed` field of this object."]
42 #[doc = ""]
43 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/effectAllowed)"]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`*"]
46 pub fn set_effect_allowed(this: &DataTransfer, value: &str);
47 #[cfg(feature = "DataTransferItemList")]
48 #[wasm_bindgen(method, getter, js_class = "DataTransfer", js_name = "items")]
49 #[doc = "Getter for the `items` field of this object."]
50 #[doc = ""]
51 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/items)"]
52 #[doc = ""]
53 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`, `DataTransferItemList`*"]
54 pub fn items(this: &DataTransfer) -> DataTransferItemList;
55 #[wasm_bindgen(method, getter, js_class = "DataTransfer", js_name = "types")]
56 #[doc = "Getter for the `types` field of this object."]
57 #[doc = ""]
58 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types)"]
59 #[doc = ""]
60 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`*"]
61 pub fn types(this: &DataTransfer) -> ::js_sys::Array;
62 #[cfg(feature = "FileList")]
63 #[wasm_bindgen(method, getter, js_class = "DataTransfer", js_name = "files")]
64 #[doc = "Getter for the `files` field of this object."]
65 #[doc = ""]
66 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/files)"]
67 #[doc = ""]
68 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`, `FileList`*"]
69 pub fn files(this: &DataTransfer) -> Option<FileList>;
70 #[wasm_bindgen(catch, constructor, js_class = "DataTransfer")]
71 #[doc = "The `new DataTransfer(..)` constructor, creating a new instance of `DataTransfer`."]
72 #[doc = ""]
73 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/DataTransfer)"]
74 #[doc = ""]
75 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`*"]
76 pub fn new() -> Result<DataTransfer, JsValue>;
77 #[wasm_bindgen(catch, method, js_class = "DataTransfer", js_name = "clearData")]
78 #[doc = "The `clearData()` method."]
79 #[doc = ""]
80 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/clearData)"]
81 #[doc = ""]
82 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`*"]
83 pub fn clear_data(this: &DataTransfer) -> Result<(), JsValue>;
84 #[wasm_bindgen(catch, method, js_class = "DataTransfer", js_name = "clearData")]
85 #[doc = "The `clearData()` method."]
86 #[doc = ""]
87 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/clearData)"]
88 #[doc = ""]
89 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`*"]
90 pub fn clear_data_with_format(this: &DataTransfer, format: &str) -> Result<(), JsValue>;
91 #[wasm_bindgen(catch, method, js_class = "DataTransfer", js_name = "getData")]
92 #[doc = "The `getData()` method."]
93 #[doc = ""]
94 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/getData)"]
95 #[doc = ""]
96 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`*"]
97 pub fn get_data(this: &DataTransfer, format: &str) -> Result<::alloc::string::String, JsValue>;
98 #[wasm_bindgen(catch, method, js_class = "DataTransfer", js_name = "getFiles")]
99 #[doc = "The `getFiles()` method."]
100 #[doc = ""]
101 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/getFiles)"]
102 #[doc = ""]
103 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`*"]
104 pub fn get_files(this: &DataTransfer) -> Result<::js_sys::Promise, JsValue>;
105 #[wasm_bindgen(catch, method, js_class = "DataTransfer", js_name = "getFiles")]
106 #[doc = "The `getFiles()` method."]
107 #[doc = ""]
108 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/getFiles)"]
109 #[doc = ""]
110 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`*"]
111 pub fn get_files_with_recursive_flag(
112 this: &DataTransfer,
113 recursive_flag: bool,
114 ) -> Result<::js_sys::Promise, JsValue>;
115 #[wasm_bindgen(
116 catch,
117 method,
118 js_class = "DataTransfer",
119 js_name = "getFilesAndDirectories"
120 )]
121 #[doc = "The `getFilesAndDirectories()` method."]
122 #[doc = ""]
123 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/getFilesAndDirectories)"]
124 #[doc = ""]
125 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`*"]
126 pub fn get_files_and_directories(this: &DataTransfer) -> Result<::js_sys::Promise, JsValue>;
127 #[wasm_bindgen(catch, method, js_class = "DataTransfer", js_name = "setData")]
128 #[doc = "The `setData()` method."]
129 #[doc = ""]
130 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setData)"]
131 #[doc = ""]
132 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`*"]
133 pub fn set_data(this: &DataTransfer, format: &str, data: &str) -> Result<(), JsValue>;
134 #[cfg(feature = "Element")]
135 #[wasm_bindgen(method, js_class = "DataTransfer", js_name = "setDragImage")]
136 #[doc = "The `setDragImage()` method."]
137 #[doc = ""]
138 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setDragImage)"]
139 #[doc = ""]
140 #[doc = "*This API requires the following crate features to be activated: `DataTransfer`, `Element`*"]
141 pub fn set_drag_image(this: &DataTransfer, image: &Element, x: i32, y: i32);
142}