import type Point from "../../geometry/Point.js";
import type Polygon from "../../geometry/Polygon.js";
import type { JSONSupport } from "../../core/JSONSupport.js";
import type { PolygonProperties } from "../../geometry/Polygon.js";
import type { PointProperties } from "../../geometry/Point.js";

export interface MeasureAreaFromImageResultProperties extends Partial<Pick<MeasureAreaFromImageResult, "area" | "length">> {
  /** The polygon's center in a map space. */
  center?: PointProperties;
  /** The polygon geometry in a map space. */
  geometry?: (PolygonProperties & { type: "polygon" });
}

/**
 * The area and length result from a selected image's measurement in an image space when the [ImageryLayer.measureAreaFromImage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#measureAreaFromImage)
 * or [measureAreaFromImage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-imageService.html#measureAreaFromImage) methods resolve successfully.
 *
 * @since 4.29
 * @see [ImageryLayer.measureAreaFromImage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#measureAreaFromImage)
 * @see [measureAreaFromImage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-imageService.html#measureAreaFromImage)
 * @see [MeasureFromImageParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-MeasureFromImageParameters.html)
 */
export default class MeasureAreaFromImageResult extends JSONSupport {
  constructor(properties?: MeasureAreaFromImageResultProperties);
  /** The area of a polygon in square meters. */
  accessor area: number;
  /** The polygon's center in a map space. */
  get center(): Point;
  set center(value: PointProperties);
  /** The polygon geometry in a map space. */
  get geometry(): Polygon;
  set geometry(value: (PolygonProperties & { type: "polygon" }));
  /** The perimeter of a polygon in meters. */
  accessor length: number;
}