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

export interface RadioButtonsInputProperties extends Partial<Pick<RadioButtonsInput, "noValueOptionLabel" | "showNoValueOption">> {}

/**
 * The `RadioButtonsInput` class defines the desired user interface for a radio button group input. This [FieldElement.input](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/#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.
 *
 * > [!WARNING]
 * >
 * > Coded-value domains are required when using this input type. Previously, fields containing values that weren't compatible with their associated coded-value domain(s) displayed the option and would remove it once a user updated the value. The `RadioButtonsInput` will now keep the value, but it will not display an option in the user interface.
 *
 * ![form field element radio buttons input](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/formtemplate/radio-buttons.png)
 *
 * @since 4.19
 * @see [FieldElement](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/)
 * @see [CodedValueDomain](https://developers.arcgis.com/javascript/latest/references/core/layers/support/CodedValueDomain/)
 * @example
 * // Creates a new Radio buttons input for a field element within a form
 * const radioButtonsInput = new RadioButtonsInput({
 *   noValueOptionLabel: "Unknown",
 *   showNoValueOption: true
 * });
 */
export default class RadioButtonsInput extends Input {
  constructor(properties?: RadioButtonsInputProperties);
  /** The text used to represent a null value. */
  accessor noValueOptionLabel: string | null | undefined;
  /**
   * Determines whether a null value option is displayed.
   *
   * > [!WARNING]
   * >
   * > This only applies to fields that support null values.
   *
   * @default true
   */
  accessor showNoValueOption: boolean;
  /** The type of form element input. */
  get type(): "radio-buttons";
}