API-Version: 1.9

clipboard

Access to the system clipboard

Source:

Methods

<static> get(selection, callback) → {String|undefined}

Gets content of the system clipboard

Parameters:
Name Type Argument Description
selection Selection

The Selection to get

callback clipboard~onGotClipboard <optional>

A callback function that is called when the clipboard content was retrieved, if a callback function is used the clipboard will be fetched asynchronously, otherwise it will be fetched synchronously

Source:
Returns:

The content of the clipboard or undefined if a callback function is used

Type
String | undefined

<static> set(selection, text)

Sets content of the system clipboard

Parameters:
Name Type Description
selection Selection

The Selection to set

text String

The text to set

Source:

Type Definitions

onGotClipboard(text)

Callback called when the clipboard was received

Parameters:
Name Type Description
text String

The text content of the clipboard

Source: