DataTransferItem

external class DataTransferItem(source)

One drag data item. During a drag operation, each drag event has a dataTransfer property which contains a list of drag data items. Each item in the list is a DataTransferItem object.

MDN Reference

Properties

Link copied to clipboard

Returns the drag data item kind, one of: "string", "file".

Link copied to clipboard

Returns the drag data item type string.

Functions

Link copied to clipboard
fun getAsFile(): File?

Returns a File object, if the drag data item kind is File.

Link copied to clipboard

Invokes the callback with the string data as the argument, if the drag data item kind is text.