/**
 * Represents geometry service resources exposed by the ArcGIS REST API. It is used to
 * perform various operations on geometries such as project, simplify, buffer, and relationships.
 *
 * View the [About the geometry service](https://enterprise.arcgis.com/en/server/latest/publish-services/windows/about-the-geometry-service.htm)
 * help topic for details. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * to support samples. However, we do not guarantee that the service will be available 24/7.
 *
 * Many of the functions in geometryService are available for use client-side using geometry operators.
 * See the [Introduction to geometry operators](https://developers.arcgis.com/javascript/latest/spatial-analysis/intro-geometry-operators/) guide topic for more details.
 *
 * @since 4.19
 */
import type Point from "../geometry/Point.js";
import type Polygon from "../geometry/Polygon.js";
import type Polyline from "../geometry/Polyline.js";
import type AreasAndLengthsParameters from "./support/AreasAndLengthsParameters.js";
import type BufferParameters from "./support/BufferParameters.js";
import type DensifyParameters from "./support/DensifyParameters.js";
import type DistanceParameters from "./support/DistanceParameters.js";
import type GeneralizeParameters from "./support/GeneralizeParameters.js";
import type LengthsParameters from "./support/LengthsParameters.js";
import type OffsetParameters from "./support/OffsetParameters.js";
import type ProjectParameters from "./support/ProjectParameters.js";
import type RelationParameters from "./support/RelationParameters.js";
import type TrimExtendParameters from "./support/TrimExtendParameters.js";
import type { GeometryWithoutMeshUnion, GeometryUnion } from "../geometry/types.js";
import type { RequestOptions } from "../request/types.js";
import type { CutResult, FromGeoCoordinateStringParameters, ToGeoCoordinateStringParameters } from "./geometryService/types.js";

/**
 * Computes the area and length for the input [polygons](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html).
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param parameters - Specify the input polygons and optionally the linear and area units.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns an object with the following specification:
 *
 * ```
 * {
 *   areas: <Number[]>,
 *   lengths: <Number[]>
 * }
 * ```
 * @see [areaOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-areaOperator.html)
 * @see [geodeticAreaOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-geodeticAreaOperator.html)
 * @see [lengthOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-lengthOperator.html)
 * @see [geodeticLengthOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-geodeticLengthOperator.html)
 * @example
 * simplify(url, { polygons: [polygon] }).then(function(simplifiedGeometries){
 *   const areasAndLengthParams = new AreasAndLengthsParameters({
 *     areaUnit: "square-kilometers",
 *     lengthUnit: "kilometers",
 *     polygons: simplifiedGeometries
 *   });
 *   areasAndLengths(url, areasAndLengthParams).then(function(results){
 *     console.log("area: ", results.areas[0]);
 *     console.log("length: ", results.lengths[0]);
 *   });
 * });
 */
export function areasAndLengths(url: string, parameters: AreasAndLengthsParameters, requestOptions?: RequestOptions): Promise<{
    areas: number[];
    lengths: number[];
}>;

/**
 * The Auto Complete operation is performed on a geometry service resource. The AutoComplete operation
 * simplifies the process of constructing new polygons that are adjacent to other polygons. It constructs
 * polygons that fill in the gaps between existing polygons and a set of polylines.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param polygons - The array of polygons that will provide boundaries for new polygons.
 * @param polylines - An array of polylines that will provide the remaining boundaries for new polygons.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns an array of [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries containing polygons with the
 *                   gaps filled with a set of polylines.
 * @see [autoCompleteOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-autoCompleteOperator.html)
 */
export function autoComplete(url: string, polygons: Polygon[], polylines: Polyline[], requestOptions?: RequestOptions): Promise<Polygon[]>;

/**
 * Creates buffer polygons at a specified distance around the given geometries.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param parameters - Specifies the input geometries,
 * buffer distances, and other options.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns Returns an array of [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries representing the buffered areas of the input.
 * @see [bufferOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-bufferOperator.html)
 * @see [geodesicBufferOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-geodesicBufferOperator.html)
 * @see [graphicBufferOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-graphicBufferOperator.html)
 * @example
 * const webMerPoint = webMercatorUtils.geographicToWebMercator(point);
 * const parameters = new BufferParameters({
 *   distances: [560],
 *   unit: "kilometers",
 *   geodesic: true,
 *   bufferSpatialReference: new SpatialReference({wkid: 3857}),
 *   outSpatialReference: view.spatialReference,
 *   geometries: [webMerPoint]
 * });
 *
 * buffer(url, parameters).then(function(results){
 *   bufferLayer.add(new Graphic({
 *      geometry: results[0]
 *   }));
 * });
 */
