import type Collection from "../core/Collection.js";
import type Layer from "./Layer.js";
import type WMTSSublayer from "./support/WMTSSublayer.js";
import type { MultiOriginJSONSupportMixin } from "../core/MultiOriginJSONSupport.js";
import type { AbortOptions } from "../core/promiseUtils.js";
import type { BlendLayer, BlendLayerProperties } from "./mixins/BlendLayer.js";
import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
import type { RefreshableLayer, RefreshableLayerProperties } from "./mixins/RefreshableLayer.js";
import type { ScaleRangeLayer, ScaleRangeLayerProperties } from "./mixins/ScaleRangeLayer.js";
import type { WMTSLayerServiceMode } from "./wmts/types.js";
import type { WMTSSublayerProperties } from "./support/WMTSSublayer.js";
import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
import type { LayerProperties } from "./Layer.js";

export interface WMTSLayerProperties extends LayerProperties, PortalLayerProperties, OperationalLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties, BlendLayerProperties, Partial<Pick<WMTSLayer, "copyright" | "customLayerParameters" | "customParameters" | "serviceMode" | "url" | "version">> {
  /** Currently active sublayer. Defaults to the first sublayer in [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#sublayers). */
  activeLayer?: WMTSSublayerProperties;
  /** A collection of [WMTSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html) objects. */
  sublayers?: ReadonlyArrayOrCollection<WMTSSublayerProperties> | null;
}

/**
 * The WMTSLayer is used to create layers based on OGC Web Map Tile Services (WMTS).
 * The WMTSLayer initially executes a WMTS GetCapabilities request, which might require [CORS](https://developers.arcgis.com/javascript/latest/cors/) or a [proxy page](https://developers.arcgis.com/javascript/latest/proxies/).
 *
 * @since 4.4
 * @see [Sample - WMTSLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-wmts/)
 * @see [Sample - Select WMTS sublayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-wmts-sublayers/)
 */
export default class WMTSLayer extends WMTSLayerSuperclass {
  /**
   * @example
   * // Typical usage
   * const wmtsLayer = new WMTSLayer({
   *   url: "https://gibs.earthdata.nasa.gov/wmts/epsg4326/best", // url to the service
   *   activeLayer: {
   *     id: "SRTM_Color_Index",
   *   }
   * });
   */
  constructor(properties?: WMTSLayerProperties);
  /** Currently active sublayer. Defaults to the first sublayer in [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#sublayers). */
  get activeLayer(): WMTSSublayer;
  set activeLayer(value: WMTSSublayerProperties);
  /**
   * Copyright information for the WMTS service.
   * This defaults to the value of the AccessConstraints property from the GetCapabilities request.
   *
   * @default ""
   */
  accessor copyright: string;
  /**
   * Use this to append different custom parameters to the WMTS tile requests.
   * The custom layer parameters are applied to GetTile.
   */
  accessor customLayerParameters: Record<string, string> | null | undefined;
  /**
   * Use this to append custom parameters to all WMTS requests.
   * The custom parameters are applied to GetCapabilities and GetTile.
   * For example, if an access key is required, the key can be configured as a custom parameter.
   */
  accessor customParameters: Record<string, string> | null | undefined;
  /**
   * The service mode for the WMTS layer.
   * If not specified, the API will first make a getCapabilities request using `RESTful`.
   * If that fails, it will try using `KVP`.
   *
   * @default "RESTful"
   */
  accessor serviceMode: WMTSLayerServiceMode;
  /** A collection of [WMTSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html) objects. */
  get sublayers(): Collection<WMTSSublayer> | null | undefined;
  set sublayers(value: ReadonlyArrayOrCollection<WMTSSublayerProperties> | 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(): "wmts";
  /**
   * The URL of the WMTS service.
   * The URL for the GetCapabilities is created based on the url and serviceMode properties.
   * For example https://gibs.earthdata.nasa.gov/wmts/epsg4326/best.
   */
  accessor url: string;
  /**
   * The version of the [WMTS specification](https://www.ogc.org/standards/wmts/) used.
   * For example, `1.0.0`.
   *
   * @default "1.0.0"
   */
  accessor version: string;
  /**
   * Requests a tile from the WMTS service.
   *
   * @param level - The tile level.
   * @param row - The tile row.
   * @param col - The tile column.
   * @param options - An object with the following properties.
   * @returns Resolves to an image element with the tile data.
   * @since 4.27
   */
  fetchTile(level: number, row: number, col: number, options?: AbortOptions): Promise<HTMLImageElement>;
  /**
   * Returns a [WMTSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html) based on the given sublayer id.
   *
   * @param id - The [WMTSSublayer.id](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#id) of the WMTS sublayer.
   * @returns Returns the requested WMTSSublayer.
   */
  findSublayerById(id: string): WMTSSublayer | null | undefined;
}
declare const WMTSLayerSuperclass: typeof Layer & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof ScaleRangeLayer & typeof RefreshableLayer & typeof BlendLayer