interface IOptions { width?: number; height?: number; lineWidth?: number; lineColor?: string; bgColor?: string; bgImage?: string | HTMLImageElement; } interface IPonit { data: { x: number; y: number; }[]; lineWidth: number; lineColor: string; } export declare class CanvasSign { /** * canvas 元素 */ private canvas; /** * 配置选项 */ private options; /** * canvas 上下文 */ private ctx; private stop; /** * 鼠标坐标X */ private X; /** * 鼠标坐标Y */ private Y; /** * 点坐标总集合 * 每一个对象代表一个笔画 */ private points; /** * 当前点坐标集合 * 每一个对象代表一个笔画 */ private currentPoints; /** * 当前笔画 */ private currentPoint; /** * 构造函数 * @param ele HTMLElement * @param opt IOptions */ constructor(ele: HTMLElement, opt?: IOptions); getThis(): this; /** * 上一步 */ prev(): void; /** * 下一步 */ next(): void; draw(): Promise; /** * 初始化 */ private init; /** * 绑定事件 */ private bindEvent; /** * 鼠标按下事件 * @param e MouseEvent */ private handleMouseDown; /** * 鼠标移动事件 * @param e MouseEvent */ private handleMouseMove; /** * 鼠标抬起事件 * @param e MouseEvent */ private handleMouseUp; /** * 设置画笔颜色 * @param color string */ setLineColor(color: string): void; /** * 设置画笔宽度 * @param width number */ setLineWidth(width: number): void; change(cb: (data: { totalStep: number; totalPoints: IPonit[]; currentStep: number; currentPoints: IPonit; }, ...args: any[]) => void): void; } export {};