Interface 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

interface DataTransferItemList {
    length: number;
    add(data, type): DataTransferItem;
    add(data): DataTransferItem;
    clear(): void;
    remove(index): void;
    [index: number]: DataTransferItem;
}

Indexable

[index: number]: DataTransferItem

Properties

Methods

Properties

length: number

Returns the number of items in the drag data store.

MDN Reference

Methods

  • 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.

    MDN Reference

    Parameters

    • data: string
    • type: string

    Returns DataTransferItem

  • Parameters

    Returns DataTransferItem

  • Removes all the entries in the drag data store.

    MDN Reference

    Returns void

  • Removes the indexth entry in the drag data store.

    MDN Reference

    Parameters

    • index: number

    Returns void