WeaveExportStageToolAction
Tool to export the stage as an image
Overview
The WeaveExportStageToolAction class that enables users to export the entire canvas (Stage) as an image file—typically in PNG format. This action captures everything visible on the canvas, including all nodes, layers, and plugin-rendered visuals, and converts it into a high-fidelity static image.
It’s particularly useful for sharing snapshots, archiving work, or generating thumbnails from collaborative visual tools.
The class extends the WeaveAction class.
Name
This action name
property value is exportStageTool
.
Import
import { WeaveExportStageToolAction } from "@inditextech/weave-sdk";
Instantiation
new WeaveExportStageToolAction();
TypeScript types
const WEAVE_EXPORT_FORMATS: {
readonly PNG: "image/png";
readonly JPEG: "image/jpeg";
};
type WeaveExportNodeOptions = {
format?: typeof WEAVE_EXPORT_FORMATS.PNG;
padding?: number;
pixelRatio?: number;
backgroundColor?: string;
quality?: number;
};
type WeaveExportNodeActionParams = {
node: WeaveElementInstance;
options?: WeaveExportNodeOptions;
};
Trigger function params
trigger(cancelAction: () => void, params?: WeaveExportNodeActionParams): Promise<void>;
For WeaveExportNodeActionParams
:
Prop | Type | Default |
---|---|---|
options? | WeaveExportNodeOptions | - |
node | WeaveElementInstance | - |
For WeaveExportNodeOptions
:
Prop | Type | Default |
---|---|---|
quality? | number | 1 |
backgroundColor? | string | #FFFFFF |
pixelRatio? | number | 1 |
padding? | number | 0 |
format | WeaveExportFormat | WEAVE_EXPORT_FORMATS.PNG |