-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
51 lines (41 loc) · 1.23 KB
/
Copy pathtypes.ts
File metadata and controls
51 lines (41 loc) · 1.23 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
export type Vec2 = { x: number; y: number };
export type GradientType = 'linear' | 'radial' | 'conic';
export type InteractionMode = 'idle' | 'panning' | 'dragging-layer' | 'dragging-gradient' | 'resizing' | 'drawing';
export type GradientStop = {
id: string;
offset: number; // 0 to 1
color: string;
opacity: number;
midpoint?: number; // 0 to 1 relative to next stop, default 0.5
};
export type Gradient = {
type: GradientType;
stops: GradientStop[];
angle: number; // In degrees, for linear/conic
center: Vec2; // 0-1, for radial/conic
// Explicit handles
start?: Vec2; // Linear gradient start point (0-1)
end?: Vec2; // Linear gradient end point (0-1)
radius?: number; // Radial gradient radius (0-1)
ratio?: number; // Radial gradient aspect ratio (Ry/Rx), default 1
};
export type LayerType = 'artboard' | 'rectangle' | 'circle';
export interface Layer {
id: string;
type: LayerType;
name: string;
x: number;
y: number;
width: number;
height: number;
rotation: number;
visible: boolean;
fill: string | Gradient;
borderRadius?: number;
}
export interface Viewport {
x: number;
y: number;
zoom: number;
}
export type Tool = 'select' | 'pan' | 'rectangle' | 'circle' | 'artboard';