declare const cvs: HTMLCanvasElement declare const cxt: CanvasRenderingContext2D declare const img: HTMLImageElement var maxUndoHistoryBytes = 0x80000000 // 128 MiB /* call before making changes to cvs to preserve undo history */ declare function undoable(): void declare function toBlob(type = "image/png", quality?: number): Promise<Blob> declare function toBlobURL(type = "image/png", quality?: number): Promise<string>