Closed
Description
lib Update Request
Configuration Check
My compilation target is ES2015
and my lib is the default
.
Missing / Incorrect Definition
there is no type ClipboardItem
constructor and read
, write
method on Navigator.Clipboard
It has already been mentioned on a similar issue before.
Chrome supports write
method from v66 and also ClipboardItem
but now current version is v90. I think it is stable enough.
How about adding at least write
method and ClipboardItem
without constructor like this
Sample Code
// sampleBlob blob
const blob = '';
navigator.clipboard.write([
new ClipboardItem({
'image/png': blob,
}),
]);
error TS2304: Cannot find name 'ClipboardItem'
error TS2339: Property 'write' does not exist on type 'Clipboard'
Documentation Link
https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API