Public function

Copy the given shapes to the clipboard.

Signature
function copyAs(
  editor: Editor,
  ids: TLShapeId[],
  format?: TLCopyType,
  opts?: Partial<TLSvgOptions>
): Promise<void>
Parameters
NameDescription

editor

Editor

The editor instance.

ids

TLShapeId[]

The ids of the shapes to copy.

format

TLCopyType

The format to copy as.

opts

Partial<TLSvgOptions>

Options for the copy.

Returns
Promise<void>
References

Editor, TLShapeId, TLSvgOptions

Source

packages/tldraw/src/lib/utils/export/copyAs.ts

ContextMenuDEFAULT_ACCEPTED_IMG_TYPE