[w3c/clipboard-apis] Consider using DataTransferItemList instead of DataTransfer (#72)

This was pointed out by @domenic - It seems like you might be able to avoid all of the barnacles on the `DataTransfer` object, by just using a `DataTransferItemList` directly. E.g.

```js
const list = new DataTransferItemList(); // would need to expose a constructor?
list.add('text/plain', '\o/');
await navigator.clipboard.write(list);
```

Currently all the examples in the explainer would be covered by above, rather than the more generic DataTransfer.

This would above the awarkward questions, what does `dataTransfer.setDragImage()` do? etc.

It _may_ (not sure about this) also be an opportunity to add convenience constructor for `DataTransferItemList`, e.g.
```js
new DataTransferItemList([{type: 'text/plain', content: 'foo'}])
```
... or something :)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/clipboard-apis/issues/72

Received on Thursday, 15 March 2018 23:56:40 UTC