const enum IpcChannels { ERROR = 'ERROR', LOGIN = 'LOGIN', LOGGED_IN = 'LOGGED_IN', } interface IIpcPayload { id: string; data: any; } interface IIpcResponse { id: string; success: boolean; data?: any; error?: any; } interface ICredentials { name: string; password: string; } interface IIpcClient { ask: (channel: IpcChannels, data?: any) => Promise; } interface IIpcServer { answer: (channel: IpcChannels, handler: (data?: any) => Promise) => void; send: (channel: IpcChannels, data: any) => void; }