import type Color from "../Color.js";
import type Extent from "../geometry/Extent.js";
import type SpatialReference from "../geometry/SpatialReference.js";
import type Layer from "./Layer.js";
import type PlaybackInfo from "./support/PlaybackInfo.js";
import type TelemetryData from "./support/TelemetryData.js";
import type TelemetryDisplay from "./support/TelemetryDisplay.js";
import type VideoTimeExtent from "./support/VideoTimeExtent.js";
import type CIMSymbol from "../symbols/CIMSymbol.js";
import type PictureMarkerSymbol from "../symbols/PictureMarkerSymbol.js";
import type SimpleFillSymbol from "../symbols/SimpleFillSymbol.js";
import type SimpleLineSymbol from "../symbols/SimpleLineSymbol.js";
import type SimpleMarkerSymbol from "../symbols/SimpleMarkerSymbol.js";
import type { MultiOriginJSONSupportMixin } from "../core/MultiOriginJSONSupport.js";
import type { VideoLayerCapabilities } from "./types.js";
import type { BlendLayer, BlendLayerProperties } from "./mixins/BlendLayer.js";
import type { CustomParametersMixin, CustomParametersMixinProperties } from "./mixins/CustomParametersMixin.js";
import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
import type { ScaleRangeLayer, ScaleRangeLayerProperties } from "./mixins/ScaleRangeLayer.js";
import type { Effect } from "./support/FeatureEffect.js";
import type { LivestreamStatus, SensorOrientationInfo, VideoMetadataEntry, VideoState } from "./video/types.js";
import type { Codecs, VideoCameraInfo, VideoGroundControlPoint, VideoQuality, VideoServiceLayerInfo, VideoSourceType } from "../portal/jsonTypes.js";
import type { SimpleMarkerSymbolProperties } from "../symbols/SimpleMarkerSymbol.js";
import type { SimpleFillSymbolProperties } from "../symbols/SimpleFillSymbol.js";
import type { ExtentProperties } from "../geometry/Extent.js";
import type { PlaybackInfoProperties } from "./support/PlaybackInfo.js";
import type { CIMSymbolProperties } from "../symbols/CIMSymbol.js";
import type { PictureMarkerSymbolProperties } from "../symbols/PictureMarkerSymbol.js";
import type { SimpleLineSymbolProperties } from "../symbols/SimpleLineSymbol.js";
import type { SpatialReferenceProperties } from "../geometry/SpatialReference.js";
import type { TelemetryDisplayProperties } from "./support/TelemetryDisplay.js";
import type { LayerProperties } from "./Layer.js";

