fix: resolve typescript types errors
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
loading?: boolean;
|
||||
class?: string;
|
||||
children?: any;
|
||||
onclick?: (event: MouseEvent) => void;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
ariaLabel?: string;
|
||||
class?: string;
|
||||
children?: any;
|
||||
onclick?: (event: MouseEvent) => void;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user