import type AreaMeasurementAnalysis from "./AreaMeasurementAnalysis.js";
import type DimensionAnalysis from "./DimensionAnalysis.js";
import type DirectLineMeasurementAnalysis from "./DirectLineMeasurementAnalysis.js";
import type DistanceMeasurementAnalysis from "./DistanceMeasurementAnalysis.js";
import type ElevationProfileAnalysis from "./ElevationProfileAnalysis.js";
import type LineOfSightAnalysis from "./LineOfSightAnalysis.js";
import type ShadowCastAnalysis from "./ShadowCastAnalysis.js";
import type SliceAnalysis from "./SliceAnalysis.js";
import type ViewshedAnalysis from "./ViewshedAnalysis.js";
import type VolumeMeasurementAnalysis from "./VolumeMeasurementAnalysis.js";

/** Union of all possible analysis types that can be added to a [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). */
export type AnalysisUnion = AreaMeasurementAnalysis | DimensionAnalysis | DirectLineMeasurementAnalysis | DistanceMeasurementAnalysis | ElevationProfileAnalysis | LineOfSightAnalysis | ShadowCastAnalysis | SliceAnalysis | ViewshedAnalysis | VolumeMeasurementAnalysis;

export type AnalysisType = AnalysisUnion["type"];

export interface FeatureReferenceLayer {
  /** The layer id. */
  id: string | number;
  /** The object id field. */
  objectIdField?: string | null;
}

/**
 * A reference to a feature in a layer. The interface of a feature reference is compatible with a
 * [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html), but contains only the minimal set of information required
 * to reference a feature.
 */
export interface FeatureReference {
  /** Feature attributes. */
  attributes: any;
  /** Reference to a layer. */
  layer?: FeatureReferenceLayer | null;
}