import type Point from "../../geometry/Point.js";
import type { Clonable } from "../../core/Clonable.js";
import type { ScreenPoint } from "../../core/types.js";
import type { PointProperties } from "../../geometry/Point.js";

/** @since 5.0 */
export interface ControlPointProperties extends Partial<Pick<ControlPoint, "sourcePoint">> {
  /**
   * The coordinate of the the control point in the map coordinate space.
   *
   * @since 5.0
   */
  mapPoint?: PointProperties | null;
}

/**
 * A control point object in the [ControlPointsGeoreference.controlPoints](https://developers.arcgis.com/javascript/latest/references/core/layers/support/ControlPointsGeoreference/#controlPoints) array.
 * A control point is composed of a [ScreenPoint](https://developers.arcgis.com/javascript/latest/references/core/core/types/#ScreenPoint) representing a point on the element and of a [mapPoint](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/) to map
 * the location of the [ScreenPoint](https://developers.arcgis.com/javascript/latest/references/core/core/types/#ScreenPoint) in the map space.
 *
 * @since 4.25
 * @example
 * const controlPoint = {
 *   sourcePoint: { x: 0, y: 0 },
 *   mapPoint: new Point({ x: -180, y: 85 })
 * };
 */
export default class ControlPoint extends Clonable {
  /** @since 5.0 */
  constructor(properties?: ControlPointProperties);
  /**
   * The coordinate of the the control point in the map coordinate space.
   *
   * @since 5.0
   */
  get mapPoint(): Point | null | undefined;
  set mapPoint(value: PointProperties | null | undefined);
  /**
   * The coordinate of the control point in the image coordinate space in pixels.
   *
   * @since 5.0
   */
  accessor sourcePoint: ScreenPoint | null | undefined;
}