provideDocumentPasteEdits

Invoked before the user pastes into a text editor.

Returned edits can replace the standard pasting behavior.

Return

Set of potential edits that can apply the paste. Only a single returned DocumentPasteEdit is applied at a time. If multiple edits are returned from all providers, then the first is automatically applied and a widget is shown that lets the user switch to the other edits.

Online Documentation

Parameters

document

Document being pasted into

ranges

Range in the document to paste into.

dataTransfer

The data transfer associated with the paste. This object is only valid for the duration of the paste operation.

context

Additional context for the paste.

token

A cancellation token.