/** * TypeScript declarations for window.electron API * Must match exactly with electron/preload.ts * * Usage: * - Use invoke(channel, ...args) for all IPC calls * - Shortcuts are provided for common operations (tokens, lang, encryption) */ export interface IElectronAPI { // Platform info platform: NodeJS.Platform; // Generic invoke method - use this for all IPC calls invoke: (channel: string, ...args: any[]) => Promise; // Token management (shortcuts for convenience) getToken: () => Promise; setToken: (token: string) => Promise; removeToken: () => Promise; // Language management (shortcuts for convenience) getLang: () => Promise<'fr' | 'en'>; setLang: (lang: 'fr' | 'en') => Promise; // Auth events (one-way communication) loginSuccess: (token: string, userId: string) => void; logout: () => void; // Encryption key management (shortcuts for convenience) generateEncryptionKey: (userId: string) => Promise; getUserEncryptionKey: (userId: string) => Promise; setUserEncryptionKey: (userId: string, encryptionKey: string) => Promise; // Database initialization (shortcut for convenience) dbInitialize: (userId: string, encryptionKey: string) => Promise; } declare global { interface Window { electron: IElectronAPI; } } export {};