Skip to main content

Home > blockly > clipboard > paste

clipboard.paste() function

Paste a pasteable element into the given workspace.

This function does not perform any checks to ensure the paste is allowed, e.g. that the workspace is rendered or the block is pasteable. Such checks should be done before calling this function.

Signature:

export declare function paste<T extends ICopyData>(copyData: T, workspace: WorkspaceSvg, coordinate?: Coordinate): ICopyable<T> | null;

Parameters

ParameterTypeDescription
copyDataTThe data to paste into the workspace.
workspaceWorkspaceSvgThe workspace to paste the data into.
coordinateCoordinate(Optional) The location to paste the thing at.

Returns:

ICopyable<T> | null

The pasted thing if the paste was successful, null otherwise.