import type Graphic from "../../../Graphic.js";
import type Field from "../../../layers/support/Field.js";
import type EditableInput from "./EditableInput.js";
import type GroupInput from "./GroupInput.js";
import type { Domain } from "../../../layers/support/domains.js";
import type { FieldValue } from "../../../layers/support/fieldUtils.js";
import type { EditableInputProperties } from "./EditableInput.js";
import type { FieldInputDataTypes } from "../../support/forms/types.js";

export interface FieldInputProperties extends EditableInputProperties {}

/**
 * This is a read-only support class that represents a field input in a [BatchAttributeForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BatchAttributeForm.html).
 *
 * @since 4.33
 * @see [BatchAttributeForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BatchAttributeForm.html)
 * @see [BatchAttributeFormViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BatchAttributeForm-BatchAttributeFormViewModel.html)
 * @see [BatchFormInputs](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BatchAttributeForm-inputs-BatchFormInputs.html)
 */
export default abstract class FieldInput extends EditableInput<any> {
  /**
   * The type of data displayed by the field input. Possible values are listed below.
   *
   * Value | Description
   * ------|------------
   * number | Input represents a number.
   * text |   Input represents text.
   * date | Input represents a date.
   * unsupported | The field represents an unsupported value. A `blob` field type is an example of this.
   */
  get dataType(): FieldInputDataTypes;
  /**
   * Returns an array of distinct values of the field input. If all features have the same value, this property returns an array with a single element containing that value.
   * If the features have different values, this property returns an array containing all distinct values of the field across the features.
   */
  get distinctValues(): FieldValue[];
  /** The input value's domain. This is used to constrain the allowable values of the layer. */
  get domain(): Domain | null | undefined;
  /** Indicates if the field is editable. The field must be editable for all layers associated with the input for this property to be true. */
  get editable(): boolean;
  /** Indicates whether all features have the same value for this field. */
  get featuresHaveSameValue(): boolean;
  /** The associated field. */
  get field(): Field;
  /** The field name as defined by the feature layer. */
  get fieldName(): string;
  /** The group containing the field input. */
  get group(): GroupInput | null;
  /** Indicates whether time information is included for date and time inputs. */
  get includeTime(): boolean;
  /**
   * Indicates whether timestamp information is included for date inputs. This
   * property is always `false` for field types other than `timestamp-offset.`
   *
   * @default false
   */
  get includeTimeOffset(): boolean;
  /** An array of features that do not have a valid value for this field. */
  get invalidFeatures(): Graphic[];
  /**
   * Restricts the input length. For fields that have no maximum length
   * specified, this property will be `-1`.
   */
  get maxLength(): number;
  /**
   * Restricts the input length. For fields that have no minimum length
   * specified, this property will be `-1`.
   */
  get minLength(): number;
  /** Indicates whether the field is required. This property will be true if it is required for _any_ of the layers associated with the input. */
  get required(): boolean;
  /**
   * The type of input.
   *
   * @default "field"
   */
  get type(): "field";
  /**
   * Indicates whether the user has changed the value of this field.
   *
   * @default false
   */
  get userHasChangedValue(): boolean;
  /**
   * Indicates whether the field has any validation errors. Evaluates to `true`
   * if and only if the value of this field is valid for _all_ features.
   */
  get valid(): boolean;
}