import type Graphic from "../../Graphic.js";
import type { JSONSupport } from "../../core/JSONSupport.js";
import type { GraphicProperties } from "../../Graphic.js";

export interface IdentifyResultProperties extends Partial<Pick<IdentifyResult, "displayFieldName" | "layerId" | "layerName">> {
  /** An identified feature from the map service. */
  feature?: GraphicProperties;
}

/**
 * The result from [identify](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-identify.html).
 *
 * @since 4.20
 * @see [identify](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-identify.html)
 * @see [IdentifyParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-IdentifyParameters.html)
 * @see [Identify - ArcGIS Server REST API](https://developers.arcgis.com/rest/services-reference/identify-map-service-.htm)
 */
export default class IdentifyResult extends JSONSupport {
  constructor(properties?: IdentifyResultProperties);
  /**
   * The name of the layer's primary display field. The value of this property matches
   * the name of one of the fields of the feature.
   */
  accessor displayFieldName: string;
  /** An identified feature from the map service. */
  get feature(): Graphic;
  set feature(value: GraphicProperties);
  /** Unique ID of the layer that contains the feature. */
  accessor layerId: number;
  /** The layer name that contains the feature. */
  accessor layerName: string;
}