Initial commit: StreamDeck Electron app

This commit is contained in:
Dávid Ádám
2026-06-06 13:52:05 +02:00
commit 96ef83c904
12 changed files with 3462 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
/* ─── Preload Script ─────────────────────────────────────────────────────────
* Context bridge a renderer és main process között.
* Exponálja a natív API-kat a weboldalnak.
* ──────────────────────────────────────────────────────────────────────────── */
const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('electronAPI', {
// Config
getConfig: () => ipcRenderer.invoke('get-config'),
reloadConfig: () => ipcRenderer.invoke('reload-config'),
// Action futtatás
executeAction: (action) => ipcRenderer.invoke('execute-action', action),
executeActions: (actions) => ipcRenderer.invoke('execute-actions', actions),
// Clipboard
getClipboardText: () => ipcRenderer.invoke('get-clipboard-text'),
setClipboardText: (text) => ipcRenderer.invoke('set-clipboard-text', text),
// System stats
getSystemStats: () => ipcRenderer.invoke('get-system-stats'),
// Fullscreen
toggleFullscreen: () => ipcRenderer.invoke('toggle-fullscreen'),
// Eredmény események (pl. shell output)
onShellResult: (callback) => {
ipcRenderer.on('shell-result', (event, data) => callback(data));
},
onClipboardResult: (callback) => {
ipcRenderer.on('clipboard-result', (event, data) => callback(data));
},
});