zan-poster
Version:
通过json在canvas上绘制图像, 基于cax画图框架开发, 本画图组件是json2canvas库的改造、优化版本 (详情查看README.md文档末说明)。
67 lines (66 loc) • 1.9 kB
TypeScript
import type { EventEmitter } from '../../stencil-public-runtime';
import type { DrawerResponse, PaintingType } from './zan-poster.type';
export declare class ZanPoster {
/**
* 画图数据
*/
painting?: PaintingType | PaintingType[];
/**
* 预加载
*/
preload?: boolean;
/**
* 是否显示画板
*/
showCanvas?: boolean;
/**
* 是否显示Loading进度状态
*/
showLoading?: boolean;
/**
* 是否保存图片
*/
isSave?: boolean;
/**
* 是否为base64格式
*/
base64?: boolean;
/**
* 是否同步画图
*/
sync?: boolean;
canvasList: PaintingType | PaintingType[] | any[];
canvasId: string;
canvas: HTMLCanvasElement;
isPainting: boolean;
readying: boolean;
syncPainting: boolean;
imgUrl: string;
success: (args: DrawerResponse[]) => void;
fail: (args: DrawerResponse[]) => void;
el: HTMLElement;
watchPaintingHandler(value: PaintingType | PaintingType[]): void;
watchSyncHandler(value: boolean): void;
private setValue;
change: EventEmitter<DrawerResponse | DrawerResponse[]>;
changeHandler(result: DrawerResponse | DrawerResponse[]): void;
ready: EventEmitter<void>;
readyHandler(): void;
/**
* 外部画图方法
* 支持回调、promise形式
*/
draw(params: {
painting: PaintingType | PaintingType[];
sync?: boolean;
success?: (args: DrawerResponse[]) => void;
fail?: (args: DrawerResponse[]) => void;
}): Promise<DrawerResponse | DrawerResponse[]>;
componentWillLoad(): void;
start(): Promise<DrawerResponse | DrawerResponse[]>;
submitSuccess(success: DrawerResponse[]): void;
drawer(painting: PaintingType): Promise<DrawerResponse>;
saveImage(): Promise<DrawerResponse>;
imageHandler(): void;
render(): any;
}