Skip to content

ElectronClipboard

Unofficial

Electron Clipboard for reading and writing system clipboard data.

Import:

import type { ElectronClipboard } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface ElectronClipboard

Methods

Method Returns Description
availableFormats(type?) string[] Returns the available clipboard formats.
clear(type?) void Clears the clipboard content.
has(format, type?) boolean Returns whether the clipboard has the specified format.
read(format) string Reads the clipboard content for the specified format.
readBookmark() ElectronClipboardBookmark Reads the bookmark from the clipboard. Only available on darwin and win32.
readBuffer(format) Buffer Reads the clipboard content as a buffer.
readFindText() string Reads the text on the find pasteboard. Only available on darwin.
readHTML(type?) string Reads the clipboard content as HTML.
readImage(type?) ElectronNativeImage Reads the clipboard content as a native image.
readRTF(type?) string Reads the clipboard content as RTF.
readText(type?) string Reads the clipboard content as plain text.
write(data, type?) void Writes data to the clipboard.
writeBookmark(title, url, type?) void Writes a bookmark to the clipboard. The title is only used on darwin. Only available on darwin and win32.
writeBuffer(format, buffer, type?) void Writes a buffer to the clipboard as the specified format.
writeFindText(text) void Writes text to the find pasteboard as plain text. Only available on darwin.
writeHTML(markup, type?) void Writes HTML content to the clipboard.
writeImage(image, type?) void Writes a native image to the clipboard.
writeRTF(text, type?) void Writes text to the clipboard as RTF.
writeText(text, type?) void Writes text to the clipboard.

Links to this page: