import { Point } from './point.js'; /** A vertex as `setTo` accepts it: a point, an `{x, y}` pair, an `[x, y]` tuple, or a loose number. */ export type PolygonVertex = Point | { x: number; y: number; } | [number, number] | number; export declare class Polygon { area: number; _points: Point[] | number[]; closed: boolean; flattened: boolean; type: number; /** * Creates a new Polygon instance. * @param {object[]} points - The array of points to define the polygon (optional). */ constructor(points?: PolygonVertex[] | null); /** * Converts the polygon's points to a number array. * @param {number[]} output - The array to store the result in (optional). * @returns {number[]} An array of numbers representing the polygon's points. */ toNumberArray(output?: number[]): number[]; /** * Flattens the polygon's point array to a simple numeric array. * @returns {Polygon} This polygon instance for chaining. */ flatten(): this; /** * Creates a clone of this polygon. * @returns {Polygon} A new polygon with the same values as this one. */ clone(): Polygon; /** * Checks if the specified point is contained within this polygon. * @param {number} x - The x coordinate of the point to check. * @param {number} y - The y coordinate of the point to check. * @returns {boolean} True if the point is contained within this polygon, false otherwise. */ contains(x: number, y: number): boolean; /** * Sets the polygon's points to new values. * @param {object[]} points - The array of points to define the polygon. * @returns {Polygon} This polygon instance for chaining. */ setTo(points: PolygonVertex[]): this; /** * Calculates the area of this polygon. * @param {number} y0 - The y coordinate of the lowest boundary (internal use). * @returns {number} The area of this polygon. */ calculateArea(y0: number): number; /** * Gets the points of this polygon. * @returns {object[]} The array of points that define this polygon. */ get points(): Point[] | number[]; /** * Sets the points of this polygon. */ set points(value: PolygonVertex[] | null); } //# sourceMappingURL=polygon.d.ts.map