-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.ts
More file actions
131 lines (116 loc) · 2.96 KB
/
types.ts
File metadata and controls
131 lines (116 loc) · 2.96 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
import React from 'react';
export enum NodeType {
INPUT_TEXT = 'INPUT_TEXT',
INPUT_IMAGE = 'INPUT_IMAGE',
UPLOAD_IMAGE = 'UPLOAD_IMAGE',
PROCESS_OPTIMIZER = 'PROCESS_OPTIMIZER',
PROCESS_GENERATOR = 'PROCESS_GENERATOR',
OUTPUT_RESULT = 'OUTPUT_RESULT',
GEN_IMAGE = 'GEN_IMAGE',
GEN_TEXT = 'GEN_TEXT',
GEN_SEARCH = 'GEN_SEARCH', // New Search Node
GROUP = 'GROUP',
}
export interface NodeData {
text?: string;
image?: string; // Base64 (Input or Main Selected Output)
params?: {
aspectRatio?: string;
model: string;
imageSize?: string;
camera?: string;
numberOfImages?: number;
temperature?: number;
thinkingBudget?: number; // New: Thinking capability
};
result?: string; // The "Main" selected image OR generated text
results?: string[]; // All generated images in this batch
searchSources?: { uri: string; title: string }[]; // New: Grounding sources
error?: string;
isLoading?: boolean;
preview?: string;
title?: string;
label?: string;
// Actions
onChange?: (id: string, data: any) => void;
onDelete?: (id: string) => void;
onRun?: (id: string) => Promise<void>;
onAddNext?: (id: string) => void;
onEdit?: (id: string, imageData: string) => void;
// Group Specific Actions
onRunGroup?: (id: string) => void;
onUngroup?: (id: string) => void;
onCreateWorkflow?: (id: string) => void;
}
export interface Node {
id: string;
type?: NodeType | string;
x?: number;
y?: number;
position: { x: number; y: number };
data: NodeData;
title?: string;
parentNode?: string;
extent?: 'parent' | [[number, number], [number, number]];
style?: React.CSSProperties;
width?: number | null;
height?: number | null;
selected?: boolean;
}
export interface Connection {
id: string;
from: string;
to: string;
}
export enum GeneratorModel {
GEMINI_FLASH_IMAGE = 'gemini-2.5-flash-image',
GEMINI_PRO_IMAGE = 'gemini-3-pro-image-preview',
GEMINI_FLASH_TEXT = 'gemini-3-flash-preview',
GEMINI_PRO_TEXT = 'gemini-3-pro-preview',
}
export interface GenerateImageParams {
prompt: string;
image?: string;
images?: string[];
model: GeneratorModel;
aspectRatio?: string;
imageSize?: "1K" | "2K" | "4K";
camera?: string;
numberOfImages?: number;
}
export interface GenerateTextParams {
prompt: string;
images?: string[];
model: string;
thinkingBudget?: number;
}
export interface GenerateSearchParams {
query: string;
}
// --- New Types for Multi-Project & History ---
export interface ProjectMeta {
id: string;
name: string;
lastModified: number;
thumbnail?: string;
nodeCount: number;
}
export interface HistoryItem {
id: string;
timestamp: number;
prompt: string;
imageData: string;
model: string;
aspectRatio: string;
camera?: string;
referenceImages?: string[];
}
export interface WorkflowTemplate {
id: string;
name: string;
description: string;
tags: string[];
nodes: Node[];
edges: any[];
createdAt: number;
}