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

/** @experimental */
export interface AudioInputProperties extends Partial<Pick<AudioInput, "inputMethod" | "maxDuration">> {}

/**
 * The `AudioInput` class defines a user interface for an input to which audio files can be attached. This [AttachmentElement#input](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-AttachmentElement.html#input) is used in [attachment elements](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-AttachmentElement.html) that are set within a [feature layer's](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#formTemplate) or [FeatureForm's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#formTemplate) `formTemplate`. This is displayed within the [Editor](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html) widget.
 *
 * > [!CAUTION]
 * >
 * > This class is not yet fully supported within the SDK and is not intended for use in development. Support will be added in an upcoming release.
 *
 * @experimental
 * @since 4.31
 * @see [AudioInput](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-inputs-attachments-AudioInput.html)
 * @example
 * // Creates a new AudioInput for an attachment element within a form
 * const audioInput = new AudioInput({
 *   inputMethod: "capture",
 *   maxDuration: 30
 * });
 */
export default class AudioInput extends Input {
  /** @experimental */
  constructor(properties?: AudioInputProperties);
  /**
   * The supported input methods used to attach an audio file.
   *
   * @default "any"
   * @experimental
   */
  accessor inputMethod: InputMethod;
  /**
   * Defines the maximum length of an attachment for this element in seconds. If not specified, there is no maximum length.
   *
   * @experimental
   */
  accessor maxDuration: number | null | undefined;
  /**
   * The input type identifier. Valid value of this property is "audio"
   *
   * @default "audio"
   * @experimental
   */
  get type(): "audio";
}