import type Input from "./Input.js";
import type { AudioInputProperties } from "./AudioInput.js";
import type { DocumentInputProperties } from "./DocumentInput.js";
import type { ImageInputProperties } from "./ImageInput.js";
import type { SignatureInputProperties } from "./SignatureInput.js";
import type { NestableAttachmentInputUnion } from "./types.js";
import type { VideoInputProperties } from "./VideoInput.js";
import type { FormAttachmentAssociationType } from "../../../../portal/jsonTypes.js";

/** @internal */
export interface AttachmentInputProperties extends Partial<Pick<AttachmentInput, "attachmentAssociationType">> {
  /**
   * Available inputs to add an attachment.
   *
   * @internal
   * @see [AudioInput](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-inputs-attachments-AudioInput.html)
   * @see [DocumentInput](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-inputs-attachments-DocumentInput.html)
   * @see [ImageInput](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-inputs-attachments-ImageInput.html)
   * @see [SignatureInput](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-inputs-attachments-SignatureInput.html)
   * @see [VideoInput](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-inputs-attachments-VideoInput.html)
   */
  inputTypes?: ((AudioInputProperties & { type: "audio"; }) | (DocumentInputProperties & { type: "document"; }) | (ImageInputProperties & { type: "image"; }) | (SignatureInputProperties & { type: "signature"; }) | (VideoInputProperties & { type: "video"; }))[] | null;
}

/**
 * The `AttachmentInput` class defines a flexible user interface for an attachment input. 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.
 *
 * @internal
 * @since 4.31
 * @see [AttachmentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-AttachmentElement.html)
 * @example
 * // Creates a new AttachmentInput for an attachment element within a form
 * const attachmentInput = new AttachmentInput({
 *   inputTypes: [
 *    { // autocastable to ImageInput
 *      type: "image",
 *      maxImageSize: 800,
 *    },
 *    { // autocastable to VideoInput
 *      type: "video",
 *      inputMethod: "capture",
 *    },
 *   ]
 * });
 */
export default class AttachmentInput extends Input {
  /** @internal */
  constructor(properties?: AttachmentInputProperties);
  /**
   * String value which indicates if existing attachments should be associated with the element and how they should be associated. This property is used in conjunction with the [AttachmentElement.attachmentKeyword](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-AttachmentElement.html#attachmentKeyword) property.
   *
   * The table below describes the options.
   *
   * value | description |
   * --------------|---------------------------
   * `any` | Associates all existing attachments to this element. This must be the only attachment element within the form.
   * `exact` | Associates any attachments with the associated `attachmentKeyword`.
   * `exactOrNone` | Associates only attachments that have the keyword specified by `attachmentKeyword` and any attachments with no keyword defined.
   *
   * @default "exact"
   * @internal
   * @see [AttachmentElement.attachmentKeyword](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-AttachmentElement.html#attachmentKeyword)
   */
  accessor attachmentAssociationType: FormAttachmentAssociationType;
  /**
   * Available inputs to add an attachment.
   *
   * @internal
   * @see [AudioInput](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-inputs-attachments-AudioInput.html)
   * @see [DocumentInput](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-inputs-attachments-DocumentInput.html)
   * @see [ImageInput](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-inputs-attachments-ImageInput.html)
   * @see [SignatureInput](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-inputs-attachments-SignatureInput.html)
   * @see [VideoInput](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-elements-inputs-attachments-VideoInput.html)
   */
  get inputTypes(): NestableAttachmentInputUnion[] | null;
  set inputTypes(value: ((AudioInputProperties & { type: "audio"; }) | (DocumentInputProperties & { type: "document"; }) | (ImageInputProperties & { type: "image"; }) | (SignatureInputProperties & { type: "signature"; }) | (VideoInputProperties & { type: "video"; }))[] | null | undefined);
  /**
   * The input type identifier. Valid value of this property is "attachment"
   *
   * @internal
   * @since 5.0
   */
  get type(): "attachment";
}