import type ControlPointsGeoreference from "./ControlPointsGeoreference.js";
import type CornersGeoreference from "./CornersGeoreference.js";
import type ExtentAndRotationGeoreference from "./ExtentAndRotationGeoreference.js";
import type ImageElement from "./ImageElement.js";
import type VideoElement from "./VideoElement.js";

/**
 * Represents animation options, a collection of properties that apply when the [ImageElement#image](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageElement.html#image) is an animated GIF or APNG.
 *
 * @since 4.28
 */
export interface AnimationOptions {
  /** Represents the number of seconds it takes to play through the layer's animation once. */
  duration?: number;
  /** Indicates whether the animated image should play its animation. */
  playing?: boolean;
  /** Represents the number of seconds to delay before repeating an animation cycle. */
  repeatDelay?: number;
  /** Determines how to repeat the animation of a layer when the animation cycle ends. */
  repeatType?: "none" | "loop" | "oscillate";
}

/**
 * Image and video elements referenced in the MediaLayer.
 *
 * @since 4.24
 * @see [LocalMediaElementSource#elements](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LocalMediaElementSource.html#elements)
 */
export type MediaElement = ImageElement | VideoElement;

export type Georeference = CornersGeoreference | ExtentAndRotationGeoreference | ControlPointsGeoreference;

export type IHTMLImageContainer = HTMLImageElement | HTMLCanvasElement;

export type IImageBinarySource = IHTMLImageContainer | ImageData;

export type IImageSource = string | IImageBinarySource;

export type IVideoSource = string | HTMLVideoElement | null | undefined;