Encodes the canvas and resolves with the bytes. An animated format takes every page.
Optionaloptions: ExportOptions & AnimationExportOptionsEncodes the canvas and resolves with the bytes.
Optionaloptions: StillExportOptionstoBuffer, blocking instead of resolving.
Optionaloptions: ExportOptions & AnimationExportOptionstoBuffer, blocking instead of resolving.
Optionaloptions: StillExportOptionstoURLSync under its HTMLCanvasElement name.
Optionaloptions: ExportOptions & AnimationExportOptionstoURLSync under its HTMLCanvasElement name.
Optionaloptions: StillExportOptionstoBuffer, resolved as a data: URL.
Optionaloptions: ExportOptions & AnimationExportOptionstoBuffer, resolved as a data: URL.
Optionaloptions: StillExportOptionstoBuffer, as a data: URL, blocking instead of resolving.
Optionaloptions: ExportOptions & AnimationExportOptionstoBuffer, as a data: URL, blocking instead of resolving.
Optionaloptions: StillExportOptions
The renderer's own
Canvas, with its exports narrowed by format.A non-worker render hands back the real canvas, whose
toBufferaccepts any format with any options — sotoBuffer('png', { fps: 30 })compiled there while the identical call throughWorkerCanvasdid not. The same mistake was a compile error or a runtimeTypeErrordepending only on which mode the render happened to use.This is that narrowing, and nothing else: the object handed back is unchanged, every other member is reachable, and a real
Canvasis assignable to it.