import type GroupElement from "../../form/elements/GroupElement.js";
import type InputBase from "./InputBase.js";
import type { FeatureFormSupportedInput } from "./types.js";

export interface GroupInputProperties extends Partial<Pick<GroupInput, "inputs" | "open">> {}

export type NestedInput = Exclude<FeatureFormSupportedInput, GroupInput>;

/**
 * This is a support class that represents a group of field inputs.
 *
 * @since 4.27
 * @see [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html)
 * @see [FeatureFormViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html)
 * @see [FieldInput](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldInput.html)
 * @see [GroupElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-GroupElement.html)
 */
export default class GroupInput extends InputBase<GroupElement> {
  constructor(properties?: GroupInputProperties);
  /**
   * Defines if the group should be expanded or collapsed when the form is initially displayed.
   *
   * Possible Value | Description
   * ---------------|-------------
   * collapsed | The grouped elements appear collapsed.
   * expanded | The grouped elements appear expanded.
   *
   * @default "expanded"
   * @since 4.28
   */
  get initialState(): "collapsed" | "expanded";
  /** The field inputs contained within the group. */
  accessor inputs: NestedInput[];
  /** The group's label. */
  get label(): string | null | undefined;
  /** Indicates whether or not the group is open, ie. expanded. */
  accessor open: boolean;
  /** The type of input. */
  get type(): "group";
  /** The group's visibility. Note that the grouped input's visibility must be `true` if any fields within the group are [required](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-FieldElement.html#requiredExpression). */
  get visible(): boolean;
}