import type Color from "../../Color.js";
import type Graphic from "../../Graphic.js";
import type Ground from "../../Ground.js";
import type ElevationProfileLine from "./ElevationProfileLine.js";
import type Layer from "../../layers/Layer.js";
import type BuildingSublayer from "../../layers/buildingSublayers/BuildingSublayer.js";
import type SubtypeSublayer from "../../layers/support/SubtypeSublayer.js";
import type { ElevationProfileLineProperties } from "./ElevationProfileLine.js";
import type { ColorLike } from "../../Color.js";

export interface ElevationProfileLineSceneProperties extends ElevationProfileLineProperties, Partial<Pick<ElevationProfileLineScene, "exclude" | "include">> {
  /**
   * Color of the line on the chart and in the view.
   *
   * @default "#cf4ccf"
   */
  color?: ColorLike;
}

/**
 * Represents a profile line that samples elevation directly from the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html).
 *
 * All volumetric objects in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) contribute to the resulting profile, including
 * [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html), [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html), [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html),
 * [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMesh3DTilesLayer.html), and [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) with
 * volumetric 3D symbols (e.g., [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html),
 * [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html)).
 *
 * The profile line is updated automatically to reflect what is currently loaded and visible in the view, including
 * changes to the [Camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html) or scene contents.
 *
 * > [!WARNING]
 * >
 * > **Known Limitations**
 * >
 * > - This profile line type is only supported in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and not in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html).
 * > - Point cloud scene layers are not supported due to performance considerations.
 *
 * @since 4.34
 * @example
 * // Create an elevation profile analysis with a scene profile line
 * const analysis = new ElevationProfileAnalysis({
 *   profiles: [{
 *     type: "scene",
 *     exclude: [view.map.ground], // Exclude ground from elevation sampling
 *   }],
 * });
 */
export default class ElevationProfileLineScene extends ElevationProfileLine {
  constructor(properties?: ElevationProfileLineSceneProperties);
  /**
   * Color of the line on the chart and in the view.
   *
   * @default "#cf4ccf"
   */
  get color(): Color;
  set color(value: ColorLike);
  /**
   * Items which are to be excluded when querying elevation from the view. When specified, these items will not
   * contribute to the resulting profile. When not specified, all layers (including ground) will be taken into account.
   *
   * @example
   * const analysis = new ElevationProfileAnalysis({
   *   profiles: [{
   *     type: "scene",
   *     exclude: [view.map.ground], // Exclude ground from elevation sampling for this profile line
   *   }],
   * });
   */
  accessor exclude: IntersectItem[] | null | undefined;
  /**
   * Items which are to be included when querying elevation from the view. When specified, only these items will
   * contribute to the resulting profile. When not specified, all layers (including ground) will be taken into account.
   *
   * @example
   * const analysis = new ElevationProfileAnalysis({
   *   profiles: [{
   *     type: "scene",
   *
   *     // Only graphics from myGraphicsLayer will be used for elevation sampling of this profile line
   *     include: [myGraphicsLayer],
   *   }],
   * });
   */
  accessor include: IntersectItem[] | null | undefined;
  /** The line type. */
  readonly type: "scene";
}

/**
 * A layer or graphic to be used in [SceneView.toMap()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toMap) and [SceneView.hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) filter options.
 *
 * @see [SceneView.toMap()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toMap)
 * @see [SceneView.hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest)
 */
export type IntersectItem = Graphic | Layer | BuildingSublayer | SubtypeSublayer | Ground;