import type Input from "./Input.js";

export interface DateTimePickerInputProperties extends Partial<Pick<DateTimePickerInput, "includeTime">> {
  /**
   * The maximum date to allow. The number represents the number of milliseconds since
   * epoch (January 1, 1970) in UTC.
   */
  max?: (Date | number | string) | null;
  /**
   * The minimum date to allow. The number represents the number of milliseconds
   * since epoch (January 1, 1970) in UTC.
   */
  min?: (Date | number | string) | null;
}

/**
 * The `DateTimePickerInput` class defines the desired user interface for editing `date` field [Field.type](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type) input. This input is used in [field elements](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/) that are set within a [feature layer's](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#formTemplate) or [FeatureForm's](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/#formTemplate) `formTemplate`. This is displayed within the [Editor](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/) widget.
 *
 * @since 4.17
 * @see [FieldElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/)
 * @example
 * const dateTimePickerInput = new DateTimePickerInput({
 *   includeTime: true, // this will allow time input, default is false
 *   min: 1547678342000, // the minimum date input allowed
 *   max: 1610836742000 // the maximum date input allowed
 * });
 */
export default class DateTimePickerInput extends Input {
  constructor(properties?: DateTimePickerInputProperties);
  /**
   * Indicates if the input should provide an option to select the time.
   * If not provided, the default value is `false`.
   *
   * @default false
   */
  accessor includeTime: boolean;
  /**
   * The maximum date to allow. The number represents the number of milliseconds since
   * epoch (January 1, 1970) in UTC.
   */
  get max(): Date | null | undefined;
  set max(value: (Date | number | string) | null | undefined);
  /**
   * The minimum date to allow. The number represents the number of milliseconds
   * since epoch (January 1, 1970) in UTC.
   */
  get min(): Date | null | undefined;
  set min(value: (Date | number | string) | null | undefined);
  /** The type of form element input. */
  get type(): "datetime-picker";
  /**
   * Creates a deep clone of the `DateTimePickerInput` class.
   *
   * @returns A deep clone of the `DateTimePickerInput` instance.
   */
  clone(): DateTimePickerInput;
}