generated from google-gemini/aistudio-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
117 lines (99 loc) · 2.1 KB
/
types.ts
File metadata and controls
117 lines (99 loc) · 2.1 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
export enum Tool {
Selection = 'selection',
Brush = 'brush',
Arrow = 'arrow',
Lasso = 'lasso',
Text = 'text',
Hand = 'hand',
}
export enum PresetTags {
CHARACTER = 'character',
ENVIRONMENT = 'environment',
STYLE = 'style',
RETOUCH = 'retouch',
COMPOSITION = 'composition',
DESIGN = 'design',
D3 = 'd3',
}
export interface Point {
x: number;
y: number;
}
export interface BaseLayer {
id: number;
x: number;
y: number;
width: number;
height: number;
}
export interface ImageLayer extends BaseLayer {
type: 'image';
src: string;
}
export interface TextLayer extends BaseLayer {
type: 'text';
text: string;
fontFamily: string;
fontSize: number;
color: string;
align: 'left' | 'center' | 'right';
}
export interface BrushLayer extends BaseLayer {
type: Tool.Brush;
points: Point[];
color: string;
size: number;
}
export interface LassoLayer extends BaseLayer {
type: Tool.Lasso;
points: Point[];
color: string;
size: number;
}
export interface ArrowLayer extends BaseLayer {
type: Tool.Arrow;
start: Point;
end: Point;
color: string;
size: number;
}
export type AnyLayer = ImageLayer | TextLayer | BrushLayer | LassoLayer | ArrowLayer;
export interface Preset {
name: string;
prompt: string;
description?: string;
tag: PresetTags;
}
export interface PresetCategory {
emoji: string;
category: string;
presets: Preset[];
}
export interface LogEntry {
timestamp: string;
type: 'action' | 'api_request' | 'api_response' | 'error';
message: string;
payload?: any;
}
export interface PromptHistoryEntry {
prompt: string;
tags: string[];
}
export interface AnnotationState {
layers: AnyLayer[];
}
export interface WorkspaceImage {
id: number;
source: File | string;
x: number;
y: number;
width: number;
height: number;
originalWidth: number;
originalHeight: number;
layers: AnyLayer[];
annotationHistory: AnnotationState[];
annotationHistoryIndex: number;
isLoading?: boolean;
isReasoning?: boolean;
}