/** * Polyfill class that replaces several basic Canvas methods with custom SVG rendering. */ import CanvasLoader, { CanvasGraphics, CanvasIsh } from "./canvas-wrapper"; export default class CanvasSVG extends CanvasLoader { constructor(width: number, height: number); makeCanvas(width: number, height: number): CanvasIsh; loadImage(image: string): Promise; toBlob(mimeType: string, quality: number): Promise; toStream(stream: any): void; toSVG(): any; } export declare class SVGCanvas implements CanvasIsh, CanvasGraphics { private col; private readonly shapeCache; private readonly defs; private readonly shapes; readonly width: number; readonly height: number; constructor(width: number, height: number); getContext(): this; set fillStyle(value: string); fillRect(x: number, y: number, width: number, height: number): void; /** * Mocks a dummy image object so the existing render commands work. * * @param img * @return {{img: string, width: number, height: number}} */ loadImage(img: string): { width: number; height: number; img: string; }; drawImage(imageObj: any, xx: number, yy: number, ow: number, oh: number, dx: number, dy: number, dw: number, dh: number): void; toSVG(): string; }