-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
143 lines (126 loc) · 3.57 KB
/
types.ts
File metadata and controls
143 lines (126 loc) · 3.57 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
132
133
134
135
136
137
138
139
140
141
142
143
export interface Tag {
id: string;
label: string;
description: string;
synonyms?: string[];
example_snippet?: string;
conflictsWith?: string[];
suggests?: string[];
color?: 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'indigo' | 'purple' | 'pink' | 'gray';
}
export interface Category {
id: string;
name: string;
description?: string;
type?: 'tags' | 'text' | 'helper_input';
tags: Tag[];
color?: 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'indigo' | 'purple' | 'pink' | 'gray';
}
export type Taxonomy = Category[];
export interface SelectedTag extends Tag {
categoryId: string;
isLocked?: boolean;
}
export interface UdioParams {
lyrics?: string;
instrumental: boolean;
duration?: number;
}
export interface Preset {
name: string;
description?: string;
isFavorite?: boolean;
createdAt: string; // ISO string
updatedAt: string; // ISO string
selectedTags: Record<string, { categoryId: string; isLocked?: boolean; }>;
categoryOrder: string[];
udioParams?: UdioParams;
textCategoryValues?: Record<string, string>;
}
export interface Conflict {
tagA: Tag;
tagB: Tag;
}
export interface AiSettings {
provider: 'ollama' | 'lmstudio';
baseUrl: string;
model: string;
}
export type AiStatus = 'checking' | 'connected' | 'disconnected';
export interface AppSettings {
aiSettings: AiSettings;
presets: Preset[];
promptPanelRatio?: number;
openDevToolsOnStart?: boolean;
iconSet?: 'heroicons' | 'lucide' | 'feather' | 'tabler';
allowPrerelease?: boolean;
uiScale?: number;
}
// New Logging types
export type LogLevel = 'DEBUG' | 'INFO' | 'WARNING' | 'ERROR';
export interface LogEntry {
timestamp: string; // ISO string for consistency
level: LogLevel;
message: string;
context?: any;
}
export interface HistoryEntry {
timestamp: string; // ISO string
promptString: string;
selectedTags: Preset['selectedTags'];
categoryOrder: string[];
textCategoryValues: Record<string, string>;
udioParams?: UdioParams;
}
// New Toast Notification types
export interface Toast {
id: number;
type: 'info' | 'success' | 'error' | 'loading';
title: string;
message: string;
duration?: number;
actions?: { label: string; onClick: () => void }[];
progress?: number; // For download progress
}
// Auto-update info type
export interface UpdateInfo {
version: string;
files: any[];
path: string;
sha512: string;
releaseDate: string;
releaseName?: string;
releaseNotes?: string | any[];
}
// New Electron API types
export interface IElectronAPI {
// Window Controls
minimizeWindow: () => void;
maximizeWindow: () => void;
closeWindow: () => void;
onWindowStateChange: (callback: (isMaximized: boolean) => void) => () => void;
// App Data & Settings
writeLog: (logEntry: LogEntry) => void;
showLogInFolder: () => void;
showSettingsInFolder: () => void;
getLogsPath: () => Promise<string>;
readSettings: () => Promise<AppSettings>;
writeSettings: (settings: AppSettings) => void;
readMarkdownFile: (filename: string) => Promise<string>;
getAppVersion: () => Promise<string>;
readDebugLog: () => Promise<string>;
readDefaultTaxonomy: () => Promise<{ taxonomy: Taxonomy }>;
readCustomTaxonomy: () => Promise<Taxonomy | null>;
writeCustomTaxonomy: (taxonomy: Taxonomy) => void;
resetCustomTaxonomy: () => void;
// Auto-update API
onUpdateEvent: (callback: (event: string, data?: any) => void) => () => void;
checkForUpdates: () => void;
downloadUpdate: () => void;
restartAndInstall: () => void;
}
declare global {
interface Window {
electronAPI: IElectronAPI;
}
}