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

/** @since 5.1 */
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.
 *
 * > [!CAUTION]
 * >
 * > *  Input methods that are configured as only allowing `capture` are not supported.
 * > *  Minimum input requirements apply only in mobile editing workflows when the input method is set to only allow capture and the minimum file count is greater than or equal to one.
 *
 * @since 5.1
 * @see [AudioInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/AudioInput/)
 * @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 {
  /** @since 5.1 */
  constructor(properties?: AudioInputProperties);
  /**
   * The supported input methods used to attach an audio file.
   *
   * @default "any"
   * @since 5.1
   */
  accessor inputMethod: InputMethod;
  /**
   * Defines the maximum length of an attachment for this element in seconds. If not specified, there is no maximum length.
   *
   * @since 5.1
   */
  accessor maxDuration: number | null | undefined;
  /**
   * The input type identifier.
   *
   * @since 5.1
   */
  get type(): "audio";
}