Skip to content

ClipboardManager

Unofficial

Manager for clipboard operations in the markdown editor, handling paste, drag, and drop.

Import:

import type { ClipboardManager } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface ClipboardManager

Properties

PropertyTypeDescription
appAppReference to the app.
infoMarkdownViewReference to the Editor View.

Methods

MethodReturnsDescription
getPath()stringGet current path of editor view for determining storage location embed.
handleDataTransfer(data)null | Promise<void>Process incoming data (image, text, url, html).
handleDragOver(event)voidHandle an incoming drag-over event.
handleDrop(event)booleanHandle an incoming drag-drop event.
handleDropIntoEditor(event)null | stringProcess a drop event into the editor.
handlePaste(event)booleanHandle an incoming paste event.
insertAttachmentEmbed(file, replace)Promise<void>Insert single file as embed into the editor.
insertFiles(importedAttachments)Promise<void>Insert files from drop-event into the editor.
saveAttachment(name, extension, data, replace)Promise<void>Save an attachment of specified name and extension to the vault.

Links to this page: