feat: add some funcs

This commit is contained in:
lucasdpt
2026-06-14 14:23:37 +02:00
parent 48fa508540
commit 4756420f8d
11 changed files with 240 additions and 44 deletions
+9 -2
View File
@@ -7,7 +7,9 @@ import {
type GameLogLine,
type UserSettings,
type DeviceCodeInfo,
type UpdateStatus
type UpdateStatus,
type PlayOptions,
type PackMeta
} from '../shared/ipc'
/** API typée exposée au renderer via window.api. */
@@ -18,7 +20,9 @@ const api = {
getProfile: (): Promise<PlayerProfile | null> => ipcRenderer.invoke(IPC.authGetProfile),
// --- Jouer (install + sync + launch) ---
play: (): Promise<void> => ipcRenderer.invoke(IPC.play),
play: (opts?: PlayOptions): Promise<void> => ipcRenderer.invoke(IPC.play, opts),
stopGame: (): Promise<boolean> => ipcRenderer.invoke(IPC.playStop),
getPackMeta: (): Promise<PackMeta | null> => ipcRenderer.invoke(IPC.packGet),
// --- Réglages ---
getSettings: (): Promise<UserSettings> => ipcRenderer.invoke(IPC.settingsGet),
@@ -29,6 +33,9 @@ const api = {
/** Ouvre le dossier d'instance (mods/config/saves) dans l'explorateur. */
openInstanceDir: (): Promise<string> => ipcRenderer.invoke(IPC.openInstanceDir),
/** Ouvre le dossier des logs du launcher. */
openLogsDir: (): Promise<string> => ipcRenderer.invoke(IPC.openLogsDir),
/** Quitte et installe la mise à jour téléchargée. */
installUpdate: (): Promise<void> => ipcRenderer.invoke(IPC.updateInstall),