From 254e4216e6ec3877c49d85b9eb2333cd1afb8d77 Mon Sep 17 00:00:00 2001 From: Xymorot Date: Thu, 1 Aug 2019 23:40:57 +0200 Subject: [PATCH] refactor: make IpcEvent an interface (from type) --- src/declarations/electron.d.ts | 4 ++-- src/main/controllers/api.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarations/electron.d.ts b/src/declarations/electron.d.ts index 02be2a0..fbe34f9 100644 --- a/src/declarations/electron.d.ts +++ b/src/declarations/electron.d.ts @@ -1,8 +1,8 @@ import WebContents = Electron.WebContents; -declare type IpcEvent = { +declare interface IIpcEvent { frameId: number; preventDefault: () => void; reply: (channel: string, ...args: any) => void; sender: WebContents; -}; +} diff --git a/src/main/controllers/api.ts b/src/main/controllers/api.ts index 6bfc9aa..acfa9f7 100644 --- a/src/main/controllers/api.ts +++ b/src/main/controllers/api.ts @@ -3,7 +3,7 @@ import { isLoggedIn, login } from '../services/nhentai-crawler'; const ipcServer: IIpcServer = { answer: (channel: IpcChannels, handler: (data?: any) => Promise): void => { - ipcMain.on(channel, (event: IpcEvent, payload: IIpcPayload) => { + ipcMain.on(channel, (event: IIpcEvent, payload: IIpcPayload) => { handler(payload.data) .then((result: any) => { const response: IIpcResponse = {