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/references/core/form/elements/inputs/attachments/AudioInput/)
   * @see [DocumentInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/DocumentInput/)
   * @see [ImageInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/ImageInput/)
   * @see [SignatureInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/SignatureInput/)
   * @see [VideoInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/VideoInput/)
   */
  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/references/core/form/elements/AttachmentElement/#input) is used in [attachment elements](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/) 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.
 *
 * > [!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/references/core/form/elements/AttachmentElement/)
 * @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/references/core/form/elements/AttachmentElement/#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/references/core/form/elements/AttachmentElement/#attachmentKeyword)
   */
  accessor attachmentAssociationType: FormAttachmentAssociationType;
  /**
   * Available inputs to add an attachment.
   *
   * @internal
   * @see [AudioInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/AudioInput/)
   * @see [DocumentInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/DocumentInput/)
   * @see [ImageInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/ImageInput/)
   * @see [SignatureInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/SignatureInput/)
   * @see [VideoInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/VideoInput/)
   */
  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";
}