@nativescript-community/ui-htmlcanvasapi
Version:
An HTML Canvas API implementation on top of android and iOS native APIs
24 lines (23 loc) • 1.05 kB
TypeScript
import { Canvas } from '@nativescript-community/ui-canvas';
import { ImageSource, Observable } from '@nativescript/core';
import { ImageBitmapRenderingContext } from '../contexts/ImageBitmapRenderingContext';
import { OffscreenCanvasRenderingContext2D } from '../contexts/OffscreenCanvasRenderingContext2D';
declare class NSOffscreenCanvas extends Observable {
private _nativeContext;
private _contexts;
private _width;
private _height;
constructor(width: number, height: number);
private _updateNativeContext;
_isPixelScaleNeeded(): boolean;
getContext(contextId: '2d', contextAttributes?: any): OffscreenCanvasRenderingContext2D | null;
getContext(contextId: 'bitmaprenderer', contextAttributes?: any): ImageBitmapRenderingContext | null;
transferToImageBitmap(): ImageSource;
convertToBlob(options: any): Blob;
get nativeContext(): Canvas;
get width(): number;
set width(val: number);
get height(): number;
set height(val: number);
}
export { NSOffscreenCanvas as OffscreenCanvas };