import type Extent from "../../geometry/Extent.js";
import type Polygon from "../../geometry/Polygon.js";
import type BaseImageMeasureParameters from "./BaseImageMeasureParameters.js";
import type { AreaUnit } from "../../core/units.js";
import type { BaseImageMeasureParametersProperties } from "./BaseImageMeasureParameters.js";
import type { LengthUnit } from "./types.js";
import type { PolygonProperties } from "../../geometry/Polygon.js";
import type { ExtentProperties } from "../../geometry/Extent.js";

export interface ImageAreaParametersProperties extends BaseImageMeasureParametersProperties, Partial<Pick<ImageAreaParameters, "areaUnit" | "is3D" | "linearUnit">> {
  /** The extent or polygon geometry used to perform the area and perimeter measurement. */
  geometry?: (ExtentProperties & { type: "extent" }) | (PolygonProperties & { type: "polygon" });
}

/**
 * Input parameters used by  the [ImageryLayer.measureAreaAndPerimeter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#measureAreaAndPerimeter)
 * and [measureAreaAndPerimeter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-imageService.html#measureAreaAndPerimeter) methods to perform imagery
 * area and perimeter mensuration.
 *
 * @since 4.26
 * @see [ImageryLayer.measureAreaAndPerimeter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#measureAreaAndPerimeter)
 * @see [measureAreaAndPerimeter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-imageService.html#measureAreaAndPerimeter)
 * @see [ImageAreaResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-ImageAreaResult.html)
 */
export default class ImageAreaParameters extends BaseImageMeasureParameters {
  constructor(properties?: ImageAreaParametersProperties);
  /**
   * The area unit used for an area calculation.
   *
   * @default "square-meters"
   */
  accessor areaUnit: Exclude<AreaUnit, "square-nautical-miles">;
  /** The extent or polygon geometry used to perform the area and perimeter measurement. */
  get geometry(): Extent | Polygon;
  set geometry(value: (ExtentProperties & { type: "extent" }) | (PolygonProperties & { type: "polygon" }));
  /**
   * When `true`, this method calculates the 3D measurements for the area and perimeter of a given geometry on an image service.
   * The elevation surface will be incorporated when performing the calculations.
   * 3D calculation can only be done when the layer's [capabilities.mensuration.supports3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#capabilities) returns `true`.
   *
   * @default false
   */
  accessor is3D: boolean;
  /**
   * Linear unit used for a perimeter calculation.
   *
   * @default "meters"
   */
  accessor linearUnit: LengthUnit;
  /** The string value representing the type of imagery mensuration. The type is always `area-perimeter` for ImageAreaParameters. */
  readonly type: "area-perimeter";
}