2020-07-25 02:02:37 +02:00
|
|
|
declare const enum IpcChannel {
|
2020-11-09 18:15:30 +01:00
|
|
|
NHENTAI_SAVE_FAVORITES = 'NHENTAI_SAVE_FAVORITES',
|
2019-07-26 23:05:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
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>;
|
|
|
|
|
2020-11-09 19:44:07 +01:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/typescript-eslint/typescript-eslint/issues/2714
|
2020-07-25 02:02:37 +02:00
|
|
|
interface IIpcController {
|
|
|
|
get(): IIpcController;
|
2019-07-26 23:05:29 +02:00
|
|
|
}
|