import { imageExtension } from './fileTypes';
export const handleDownloadFile = (fileUrl, fileName) => {
    const a = document.createElement('a');
    a.style.display = 'none';
    a.href = fileUrl;
    a.download = fileName;
    document.body.appendChild(a);
    a.click();
    window.URL.revokeObjectURL(fileUrl);
};
export const validateFilesImageType = (files = [], fileExtensionField) => {
    let type = "image";
    files.forEach(file => {
        if (!imageExtension.includes(file === null || file === void 0 ? void 0 : file[fileExtensionField])) {
            type = 'invalid';
            return;
        }
    });
    return type;
};
//# sourceMappingURL=fileUtils.js.map