DataTransferItemList

A list of DataTransferItem objects representing items being dragged. During a drag operation, each DragEvent has a dataTransfer property and that property is a DataTransferItemList.

MDN Reference

Properties

Link copied to clipboard
open override val length: Int

Returns the number of items in the drag data store.

Functions

Link copied to clipboard

fun add(data: String, type: String): DataTransferItem?

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.

Link copied to clipboard
fun clear()

Removes all the entries in the drag data store.

Link copied to clipboard
open operator fun get(index: Int): DataTransferItem
open operator fun get(key: Symbol.iterator): () -> JsIterator<DataTransferItem>
Link copied to clipboard
open inline operator fun iterator(): Iterator<DataTransferItem>
Link copied to clipboard
fun remove(index: Int)

Removes the indexth entry in the drag data store.