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
+1
View File
@@ -12,6 +12,7 @@
loading?: boolean;
class?: string;
children?: any;
onclick?: (event: MouseEvent) => void;
[key: string]: any;
}
+1
View File
@@ -9,6 +9,7 @@
ariaLabel?: string;
class?: string;
children?: any;
onclick?: (event: MouseEvent) => void;
[key: string]: any;
}
+3 -4
View File
@@ -1,14 +1,13 @@
export type TextAlign = "left" | "center" | "right";
export interface TextItem {
id: string;
text: string;
fontSize: number;
fontFamily: string;
color: string;
// Выравнивание текста: left, center, right
textAlign: "left" | "center" | "right";
// Боковые отступы (лево/право)
textAlign: TextAlign;
paddingX: number;
// Смещение от центра по вертикали (для компенсации визуального центра разных шрифтов)
verticalOffset: number;
}
+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) {