Skip to content

Missing Definition On Navigator.ClipBoard #43821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mango906 opened this issue Apr 26, 2021 · 1 comment
Closed

Missing Definition On Navigator.ClipBoard #43821

mango906 opened this issue Apr 26, 2021 · 1 comment
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this
Milestone

Comments

@mango906
Copy link

mango906 commented Apr 26, 2021

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.

#26728

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

mango906@587267c

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'

playground

Documentation Link

https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API

@mango906 mango906 changed the title Navigator.clipBoard Add Navigator.clipBoard missing types Apr 26, 2021
@mango906 mango906 changed the title Add Navigator.clipBoard missing types Missing Definition On Navigator.ClipBoard Apr 26, 2021
@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this labels Apr 26, 2021
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Apr 26, 2021
@mango906
Copy link
Author

Fixed by #1034

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants