import type TimeExtent from "../../time/TimeExtent.js";
import type TimeInterval from "../../time/TimeInterval.js";
import type { ClonableMixin } from "../../core/Clonable.js";
import type { JSONSupport } from "../../core/JSONSupport.js";
import type { TimeZone } from "../../time/types.js";
import type { TimeExtentProperties } from "../../time/TimeExtent.js";
import type { TimeIntervalProperties } from "../../time/TimeInterval.js";

export interface TimeInfoProperties extends Partial<Pick<TimeInfo, "endField" | "startField" | "timeZone" | "trackIdField">> {
  /**
   * The time extent defines the start time and end time for all data in the layer.
   *
   * @since 4.12
   * @example
   * const { start, end } = featureLayer.timeInfo.fullTimeExtent;
   * const range = end - start;  // milliseconds
   * const days = range / ( 1000 * 60 * 60 * 24 ); // days
   * console.log(`The layer's temporal extent is ${days} days.`);
   */
  fullTimeExtent?: TimeExtentProperties | null;
  /**
   * The time interval defines the granularity of the temporal data and allows you to
   * visualize the data at specified intervals using the [time slider widget](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/).
   * Usually temporal data is collected at regular intervals such as every hour or every day.
   *
   * @since 4.12
   */
  interval?: TimeIntervalProperties | null;
  /**
   * Indicates the time instants that the layer has data for. Used in place of interval, etc.
   *
   * @since 4.30
   */
  stops?: (Date | number | string)[] | null;
}

/**
 * Time info represents the temporal data of a time-aware layer.
 * The time info class provides information such as date fields that store the [start](https://developers.arcgis.com/javascript/latest/references/core/layers/support/TimeInfo/#startField)
 * and [end](https://developers.arcgis.com/javascript/latest/references/core/layers/support/TimeInfo/#endField) times for each feature and the [total time span](https://developers.arcgis.com/javascript/latest/references/core/layers/support/TimeInfo/#fullTimeExtent) for the layer.
 *
 * Temporal data is data that represents a state in time.
 * You can to step through periods of time to reveal patterns and trends in your data.
 * With temporal data, you can visualize and analyze:
 * - Moving objects (e.g. planes, satellites, storms),
 * - Events (e.g. accidents or earthquakes),
 * - Sensor data (e.g. stream gauges, weather station readings), or
 * - Variable characteristics (e.g. national or regional population).
 *
 * @since 4.11
 */
export default class TimeInfo extends TimeInfoSuperclass {
  constructor(properties?: TimeInfoProperties);
  /**
   * The name of the field containing the end time information. This field can be `date`, `date-only` or `timestamp-offset`
   * [field type](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type) for [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/)
   * and [MapImageLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/MapImageLayer/).
   */
  accessor endField: string | null | undefined;
  /**
   * The time extent defines the start time and end time for all data in the layer.
   *
   * @since 4.12
   * @example
   * const { start, end } = featureLayer.timeInfo.fullTimeExtent;
   * const range = end - start;  // milliseconds
   * const days = range / ( 1000 * 60 * 60 * 24 ); // days
   * console.log(`The layer's temporal extent is ${days} days.`);
   */
  get fullTimeExtent(): TimeExtent | null | undefined;
  set fullTimeExtent(value: TimeExtentProperties | null | undefined);
  /**
   * The time interval defines the granularity of the temporal data and allows you to
   * visualize the data at specified intervals using the [time slider widget](https://developers.arcgis.com/javascript/latest/references/core/widgets/TimeSlider/).
   * Usually temporal data is collected at regular intervals such as every hour or every day.
   *
   * @since 4.12
   */
  get interval(): TimeInterval | null | undefined;
  set interval(value: TimeIntervalProperties | null | undefined);
  /**
   * The name of the field containing the start time information. This field can be `date`, `date-only` or `timestamp-offset`
   * [field type](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type) for [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/)
   * and [MapImageLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/MapImageLayer/).
   */
  accessor startField: string | null | undefined;
  /**
   * Indicates the time instants that the layer has data for. Used in place of interval, etc.
   *
   * @since 4.30
   */
  get stops(): Date[] | null | undefined;
  set stops(value: (Date | number | string)[] | null | undefined);
  /**
   * The IANA time zone that dates are stored in. This only applies to [startField](https://developers.arcgis.com/javascript/latest/references/core/layers/support/TimeInfo/#startField) and [endField](https://developers.arcgis.com/javascript/latest/references/core/layers/support/TimeInfo/#endField).
   *
   * @since 4.28
   * @see [Wikipedia - List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
   * @see [Date-time queries | Time zone properties](https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-layer/#time-zone-properties)
   */
  accessor timeZone: TimeZone | null | undefined;
  /**
   * The name of the field used to join or group discrete locations. For example, for hurricane tracks,
   * trackIdField can be the hurricane name field.
   *
   * @since 4.15
   */
  accessor trackIdField: string | null | undefined;
}
declare const TimeInfoSuperclass: typeof JSONSupport & typeof ClonableMixin