import { Watcher, RawMap, RawValue } from "./watcher"; import { HTMLWatcher } from "./html"; export interface Canvas extends HTMLCanvasElement { __element?: RawValue; } export type OperationType = keyof Path2D; export interface Operation { type: OperationType; args: any; paths: RawValue[]; } export interface PathStyle { [key: string]: RawValue | undefined; fillStyle?: string; strokeStyle?: string; lineWidth?: number; lineCap?: CanvasLineCap; lineJoin?: CanvasLineJoin; } export declare class CanvasWatcher extends Watcher { html: HTMLWatcher; canvases: RawMap; paths: RawMap; operations: RawMap; canvasPaths: RawMap; pathToCanvases: RawMap; pathStyles: RawMap; pathCache: RawMap; dirty: RawMap; addCanvasInstance(canvasId: RawValue, instanceId: RawValue): void; clearCanvasInstance(canvasId: RawValue, instanceId: RawValue): void; getCanvasInstances(canvasId: RawValue): RawValue[]; getCanvasPaths(canvasId: RawValue): RawValue[] | undefined; addPath(id: RawValue): never[]; clearPath(id: RawValue): void; getPath(id: RawValue): RawValue[]; addOperation(id: RawValue, type: RawValue): { type: keyof Path2D; args: {}; paths: never[]; }; clearOperation(id: RawValue): void; getOperation(id: RawValue): Operation; getOperationArgs(operation: Operation): any[] | undefined; updateCache(dirtyPaths: RawValue[]): void; rerender(dirtyPaths: RawValue[]): void; changed: () => void; setup(): void; }