UNPKG

@gorpacrate/core-graphics

Version:

A core library for creating shape-based graphic editors

46 lines (45 loc) 1.72 kB
import { IScene, IShapesDeclarations } from '../declarations'; import { IEditorGridState } from '../editor-state/editor-state'; export interface ISceneCanvasExportParams { scene: IScene; shapesDeclarations: IShapesDeclarations; grid: IEditorGridState; type?: string; quality?: number; minWidth?: number; minHeight?: number; padding?: number; } export interface ISceneImageDataExportParams extends ISceneCanvasExportParams { type?: string; quality?: number; } export declare type IGetSceneCanvasCallback = (canvas: HTMLCanvasElement, dims: { width: number; height: number; }) => void; export declare function getSceneCanvas(params: ISceneCanvasExportParams, cb: IGetSceneCanvasCallback, additionalSvgDeclarations?: string): void; export declare type IGetSceneBlobCallback = (blob: Blob, dims: { width: number; height: number; }) => void; export declare function getSceneBlob(params: ISceneImageDataExportParams, cb: IGetSceneBlobCallback): void; export declare type IGetScenePNGBlobCallback = (blob: Blob, dims: { width: number; height: number; }) => void; export default function getScenePNGBlob(params: ISceneImageDataExportParams, cb: IGetScenePNGBlobCallback): void; export interface IGetSceneBase64Params { scene: IScene; shapesDeclarations: IShapesDeclarations; grid: IEditorGridState; type?: string; quality?: number; minWidth?: number; minHeight?: number; } export declare type IGetSceneBase64Callback = (data: string, dims: { width: number; height: number; }) => void; export declare function getSceneBase64(params: IGetSceneBase64Params, cb: IGetSceneBase64Callback, additionalSvgDeclarations?: string): void;