import type Accessor from "../../../core/Accessor.js"; import type EsriError from "../../../core/Error.js"; import type AttachmentInfo from "../../../rest/query/support/AttachmentInfo.js"; import type { ObjectId } from "../../../views/types.js"; export interface AttachmentsViewOptionsProperties {} /** * AttachmentsViewOptions is a read-only class which defines what can be displayed within [FeatureTable](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/) attachments. It is used to manage the state of the attachments view, including the current attachment being edited, the list of attachment information, candidates for new attachments, and any errors that may occur. It is meant to provide a user-friendly interface for managing attachments in the [FeatureTable](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/) widget * * It is important to note that this class does not handle the actual uploading or downloading of attachments, but rather manages the state and options for displaying attachments within the [FeatureTable](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/) widget. * * @since 4.33 */ export default class AttachmentsViewOptions extends Accessor { constructor(properties?: AttachmentsViewOptionsProperties); /** The ID of the attachment currently displayed in the attachments details view. */ get attachmentId(): number | null | undefined; /** * An array of attachment information objects. * * @default [] */ get attachmentInfos(): AttachmentInfo[]; /** * A list of file candidates that can be added as attachments. * This is typically used when a user selects files to upload. * * @since 4.33 */ get candidates(): FileList | null | undefined; /** * An error that may occur during attachment operations. * This is typically used to display error messages to the user. * * @since 4.33 */ get error(): EsriError | null | undefined; /** * The HTML form element used for file uploads. * This is typically used to submit files to the server. * * @since 4.33 */ get form(): HTMLFormElement | null | undefined; /** * The current mode of the attachments view. * This can be either `list` to display a list of attachments, `details` to see information about * a specific attachment or `file` to allow file uploads. If an `attachmentId` is also set * then uploading a file will replace the attachment with that id. * * @default "list" */ get mode(): "list" | "details" | "file"; /** * The object ID of the feature associated with the attachments. * This is used to identify which feature the attachments belong to. * * @since 4.33 */ get objectId(): ObjectId | null | undefined; /** * Used to display the list view and clear temporary file data after a successful edit. * It resets the `attachmentId`, clears the `candidates`, and sets the mode to `list` to display the list of attachments. * * @since 4.33 */ onEditComplete(): void; /** * Use this method to reset feature-specific properties after the [objectId](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureTable/support/AttachmentsViewOptions/#objectId) changes. * This is useful when the feature table is displaying attachments for a different feature, allowing the widget to reset its state without losing the current `objectId`. * * @since 4.33 */ reset(): void; }