maxcountryman_web_sys/features/
gen_DataTransfer.rs

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