import { getProp } from "../../../objects/get-prop";
import { ServiceDownloadFormat } from "../../enums/serviceDownloadFormat";
import { EXPORT_IMAGE_FORMATS } from "../_types";
/**
 * @private
 * Returns all the download formats that are exposed by an Image Service via the /exportImage operation.
 */
export function getExportImageFormats(entity) {
    const serverVersion = getProp(entity, "extendedProps.server.currentVersion") || 0;
    // NOTE: We have to imperatively exclude formats based on the server version
    // because there is no other way to determine which formats are supported.
    // See the EXPORT_IMAGE_FORMATS constant for notes on individual formats.
    const supportedFormats = (serverVersion < 10.2
        ? EXPORT_IMAGE_FORMATS.filter((f) => f !== ServiceDownloadFormat.PNG32)
        : EXPORT_IMAGE_FORMATS);
    return supportedFormats.map((format) => ({
        type: "dynamic",
        format,
    }));
}
//# sourceMappingURL=getExportImageFormats.js.map