2020-07-25 02:02:37 +02:00
|
|
|
declare const enum IpcChannel {
|
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;
|
2020-07-25 02:02:37 +02:00
|
|
|
data: unknown;
|
2019-07-26 23:05:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
interface IIpcResponse {
|
2019-07-30 23:58:58 +02:00
|
|
|
id: string;
|
2019-07-26 23:05:29 +02:00
|
|
|
success: boolean;
|
2020-07-25 02:02:37 +02:00
|
|
|
data?: unknown;
|
|
|
|
// just the error message
|
|
|
|
error?: string;
|
2019-06-16 00:41:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
interface ICredentials {
|
|
|
|
name: string;
|
|
|
|
password: string;
|
|
|
|
}
|
2019-07-26 23:05:29 +02:00
|
|
|
|
|
|
|
interface IIpcClient {
|
2020-07-25 02:02:37 +02:00
|
|
|
ask: (channel: IpcChannel, data?: unknown) => Promise<unknown>;
|
2019-07-26 23:05:29 +02:00
|
|
|
}
|
|
|
|
|
2020-07-25 02:02:37 +02:00
|
|
|
type IpcHandler = (data?: unknown) => Promise<unknown>;
|
|
|
|
|
|
|
|
interface IIpcController {
|
|
|
|
get(): IIpcController;
|
2019-07-26 23:05:29 +02:00
|
|
|
}
|