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

MethodReturnsDescription
availableFormats(type?)string[]Returns the available clipboard formats.
clear(type?)voidClears the clipboard content.
has(format, type?)booleanReturns whether the clipboard has the specified format.
read(format)stringReads the clipboard content for the specified format.
readBookmark()ElectronClipboardBookmarkReads the bookmark from the clipboard. Only available on darwin and win32.
readBuffer(format)BufferReads the clipboard content as a buffer.
readFindText()stringReads the text on the find pasteboard. Only available on darwin.
readHTML(type?)stringReads the clipboard content as HTML.
readImage(type?)ElectronNativeImageReads the clipboard content as a native image.
readRTF(type?)stringReads the clipboard content as RTF.
readText(type?)stringReads the clipboard content as plain text.
write(data, type?)voidWrites data to the clipboard.
writeBookmark(title, url, type?)voidWrites a bookmark to the clipboard. The title is only used on darwin. Only available on darwin and win32.
writeBuffer(format, buffer, type?)voidWrites a buffer to the clipboard as the specified format.
writeFindText(text)voidWrites text to the find pasteboard as plain text. Only available on darwin.
writeHTML(markup, type?)voidWrites HTML content to the clipboard.
writeImage(image, type?)voidWrites a native image to the clipboard.
writeRTF(text, type?)voidWrites text to the clipboard as RTF.
writeText(text, type?)voidWrites text to the clipboard.

Links to this page: