feat: start implement mvp

This commit is contained in:
2026-02-03 21:30:14 +05:00
parent 3f35247928
commit ac864e3791
10 changed files with 1132 additions and 2 deletions
+37
View File
@@ -0,0 +1,37 @@
export class AppError extends Error {
constructor(
message: string,
public code: string,
public recoverable: boolean = true,
public details?: unknown,
) {
super(message);
this.name = "AppError";
}
}
export class ImageError extends AppError {
constructor(message: string, recoverable: boolean = true) {
super(message, "IMAGE_ERROR", recoverable);
}
}
export class TextError extends AppError {
constructor(message: string, recoverable: boolean = true) {
super(message, "TEXT_ERROR", recoverable);
}
}
export class CanvasError extends AppError {
constructor(message: string, recoverable: boolean = true) {
super(message, "CANVAS_ERROR", recoverable);
}
}
export class StorageError extends AppError {
constructor(message: string, recoverable: boolean = true) {
super(message, "STORAGE_ERROR", recoverable);
}
}
export type ErrorType = AppError | ImageError | TextError | CanvasError | StorageError;
+45
View File
@@ -0,0 +1,45 @@
export interface TextItem {
id: string;
text: string;
fontSize: number;
fontFamily: string;
color: string;
x: number;
y: number;
}
export interface Panel {
id: string;
backgroundImage: string;
texts: TextItem[];
height: number;
createdAt: Date;
updatedAt: Date;
}
export interface ImageUploadResult {
success: boolean;
image?: string;
error?: string;
}
export interface CropOptions {
width: number;
height: number;
x?: number;
y?: number;
}
export interface ImageCropResult {
success: boolean;
croppedImage?: string;
error?: string;
}
export interface UIState {
isLoading: boolean;
error: string | null;
currentStep: "upload" | "crop" | "text" | "preview";
showCropModal: boolean;
showTextManager: boolean;
}