|
|
|
@ -4,14 +4,12 @@ import {
|
|
|
|
|
IpcRendererEvent,
|
|
|
|
|
webFrame,
|
|
|
|
|
} from 'electron';
|
|
|
|
|
import { CONSTANT } from './util';
|
|
|
|
|
|
|
|
|
|
export type Channels =
|
|
|
|
|
| 'ipc-example'
|
|
|
|
|
| 'webview-message'
|
|
|
|
|
| 'close'
|
|
|
|
|
| 'selectServer'
|
|
|
|
|
| 'selectCapturerSource';
|
|
|
|
|
| 'selectServer';
|
|
|
|
|
|
|
|
|
|
contextBridge.exposeInMainWorld('electron', {
|
|
|
|
|
ipcRenderer: {
|
|
|
|
@ -28,14 +26,11 @@ contextBridge.exposeInMainWorld('electron', {
|
|
|
|
|
once(channel: Channels, func: (...args: unknown[]) => void) {
|
|
|
|
|
ipcRenderer.once(channel, (_event, ...args) => func(...args));
|
|
|
|
|
},
|
|
|
|
|
getDesktopCapturerSource:
|
|
|
|
|
async (): Promise<Electron.DesktopCapturerSource> => {
|
|
|
|
|
const source = await ipcRenderer.invoke(
|
|
|
|
|
CONSTANT.DESKTOP_CAPTURER_GET_SOURCES
|
|
|
|
|
);
|
|
|
|
|
async getDesktopCapturerSource(): Promise<Electron.DesktopCapturerSource> {
|
|
|
|
|
const source = await ipcRenderer.invoke('DESKTOP_CAPTURER_GET_SOURCES');
|
|
|
|
|
|
|
|
|
|
return source;
|
|
|
|
|
},
|
|
|
|
|
return source;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|