-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
166 lines (157 loc) · 3.35 KB
/
types.ts
File metadata and controls
166 lines (157 loc) · 3.35 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
export interface NotePosition {
x: number;
y: number;
width: number;
height: number;
zIndex: number;
}
export interface Note {
id: string;
title: string;
content: string; // HTML string
color: string;
tags: string[];
isPinned: boolean;
isLocked: boolean;
opacity: number; // Opacity value 0.1 to 1.0
showToolbar: boolean; // Toggle formatting toolbar
deletedAt?: number; // Timestamp when moved to trash
createdAt: number;
updatedAt: number;
position: NotePosition;
isOpen: boolean; // Is the floating window visible?
}
export type ThemeMode = "light" | "dark" | "glass";
export interface AppSettings {
theme: ThemeMode;
showDashboard: boolean;
}
export const NOTE_COLORS = [
{
id: "slate",
bg: "#1e293b",
border: "rgba(255,255,255,0.1)",
isLight: false,
},
{
id: "red",
bg: "#450a0a",
border: "rgba(248, 113, 113, 0.2)",
isLight: false,
},
{
id: "amber",
bg: "#451a03",
border: "rgba(251, 191, 36, 0.2)",
isLight: false,
},
{
id: "emerald",
bg: "#022c22",
border: "rgba(52, 211, 153, 0.2)",
isLight: false,
},
{
id: "blue",
bg: "#172554",
border: "rgba(96, 165, 250, 0.2)",
isLight: false,
},
{
id: "violet",
bg: "#2e1065",
border: "rgba(167, 139, 250, 0.2)",
isLight: false,
},
{
id: "pink",
bg: "#500724",
border: "rgba(244, 114, 182, 0.2)",
isLight: false,
},
{
id: "orange",
bg: "#431407",
border: "rgba(251, 146, 60, 0.2)",
isLight: false,
},
{
id: "teal",
bg: "#134e4a",
border: "rgba(45, 212, 191, 0.2)",
isLight: false,
},
{
id: "indigo",
bg: "#312e81",
border: "rgba(129, 140, 248, 0.2)",
isLight: false,
},
// Light colors for visibility, marked as isLight=true for dark text
{
id: "cool-gray",
bg: "#bdbdbd",
border: "rgba(0, 0, 0, 0.1)",
isLight: true,
},
{
id: "off-white",
bg: "#efefef",
border: "rgba(0, 0, 0, 0.1)",
isLight: true,
},
];
// Updater Types
export interface UpdateState {
status:
| "idle"
| "checking"
| "available"
| "not-available"
| "downloading"
| "downloaded"
| "error";
currentVersion: string;
availableVersion: string | null;
releaseNotes: string | null;
releaseDate: string | null;
downloadProgress: number;
bytesPerSecond: number;
totalBytes: number;
downloadedBytes: number;
error: string | null;
}
export interface UpdateSettings {
autoCheck: boolean;
autoDownload: boolean;
autoInstall: boolean;
checkInterval: number;
allowPrerelease: boolean;
allowDowngrade: boolean;
}
export interface UpdaterAPI {
checkForUpdates: () => Promise<any>;
downloadUpdate: () => Promise<any>;
installUpdate: () => void;
skipVersion: (version: string) => Promise<void>;
getState: () => Promise<UpdateState>;
getSettings: () => Promise<UpdateSettings>;
updateSettings: (
settings: Partial<UpdateSettings>
) => Promise<UpdateSettings>;
onStateChanged: (callback: (state: UpdateState) => void) => () => void;
}
export interface WindowAPI {
setAlwaysOnTop: (value: boolean) => Promise<boolean>;
getAlwaysOnTop: () => Promise<boolean>;
setIgnoreMouseEvents: (
ignore: boolean,
options?: { forward: boolean }
) => void;
}
declare global {
interface Window {
updaterAPI: UpdaterAPI;
windowAPI: WindowAPI;
}
}