import type Accessor from "../../core/Accessor.js";
import type { GeometryUnion } from "../../geometry/types.js";
import type { GeometryOperationLengthUnit } from "./types.js";
import type { MeshProperties } from "../../geometry/Mesh.js";
import type { PolylineProperties } from "../../geometry/Polyline.js";
import type { PolygonProperties } from "../../geometry/Polygon.js";
import type { PointProperties } from "../../geometry/Point.js";
import type { MultipointProperties } from "../../geometry/Multipoint.js";
import type { ExtentProperties } from "../../geometry/Extent.js";

export interface DistanceParametersProperties extends Partial<Pick<DistanceParameters, "distanceUnit" | "geodesic">> {
  /**
   * The geometry from which the distance is to be measured. The geometry can be
   * a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html),
   * [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), or a [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html).
   */
  geometry1?: ((ExtentProperties & { type: "extent" }) | (MultipointProperties & { type: "multipoint" }) | (PointProperties & { type: "point" }) | (PolygonProperties & { type: "polygon" }) | (PolylineProperties & { type: "polyline" }) | (MeshProperties & { type: "mesh" })) | null;
  /**
   * The geometry to which the distance is to be measured. The geometry can be
   * a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html),
   * [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), or a [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html).
   */
  geometry2?: ((ExtentProperties & { type: "extent" }) | (MultipointProperties & { type: "multipoint" }) | (PointProperties & { type: "point" }) | (PolygonProperties & { type: "polygon" }) | (PolylineProperties & { type: "polyline" }) | (MeshProperties & { type: "mesh" })) | null;
}

/**
 * Defines the input parameters when calling
 * [distance()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-geometryService.html#distance).
 *
 * @since 4.20
 * @see [distance()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-geometryService.html#distance)
 * @see [ArcGIS REST API - Distance](https://developers.arcgis.com/rest/services-reference/distance.htm)
 */
export default class DistanceParameters extends Accessor {
  constructor(properties?: DistanceParametersProperties);
  /**
   * Specifies the units for measuring distance between [geometry1](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-DistanceParameters.html#geometry1) and [geometry2](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-DistanceParameters.html#geometry2). If the unit
   * is not specified the units are derived from the spatial reference. For a list of valid units, see [esriSRUnitType Constants](https://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](https://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/).
   */
  accessor distanceUnit: GeometryOperationLengthUnit | null | undefined;
  /** When `true`, the geodesic distance between [geometry1](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-DistanceParameters.html#geometry1) and [geometry2](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-DistanceParameters.html#geometry2) is measured. */
  accessor geodesic: boolean | null | undefined;
  /**
   * The geometry from which the distance is to be measured. The geometry can be
   * a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html),
   * [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), or a [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html).
   */
  get geometry1(): GeometryUnion | null | undefined;
  set geometry1(value: ((ExtentProperties & { type: "extent" }) | (MultipointProperties & { type: "multipoint" }) | (PointProperties & { type: "point" }) | (PolygonProperties & { type: "polygon" }) | (PolylineProperties & { type: "polyline" }) | (MeshProperties & { type: "mesh" })) | null | undefined);
  /**
   * The geometry to which the distance is to be measured. The geometry can be
   * a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html),
   * [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), or a [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html).
   */
  get geometry2(): GeometryUnion | null | undefined;
  set geometry2(value: ((ExtentProperties & { type: "extent" }) | (MultipointProperties & { type: "multipoint" }) | (PointProperties & { type: "point" }) | (PolygonProperties & { type: "polygon" }) | (PolylineProperties & { type: "polyline" }) | (MeshProperties & { type: "mesh" })) | null | undefined);
  /**
   * Converts an instance of  this class to its ArcGIS portal JSON representation.
   * See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/using-fromjson) topic in the Guide for more information.
   *
   * @returns The ArcGIS portal JSON representation of an instance of this class.
   */
  toJSON(): object;
}