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), {@link geometry/operators/proximityOperator#nearestVegetNearestVertex getNearestVertex()}, and [getNearestVertices()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-proximityOperator.html#getNearestVertices) methods. */
export interface ProximityResult {
  /** The nearest coordinate on the geometry to the given input point. */
  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.
   */
  distance: number;
  /** Indicates if the result is empty. */
  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()`.
   */
  isRightSide?: boolean;
  /** The index of the vertex on the geometry that is closest to the input point. */
  vertexIndex: number;
}

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.
   */
  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.
   */
  readonly geographicTransformation?: GeographicTransformation | null;
}