import type Point from "../../geometry/Point.js";
import type { JSONSupport } from "../../core/JSONSupport.js";
import type { PointProperties } from "../../geometry/Point.js";

export interface ImageSampleProperties extends Partial<Pick<ImageSample, "attributes" | "locationId" | "pixelValue" | "rasterId" | "resolution">> {
  /** The sample location. */
  location?: PointProperties;
}

/**
 * The [ImageryLayer.getSamples()](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryLayer/#getSamples)
 * method on [ImageryLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryLayer/) returns
 * [ImageSampleResult](https://developers.arcgis.com/javascript/latest/references/core/rest/support/ImageSampleResult/) containing array of this class.
 *
 * @since 4.20
 * @see [ImageSampleResult](https://developers.arcgis.com/javascript/latest/references/core/rest/support/ImageSampleResult/)
 * @see [ImageSampleParameters](https://developers.arcgis.com/javascript/latest/references/core/rest/support/ImageSampleParameters/)
 * @see [ImageryLayer.getSamples()](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryLayer/#getSamples)
 */
export default class ImageSample extends JSONSupport {
  constructor(properties?: ImageSampleProperties);
  /**
   * Name-value pairs of fields and field values associated with the [sample location](https://developers.arcgis.com/javascript/latest/references/core/rest/support/ImageSample/#location).
   * The returned name-value pairs will correspond to fields specified in [ImageSampleParameters.outFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/ImageSampleParameters/#outFields) parameter.
   */
  accessor attributes: Record<string, any> | null | undefined;
  /** The sample location. */
  get location(): Point;
  set location(value: PointProperties);
  /** The location id. */
  accessor locationId: number;
  /** The pixel value associated with the sampled location. */
  accessor pixelValue: number[] | null | undefined;
  /** The raster id. Available when the layer's data source is a mosaic dataset. */
  accessor rasterId: number | null | undefined;
  /** The resolution representing the average of source raster's resolutions in x and y axes. */
  accessor resolution: number;
}