add

open external fun add(data: String, type: String): DataTransferItem?(source)

The add() method of the DataTransferItemList interface creates a new DataTransferItem using the specified data and adds it to the drag data list. The item may be a File or a string of a given type. If the item is successfully added to the list, the newly-created DataTransferItem object is returned.

MDN Reference


open external fun add(data: File): DataTransferItem?(source)