import type Polygon from "../../geometry/Polygon.js";
import type Polyline from "../../geometry/Polyline.js";
import type { JSONSupport } from "../../core/JSONSupport.js";
import type { PolygonProperties } from "../../geometry/Polygon.js";
import type { PolylineProperties } from "../../geometry/Polyline.js";

export interface MeasureFromImageParametersProperties extends Partial<Pick<MeasureFromImageParameters, "rasterId">> {
  /** The polyline or polygon geometry used to perform length or area measurements in an image space. */
  geometry?: (PolylineProperties & { type: "polyline" }) | (PolygonProperties & { type: "polygon" });
}

/**
 * Input parameters used by the [ImageryLayer.measureLengthFromImage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#measureLengthFromImage),
 * [ImageryLayer.measureAreaFromImage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#measureAreaFromImage),
 * [measureLengthFromImage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-imageService.html#measureLengthFromImage)
 * and [measureAreaFromImage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-imageService.html#measureAreaFromImage) methods to perform imagery
 * area, perimeter and length mensuration.
 *
 * @since 4.29
 * @see [ImageryLayer.measureLengthFromImage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#measureLengthFromImage)
 * @see [ImageryLayer.measureAreaFromImage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#measureAreaFromImage)
 * @see [measureLengthFromImage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-imageService.html#measureLengthFromImage)
 * @see [measureAreaFromImage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-imageService.html#measureAreaFromImage)
 */
export default class MeasureFromImageParameters extends JSONSupport {
  constructor(properties?: MeasureFromImageParametersProperties);
  /** The polyline or polygon geometry used to perform length or area measurements in an image space. */
  get geometry(): Polyline | Polygon;
  set geometry(value: (PolylineProperties & { type: "polyline" }) | (PolygonProperties & { type: "polygon" }));
  /** The id of the raster to be measured. */
  accessor rasterId: number;
}