import type Point from "../../geometry/Point.js";
import type SpatialReference from "../../geometry/SpatialReference.js";
import type { JSONSupport, JSONSupportMixinProperties } from "../../core/JSONSupport.js";
import type { PointProperties } from "../../geometry/Point.js";
import type { SpatialReferenceProperties } from "../../geometry/SpatialReference.js";

export interface ImageAngleParametersProperties extends JSONSupportMixinProperties, Partial<Pick<ImageAngleParameters, "angleNames" | "rasterId">> {
  /**
   * A [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry that defines the reference point of rotation to
   * compute the angle direction. By default the centroid of the image is used.
   */
  point?: PointProperties | null;
  /** The spatial reference used to compute the angles. If not specified, the image service's spatial reference will be used. */
  spatialReference?: SpatialReferenceProperties | null;
}

export type ImageAngleName = "up" | "north";

/**
 * Input parameters for [ImageryLayer#computeAngles()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#computeAngles)
 * or [computeAngles()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-imageService.html#computeAngles) methods.
 *
 * @since 4.22
 * @see [ImageryLayer#computeAngles()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#computeAngles)
 * @see [computeAngles()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-imageService.html#computeAngles)
 * @see [ArcGIS REST API - Compute Angles](https://developers.arcgis.com/rest/services-reference/enterprise/compute-angles.htm)
 */
export default class ImageAngleParameters extends JSONSupport {
  constructor(properties?: ImageAngleParametersProperties);
  /**
   * Angle names to be computed. By default both north and up angles are computed.
   *
   * Possible values | Description
   * --------------- | -----------
   * ["up"] | Angle computed after rotating the map so that the top of the image is always oriented to the direction of sensor when it acquired the image.
   * ["north"] | Angle computed after rotating the map so that the top of the image is always oriented toward north. This angle is essentially the arithmetic rotation from [SpatialReference#imageCoordinateSystem](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#imageCoordinateSystem) to pixel space.
   * ["north", "up"] | Angle computed for all directions.
   *
   * @default ["north","up"]
   */
  accessor angleNames: ImageAngleName[] | null | undefined;
  /**
   * A [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry that defines the reference point of rotation to
   * compute the angle direction. By default the centroid of the image is used.
   */
  get point(): Point | null | undefined;
  set point(value: PointProperties | null | undefined);
  /** The rasterId of a raster catalog in the image service. The specified raster catalog's image coordinate system will be used in the calculation. */
  accessor rasterId: number | null | undefined;
  /** The spatial reference used to compute the angles. If not specified, the image service's spatial reference will be used. */
  get spatialReference(): SpatialReference | null | undefined;
  set spatialReference(value: SpatialReferenceProperties | null | undefined);
}