index.d.cts 847 B

12345678910111213141516171819202122
  1. import { Polygon, MultiPolygon, Feature, FeatureCollection } from 'geojson';
  2. /**
  3. * Takes a kinked polygon and returns a feature collection of polygons that have
  4. * no kinks.
  5. *
  6. * Uses [simplepolygon](https://github.com/mclaeysb/simplepolygon) internally.
  7. *
  8. * @function
  9. * @param {FeatureCollection<Polygon|MultiPolygon>|Feature<Polygon|MultiPolygon>|Polygon|MultiPolygon} geojson polygons to unkink
  10. * @returns {FeatureCollection<Polygon>} Unkinked polygons
  11. * @example
  12. * const poly = turf.polygon([[[0, 0], [2, 0], [0, 2], [2, 2], [0, 0]]]);
  13. *
  14. * const result = turf.unkinkPolygon(poly);
  15. *
  16. * //addToMap
  17. * const addToMap = [poly, result]
  18. */
  19. declare function unkinkPolygon<T extends Polygon | MultiPolygon>(geojson: Feature<T> | FeatureCollection<T> | T): FeatureCollection<Polygon>;
  20. export { unkinkPolygon as default, unkinkPolygon };