Skip to main content

sdk.canvasapi

Home > @kittl/sdk > CanvasAPI

CanvasAPI interface

API for canvas-related operations. These functions may not have an implementation setup; they require a canvas implementation to register itself as the handler.

Signature:

export interface CanvasAPI 

Properties

Property

Modifiers

Type

Description

getExport

(options: GetExportOptions) => Promise<Blob | null>

Generate an export of the canvas content in the specified format.

This function allows you to export a specific board or set of nodes (objects or groups) from the canvas in various formats including raster (PNG, JPG), vector (SVG), document (PDF), and video (MP4) formats. The export respects the original aspect ratio.

getPreviewImage

(id: string, options?: Partial<GetPreviewImageOptions>) => Promise<string | null>

Get the preview image for a given board id