export interface VideoLayerProperties extends LayerProperties, CustomParametersMixinProperties, PortalLayerProperties, OperationalLayerProperties, ScaleRangeLayerProperties, BlendLayerProperties, Partial<Pick<VideoLayer, "autoplay" | "copyright" | "description" | "frameEffect" | "frameOpacity" | "loop" | "muted" | "playbackRate" | "sensorSymbolOrientation" | "start" | "url" | "volume">> {
  /**
   * A [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleMarkerSymbol/) used for representing the center point of a video frame.
   *
   * @since 4.33
   */
  frameCenterSymbol?: (SimpleMarkerSymbolProperties & { type: "simple-marker" });
  /**
   * A [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleFillSymbol/) used for representing the coverage area of a video frame.
   *
   * @since 4.33
   */
  frameOutlineSymbol?: (SimpleFillSymbolProperties & { type: "simple-fill" });
  /**
   * The full extent of the video layer.
   *
   * @example
   * // Set the map view's extent to the full extent of the video layer
   * await layer.load();
   * view.goTo(layer.fullExtent);
   * @example
   * // Once the layer loads, set the view's extent to the layer's full extent
   * layer.when(function(){
   *   view.extent = layer.fullExtent;
   * });
   */
  fullExtent?: ExtentProperties | null;
  /**
   * The initial extent of the video layer.
   *
   * @example
   * // Set the map view's extent to the initial extent of the video layer
   * await layer.load();
   * view.goTo(layer.initialExtent);
   */
  initialExtent?: ExtentProperties | null;
  /**
   * The playback information for the video layer.
   * The playback information includes the framerate, container format, group of pictures (GOP), aspect ratio, and key length value (KLV).
   *
   * @since 4.33
   */
  playbackInfo?: PlaybackInfoProperties | null;
  /**
   * A [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/) used for representing the line of sight from the sensor to the center of the frame coverage area.
   *
   * @since 4.33
   */
  sensorSightLineSymbol?: (SimpleLineSymbolProperties & { type: "simple-line" });
  /**
   * A [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleMarkerSymbol/), [PictureMarkerSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/PictureMarkerSymbol/) or [CIMSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/CIMSymbol/) used for representing the point position geometry of the video sensor.
   *
   * The default sensor symbol is the following:
   * ```js
   * {
   *   type: "simple-marker",
   *   style: "circle",
   *   size: 16,
   *   color: [255, 127, 0],
   *   outline: {
   *     color: [255, 255, 255],
   *     width: 1.33
   *   }
   * }
   * ```
   *
   * @since 4.33
   */
  sensorSymbol?: (SimpleMarkerSymbolProperties & { type: "simple-marker" }) | (PictureMarkerSymbolProperties & { type: "picture-marker" }) | (CIMSymbolProperties & { type: "cim" });
  /**
   * A [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/) used for representing the trailing line of travel of a moving video collection sensor.
   *
   * @since 4.33
   */
  sensorTrailSymbol?: (SimpleLineSymbolProperties & { type: "simple-line" });
  /**
   * The spatial reference of the video layer.
   *
   * @default SpatialReference.WGS84
   * @see [SpatialReference.WGS84](https://developers.arcgis.com/javascript/latest/references/core/geometry/SpatialReference/#WGS84)
   * @example
   * // Set the spatial reference of the video layer
   * videoLayer.spatialReference = new SpatialReference({
   *  wkid: 4326
   * });
   */
  spatialReference?: SpatialReferenceProperties;
  /**
   * The telemetry display for the video layer.
   * The telemetry display is used to determine what [telemetry](https://developers.arcgis.com/javascript/latest/references/core/layers/VideoLayer/#telemetry) data to display on the video layer.
   *
   * @example
   * // Display only the frame outline
   * videoLayer.telemetryDisplay = new TelemetryDisplay({
   *   frame: false,
   *   frameCenter: false,
   *   frameOutline: true,
   *   lineOfSight: false,
   *   sensorLocation: false,
   *   sensorTrail: false,
   * });
   */
  telemetryDisplay?: TelemetryDisplayProperties;
  /**
   * The title of the layer used to identify it in places such as the [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/)
   * and [LayerList](https://developers.arcgis.com/javascript/latest/references/core/widgets/LayerList/).
   *
   * @example
   * // Set the title of the video layer
   * videoLayer.title = "My Video Layer";
   */
  title?: string | null;
}

/**
 * The VideoLayer provides video content from on-demand and livestream feeds from an [ArcGIS Video Server](https://enterprise.arcgis.com/en/video/).
 * Application developers using VideoLayer can display the video georeferenced on a [Map](https://developers.arcgis.com/javascript/latest/references/core/Map/), and control the playback with the [VideoPlayer](https://developers.arcgis.com/javascript/latest/references/core/widgets/VideoPlayer/) widget.
 *
 * > [!WARNING]
 * >
 * > **Known Limitations**
 * >
 * > Not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
 * > Not supported by the [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/).
 * > Not supported on macOS and iOS devices.
 *
 * ![VideoLayer and VideoPlayer](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/video-player.png)
 *
 * @since 4.30
 * @example const videoLayer = new VideoLayer({ url });
 */
