improve local-app

This commit is contained in:
Anton Bracke
2022-02-19 01:08:33 +01:00
parent 389c2e4844
commit 9301433fdf
18 changed files with 82 additions and 33 deletions
+11
View File
@@ -0,0 +1,11 @@
import { contextBridge, ipcRenderer, IpcRendererEvent } from "electron";
import type { WorkAdventureDesktopApi } from "./types";
const api: WorkAdventureDesktopApi = {
desktop: true,
notify: (txt: string) => ipcRenderer.send("app:notify", txt),
onMutedKeyPress: (callback: (event: IpcRendererEvent) => void) =>
ipcRenderer.on("app:on-muted-key-press", callback),
};
contextBridge.exposeInMainWorld("WorkAdventureDesktopApi", api);