import { Units } from '@turf/helpers';
import { FeatureCollection, GeometryCollection, Polygon, MultiPolygon, Feature } from 'geojson';

/**
 * Calculates a buffer for input features for a given radius.
 *
 * When using a negative radius, the resulting geometry may be invalid if
 * it's too small compared to the radius magnitude. If the input is a
 * FeatureCollection, only valid members will be returned in the output
 * FeatureCollection - i.e., the output collection may have fewer members than
 * the input, or even be empty.
 *
 * @function
 * @param {FeatureCollection|Geometry|Feature<any>} geojson input to be buffered
 * @param {number} radius distance to draw the buffer (negative values are allowed)
 * @param {Object} [options={}] Optional parameters
 * @param {Units} [options.units="kilometers"] Supports all valid Turf {@link https://turfjs.org/docs/api/types/Units Units}.
 * @param {number} [options.steps=8] number of steps
 * @returns {FeatureCollection|Feature<Polygon|MultiPolygon>|undefined} buffered features
 * @example
 * var point = turf.point([-90.548630, 14.616599]);
 * var buffered = turf.buffer(point, 500, {units: 'miles'});
 *
 * //addToMap
 * var addToMap = [point, buffered]
 */
declare function buffer<T extends GeoJSON.GeoJSON>(geojson: T, radius?: number, options?: {
    units?: Units;
    steps?: number;
}): T extends FeatureCollection | GeometryCollection ? FeatureCollection<Polygon | MultiPolygon> | undefined : Feature<Polygon | MultiPolygon> | undefined;

export { buffer, buffer as default };
