import Vertex from './vertex'; type Point = [number, number] | { x: number; y: number; }; type PointArray = Point[]; export default class Polygon { first: Vertex | null; vertices: number; _lastUnprocessed: Vertex | null; _arrayVertices: boolean; _firstIntersect?: Vertex; /** * Polygon representation * @param {PointArray} p * @param {boolean=} arrayVertices */ constructor(p: PointArray, arrayVertices?: boolean); /** * Add a vertex object to the polygon * (vertex is added at the 'end' of the list') * * @param vertex */ addVertex(vertex: Vertex): void; /** * Inserts a vertex inbetween start and end * * @param {Vertex} vertex * @param {Vertex} start * @param {Vertex} end */ insertVertex(vertex: Vertex, start: Vertex, end: Vertex): void; /** * Get next non-intersection point * @param {Vertex} v * @return {Vertex} */ getNext(v: Vertex): Vertex; /** * Unvisited intersection * @return {Vertex} */ getFirstIntersect(): Vertex; /** * Does the polygon have unvisited vertices * @return {boolean} */ hasUnprocessed(): boolean; /** * The output depends on what you put in, arrays or objects * @return {PointArray} */ getPoints(): PointArray; /** * Clip polygon against another one. * Result depends on algorithm direction: * * Intersection: forwards forwards * Union: backwards backwards * Diff: backwards forwards * * @param {Polygon} clip * @param {boolean} sourceForwards * @param {boolean} clipForwards */ clip(clip: Polygon, sourceForwards: boolean, clipForwards: boolean): PointArray[] | null; } export {}; //# sourceMappingURL=polygon.d.ts.map