import { NonEmptyArray } from '../../../helpers/array-helpers';
import { MediaItemFileType } from '../../Documents/Document.types';
import { default as Compressor } from 'compressorjs';
import { InternalFile } from '../MediaItemSelectInput';
import { MediaItemTransformer } from './MediaItemTransformer';
type ImageCompressorTransformerProps = {
    compressorOptions: Compressor.Options;
    showLoadingModalDuringCompression?: boolean;
};
/**
 * Class responsible for compressing image files.
 *
 * @extends MediaItemTransformer
 */
export declare class ImageCompressorTransformer extends MediaItemTransformer {
    /**
     * List of applicable file types for compression.
     */
    applicableFileTypes: NonEmptyArray<MediaItemFileType>;
    /**
     * Promise resolver for the transform method.
     * @private
     */
    private resolveTransformPromise?;
    /**
     * Options for the compressor.
     * @private
     */
    private compressorOptions;
    /**
     * Flag to show loading modal during compression.
     * @private
     */
    private showLoadingModalDuringCompression;
    /**
     * Constructor for ImageCompressorTransformer.
     *
     * @param config - Configuration options for the transformer.
     */
    constructor(config: ImageCompressorTransformerProps);
    /**
     * Transforms the given files by compressing them.
     *
     * @param files - Array of files to be compressed.
     * @returns A promise that resolves with the compressed files or null.
     */
    transform: (files: InternalFile[]) => Promise<InternalFile[] | null>;
    /**
     * Compresses the given files.
     *
     * @param files - Array of files to be compressed.
     * @private
     */
    private compress;
    /**
     * Compresses a single file.
     *
     * @param selectedFile - The file to be compressed.
     * @private
     */
    private compressSingleFile;
    /**
     * Compresses multiple files.
     *
     * @param selectedFiles - Array of files to be compressed.
     * @private
     */
    private compressMultipeFiles;
    /**
     * Handles the closing of the loading modal after compression.
     *
     * @param t0 - The timestamp when the compression started.
     *
     * This function calculates the duration of the compression process and determines
     * an appropriate timeout before closing the loading modal. The timeout is used to
     * ensure that the modal is visible for a minimum amount of time, even if the
     * compression process is very fast.
     *
     * Timeout logic:
     * - If the duration is less than or equal to 500ms, the timeout is set to 1500ms.
     * - If the duration is less than or equal to 1000ms, the timeout is set to 1000ms.
     * - If the duration is less than or equal to 1500ms, the timeout is set to 500ms.
     * - If the duration is less than or equal to 2000ms, the timeout is set to 0ms.
     *
     * After the calculated timeout, the loading modal is closed using the ModalService.
     */
    private handleLoadingModalClose;
}
export {};
