up
This commit is contained in:
+3
-1
@@ -1,9 +1,11 @@
|
||||
import { contextBridge, ipcRenderer } from 'electron'
|
||||
import type { Command, Report, State } from '../src/types/screen.js'
|
||||
import type { Command, Report, SceneReport, State } from '../src/types/screen.js'
|
||||
|
||||
contextBridge.exposeInMainWorld('screenBridge', {
|
||||
command: (command: Command) => ipcRenderer.invoke('command', command),
|
||||
report: (report: Report) => ipcRenderer.send('report', report),
|
||||
reportScene: (report: SceneReport) => ipcRenderer.send('scene-report', report),
|
||||
preview: () => ipcRenderer.invoke('preview'),
|
||||
state: () => ipcRenderer.invoke('state'),
|
||||
subscribe: (listener: (state: State) => void) => {
|
||||
const handler = (_event: Electron.IpcRendererEvent, state: State) => listener(state)
|
||||
|
||||
Reference in New Issue
Block a user