Skip to content

Commit

Permalink
Amend types declaration file (fix compilation / IDE issues)
Browse files Browse the repository at this point in the history
  • Loading branch information
geopic committed Jun 8, 2020
1 parent 9bcfa34 commit d5c72f0
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ declare module 'polybooljs' {
geopolys: Polygon[];
}

export default interface PolyBool {
/**
* Getter/setter for buildLog
*/
buildLog: (bl: boolean) => object[] | boolean,
/**
* Getter/setter for epsilon
*/
epsilon: (value: number) => number,
segments: (poly: Polygon) => Segment,
combine: (segment1: Segment, segment2: Segment) => {
combined: object;
inverted1: boolean;
inverted2: boolean;
},
selectUnion: (combined: object) => Segment,
selectIntersect: (combined: object) => Segment,
selectDifference: (combined: object) => Segment,
selectDifferenceRev: (combined: object) => Segment,
selectXor: (combined: object) => Segment,
polygon: (segments: Segment) => Polygon,
polygonFromGeoJSON: (geojson: GeoJSON) => Polygon,
polygonToGeoJSON: (poly: Polygon) => GeoJSON,
union: (poly1: Polygon, poly2: Polygon) => Polygon,
intersect: (poly1: Polygon, poly2: Polygon) => Polygon,
difference: (poly1: Polygon, poly2: Polygon) => Polygon,
differenceRev: (poly1: Polygon, poly2: Polygon) => Polygon,
xor: (poly1: Polygon, poly2: Polygon) => Polygon
}
}
/**
* Getter/setter for buildLog
*/
export function buildLog(bl: boolean): object[] | boolean;

/**
* Getter/setter for epsilon
*/
export function epsilon(value: number): number;

export function segments(poly: Polygon): Segment;
export function combine(segment1: Segment, segment2: Segment): {
combined: object;
inverted1: boolean;
inverted2: boolean;
};
export function selectUnion(combined: object): Segment;
export function selectIntersect(combined: object): Segment;
export function selectDifference(combined: object): Segment;
export function selectDifferenceRev(combined: object): Segment;
export function selectXor(combined: object): Segment;
export function polygon(segments: Segment): Polygon;
export function polygonFromGeoJSON(geojson: GeoJSON): Polygon;
export function polygonToGeoJSON(poly: Polygon): GeoJSON;
export function union(poly1: Polygon, poly2: Polygon): Polygon;
export function intersect(poly1: Polygon, poly2: Polygon): Polygon;
export function difference(poly1: Polygon, poly2: Polygon): Polygon;
export function differenceRev(poly1: Polygon, poly2: Polygon): Polygon;
export function xor(poly1: Polygon, poly2: Polygon): Polygon;
}

0 comments on commit d5c72f0

Please sign in to comment.