Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import boolean from "./src/";
import { INTERSECTION, DIFFERENCE, UNION, XOR } from "./src/operation";
import type { Geometry } from "./src/types";
import type { Geometry, MultiPolygon } from "./src/types";

export type {
Position,
Expand All @@ -10,22 +10,22 @@ export type {
Geometry,
} from "./src/types";

export function union(subject: Geometry, clipping: Geometry): Geometry | null {
export function union(subject: Geometry, clipping: Geometry): MultiPolygon | null {
return boolean(subject, clipping, UNION);
}

export function diff(subject: Geometry, clipping: Geometry): Geometry | null {
export function diff(subject: Geometry, clipping: Geometry): MultiPolygon | null {
return boolean(subject, clipping, DIFFERENCE);
}

export function xor(subject: Geometry, clipping: Geometry): Geometry | null {
export function xor(subject: Geometry, clipping: Geometry): MultiPolygon | null {
return boolean(subject, clipping, XOR);
}

export function intersection(
subject: Geometry,
clipping: Geometry
): Geometry | null {
): MultiPolygon | null {
return boolean(subject, clipping, INTERSECTION);
}

Expand Down
Loading