feat: add way to select game dir
This commit is contained in:
+10
-1
@@ -9,7 +9,8 @@ import {
|
||||
type DeviceCodeInfo,
|
||||
type UpdateStatus,
|
||||
type PlayOptions,
|
||||
type PackMeta
|
||||
type PackMeta,
|
||||
type DataDirInfo
|
||||
} from '../shared/ipc'
|
||||
|
||||
/** API typée exposée au renderer via window.api. */
|
||||
@@ -39,6 +40,14 @@ const api = {
|
||||
/** Quitte et installe la mise à jour téléchargée. */
|
||||
installUpdate: (): Promise<void> => ipcRenderer.invoke(IPC.updateInstall),
|
||||
|
||||
// --- Dossier de données ---
|
||||
isFirstLaunch: (): Promise<boolean> => ipcRenderer.invoke(IPC.isFirstLaunch),
|
||||
getDataDir: (): Promise<DataDirInfo> => ipcRenderer.invoke(IPC.dataDirGet),
|
||||
browseDataDir: (): Promise<string | null> => ipcRenderer.invoke(IPC.dataDirBrowse),
|
||||
/** relaunch=true : relance l'app (pour un changement post-installation). */
|
||||
setDataDir: (dir: string, relaunch: boolean): Promise<string> =>
|
||||
ipcRenderer.invoke(IPC.dataDirSet, dir, relaunch),
|
||||
|
||||
// --- Abonnements aux événements (retournent une fonction de désabonnement) ---
|
||||
onProgress: (cb: (e: ProgressEvent) => void): (() => void) => {
|
||||
const handler = (_: unknown, e: ProgressEvent): void => cb(e)
|
||||
|
||||
Reference in New Issue
Block a user