ClipboardItem

open external class ClipboardItem : ClipboardItem(source)

Constructors

Link copied to clipboard
constructor(items: ReadonlyRecord<String, Any>)

Properties

Link copied to clipboard
external val types: ReadonlyArray<String>

A string[] property — the MIME types of the data carried by this entry. For a constructed ClipboardItem these are the keys passed to the constructor; for an item returned by clipboard.read() these are the MIME types the platform clipboard currently makes available.

Functions

Link copied to clipboard
external fun <T : Any> getType(type: T): Promise<Any>

Resolves with the payload for the given MIME type. Modeled after the W3C ClipboardItem.getType method. The promise resolves to a Blob for most MIME types; the one exception is getType('electron application/bookmark'), which resolves to a ClipboardBookmark object instead. Rejects when type is not present in clipboardItem.types.

external fun getType(bookmark: String): Promise<ClipboardBookmark>

Resolves with a ClipboardBookmark when a bookmark is available in the clipboard. Rejects when a bookmark is not available in the clipboard.