diff --git a/electron/binaries.ts b/electron/binaries.ts index 4cfab6d..f0a90f7 100644 --- a/electron/binaries.ts +++ b/electron/binaries.ts @@ -5,7 +5,7 @@ */ import { join, dirname, resolve } from "path"; -import { getPlatform } from "./getPlatform"; +import getPlatform from "./getPlatform"; import isDev from "electron-is-dev"; import { app } from "electron"; diff --git a/electron/getPlatform.ts b/electron/getPlatform.ts index e8ad1ae..0defecc 100644 --- a/electron/getPlatform.ts +++ b/electron/getPlatform.ts @@ -18,4 +18,4 @@ const getPlatform = () => { } }; -export { getPlatform }; +export default getPlatform; diff --git a/electron/index.ts b/electron/index.ts index d6a41cf..86e598d 100644 --- a/electron/index.ts +++ b/electron/index.ts @@ -5,7 +5,7 @@ import { ChildProcessWithoutNullStreams, spawn } from "child_process"; import fs from "fs"; import sizeOf from "image-size"; import { autoUpdater } from "electron-updater"; -import { getPlatform } from "./getPlatform"; +import getPlatform from "./getPlatform"; import { execPath, modelsPath } from "./binaries"; diff --git a/electron/preload.ts b/electron/preload.ts index 5b9578b..8cad08d 100644 --- a/electron/preload.ts +++ b/electron/preload.ts @@ -2,10 +2,11 @@ import { ipcRenderer, contextBridge } from "electron"; // 'ipcRenderer' will be available in index.js with the method 'window.electron' contextBridge.exposeInMainWorld("electron", { - send: (command, payload) => ipcRenderer.send(command, payload), - on: (command, func) => + send: (command: string, payload: any) => ipcRenderer.send(command, payload), + on: (command: string, func: (...args: any) => any) => ipcRenderer.on(command, (event, args) => { func(event, args); }), - invoke: (command, payload) => ipcRenderer.invoke(command, payload), + invoke: (command: string, payload: any) => + ipcRenderer.invoke(command, payload), }); diff --git a/electron/utils.ts b/electron/utils.ts index 810d226..1ee1749 100644 --- a/electron/utils.ts +++ b/electron/utils.ts @@ -1,14 +1,6 @@ import { spawn } from "child_process"; import { execPath } from "./binaries"; -/** - * - * @param {*} inputFile - * @param {*} outFile - * @param {*} modelsPath - * @param {*} model - * @returns - */ function upscaylImage( inputFile: string, outFile: string,