Interface ClipboardTarget

interface ClipboardTarget {
    createClipboardItem?: ((text?, html?, args?) => DynamicClipboardItem | Promise<DynamicClipboardItem>);
    doPaste?: ((item, args) => boolean | Promise<boolean>);
    element: (() => HTMLElement);
}

Properties

createClipboardItem?: ((text?, html?, args?) => DynamicClipboardItem | Promise<DynamicClipboardItem>)

This is called if no in memory item was detected and there is text or hml data on the clipboard. Return a dynamic clipboard item for text or html. If this throws an error this will be caught and displayed. If null then this operation will stop and nothing will be pasted.

Type declaration

doPaste?: ((item, args) => boolean | Promise<boolean>)

If this is not specified than native paste will still be attempted.

Type declaration

element: (() => HTMLElement)

A method that allows or focus to be called. (and supports an addEventListener('focus'))

Type declaration

    • (): HTMLElement
    • Returns HTMLElement