UNPKG

@thoschu/canvas-web-component

Version:

Web Components made by Tom S. with Stencil.js

52 lines (51 loc) 1.38 kB
export type Options = { allowTaint?: boolean; backgroundColor?: string | null; canvas?: HTMLCanvasElement | null; foreignObjectRendering?: boolean; imageTimeout?: number; ignoreElements?: (element: HTMLElement) => boolean; logging?: boolean; onclone?: ((doc: Document) => void) | null; proxy?: string | null; removeContainer?: boolean; scale?: number; useCORS?: boolean; width?: number; height?: number; x?: number; y?: number; scrollX?: number; scrollY?: number; windowWidth?: number; windowHeight?: number; }; export declare class CanvasComponent { private static dataUrl; private readonly tempHTMLElement; /** * The copy property for activate copy to clipboad */ copy: boolean; /** * The type property for image type */ type: "canvas" | "image"; /** * The config property for canvas generation config */ config: Options; private readonly hostHTMLElement; private stage; private readonly imgElement; private canvas; constructor(); /** * Public API to get content during runtime */ get(type?: "canvas" | "image"): Promise<string | HTMLImageElement | HTMLCanvasElement>; protected componentDidLoad(): Promise<void>; private set; private hostClick; protected render(): Element; }