Constructor
new ve.ui.DataTransferItem(kind, type, [data], [name])
#
Data transfer item wrapper
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
kind |
string | Item kind, e.g. 'string' or 'file' |
|||||||||||||||||||||||||
type |
string | MIME type |
|||||||||||||||||||||||||
data |
Object |
optional |
Data object to wrap or convert Properties:
|
||||||||||||||||||||||||
name |
string |
optional |
Item's name, for types which support it, e.g. File |
- Source:
Methods
getAsFile() → {Blob}
#
Get file blob
Generically getAsFile returns a Blob, which could be a File.
- Source:
Returns:
File blob
- Type
- Blob
Get file blob
Generically getAsFile returns a Blob, which could be a File.
getAsString() → {string}
#
Get string data
Differs from native DataTransferItem#getAsString by being synchronous
- Source:
Returns:
String data
- Type
- string
Get string data
Differs from native DataTransferItem#getAsString by being synchronous
getExtension() → {string|null
}
#
null
}
#
Get the extension of the item's name
- Source:
Returns:
The extension of the item's name, or null if not present
- Type
-
string
|
null
newFromBlob(blob, [htmlStringData]) → {ve.ui.DataTransferItem}static
#
Create a data transfer item from a file blob.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
blob |
Blob | File blob |
|
htmlStringData |
string |
optional |
HTML string representation of data transfer |
- Source:
Returns:
New data transfer item
newFromDataUri(dataUri, [htmlStringData]) → {ve.ui.DataTransferItem}static
#
Create a data transfer item from a data URI.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
dataUri |
string | Data URI |
|
htmlStringData |
string |
optional |
HTML string representation of data transfer |
- Source:
Returns:
New data transfer item
newFromItem(item, [htmlStringData]) → {ve.ui.DataTransferItem}static
#
Create a data transfer item from a native data transfer item.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
item |
DataTransferItem | Native data transfer item |
|
htmlStringData |
string |
optional |
HTML string representation of data transfer |
- Source:
Returns:
New data transfer item
newFromString(stringData, [type], [htmlStringData]) → {ve.ui.DataTransferItem}static
#
Create a data transfer item from string data.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stringData |
string | Native string data |
|
type |
string |
optional |
Native MIME type |
htmlStringData |
string |
optional |
HTML string representation of data transfer |
- Source:
Returns:
New data transfer item