feat(#9): export/import состояния — backup в JSON и восстановление
This commit is contained in:
@@ -116,6 +116,12 @@ const api = {
|
||||
clearHistory: (beforeTs?: number): Promise<number> =>
|
||||
ipcRenderer.invoke(IPC.clearHistory, beforeTs),
|
||||
|
||||
// Export / Import — открывают native save/open dialogs из main process.
|
||||
exportState: (): Promise<{ ok: boolean; path: string | null }> =>
|
||||
ipcRenderer.invoke(IPC.exportState),
|
||||
importState: (): Promise<{ ok: boolean; error?: string }> =>
|
||||
ipcRenderer.invoke(IPC.importState),
|
||||
|
||||
onTick: (h: Handler<Tick[]>): Unsub => on(IPC.evtTick, h),
|
||||
onFire: (h: Handler<Exercise>): Unsub => on(IPC.evtFire, h),
|
||||
onMatchEnd: (h: Handler<MatchSummary>): Unsub => on(IPC.evtMatchEnd, h),
|
||||
|
||||
Reference in New Issue
Block a user