refactor frontend ipc
This commit is contained in:
parent
c8411d573a
commit
56196bcbcf
13 changed files with 177 additions and 52 deletions
10
src/types.ts
10
src/types.ts
|
|
@ -46,8 +46,8 @@ interface IpcHandlerCallback<I, O> {
|
|||
(payload: I | null): Promise<Error | O>;
|
||||
}
|
||||
|
||||
interface IpcListenerCallback<I> {
|
||||
(payload: I | null): void;
|
||||
interface IpcListenerCallback<T> {
|
||||
(payload: T | null): void;
|
||||
}
|
||||
|
||||
interface IIpcHandler<I, O> {
|
||||
|
|
@ -67,6 +67,10 @@ interface IPCHandlers {
|
|||
}
|
||||
|
||||
interface IPCListeners {
|
||||
[listener: string]: IIpcListener<any>;
|
||||
[listener: string]: IIpcListener<any> | null;
|
||||
}
|
||||
|
||||
interface IpcEmitPayload<T> {
|
||||
message: T | null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue