From a993d34c9db0c86e9c0aec2e299cd8fdde243776 Mon Sep 17 00:00:00 2001 From: V Date: Wed, 21 Jun 2023 16:15:57 +0200 Subject: [PATCH] autostart: improve typing --- src/main/autoStart.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/autoStart.ts b/src/main/autoStart.ts index e3fb17f..17ee6fd 100644 --- a/src/main/autoStart.ts +++ b/src/main/autoStart.ts @@ -8,7 +8,13 @@ import { app } from "electron"; import { existsSync, mkdirSync, rmSync, writeFileSync } from "fs"; import { join } from "path"; -function makeAutoStartLinux() { +interface AutoStart { + isEnabled(): boolean; + enable(): void; + disable(): void; +} + +function makeAutoStartLinux(): AutoStart { const dir = join(process.env.HOME!, ".config", "autostart"); const file = join(dir, "vencord.desktop"); @@ -33,7 +39,7 @@ StartupNotify=false }; } -const autoStartWindowsMac = { +const autoStartWindowsMac: AutoStart = { isEnabled: () => app.getLoginItemSettings().openAtLogin, enable: () => app.setLoginItemSettings({ openAtLogin: true }), disable: () => app.setLoginItemSettings({ openAtLogin: false })