-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.ts
More file actions
68 lines (63 loc) · 1.55 KB
/
types.ts
File metadata and controls
68 lines (63 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Core types for text-behind-image functionality
export interface TextSet {
id: number;
text: string;
fontSize: number;
fontWeight: number;
fontFamily: string;
color: string;
x: number; // Absolute pixel coordinate
y: number; // Absolute pixel coordinate
rotation: number;
opacity: number;
letterSpacing: number;
tiltX: number;
tiltY: number;
// Text Effects
shadowEnabled: boolean;
shadowColor: string;
shadowBlur: number;
shadowOffsetX: number;
shadowOffsetY: number;
outlineEnabled: boolean;
outlineColor: string;
outlineWidth: number;
glowEnabled: boolean;
glowColor: string;
glowIntensity: number;
}
export interface ImageProcessingState {
selectedImage: string | null;
removedBgImageUrl: string | null;
isImageSetupDone: boolean;
isProcessing: boolean;
imageWidth: number;
imageHeight: number;
}
export interface AppState {
textSets: TextSet[];
imageState: ImageProcessingState;
}
// Props for the new LayerComposition component
export interface LayerCompositionProps {
backgroundImage: string;
subjectImage: string | null;
width: number;
height: number;
textSets: TextSet[];
onCanvasReady?: (canvas: HTMLCanvasElement) => void;
}
// Props for text customizer with image dimensions
export interface TextCustomizerProps {
textSet: TextSet;
onUpdate: (
id: number,
attribute: keyof TextSet,
value: string | number | boolean
) => void;
onRemove: (id: number) => void;
onDuplicate: (id: number) => void;
imageWidth: number;
imageHeight: number;
isFirstText?: boolean;
}