index.d.cts 874 B

1234567891011121314151617181920212223242526
  1. import { GeoJsonProperties, BBox, Feature, Polygon } from 'geojson';
  2. import { Id } from '@turf/helpers';
  3. /**
  4. * Takes a bbox and returns an equivalent {@link Polygon|polygon}.
  5. *
  6. * @function
  7. * @param {BBox} bbox extent in [minX, minY, maxX, maxY] order
  8. * @param {Object} [options={}] Optional parameters
  9. * @param {GeoJsonProperties} [options.properties={}] Translate properties to Polygon
  10. * @param {string|number} [options.id={}] Translate Id to Polygon
  11. * @returns {Feature<Polygon>} a Polygon representation of the bounding box
  12. * @example
  13. * var bbox = [0, 0, 10, 10];
  14. *
  15. * var poly = turf.bboxPolygon(bbox);
  16. *
  17. * //addToMap
  18. * var addToMap = [poly]
  19. */
  20. declare function bboxPolygon<P extends GeoJsonProperties = GeoJsonProperties>(bbox: BBox, options?: {
  21. properties?: P;
  22. id?: Id;
  23. }): Feature<Polygon, P>;
  24. export { bboxPolygon, bboxPolygon as default };