2020-02-08 23:26:57 +01:00
|
|
|
declare const enum IpcChannels {
|
2019-11-18 22:38:51 +01:00
|
|
|
ERROR = 'ERROR',
|
2019-07-26 23:05:29 +02:00
|
|
|
LOGIN = 'LOGIN',
|
|
|
|
LOGGED_IN = 'LOGGED_IN',
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IIpcPayload {
|
2019-07-30 23:58:58 +02:00
|
|
|
id: string;
|
2019-07-26 23:05:29 +02:00
|
|
|
data: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IIpcResponse {
|
2019-07-30 23:58:58 +02:00
|
|
|
id: string;
|
2019-07-26 23:05:29 +02:00
|
|
|
success: boolean;
|
|
|
|
data?: any;
|
|
|
|
error?: any;
|
2019-06-16 00:41:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
interface ICredentials {
|
|
|
|
name: string;
|
|
|
|
password: string;
|
|
|
|
}
|
2019-07-26 23:05:29 +02:00
|
|
|
|
|
|
|
interface IIpcClient {
|
|
|
|
ask: (channel: IpcChannels, data?: any) => Promise<any>;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IIpcServer {
|
|
|
|
answer: (channel: IpcChannels, handler: (data?: any) => Promise<any>) => void;
|
2019-11-18 22:38:51 +01:00
|
|
|
send: (channel: IpcChannels, data: any) => void;
|
2019-07-26 23:05:29 +02:00
|
|
|
}
|