polygon-clipping.d.ts 516 B

1234567891011121314
  1. declare module "polygon-clipping" {
  2. export type Pair = [number, number]
  3. export type Ring = Pair[]
  4. export type Polygon = Ring[]
  5. export type MultiPolygon = Polygon[]
  6. type Geom = Polygon | MultiPolygon
  7. export function intersection(geom: Geom, ...geoms: Geom[]): MultiPolygon
  8. export function xor(geom: Geom, ...geoms: Geom[]): MultiPolygon
  9. export function union(geom: Geom, ...geoms: Geom[]): MultiPolygon
  10. export function difference(
  11. subjectGeom: Geom,
  12. ...clipGeoms: Geom[]
  13. ): MultiPolygon
  14. }