Re: [w3c/clipboard-apis] Add clipboard IDL description. (#158)

@martinthomson commented on this pull request.



>  
-  [SecureContext, Exposed=Window] interface Clipboard : EventTarget {
-    Promise<ClipboardItems> read();
-    Promise<DOMString> readText();
-    Promise<undefined> write(ClipboardItems data);
-    Promise<undefined> writeText(DOMString data);
-  };
+   [SecureContext, Exposed=Window]
+   interface ClipboardItem {
+    constructor(record<DOMString, ClipboardItemData> items,
+                optional ClipboardItemOptions options = {});
+
+    readonly attribute PresentationStyle presentationStyle;
+    readonly attribute FrozenArray<DOMString> types;
+
+    Promise<Blob> getType(DOMString type);

This name isn't ideal.  You aren't getting a type, you are getting the item... by type.  `get()` might have been better.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/clipboard-apis/pull/158#pullrequestreview-1349455843
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/clipboard-apis/pull/158/review/1349455843@github.com>

Received on Monday, 20 March 2023 21:56:36 UTC