DNDGamePlayer: Electron редактор сцен, презентация, упаковка electron-builder

Made-with: Cursor
This commit is contained in:
Ivan Fontosh
2026-04-19 14:16:54 +08:00
commit a6cbcc273e
82 changed files with 22195 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import { contextBridge } from 'electron';
import type { IpcEventMap, IpcInvokeMap } from '../shared/ipc/contracts';
import { invoke, on } from './ipcClient';
export type DndApi = {
invoke: <K extends keyof IpcInvokeMap>(
channel: K,
payload: IpcInvokeMap[K]['req'],
) => Promise<IpcInvokeMap[K]['res']>;
on: <K extends keyof IpcEventMap>(channel: K, listener: (payload: IpcEventMap[K]) => void) => () => void;
};
const api: DndApi = { invoke, on };
contextBridge.exposeInMainWorld('dnd', api);
declare global {
var dnd: DndApi | undefined;
interface Window {
dnd: DndApi;
}
}