-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDataTransferItemList.res
More file actions
30 lines (26 loc) · 1.07 KB
/
DataTransferItemList.res
File metadata and controls
30 lines (26 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
open UIEventsAPI
open FileAPI
/**
Adds a new entry for the given data to the drag data store. If the data is plain text then a type string has to be provided also.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/add)
*/
@send
external add: (dataTransferItemList, ~data: string, ~type_: string) => dataTransferItem = "add"
/**
Adds a new entry for the given data to the drag data store. If the data is plain text then a type string has to be provided also.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/add)
*/
@send
external addFile: (dataTransferItemList, file) => dataTransferItem = "add"
/**
Removes the indexth entry in the drag data store.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/remove)
*/
@send
external remove: (dataTransferItemList, int) => unit = "remove"
/**
Removes all the entries in the drag data store.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/clear)
*/
@send
external clear: dataTransferItemList => unit = "clear"