Public function

Export the given shapes as a blob.

Signature
function exportToBlob({
  editor,
  ids,
  format,
  opts,
}: {
  editor: Editor
  format: 'jpeg' | 'json' | 'png' | 'svg' | 'webp'
  ids: TLShapeId[]
  opts?: Partial<TLSvgOptions>
}): Promise<Blob>
Parameters
NameDescription

{ editor, ids, format, opts, }

{
  editor: Editor
  format: 'jpeg' | 'json' | 'png' | 'svg' | 'webp'
  ids: TLShapeId[]
  opts?: Partial<TLSvgOptions>
}
Returns
Promise<Blob>

A promise that resolves to a blob.

References

Editor, TLShapeId, TLSvgOptions

Source

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

ExportFileContentSubMenuExtrasGroup