Clipboard

external interface Clipboard(source)

Functions

Link copied to clipboard
abstract fun availableFormats(type: ClipboardAvailableFormatsType = definedExternally): ReadonlyArray<String>

An array of supported formats for the clipboard type.

Link copied to clipboard
abstract fun clear(type: ClipboardClearType = definedExternally)

Clears the clipboard content.

Link copied to clipboard
abstract fun has(format: String, type: ClipboardHasType = definedExternally): Boolean

Whether the clipboard supports the specified format.

Link copied to clipboard
abstract fun read(format: String): String

Reads format type from the clipboard.

Link copied to clipboard
abstract fun readBookmark(): ReadBookmark

Returns an Object containing title and url keys representing the bookmark in the clipboard. The title and url values will be empty strings when the bookmark is unavailable. The title value will always be empty on Windows.

Link copied to clipboard
abstract fun readBuffer(format: String): Buffer

Reads format type from the clipboard.

Link copied to clipboard
abstract fun readFindText(): String

The text on the find pasteboard, which is the pasteboard that holds information about the current state of the active application’s find panel.

Link copied to clipboard
abstract fun readHTML(type: ClipboardReadHTMLType = definedExternally): String

The content in the clipboard as markup.

Link copied to clipboard
abstract fun readImage(type: ClipboardReadImageType = definedExternally): NativeImage

The image content in the clipboard.

Link copied to clipboard
abstract fun readRTF(type: ClipboardReadRTFType = definedExternally): String

The content in the clipboard as RTF.

Link copied to clipboard
abstract fun readText(type: ClipboardReadTextType = definedExternally): String

The content in the clipboard as plain text.

Link copied to clipboard
abstract fun write(data: Data, type: ClipboardWriteType = definedExternally)

Writes data to the clipboard.

Link copied to clipboard
abstract fun writeBookmark(title: String, url: String, type: ClipboardWriteBookmarkType = definedExternally)

Writes the title (macOS only) and url into the clipboard as a bookmark.

Link copied to clipboard
abstract fun writeBuffer(format: String, buffer: Buffer, type: ClipboardWriteBufferType = definedExternally)

Writes the buffer into the clipboard as format.

Link copied to clipboard
abstract fun writeFindText(text: String)

Writes the text into the find pasteboard (the pasteboard that holds information about the current state of the active application’s find panel) as plain text. This method uses synchronous IPC when called from the renderer process.

Link copied to clipboard
abstract fun writeHTML(markup: String, type: ClipboardWriteHTMLType = definedExternally)

Writes markup to the clipboard.

Link copied to clipboard
abstract fun writeImage(image: NativeImage, type: ClipboardWriteImageType = definedExternally)

Writes image to the clipboard.

Link copied to clipboard
abstract fun writeRTF(text: String, type: ClipboardWriteRTFType = definedExternally)

Writes the text into the clipboard in RTF.

Link copied to clipboard
abstract fun writeText(text: String, type: ClipboardWriteTextType = definedExternally)

Writes the text into the clipboard as plain text.