w3c / clipboard-apis

Clipboard API and events
https://w3c.github.io/clipboard-apis/
Other
151 stars 36 forks source link

`supports` should take a dictionary instead of a DOMString as argument for readability #211

Closed snianu closed 9 months ago

snianu commented 9 months ago

From TAG review feedback, "supports() is a rather generic name, but the type of support being tested is very specific. This could hinder both learnability and future extensibility. One way to address that would be to adopt a dictionary argument (e.g. ClipboardItem.supports({type: "image/webp"})). If it later becomes clear that MIME type is the primary criteria that support queries are used for, a string argument could be supported as an overloaded shortcut."

annevk commented 9 months ago

The way we did this matches precedent in HTML and still makes sense to me. I'd argue that once we need a lot of things we can then add the overload.

Also said so here: https://github.com/w3ctag/design-reviews/issues/901#issuecomment-1912236890

snianu commented 9 months ago

Since the TAG closed the original issue with a satisfied resolution for the existing supports method, closing this issue as well.