autostart: improve typing

This commit is contained in:
V 2023-06-21 16:15:57 +02:00
parent f232defd1c
commit a993d34c9d
No known key found for this signature in database
GPG key ID: A1DC0CFB5615D905

View file

@ -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 })