UNPKG

@nativescript-community/ui-htmlcanvasapi

Version:

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

31 lines (30 loc) 1.32 kB
import { Path } from '@nativescript-community/ui-canvas'; import { DOMMatrix } from './DOMMatrix'; declare class NSPath2D { private readonly _path; private _lastPoint; constructor(path?: NSPath2D | string); addPath(path: NSPath2D, matrix?: DOMMatrix): void; closePath(): void; moveTo(x: number, y: number): void; lineTo(x: number, y: number): void; bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void; /** * Source: https://github.com/zenozeng/svgcanvas * * @param x1 * @param y1 * @param x2 * @param y2 * @param radius * @returns */ arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void; rect(x: number, y: number, width: number, height: number): void; roundRect(x: number, y: number, width: number, height: number, radii: number | number[]): void; get native(): Path; } export { NSPath2D as Path2D };