@mocanvas/mocanvas · function

useCopyAs

declare function useCopyAs(): (ids: readonly ShapeId[], format?: TLCopyType, opts?: CopyAsOptions) => Promise<void>

"Copy as PNG/SVG/JSON", with the toast the menu item is expected to raise.

The toast is the reason this is a hook rather than a call to copyAs: a copy that produces no visible change on the canvas looks like nothing happened.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.