From ebbdf83962b5f88b15f46b8cd4a0379e4d2a1a81 Mon Sep 17 00:00:00 2001 From: Oliver Roick Date: Wed, 6 Mar 2019 01:48:02 +0100 Subject: [PATCH] Add TypeScript declaration to @turf/clean-coords (#1608) --- packages/turf-clean-coords/index.d.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 packages/turf-clean-coords/index.d.ts diff --git a/packages/turf-clean-coords/index.d.ts b/packages/turf-clean-coords/index.d.ts new file mode 100644 index 0000000000..035a646499 --- /dev/null +++ b/packages/turf-clean-coords/index.d.ts @@ -0,0 +1,26 @@ +import { Geometry, Feature } from "@turf/helpers"; + +/** + * Removes redundant coordinates from any GeoJSON Geometry. + * + * @name cleanCoords + * @param {Geometry|Feature} geojson Feature or Geometry + * @param {Object} [options={}] Optional parameters + * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated + * @returns {Geometry|Feature} the cleaned input Feature/Geometry + * @example + * var line = turf.lineString([[0, 0], [0, 2], [0, 5], [0, 8], [0, 8], [0, 10]]); + * var multiPoint = turf.multiPoint([[0, 0], [0, 0], [2, 2]]); + * + * turf.cleanCoords(line).geometry.coordinates; + * //= [[0, 0], [0, 10]] + * + * turf.cleanCoords(multiPoint).geometry.coordinates; + * //= [[0, 0], [2, 2]] + */ +export default function cleanCoords( + geojson: T, + options?: { + mutate?: boolean + } +): T;