import Style from "../../Style"; import ControlElement from "./ControlElement"; import { ComponentFactory, ValueOrAsync } from "../ComponentFactory"; /** Represents a canvas control */ export declare class Canvas extends ControlElement { /** Create a canvas element */ constructor(width?: number, height?: number, scale?: number); /** Initialize an image control with given values */ static with: (values: Canvas.Initializer) => ComponentFactory; /** Initialize with given (observable) values; returns this */ initializeWith: (values: Canvas.Initializer) => this; /** Component height (CSS value, observed) */ height: string; /** Canvas scale (i.e. if set to 1, a pixel on screen corresponds to 1 unit on the canvas coordinate system), only works if this component has width and height properties set in pixels; (observed) */ scale: number; /** Set to false to expand horizontally within row (observed); note that canvas itself will be scaled up, not resized */ shrinkwrap: boolean; /** The 2D rendering context from the canvas element (read-only) */ readonly drawingContext: CanvasRenderingContext2D; /** Clear the entire canvas */ clear(): void; /** Get the current image as a data URL */ getImageDataURL(mimeType?: string): string; /** Get the current image as a blob (promise); note not all browsers support the native canvas [ms]`toBlob(...)` method */ getImageBlob(mimeType?: string): PromiseLike; /** Encapsulation of canvas element style (observed) */ readonly style_canvas: Style; private _canvasElement; private _2dCtx; } export declare namespace Canvas { /** Initializer for .with({ ... }) */ interface Initializer extends ControlElement.Initializer { /** Property initializer */ width: ValueOrAsync; /** Property initializer */ height: ValueOrAsync; /** Property initializer */ scale?: ValueOrAsync; /** Property initializer */ style_canvas?: ValueOrAsync