index.d.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import {
  2. Point,
  3. LineString,
  4. Polygon,
  5. MultiPoint,
  6. MultiLineString,
  7. MultiPolygon,
  8. GeometryObject,
  9. GeometryCollection,
  10. Feature,
  11. FeatureCollection,
  12. Units,
  13. } from "@turf/helpers";
  14. interface Options {
  15. units?: Units;
  16. steps?: number;
  17. }
  18. /**
  19. * http://turfjs.org/docs/#buffer
  20. */
  21. declare function buffer<Geom extends Point | LineString | Polygon>(
  22. feature: Feature<Geom> | Geom,
  23. radius?: number,
  24. options?: Options
  25. ): Feature<Polygon>;
  26. declare function buffer<
  27. Geom extends MultiPoint | MultiLineString | MultiPolygon
  28. >(
  29. feature: Feature<Geom> | Geom,
  30. radius?: number,
  31. options?: Options
  32. ): Feature<MultiPolygon>;
  33. declare function buffer<Geom extends Point | LineString | Polygon>(
  34. feature: FeatureCollection<Geom>,
  35. radius?: number,
  36. options?: Options
  37. ): FeatureCollection<Polygon>;
  38. declare function buffer<
  39. Geom extends MultiPoint | MultiLineString | MultiPolygon
  40. >(
  41. feature: FeatureCollection<Geom>,
  42. radius?: number,
  43. options?: Options
  44. ): FeatureCollection<MultiPolygon>;
  45. declare function buffer(
  46. feature:
  47. | FeatureCollection<any>
  48. | Feature<GeometryCollection>
  49. | GeometryCollection,
  50. radius?: number,
  51. options?: Options
  52. ): FeatureCollection<Polygon | MultiPolygon>;
  53. declare function buffer(
  54. feature: Feature<any> | GeometryObject,
  55. radius?: number,
  56. options?: Options
  57. ): Feature<Polygon | MultiPolygon>;
  58. export default buffer;