Public function

Export the given shapes as files.

Signature
function exportAs(
  editor: Editor,
  ids: TLShapeId[],
  format: TLExportType | undefined,
  name: string | undefined,
  opts?: Partial<TLSvgOptions>
): Promise<void>
Parameters
NameDescription

editor

Editor

The editor instance.

ids

TLShapeId[]

The ids of the shapes to export.

format

TLExportType | undefined

The format to export as.

name

string | undefined

Name of the exported file. If undefined a predefined name, based on the selection, will be used.

opts

Partial<TLSvgOptions>

Options for the export.

Returns
Promise<void>
References

Editor, TLShapeId, TLExportType, TLSvgOptions

Source

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

ExampleDialogExportFileContentSubMenu