Add native screen region capture modules and preload build

This commit is contained in:
CREDO23 2026-04-24 19:13:14 +02:00
parent 6c178a0271
commit 7097f542fb
4 changed files with 309 additions and 0 deletions

View file

@ -0,0 +1,11 @@
import { contextBridge, ipcRenderer } from 'electron';
import { IPC_CHANNELS } from './ipc/channels';
contextBridge.exposeInMainWorld('surfsenseScreenRegion', {
submit: (rect: { x: number; y: number; width: number; height: number }) => {
ipcRenderer.send(IPC_CHANNELS.SCREEN_REGION_SUBMIT, rect);
},
cancel: () => {
ipcRenderer.send(IPC_CHANNELS.SCREEN_REGION_CANCEL);
},
});