v0.1.0: 仙途家族志 · Chronicle of the Immortal Clan
家族模拟器首版:修仙/经营/战斗/外交/叙事全套系统 - Electron + React + TS + MetonaSqlark(aria+OPFS) - 水墨中国风 UI - 引擎种子随机、确定性可回放 - 19 项单元测试、端到端冒烟验证
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { contextBridge, ipcRenderer } from 'electron'
|
||||
|
||||
export interface SaveExportResult {
|
||||
ok: boolean
|
||||
error?: string
|
||||
}
|
||||
export interface SaveImportResult {
|
||||
ok: boolean
|
||||
text?: string
|
||||
error?: string
|
||||
}
|
||||
|
||||
const api = {
|
||||
exportSave: (json: string, defaultName: string): Promise<SaveExportResult> =>
|
||||
ipcRenderer.invoke('save:export', json, defaultName),
|
||||
importSave: (): Promise<SaveImportResult> => ipcRenderer.invoke('save:import')
|
||||
}
|
||||
|
||||
contextBridge.exposeInMainWorld('api', api)
|
||||
|
||||
export type Api = typeof api
|
||||
Reference in New Issue
Block a user