import type Color from "../../Color.js";
import type ElevationProfileLine from "./ElevationProfileLine.js";
import type { ElevationProfileLineProperties } from "./ElevationProfileLine.js";
import type { ElevationQuerySource } from "./types.js";
import type { ColorLike } from "../../Color.js";

/** @deprecated since 5.0. Use the [Elevation Profile component](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-elevation-profile/) or [ElevationProfileLineQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfile-ElevationProfileLineQuery.html) from [ElevationProfileAnalysis](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfileAnalysis.html) instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/). */
export interface ElevationProfileLineQueryProperties extends ElevationProfileLineProperties, Partial<Pick<ElevationProfileLineQuery, "source">> {
  /**
   * Color of the line on the chart and in the view.
   *
   * @default "#db334a"
   */
  color?: ColorLike;
  /**
   * Whether a line visualization representing [elevationSamples](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ElevationProfile-ElevationProfileLine.html#samples)
   * should be added to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This property doesn't apply to [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html).
   *
   * @default true
   * @since 4.20
   */
  viewVisualizationEnabled?: boolean;
}

/**
 * Profile line which samples elevation from a custom elevation source, for example by creating a new
 * [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html), or by using an elevation layer from [Ground#layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers).
 *
 * Additionally, you can create your own source object with a method called `queryElevation`, with the same signature as
 * [ElevationLayer#queryElevation()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation).
 *
 * @deprecated since 5.0. Use the [Elevation Profile component](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-elevation-profile/) or [ElevationProfileLineQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfile-ElevationProfileLineQuery.html) from [ElevationProfileAnalysis](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfileAnalysis.html) instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
 * @since 4.18
 * @see [ElevationProfile](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ElevationProfile.html) widget - Deprecated since 5.0. Use the [Elevation Profile component](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-elevation-profile/) instead.
 * @see [ElevationProfileViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ElevationProfile-ElevationProfileViewModel.html) - Deprecated since 5.0. Use [ElevationProfileAnalysis](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfileAnalysis.html) instead.
 * @see [ElevationProfileLineGround](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ElevationProfile-ElevationProfileLineGround.html) - Deprecated since 5.0. Use [ElevationProfileLineGround](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfile-ElevationProfileLineGround.html) from [ElevationProfileAnalysis](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfileAnalysis.html) instead.
 * @see [ElevationProfileLineInput](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ElevationProfile-ElevationProfileLineInput.html) - Deprecated since 5.0. Use [ElevationProfileLineInput](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfile-ElevationProfileLineInput.html) from [ElevationProfileAnalysis](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfileAnalysis.html) instead.
 * @see [ElevationProfileLineView](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ElevationProfile-ElevationProfileLineView.html) - Deprecated since 5.0. Use [ElevationProfileLineScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfile-ElevationProfileLineScene.html) from [ElevationProfileAnalysis](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-ElevationProfileAnalysis.html) instead.
 * @example
 * const elevLayer = new ElevationLayer({
 *   url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Elevation/MtBaldy_Elevation/ImageServer"
 * });
 * const elevationProfile = new ElevationProfile({
 *   view: view,
 *   profiles: [{
 *     type: "query", // autocasts as new ElevationProfileLineQuery(),
 *     source: elevLayer
 *   }]
 * });
 */
export default abstract class ElevationProfileLineQuery extends ElevationProfileLine {
  /**
   * Color of the line on the chart and in the view.
   *
   * @default "#db334a"
   */
  get color(): Color;
  set color(value: ColorLike);
  /**
   * Elevation source used to sample elevation when generating the profile, for
   * example an [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html).
   *
   * @example
   * const elevLayer = new ElevationLayer({
   *   url: "https://sampleserver6.arcgisonline.com/arcgis/rest/.../Elevation/ImageServer"
   * });
   *
   * // profile line with elevation layer source
   * const elevationProfile = new ElevationProfile({
   *   view,
   *   profiles: [{
   *     type: "query", // autocasts as new ElevationProfileLineQuery(),
   *     source: elevLayer
   *   }]
   * });
   *
   * // profile line with a source coming from an elevation
   * // layer with a specific sampling resolution
   * const elevationProfile = new ElevationProfile({
   *   view,
   *   profiles: [{
   *     type: "query",
   *     source: {
   *       queryElevation(geometry, options) {
   *         return elevLayer.queryElevation(geometry, { ...options, demResolution: 20 })
   *       }
   *     }
   *   }]
   * });
   *
   * // profile line with a source that queries data
   * // on an elevation sampler
   * view.when(async() => {
   *   const sampler = await elevLayer.createElevationSampler(extent);
   *   const querySource = {
   *     queryElevation: async (geometry: Multipoint) => {
   *       return {
   *         geometry: await sampler.queryElevation(geometry),
   *         noDataValue: sampler.noDataValue
   *       };
   *     }
   *   };
   *   const elevationProfile = new ElevationProfile({
   *     view,
   *     profiles: [{
   *       type: "query",
   *       source: querySource
   *     }]
   *   });
   * });
   */
  accessor source: ElevationQuerySource;
  /** The line type. */
  readonly type: "query";
  /**
   * Whether a line visualization representing [elevationSamples](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ElevationProfile-ElevationProfileLine.html#samples)
   * should be added to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This property doesn't apply to [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html).
   *
   * @default true
   * @since 4.20
   */
  accessor viewVisualizationEnabled: boolean;
}