UNPKG

@nativescript-community/ui-htmlcanvasapi

Version:

An HTML Canvas API implementation on top of android and iOS native APIs

26 lines (25 loc) 1.2 kB
import { Canvas } from '@nativescript-community/ui-canvas'; import { Observable } from '@nativescript/core'; import { CanvasRenderingContext2D } from '../contexts/CanvasRenderingContext2D'; import { ImageBitmapRenderingContext } from '../contexts/ImageBitmapRenderingContext'; import type { HTMLCanvasView } from '../html-canvas-view'; import { OffscreenCanvas } from './OffscreenCanvas'; declare class NSHTMLCanvasElement extends Observable { private _contexts; private _isControlledByOffscreen; private readonly _nativeElement; constructor(nativeElement: HTMLCanvasView); getContext(contextId: '2d', contextAttributes?: any): CanvasRenderingContext2D | null; getContext(contextId: 'bitmaprenderer', contextAttributes?: any): ImageBitmapRenderingContext | null; transferControlToOffscreen(): OffscreenCanvas; toDataURL(type?: string, quality?: number): string; _isPixelScaleNeeded(): boolean; get width(): number; set width(val: number); get height(): number; set height(val: number); get nativeElement(): HTMLCanvasView; get nativeContext(): Canvas; private _toImageSource; } export { NSHTMLCanvasElement as HTMLCanvasElement };