export default class VideoLayer extends VideoLayerSuperclass {
  /**
   * @example
   * // Create a new VideoLayer instance referencing a video service
   * const videoLayer = new VideoLayer({ url });
   */
  constructor(properties?: VideoLayerProperties);
  /**
   * Indicates if the video layer is configured to start playback when ready.
   *
   * @default false
   * @since 4.33
   * @example
   * // Configure the layer to start playback when ready
   * videoLayer.autoplay = true;
   */
  accessor autoplay: boolean;
  /**
   * Represents the length of the currently buffered video in seconds.
   * The buffered time is updated as the video is played.
   */
  get buffered(): number;
  /**
   * Represents available information about the sensor that captured the
   * stream data. This property is mainly used in defining camera information
   * from static sensors.
   *
   * @since 4.34
   */
  get cameraInfo(): VideoCameraInfo | null | undefined;
  /**
   * The capabilities of the video layer.
   * The capabilities describe the operations the video layer supports and are defined by the video service.
   */
  get capabilities(): VideoLayerCapabilities | null | undefined;
  /**
   * Defines the codecs on the media content of the video layer. The
   * codec for audio, text and video are defined on the video service
   * during layer creation. Media type and formats are described in more
   * detail [here](https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats).
   *
   * @since 4.33
   */
  get codecs(): Codecs | null | undefined;
  /**
   * The connection information for the video layer.
   * The information includes the HTTP Live Streaming (HLS) connection URL for the video layer.
   *
   * @since 4.34
   */
  get connectionInfo(): any | null | undefined;
  /**
   * The copyright information for the video layer.
   *
   * @example
   * // Set the copyright
   * videoLayer.copyright = "© 2024 Esri";
   */
  accessor copyright: string | null | undefined;
  /** The date the video layer was created. */
  get created(): Date | null | undefined;
  /** The current time of the video layer in seconds. */
  get currentTime(): number;
  /**
   * The description of the video layer.
   *
   * @example
   * // Set the description
   * videoLayer.description = "This is a video layer";
   */
  accessor description: string | null | undefined;
  /** The duration of the video layer in seconds. */
  get duration(): number;
  /** Indicates if the video layer has ended and the [current time](https://developers.arcgis.com/javascript/latest/references/core/layers/VideoLayer/#currentTime) is equal to the [duration](https://developers.arcgis.com/javascript/latest/references/core/layers/VideoLayer/#duration) of the video. */
  get ended(): boolean;
  /**
   * A [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleMarkerSymbol/) used for representing the center point of a video frame.
   *
   * @since 4.33
   */
  get frameCenterSymbol(): SimpleMarkerSymbol;
  set frameCenterSymbol(value: (SimpleMarkerSymbolProperties & { type: "simple-marker" }));
  /** The total number of frames in the video layer. */
  get frameCount(): number | null | undefined;
  /**
   * Provides filter functions that can be performed on the video frame to
   * achieve different visual effects.
   *
   * @since 4.33
   */
  accessor frameEffect: Effect | null | undefined;
  /**
   * The opacity of the video frame draped on the map. Value can be a number
   * between `0` and `1` where `0` is 100% transparent, `0.5` is 50%
   * transparent and `1` is fully opaque.
   *
   * @default 1
   * @since 4.33
   */
  accessor frameOpacity: number;
  /**
   * A [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleFillSymbol/) used for representing the coverage area of a video frame.
   *
   * @since 4.33
   */
  get frameOutlineSymbol(): SimpleFillSymbol;
  set frameOutlineSymbol(value: (SimpleFillSymbolProperties & { type: "simple-fill" }));
  /**
   * The full extent of the video layer.
   *
   * @example
   * // Set the map view's extent to the full extent of the video layer
   * await layer.load();
   * view.goTo(layer.fullExtent);
   * @example
   * // Once the layer loads, set the view's extent to the layer's full extent
   * layer.when(function(){
   *   view.extent = layer.fullExtent;
   * });
   */
  get fullExtent(): Extent | null | undefined;
  set fullExtent(value: ExtentProperties | null | undefined);
  /**
   * The ground control points for the video layer.
   * The ground control points are used to transform the video layer's pixel coordinates to ground coordinates.
   * The `x` and `y` properties are measured in pixels from the top left corner of the video frame.
   *
   * @since 4.34
   */
  get groundControlPoints(): VideoGroundControlPoint[] | null | undefined;
  /**
   * The initial extent of the video layer.
   *
   * @example
   * // Set the map view's extent to the initial extent of the video layer
   * await layer.load();
   * view.goTo(layer.initialExtent);
   */
  get initialExtent(): Extent | null | undefined;
  set initialExtent(value: ExtentProperties | null | undefined);
  /**
   * The active stream is loaded as a livestream video layer
   *
   * @default false
   * @since 4.33
   */
  get isLive(): boolean;
  /** The layer id of the video layer. */
  get layerId(): number | null | undefined;
  /**
   * Provides status details about an ongoing livestream playback. This
   * property is updated with each livestream time update.
   *
   * @since 4.34
   */
  get livestreamStatus(): LivestreamStatus | null | undefined;
  /**
   * Indicates if the video layer should loop.
   * If the video layer is set to loop, the video will restart from the beginning once it reaches the end.
   * Otherwise, the video will stop playing once it reaches the end.
   *
   * @default false
   * @example
   * // Loop the video layer
   * videoLayer.loop = true;
   */
  accessor loop: boolean;
  /**
   * The metadata for the video layer.
   * The metadata includes information such as the telemetry data, sensor model, and video frame information.
   */
  get metadata(): Map<number, VideoMetadataEntry> | null | undefined;
  /**
   * Defines the mime type of the active playback source
   *
   * @since 4.33
   */
  get mimeType(): string | null | undefined;
  /**
   * Indicates if the video layer is muted.
   *
   * @default false
   * @example
   * // Mute the video layer
   * videoLayer.muted = true;
   */
  accessor muted: boolean;
  /**
   * The playback information for the video layer.
   * The playback information includes the framerate, container format, group of pictures (GOP), aspect ratio, and key length value (KLV).
   *
   * @since 4.33
   */
  get playbackInfo(): PlaybackInfo | null | undefined;
  set playbackInfo(value: PlaybackInfoProperties | null | undefined);
  /**
   * The playback rate of the video layer.
   * The playback rate is the speed at which the video is played.
   *
   * @default 1
   * @example
   * // Set the playback rate of the video layer
   * videoLayer.playbackRate = 2;
   */
  accessor playbackRate: number;
  /**
   * The URL for use with the video player.
   *
   * @since 4.34
   */
  get playerUrl(): string | null | undefined;
  /**
   * Indicates if the video layer is playing.
   *
   * @see [play()](https://developers.arcgis.com/javascript/latest/references/core/layers/VideoLayer/#play)
   */
  get playing(): boolean;
  /** The URL to the poster image for the video layer. */
  get posterUrl(): string | null | undefined;
  /**
   * The available video qualities for the video layer.
   *
   * Quality | Resolution | Description
   * --------|------------|------------
   * sd | 720x480 | Standard Definition
   * hd | 1280x720 | High Definition
   * fhd | 1920x1080 | Full High Definition
   * qhd | 2560x1440 | Quad High Definition
   * uhd | 3840x2160 | Ultra High Definition
   */
  get qualities(): VideoQuality[] | null | undefined;
  /**
   * A [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/) used for representing the line of sight from the sensor to the center of the frame coverage area.
   *
   * @since 4.33
   */
  get sensorSightLineSymbol(): SimpleLineSymbol;
  set sensorSightLineSymbol(value: (SimpleLineSymbolProperties & { type: "simple-line" }));
  /**
   * A [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleMarkerSymbol/), [PictureMarkerSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/PictureMarkerSymbol/) or [CIMSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/CIMSymbol/) used for representing the point position geometry of the video sensor.
   *
   * The default sensor symbol is the following:
   * ```js
   * {
   *   type: "simple-marker",
   *   style: "circle",
   *   size: 16,
   *   color: [255, 127, 0],
   *   outline: {
   *     color: [255, 255, 255],
   *     width: 1.33
   *   }
   * }
   * ```
   *
   * @since 4.33
   */
  get sensorSymbol(): SimpleMarkerSymbol | PictureMarkerSymbol | CIMSymbol;
  set sensorSymbol(value: (SimpleMarkerSymbolProperties & { type: "simple-marker" }) | (PictureMarkerSymbolProperties & { type: "picture-marker" }) | (CIMSymbolProperties & { type: "cim" }));
  /**
   * Property is used to define orientation information to compute the
   * display angle of the sensor location symbol. The symbol angle can be
   * used to orient to the heading direction of the sensor platform, or to
   * the camera azimuth of the recording sensor
   *
   * @default { source: "platformHeading", symbolOffset: 0 }
   * @since 4.34
   */
  accessor sensorSymbolOrientation: SensorOrientationInfo;
  /**
   * A [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/) used for representing the trailing line of travel of a moving video collection sensor.
   *
   * @since 4.33
   */
  get sensorTrailSymbol(): SimpleLineSymbol;
  set sensorTrailSymbol(value: (SimpleLineSymbolProperties & { type: "simple-line" }));
  /** The ArcGIS Enterprise Portal item id of the video service. */
  get serviceItemId(): string | null | undefined;
  /**
   * The source quality of the video layer.
   *
   * Quality | Resolution | Description
   * --------|------------|------------
   * sd | 720x480 | Standard Definition
   * hd | 1280x720 | High Definition
   * qhd | 2560x1440 | Quad High Definition
   * uhd | 3840x2160 | Ultra High Definition
   */
  get sourceQuality(): VideoQuality | null | undefined;
  /** The source type of the video layer. */
  get sourceType(): VideoSourceType | null | undefined;
  /**
   * The spatial reference of the video layer.
   *
   * @default SpatialReference.WGS84
   * @see [SpatialReference.WGS84](https://developers.arcgis.com/javascript/latest/references/core/geometry/SpatialReference/#WGS84)
   * @example
   * // Set the spatial reference of the video layer
   * videoLayer.spatialReference = new SpatialReference({
   *  wkid: 4326
   * });
   */
  get spatialReference(): SpatialReference;
  set spatialReference(value: SpatialReferenceProperties);
  /**
   * The playback start time in seconds since the beginning of the video.
   *
   * @default 0
   * @since 4.33
   */
  accessor start: number;
  /**
   * The layer play operation has been invoked at least one time.
   *
   * @default false
   * @since 4.33
   */
  get started(): boolean;
  /** The current state of the video layer. */
  get state(): VideoState | null | undefined;
  /**
   * The telemetry data for the video layer.
   * The telemetry data is used to display the frame and sensor location on the map and is updated as the video is played.
   */
  get telemetry(): TelemetryData;
  /**
   * The telemetry display for the video layer.
   * The telemetry display is used to determine what [telemetry](https://developers.arcgis.com/javascript/latest/references/core/layers/VideoLayer/#telemetry) data to display on the video layer.
   *
   * @example
   * // Display only the frame outline
   * videoLayer.telemetryDisplay = new TelemetryDisplay({
   *   frame: false,
   *   frameCenter: false,
   *   frameOutline: true,
   *   lineOfSight: false,
   *   sensorLocation: false,
   *   sensorTrail: false,
   * });
   */
  get telemetryDisplay(): TelemetryDisplay;
  set telemetryDisplay(value: TelemetryDisplayProperties);
  /**
   * The title of the layer used to identify it in places such as the [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/)
   * and [LayerList](https://developers.arcgis.com/javascript/latest/references/core/widgets/LayerList/).
   *
   * @example
   * // Set the title of the video layer
   * videoLayer.title = "My Video Layer";
   */
  accessor title: string | null | undefined;
  /** The layer type provides a convenient way to check the type of the layer without the need to import specific layer modules. */
  get type(): "video";
  /** The URL to the REST endpoint of the video service. */
  accessor url: string | null | undefined;
  /**
   * The video service version of this layer.
   *
   * @since 4.33
   */
  get version(): number | null | undefined;
  /** The height of the video in pixels. */
  get videoHeight(): number | null | undefined;
  /**
   * Defines layer information for video layers published within the same
   * video service
   */
  get videoLayersInfo(): VideoServiceLayerInfo[] | null | undefined;
  /** The time extent of the video. */
  get videoTimeExtent(): VideoTimeExtent | null | undefined;
  /** The width of the video in pixels. */
  get videoWidth(): number | null | undefined;
  /**
   * The volume property sets or returns the audio volume of a video, from 0.0
   * (silent) to 1.0 (loudest). The default value is 0.0.
   *
   * @since 4.33
   */
  accessor volume: number;
  /**
   * Indicates if the video layer is waiting for data.
   * If `true`, the video layer is waiting for data; otherwise, it is not waiting for data.
   */
  get waiting(): boolean | null | undefined;
  /**
   * Pauses the video layer.
   *
   * @example
   * // Pause the video layer
   * videoLayer.pause();
   */
  pause(): void;
  /**
   * Plays the video layer.
   *
   * @example
   * // Play the video layer
   * videoLayer.play();
   */
  play(): void;
  /**
   * Resets the video layer to its initial state.
   *
   * @example
   * // Reset the video layer
   * videoLayer.reset();
   */
  reset(): void;
  /**
   * Sets the current time, in seconds, of the video layer.
   *
   * @param timestamp - The timestamp to set the video layer to.
   * @example
   * // Set the current time of the video layer to 30 seconds
   * videoLayer.setCurrentTime(30);
   */
  setCurrentTime(timestamp: number): void;
  /**
   * Updates the telemetry color of all telemetry symbol elements to the provided color value.
   *
   * @param color - The color to set the video telemetry symbol color to.
   * @example
   * // Set the telemetry color to red
   * videoLayer.updateTelemetryColor(new Color("red"));
   */
  updateTelemetryColor(color: Color): void;
}
declare const VideoLayerSuperclass: typeof Layer & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof ScaleRangeLayer & typeof BlendLayer

/** The **VideoPoint** is an object that represents a point on the current video frame. */
export interface VideoPoint {
  /** The x coordinate on the current video frame in pixels from the top left corner */
  x: number;
  /** The y coordinate on the current video frame in pixels from the top left corner */
  y: number;
}