import type Extent from "../../geometry/Extent.js";
import type GeoreferenceBase from "./GeoreferenceBase.js";
import type { ExtentProperties } from "../../geometry/Extent.js";

export interface ExtentAndRotationGeoreferenceProperties extends Partial<Pick<ExtentAndRotationGeoreference, "rotation">> {
  /**
   * An extent of the image or video element representing its geographic location when added to the [MediaLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MediaLayer.html).
   *
   * @see [ImageElement.georeference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageElement.html#georeference)
   * @see [VideoElement.georeference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-VideoElement.html#georeference)
   */
  extent?: ExtentProperties | null;
}

/**
 * ExtentAndRotationGeoreference is used to set the [geographic location](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageElement.html#georeference) of the
 * [image](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageElement.html) or [element](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-VideoElement.html) referenced
 * in the [MediaLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MediaLayer.html) using the [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ExtentAndRotationGeoreference.html#extent) and [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ExtentAndRotationGeoreference.html#rotation) parameters.
 *
 * ```js
 * // create a new ExtentAndRotationGeoreference
 * const geoReference = new ExtentAndRotationGeoreference({
 *   extent: new Extent({
 *     spatialReference: {
 *       wkid: 102100
 *     },
 *     xmin: -10047456.27662979,
 *     ymin: 3486722.2723874687,
 *     xmax: -10006982.870152846,
 *     ymax: 3514468.91365495
 *   })
 * });
 * const imageElement = new ImageElement({
 *   type: "image",
 *   image: "https://arcgis.github.io/arcgis-samples-javascript/sample-data/media-layer/neworleans1891.png",
 *   georeference: geoReference
 * });
 * ```
 *
 * @since 4.24
 * @see [ImageElement.georeference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageElement.html#georeference)
 * @see [VideoElement.georeference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-VideoElement.html#georeference)
 * @see [Sample - MediaLayer with images](https://developers.arcgis.com/javascript/latest/sample-code/layers-medialayer-images/)
 */
export default class ExtentAndRotationGeoreference extends GeoreferenceBase {
  constructor(properties?: ExtentAndRotationGeoreferenceProperties);
  /**
   * An extent of the image or video element representing its geographic location when added to the [MediaLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MediaLayer.html).
   *
   * @see [ImageElement.georeference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageElement.html#georeference)
   * @see [VideoElement.georeference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-VideoElement.html#georeference)
   */
  get extent(): Extent | null | undefined;
  set extent(value: ExtentProperties | null | undefined);
  /**
   * A rotation of the image or video element when added to the [MediaLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MediaLayer.html).
   * The rotation is clockwise angle of due north in relation to the top of the view in degrees.
   *
   * @default 0
   * @see [ImageElement.georeference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageElement.html#georeference)
   * @see [VideoElement.georeference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-VideoElement.html#georeference)
   */
  accessor rotation: number;
  /** The georeference type. */
  readonly type: "extent-and-rotation";
}