import { ShapePrimitive } from './shape-primitive'; import type { PointData } from './point-data'; /** * A class to define a shape via user defined coordinates. */ export declare class Polygon extends ShapePrimitive { /** * An array of the points of this polygon. */ points: number[]; /** * `false` after moveTo, `true` after `closePath`. In all other cases it is `true`. */ closePath: boolean; constructor(points: PointData[] | number[]); constructor(...points: PointData[] | number[]); /** * Creates a clone of this polygon. * @returns - A copy of the polygon. */ clone(): Polygon; /** * Checks whether the x and y coordinates passed to this function are contained within this polygon. * @param x - The X coordinate of the point to test. * @param y - The Y coordinate of the point to test. * @returns - Whether the x/y coordinates are within this polygon. */ contains(x: number, y: number): boolean; /** * Copies another polygon to this one. * @param polygon - The polygon to copy from. * @returns Returns itself. */ copyFrom(polygon: Polygon): this; /** * Copies this polygon to another one. * @param polygon - The polygon to copy to. * @returns Returns given parameter. */ copyTo(polygon: Polygon): Polygon; /** * Get the last X coordinate of the polygon * @readonly */ get lastX(): number; /** * Get the last Y coordinate of the polygon * @readonly */ get lastY(): number; /** * Get the first X coordinate of the polygon * @readonly */ getX(): number; /** * Get the first Y coordinate of the polygon * @readonly */ getY(): number; build(points: number[]): void; triangulate(points: number[], vertices: number[], verticesOffset: number, indices: number[], indicesOffset: number): void; /** * 获取直线上最远的两个端点坐标组成的三角形 */ private getLineEndPointsTriangle; }