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

/** @since 5.0 */
export interface PurgeOptionsProperties extends Partial<Pick<PurgeOptions, "age" | "ageReceived" | "displayCount" | "maxObservations">> {}

/**
 * Options for purging stale features from [StreamLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/StreamLayer/). The purge options controls how much data is removed from StreamLayerView and how often.
 * Choosing the right purge rule for your stream layer is critical for maximizing functionality and performance. Cannot be changed
 * after the layer has been loaded.
 *
 * @see [StreamLayer.purgeOptions](https://developers.arcgis.com/javascript/latest/references/core/layers/StreamLayer/#purgeOptions)
 * @since 5.0
 */
export default class PurgeOptions extends JSONSupport {
  constructor(properties?: PurgeOptionsProperties);
  /**
   * Specifies the maximum age of a feature in minutes. It purges features whose `start time` specified in the [TimeInfo.startField](https://developers.arcgis.com/javascript/latest/references/core/layers/support/TimeInfo/#startField)
   * of the feature is older than the age. If no new features coming in then the `age` of the application does not advance.
   *
   * @since 5.0
   */
  accessor age: number | null | undefined;
  /**
   * Specifies the maximum age of a feature in minutes since it arrived in the application. The features older than specified `ageReceived` will be removed.
   *
   * @since 5.0
   */
  accessor ageReceived: number | null | undefined;
  /**
   * Controls the overall maximum number of features.
   *
   * @since 5.0
   */
  accessor displayCount: number | null | undefined;
  /**
   * Controls the maximum number of observations to show within a [track](https://enterprise.arcgis.com/en/geoevent/latest/get-started/essential-geoevent-server-vocabulary.htm#ESRI_SECTION1_F45BBCE9ADFA4E57AF38DD225921EFCD).
   * If [TimeInfo.trackIdField](https://developers.arcgis.com/javascript/latest/references/core/layers/support/TimeInfo/#trackIdField) is not configured on the geoevent service, this property will have
   * no effect. The default is 1.
   *
   * @default 1
   * @since 5.0
   */
  accessor maxObservations: number | null | undefined;
}