import type Accessor from "../../core/Accessor.js";
import type Collection from "../../core/Collection.js";
import type { ElevationProfileLineUnion } from "./types.js";
import type { ReadonlyArrayOrCollection } from "../../core/Collection.js";
import type { ElevationProfileLineSceneProperties } from "./ElevationProfileLineScene.js";
import type { ElevationProfileLineQueryProperties } from "./ElevationProfileLineQuery.js";
import type { ElevationProfileLineInputProperties } from "./ElevationProfileLineInput.js";
import type { ElevationProfileLineGroundProperties } from "./ElevationProfileLineGround.js";

/** @since 5.1 */
export interface ElevationProfileGroupProperties extends Partial<Pick<ElevationProfileGroup, "id" | "title">> {
  /**
   * The collection of [profile lines](https://developers.arcgis.com/javascript/latest/references/core/analysis/ElevationProfile/ElevationProfileLine/) that belong to this group.
   *
   * Each line defines a source for sampling elevation along the analysis geometry and is computed independently.
   * The group itself is used for organization and does not produce a separate result line.
   *
   * Each line in the group will be included in both the [ElevationProfileAnalysisView2D.results](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/ElevationProfileAnalysisView2D/#results)
   * and [ElevationProfileAnalysisView3D.results](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ElevationProfileAnalysisView3D/#results) array of the analysis view, but the group will
   * not have a corresponding result entry.
   *
   * @since 5.1
   * @see [Sample - Elevation Profile group](https://developers.arcgis.com/javascript/latest/sample-code/elevation-profile-group/)
   */
  profiles?: ReadonlyArrayOrCollection<((ElevationProfileLineGroundProperties & { type: "ground" }) | (ElevationProfileLineInputProperties & { type: "input" }) | (ElevationProfileLineQueryProperties & { type: "query" }) | (ElevationProfileLineSceneProperties & { type: "scene" }))> | null;
}

/**
 * Represents a logical container that organizes multiple profile lines.
 *
 * The group itself is not computed directly as a profile line. Instead, each individual line within
 * [profiles](https://developers.arcgis.com/javascript/latest/references/core/analysis/ElevationProfile/ElevationProfileGroup/#profiles) is computed independently, with the resulting data
 * exposed through the [ElevationProfileAnalysisView2D.results](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/ElevationProfileAnalysisView2D/#results) and
 * [ElevationProfileAnalysisView3D.results](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ElevationProfileAnalysisView3D/#results) properties.
 *
 * When using the
 * [Elevation Profile component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-elevation-profile/),
 * the group serves to consolidate these profile lines under a single entry in the legend for better
 * organization.
 *
 * @since 5.1
 * @see [ElevationProfileAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ElevationProfileAnalysis/)
 * @see [ElevationProfileLine](https://developers.arcgis.com/javascript/latest/references/core/analysis/ElevationProfile/ElevationProfileLine/)
 * @see [Sample - Elevation Profile group](https://developers.arcgis.com/javascript/latest/sample-code/elevation-profile-group/)
 */
export default class ElevationProfileGroup extends Accessor {
  /** @since 5.1 */
  constructor(properties?: ElevationProfileGroupProperties);
  /**
   * Unique identifier for the profile group. This value is automatically generated unless specified.
   *
   * @since 5.1
   */
  accessor id: string;
  /**
   * The collection of [profile lines](https://developers.arcgis.com/javascript/latest/references/core/analysis/ElevationProfile/ElevationProfileLine/) that belong to this group.
   *
   * Each line defines a source for sampling elevation along the analysis geometry and is computed independently.
   * The group itself is used for organization and does not produce a separate result line.
   *
   * Each line in the group will be included in both the [ElevationProfileAnalysisView2D.results](https://developers.arcgis.com/javascript/latest/references/core/views/2d/analysis/ElevationProfileAnalysisView2D/#results)
   * and [ElevationProfileAnalysisView3D.results](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ElevationProfileAnalysisView3D/#results) array of the analysis view, but the group will
   * not have a corresponding result entry.
   *
   * @since 5.1
   * @see [Sample - Elevation Profile group](https://developers.arcgis.com/javascript/latest/sample-code/elevation-profile-group/)
   */
  get profiles(): Collection<ElevationProfileLineUnion>;
  set profiles(value: ReadonlyArrayOrCollection<((ElevationProfileLineGroundProperties & { type: "ground" }) | (ElevationProfileLineInputProperties & { type: "input" }) | (ElevationProfileLineQueryProperties & { type: "query" }) | (ElevationProfileLineSceneProperties & { type: "scene" }))> | null | undefined);
  /**
   * Title of the group, shown in the chart legend.
   *
   * @since 5.1
   */
  accessor title: string | null | undefined;
  readonly type: "group";
}