import type Input from "./Input.js"; import type { InputMethod } from "../../../../portal/jsonTypes.js"; /** @since 5.1 */ export interface ImageInputProperties extends Partial> {} /** * The `ImageInput` class defines a user interface for an input to which image files can be attached. 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` and is displayed within the [Editor](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/). * * > [!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. * > When using specific input types, such as `ImageInput`, existing attachments are displayed only if they match the element's [keyword](https://developers.arcgis.com/javascript/latest/references/core/form/elements/AttachmentElement/#attachmentKeyword). Existing attachments without a matching keyword are not shown. To display attachments that do not have a corresponding keyword, use the general [AttachmentInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/AttachmentInput/) instead. This input type provides a more general approach to displaying attachments and does not require a keyword to be specified by setting the [attachmentAssociationType](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/AttachmentInput/#attachmentAssociationType) accordingly. * * @since 5.1 * @see [ImageInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/attachments/ImageInput/) * @example * // Creates a new ImageInput for an attachment element within a form * const imageInput = new ImageInput({ * inputMethod: "upload", * maxImageSize: 800, * }); */ export default class ImageInput extends Input { /** @since 5.1 */ constructor(properties?: ImageInputProperties); /** * The supported input methods used to attach an image. * * @default "any" * @since 5.1 */ accessor inputMethod: InputMethod; /** * Number of pixels on the longest edge depending on orientation. Larger images will be resized and aspect ratio is maintained. If `maxImageSize` is not specified, images will not be resized. * * @since 5.1 */ accessor maxImageSize: number | null | undefined; /** * The input type identifier. * * @since 5.1 */ get type(): "image"; }