first pass implementation

This commit is contained in:
talksik
2026-04-08 16:04:55 -07:00
parent 382f195847
commit 36fbb2acfd
13 changed files with 522 additions and 8 deletions
+15
View File
@@ -41,6 +41,21 @@ contextBridge.exposeInMainWorld('electronAutoplay', {
},
});
contextBridge.exposeInMainWorld('electronScreen', {
getScreenSources: () => ipcRenderer.invoke('screen:get-sources'),
startRecordingWindow: () => ipcRenderer.send('screen-record:start'),
stopRecordingWindow: () => ipcRenderer.send('screen-record:cancel'),
onStopRequested: (callback: () => void) => {
const handler = () => callback();
ipcRenderer.on('screen-record:stopped', handler);
return () => { ipcRenderer.removeListener('screen-record:stopped', handler); };
},
});
contextBridge.exposeInMainWorld('electronScreenRecord', {
stop: () => ipcRenderer.send('screen-record:stop'),
});
contextBridge.exposeInMainWorld('electronLink', {
fetchMetadata: (url: string) => ipcRenderer.invoke('link:fetch-metadata', url),
openExternal: (url: string) => ipcRenderer.invoke('link:open-external', url),