import type FeatureLayer from "@arcgis/core/layers/FeatureLayer";
import type { Attachment, AttachmentProperties } from "../Attachment.js";
import type { Feature } from "../Feature.js";
/**
 * Converts an attachment to a file.
 *
 * @param attachment The attachment to convert.
 * @param errorPrefix A prefix for any resulting error messages.
 */
export declare function toAttachmentFile(attachment: Attachment | AttachmentProperties | File, errorPrefix?: string): Promise<File>;
/**
 * A feature source that support attachments.
 */
export interface AttachmentEnabledLayer {
    /**
     * Adds an attachment to a feature.
     */
    addAttachment: FeatureLayer["addAttachment"];
    /**
     * Deletes attachments from a feature.
     */
    deleteAttachments: FeatureLayer["deleteAttachments"];
}
/**
 * Options that can be used as arguments for the addAttachment() function.
 */
export interface AddAttachmentOptions {
    /**
     * A list of the valid file MIME types that can be uploaded as attachments.
     * For list of supported attachment types, see:
     * https://developers.arcgis.com/rest/services-reference/enterprise/query-attachments-feature-service-layer-.htm.
     */
    attachmentTypes?: string[];
}
/**
 * Returns whether a feature source supports attachments.
 *
 * @param featureSource The feature source to check.
 */
export declare function supportsAttachments(featureSource: unknown): boolean;
/**
 * Returns whether a layer supports editing attachments.
 *
 * @param layer The layer to check.
 */
export declare function supportsAttachmentEditing(layer: unknown): boolean;
/**
 * Adds an attachment to a feature.
 *
 * @param feature The feature to which the attachment will be added.
 * @param layer The layer (or table) that the feature belongs to.
 * @param attachment The file attachment.
 * @param options Optional options.
 */
export declare function addAttachment(feature: Feature, layer: AttachmentEnabledLayer, attachment: Attachment | AttachmentProperties | File, options?: AddAttachmentOptions): Promise<Attachment>;
/**
 * Returns whether an error was thrown due to an invalid attachment type.
 *
 * @param error The error to test.
 */
export declare function isAttachmentTypeError(error: Error): boolean;
export declare const ATTACHMENT_TYPE_ERROR_REGEX: RegExp;
/**
 * Deletes attachments from a feature.
 *
 * @param feature The feature to delete attachments from.
 * @param layer The layer that the feature belongs to.
 * @param attachments The attachments or attachment IDs to delete.
 */
export declare function deleteAttachments(feature: Feature, layer: AttachmentEnabledLayer, attachments: (Attachment | string)[]): Promise<void>;
