This repository was archived by the owner on Sep 19, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.d.ts
More file actions
69 lines (58 loc) · 1.61 KB
/
types.d.ts
File metadata and controls
69 lines (58 loc) · 1.61 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
interface User {
id: string;
email: string;
firstName: string;
lastName: string;
createdAt: Date;
}
interface AuthResponse {
success: boolean;
message?: string;
user?: User;
token?: string;
}
interface LoginRequest {
email: string;
password: string;
}
interface RegisterRequest {
firstName: string;
lastName: string;
email: string;
password: string;
confirmPassword: string;
acceptTerms: boolean;
}
interface ElectronAPI {
// Window controls
minimize: () => void;
maximize: () => void;
close: () => void;
setWindowTitle: (title: string) => void;
updateWindowPreview: () => void;
// Navigation controls
goBack: () => void;
goForward: () => void;
reload: () => void;
navigate: (url: string) => void;
requestNavigationStateUpdate: () => void;
// File operations
openFile: () => Promise<string | null>; // Opens file dialog, returns path or null if canceled
// DevTools controls
toggleDevTools: () => Promise<void>;
// Authentication API
auth: {
login: (data: LoginRequest) => Promise<AuthResponse>;
register: (data: RegisterRequest) => Promise<AuthResponse>;
logout: (token: string) => Promise<AuthResponse>;
verifyToken: (token: string) => Promise<AuthResponse>;
getUsers: () => Promise<{ success: boolean; users?: User[]; message?: string }>;
};
// Window state listeners
onMaximizeChange: (callback: (isMaximized: boolean) => void) => () => void;
// Navigation state listeners
onNavigationStateChange: (callback: (canGoBack: boolean, canGoForward: boolean) => void) => () => void;
}
interface Window {
electron: ElectronAPI;
}