6 * @param {DataTransfer} clipboardData
8 constructor(clipboardData) {
9 this.data = clipboardData;
13 * Check if the clipboard has any items.
16 return Boolean(this.data) && Boolean(this.data.types) && this.data.types.length > 0;
20 * Check if the given event has tabular-looking data in the clipboard.
23 containsTabularData() {
24 const rtfData = this.data.getData( 'text/rtf');
25 return rtfData && rtfData.includes('\\trowd');
29 * Get the images that are in the clipboard data.
30 * @return {Array<File>}
33 const types = this.data.types;
34 const files = this.data.files;
37 for (const type of types) {
38 if (type.includes('image')) {
39 const item = this.data.getData(type);
40 images.push(item.getAsFile());
44 for (const file of files) {
45 if (file.type.includes('image')) {
54 export default Clipboard;