import type Input from "./Input.js";
import type { TimeResolution } from "../../../portal/jsonTypes.js";

export interface TimePickerInputProperties extends Partial<Pick<TimePickerInput, "max" | "min" | "timeResolution">> {}

/**
 * The `TimePickerInput` class defines the desired user interface for editing `time-only` field [Field#type](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#type) input. These inputs are used in [field elements](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-FieldElement.html) that are set within a [feature layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#formTemplate) or [FeatureForm#formTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#formTemplate) `formTemplate` which will be picked up and displayed within the [Editor](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html) widget.
 *
 * @since 4.28
 * @see [FieldElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-FieldElement.html)
 * @see [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html)
 * @see [Editor](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html)
 * @see [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html)
 * @see [FormTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-FormTemplate.html)
 * @example
 * const timePickerInput = new TimePickerInput({
 *   min: "14:15:00" , // the minimum time input allowed, this equates to 2:15 PM (14th hour), 30 seconds, and 132 milliseconds.
 *   max: "20:10:15", // the maximum time input allowed, this equates to 8:10 PM (20th hour), 15 seconds, and 123 milliseconds.
 *   timeResolution: "minutes" // the level of precision needed for the time input
 * });
 */
export default class TimePickerInput extends Input {
  constructor(properties?: TimePickerInputProperties);
  /** The maximum time to allow. The string represents an [ISO-8601 time](https://www.iso.org/iso-8601-date-and-time-format.html) in either `hh:mm:ss` or `hh:mm:ss.sss` format. For example, a string of `"20:10:15"` represents the time of 8:10 PM (20th hour), and 15 seconds. */
  accessor max: string | null | undefined;
  /** The minimum time to allow. The string represents an [ISO-8601 time](https://www.iso.org/iso-8601-date-and-time-format.html) in either `hh:mm:ss` or `hh:mm:ss.sss` format. For example, a string of `14:15:30` represents the time of 2:15 PM (14th hour), and 30 seconds. */
  accessor min: string | null | undefined;
  /**
   * The level of detail used to represent time.
   *
   * @default "minutes"
   */
  accessor timeResolution: TimeResolution;
  /** The type of form element input. */
  get type(): "time-picker";
  /**
   * Creates a deep clone of the `TimePickerInput` class.
   *
   * @returns A deep clone of the `TimePickerInput` instance.
   */
  clone(): TimePickerInput;
}