-
-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathindex.ts
More file actions
35 lines (29 loc) · 866 Bytes
/
index.ts
File metadata and controls
35 lines (29 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import boolean from "./src/";
import { INTERSECTION, DIFFERENCE, UNION, XOR } from "./src/operation";
import type { Geometry } from "./src/types";
export type {
Position,
Ring,
Polygon,
MultiPolygon,
Geometry,
} from "./src/types";
export function union(subject: Geometry, clipping: Geometry): Geometry | null {
return boolean(subject, clipping, UNION);
}
export function diff(subject: Geometry, clipping: Geometry): Geometry | null {
return boolean(subject, clipping, DIFFERENCE);
}
export function xor(subject: Geometry, clipping: Geometry): Geometry | null {
return boolean(subject, clipping, XOR);
}
export function intersection(
subject: Geometry,
clipping: Geometry
): Geometry | null {
return boolean(subject, clipping, INTERSECTION);
}
/**
* @enum {Number}
*/
export const operations = { UNION, DIFFERENCE, INTERSECTION, XOR };