import type Extent from "../Extent.js";
import type Point from "../Point.js";
import type GeographicTransformation from "./support/GeographicTransformation.js";

/**
 * Object returned from the [getNearestCoordinate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-proximityOperator.html#getNearestCoordinate), [proximityOperator's getNearestVertex()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-proximityOperator.html#getNearestVertex), and [getNearestVertices()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-proximityOperator.html#getNearestVertices) methods.
 *
 * @since 5.0
 */
export interface ProximityResult {
  /**
   * The nearest coordinate on the geometry to the given input point.
   *
   * @since 5.0
   */
  coordinate: Point;
  /**
   * The planar distance between the input point and the nearest coordinate on the geometry.
   * Unless the `unit` option is set, the default is the spatial reference unit of the input geometries.
   *
   * @since 5.0
   */
  distance: number;
  /**
   * Indicates if the result is empty.
   *
   * @since 5.0
   */
  isEmpty: boolean;
  /**
   * Indicates if the nearest coordinate is on the right side or left side of the input point.
   *
   * > [!WARNING]
   * > This property will only be present when `calculateLeftRightSide` is set to `true` when calling `getNearestCoordinate()`.
   *
   * @since 5.0
   */
  isRightSide?: boolean;
  /**
   * The index of the vertex on the geometry that is closest to the input point.
   *
   * @since 5.0
   */
  vertexIndex: number;
}

/** @since 5.0 */
export interface ProjectOptions {
  /**
   * An extent used to help pick the correct transform.
   * This is not used if the `geographicTransformation` option is provided.
   * The extent's spatial reference should be the same as the `geometries` spatial reference.
   *
   * @since 5.0
   */
  readonly areaOfInterestExtent?: Extent | null;
  /**
   * The geographic transformation used to transform the geometries.
   * Specify this parameter to project a geometry when the default transformation is not appropriate for your requirements.
   *
   * @since 5.0
   */
  readonly geographicTransformation?: GeographicTransformation | null;
}