RenaiApp/src/types/ipc.ts

28 lines
446 B
TypeScript

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