export function buffer(url: string, parameters: BufferParameters, requestOptions?: RequestOptions): Promise<Polygon[]>;

/**
 * The convexHull operation is performed on a geometry service resource. It returns the convex hull
 * of the input geometry. The input geometry can be a point, multipoint, polyline or polygon. The
 * hull is typically a polygon but can also be a polyline or point in degenerate cases.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param geometries - The geometries whose convex hull is to be created.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns a [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) representing the convex hull of the input.
 * @see [convexHullOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-convexHullOperator.html)
 * @example
 * const geoms = pointLayer.graphics.map(function(item, i){
 *   return webMercatorUtils.geographicToWebMercator(item.geometry);
 * });
 * convexHull(url, { geometries: geoms.toArray() }).then(function(result){
 *   convexLayer.add(new Graphic({
 *     geometry: result
 *   }));
 * },function(error){
 *    console.log("error occurred", error)
 * });
 */
export function convexHull(url: string, geometries: GeometryUnion[], requestOptions?: RequestOptions): Promise<GeometryUnion>;

/**
 * The cut operation is performed on a geometry service resource. This operation splits the
 * input polyline or polygon where it crosses a cutting polyline.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param geometries - The polylines or polygons to be cut.
 * @param cutter - The polyline that will be used to divide
 * the target into pieces where it crosses the target.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns an object with the following specification:
 *
 * ```
 * {
 *   cutIndexes: <Number[]>,
 *   geometries: <Geometry[]>
 * }
 * ```
 * @see [cutOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-cutOperator.html)
 */
export function cut<T extends Polygon | Polyline>(url: string, geometries: T[], cutter: Polyline, requestOptions?: RequestOptions): Promise<CutResult<T>>;

/**
 * The densify operation is performed on a geometry service resource. This operation densifies
 * geometries by plotting points between existing vertices.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param parameters - The DensifyParameters objects
 * contains `geometries`, `geodesic`, `lengthUnit`, and `maxSegmentLength` properties.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns an array of [geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) defining the densified input features.
 * @see [densifyOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-densifyOperator.html)
 * @see [geodeticDensifyOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-geodeticDensifyOperator.html)
 * @example
 * const params = new DensifyParameters({
 *   geodesic: true,
 *   lengthUnit: "meters",
 *   maxSegmentLength: 30,
 *   geometries: [polygon]
 * });
 *
 * densify(url, params).then(function(results){
 *   layer.add(new Graphic({
 *     geometry: results[0]
 *   }));
 * }.catch(function(error){
 *    console.log("error occurred", error)
 * });
 */
export function densify(url: string, parameters: DensifyParameters, requestOptions?: RequestOptions): Promise<GeometryUnion[]>;

/**
 * The difference operation is performed on a geometry service resource. This operation
 * constructs the set-theoretic difference between an array of geometries and another geometry.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param geometries - An array of points, multipoints, polylines or polygons.
 * @param geometry - A single geometry of any type, with a dimension
 * equal to or greater than the items in geometries.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns an array of [geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) defining the difference of the input features.
 * @see [differenceOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-differenceOperator.html)
 */
export function difference(url: string, geometries: GeometryWithoutMeshUnion[], geometry: GeometryWithoutMeshUnion, requestOptions?: RequestOptions): Promise<GeometryWithoutMeshUnion[]>;

/**
 * Measures the planar or geodesic distance between geometries.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param parameters - Sets the input geometries to measure,
 * distance units, and other parameters.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns a number representing the distance between the input geometries.
 * @see [distanceOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-distanceOperator.html)
 * @see [geodeticDistanceOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-geodeticDistanceOperator.html)
 */
export function distance(url: string, parameters: DistanceParameters, requestOptions?: RequestOptions): Promise<number>;

/**
 * Converts an array of well-known strings into xy-coordinates based on the conversion type and spatial
 * reference supplied by the user. Only available with ArcGIS Server 10.3 or above.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param parameters - See the object specifications table below for the structure of the  `parameters`  object.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns an array of XY-coordinate pairs.
 * @see [coordinateFormatter](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html)
 * @example
 * parameters = {
 *   conversionType: "geo-ref",
 *   sr: "4326",
 *   strings: ["ZGQA5999999900000000","EJCE3864000012728040","NKBH1196052000273924" ]
 * };
 *
 * fromGeoCoordinateString(url, parameters).then(function(results){
 *   console.log("results", results);
 * }, function(error){
 *     console.log(error);
 * });
 */
