fix: resolve typescript types errors

This commit is contained in:
2026-02-04 13:43:10 +05:00
parent dfa6c40743
commit 3a99a3d22a
9 changed files with 36 additions and 33 deletions
+8 -4
View File
@@ -3,10 +3,14 @@ import { ImageError } from "../types/errors";
export const MAX_FILE_SIZE = 10 * 1024 * 1024; // 10MB
export const SUPPORTED_FORMATS = ["image/jpeg", "image/jpg", "image/png", "image/webp", "image/gif"];
export interface ValidationResult {
isValid: boolean;
error?: string;
}
export type ValidationResult =
| {
isValid: true;
}
| {
isValid: false;
error: string;
};
export function validateFileSize(file: File): ValidationResult {
if (file.size > MAX_FILE_SIZE) {