mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-04 19:21:33 -07:00
19 lines
581 B
TypeScript
19 lines
581 B
TypeScript
import { contextBridge, ipcRenderer } from 'electron';
|
|
import { IPC_CHANNELS } from './shared/ipc/contracts';
|
|
|
|
const statsAPI = {
|
|
confirmNativeDialog: (message: string): boolean => {
|
|
return ipcRenderer.sendSync(IPC_CHANNELS.command.statsNativeConfirmDialog, message) === true;
|
|
},
|
|
|
|
beginNativeDialog: (): void => {
|
|
ipcRenderer.sendSync(IPC_CHANNELS.command.statsNativeDialogOpened);
|
|
},
|
|
|
|
endNativeDialog: (): void => {
|
|
ipcRenderer.send(IPC_CHANNELS.command.statsNativeDialogClosed);
|
|
},
|
|
};
|
|
|
|
contextBridge.exposeInMainWorld('electronAPI', { stats: statsAPI });
|