export function fromGeoCoordinateString(url: string, parameters: FromGeoCoordinateStringParameters, requestOptions?: RequestOptions): Promise<number[][]>;

/**
 * Generalizes the input geometries using the Douglas-Peucker algorithm.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param parameters - An array of geometries to generalize
 * and a maximum deviation. Optionally set the deviation units.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns an array of [geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) defining the generalized geometries of the input.
 * @see [generalizeOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-generalizeOperator.html)
 */
export function generalize(url: string, parameters: GeneralizeParameters, requestOptions?: RequestOptions): Promise<GeometryUnion[]>;

/**
 * The intersect operation is performed on a geometry service resource. This operation constructs
 * the set-theoretic intersection between an array of geometries and another geometry.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param geometries - An array of points, multipoints, polylines, or polygons.
 * @param intersector - A single geometry of any type, of dimension equal to or greater
 * than the dimension of the items in `geometries`.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns an array of [geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) defining the intersection of the input features.
 * @see [intersectionOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-intersectionOperator.html)
 * @see [intersectsOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-intersectsOperator.html)
 */
export function intersect(url: string, geometries: GeometryUnion[], intersector: GeometryUnion, requestOptions?: RequestOptions): Promise<GeometryUnion[]>;

/**
 * Calculates an interior point for each polygon specified. These interior points can be used by clients for labeling the polygons.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param polygons - The polygon graphics to process.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns an array of [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries defining the interior points of the input
 * polygons that may be used for labeling.
 * @see [labelPointOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-labelPointOperator.html)
 * @example
 * if (geometries[0].rings.length > 0) {
 *  labelPoints(url, { geometries: geometries }).then(function(labelPoints) {
 *   const graphics = labelPoints.map(function(labelPoint, i){
 *       const textSymbol = {
 *         type: "text",  // autocasts as new TextSymbol()
 *         color: "white",
 *         haloColor: "black",
 *         haloSize: "1px",
 *         text: "X: " + number.format(labelPoint.x) + ", Y: " + number.format(labelPoint.y),
 *         xoffset: 3,
 *         yoffset: 3,
 *         font: {  // autocast as new Font()
 *           size: 12,
 *           family: "sans-serif",
 *           weight: "bolder"
 *         }
 *       };
 *     const labelPointGraphic = new Graphic({
 *       geometry: labelPoint,
 *       symbol: textSymbol
 *     });
 *     return labelPointGraphic;
 *   });
 *
 *   // add the labels to the map
 *   view.graphics.addMany(graphics);
 *  });
 * }
 */
export function labelPoints(url: string, polygons: Polygon[], requestOptions?: RequestOptions): Promise<Point[]>;

/**
 * Gets the lengths for a [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) when the geometry type is [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html)
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param parameters - Specify the polylines and optionally the length unit and the geodesic length option.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns an object containing a `lengths` property, which is an array of numbers, each representing the length of an input line.
 * See object specification below:
 * ```
 * {
 *   lengths: <Number[]>
 * }
 * ```
 * @see [lengthOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-lengthOperator.html)
 * @see [geodeticLengthOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-geodeticLengthOperator.html)
 */
export function lengths(url: string, parameters: LengthsParameters, requestOptions?: RequestOptions): Promise<{ lengths: number[]; }>;

/**
 * Constructs the offset of the input geometries based on a planar distance. If the offsetDistance is positive the constructed
 * offset will be on the right side of the geometry. Left side offsets are constructed with negative values.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param parameters - Set the geometries to offset, distance, and units.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns an array of [geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) offset at the specified distance from the input.
 * @see [offsetOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-offsetOperator.html)
 */
export function offset(url: string, parameters: OffsetParameters, requestOptions?: RequestOptions): Promise<GeometryUnion[]>;

/**
 * Projects a set of geometries to a new spatial reference.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param parameters - The input projection parameters.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns an array of projected [geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html).
 * @see [projectOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-projectOperator.html)
 * @example
 * const [geometryService, ProjectParameters] = await $arcgis.import([
 *   "@arcgis/core/rest/geometryService.js",
 *   "@arcgis/core/rest/support/ProjectParameters.js"
 * ]);
 *
 * const url = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer";
 *
 * const params = new ProjectParameters({
 *   geometries: [point],
 *   outSpatialReference: outSpatialReference,
 *   transformation: transformation
 * });
 *
 * geometryService.project(url, params).then(function(response){
 *   console.log("results: ", response);
 * });
 */
export function project(url: string, parameters: ProjectParameters, requestOptions?: RequestOptions): Promise<GeometryUnion[]>;

/**
 * Computes the set of pairs of geometries from the input geometry arrays that belong to the specified relation.
 * Both arrays are assumed to be in the same spatial reference. The relations are evaluated in 2D. Z-coordinates
 * are not used. Geometry types cannot be mixed within an array.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param parameters - The set of parameters required to perform the comparison.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns an array of [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries that meet the relation.
 * @see [Guide topic - Spatial relationship operators](https://developers.arcgis.com/javascript/latest/spatial-analysis/intro-geometry-operators/#spatial-relationships)
 * @example
 * const [geometryService, RelationParameters] = await $arcgis.import([
 *   "@arcgis/core/rest/geometryService.js",
 *   "@arcgis/core/rest/support/RelationParameters.js"
 * ]);
 *
 * const url = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer";
 *
 * const params = new RelationParameters({
 *   geometries1: geometries[0],
 *   geometries2: geometries[1],
 *   relation: "within"
 * });
 *
 * geometryService.relation(url, params).then(function(response){
 *   console.log("results: ", response);
 * });
 */
export function relation(url: string, parameters: RelationParameters, requestOptions?: RequestOptions): Promise<Polygon[]>;

/**
 * The reshape operation is performed on a geometry service resource. It reshapes a [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) or a part
 * of a [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) using a reshaping line.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param geometry - The Polyline or Polygon to be reshaped.
 * @param reshaper - The single-part polyline that performs the reshaping.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns the [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) defining the reshaped input feature.
 * @see [reshapeOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-reshapeOperator.html)
 */
export function reshape(url: string, geometry: Polygon | Polyline, reshaper: Polyline, requestOptions?: RequestOptions): Promise<GeometryUnion>;

/**
 * Alters the given geometries to make their definitions topologically legal with respect to their geometry type.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param geometries - The geometries to simplify.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns an array of the simplified [geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html).
 * @see [simplifyOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-simplifyOperator.html)
 * @example geometryService.simplify(url, [polygonGraphic.geometry]).then( ... );
 */
export function simplify<T extends GeometryUnion>(url: string, geometries: T[], requestOptions?: RequestOptions): Promise<T[]>;

/**
 * Converts an array of XY-coordinates into well-known strings based on the conversion type and spatial
 * reference supplied by the user. Only available with ArcGIS Server 10.3 or above.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param parameters - See the object specifications table below for the structure of the `parameters` object.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns an array of well-known strings.
 * @see [coordinateFormatter](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html)
 * @example
 * const geometryService = await $arcgis.import("@arcgis/core/rest/geometryService.js");
 *
 * const url = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer";
 *
 * const parameters = {
 *   sr: "4326",
 *   coordinates: [ [180,0] , [-117,34] , [0,52] ],
 *   conversionType: "mgrs",
 *   conversionMode: "mgrsNewWith180InZone01",
 *   numOfDigits: 8
 * };
 *
 * geometryService.toGeoCoordinateString(url, parameters).then(function(response){
 *   // When resolved, these strings are stored in response object
 *   // response.strings[0] = "01N AA 66021443 00000000"
 *   // response.strings[1] = "11S NT 00000000 62155978"
 *   // response.strings[2] = "31U BT 94071081 65288255"
 * });
 */
export function toGeoCoordinateString(url: string, parameters: ToGeoCoordinateStringParameters, requestOptions?: RequestOptions): Promise<string[]>;

/**
 * Trims or extends the input polylines using the user specified guide polyline. When trimming features,
 * the portion to the left of the cutting line is preserved in the output and the rest is discarded. If the
 * input polyline is not cut or extended then an empty polyline is added to the output array.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param parameters - Input parameters for the `trimExtend` operation.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns an array of the trimmed or extended [geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html).
 * @see [extendOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-extendOperator.html)
 * @see [cutOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-cutOperator.html)
 */
export function trimExtend(url: string, parameters: TrimExtendParameters, requestOptions?: RequestOptions): Promise<Polyline[]>;

/**
 * The union operation is performed on a geometry service resource. This operation constructs the set-theoretic
 * union of the geometries in the input array. All inputs must be of the same type.
 *
 * @param url - The ArcGIS Server REST service URL of a GeometryService. Esri hosts
 * a geometry service on [sampleserver6.arcgisonline.com](https://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer)
 * for development and testing purposes.
 * @param geometries - An array of the geometries to be unioned.
 * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
 * @returns When resolved, returns a [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) representing the union of the input features.
 * @see [unionOperator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-unionOperator.html)
 */
export function union(url: string, geometries: GeometryUnion[], requestOptions?: RequestOptions): Promise<GeometryUnion>;