1 import { contextBridge, ipcRenderer } from 'electron';
3 import type { ContextBridgeApi } from '@proton/pass/types';
4 import { disableMouseNavigation } from '@proton/shared/lib/desktop/disableMouseNavigation';
6 const contextBridgeApi: ContextBridgeApi = {
8 writeToClipboard: (text) => ipcRenderer.invoke('clipboard:writeText', text),
9 setClipboardConfig: (config) => ipcRenderer.invoke('clipboard:setConfig', config),
10 getClipboardConfig: () => ipcRenderer.invoke('clipboard:getConfig'),
13 getTheme: () => ipcRenderer.invoke('theming:getTheme'),
14 setTheme: (theme) => ipcRenderer.invoke('theming:setTheme', theme),
17 navigate: (href) => ipcRenderer.invoke('router:navigate', href),
20 canCheckPresence: () => ipcRenderer.invoke('biometrics:canCheckPresence'),
21 checkPresence: (reason) => ipcRenderer.invoke('biometrics:checkPresence', reason),
22 getDecryptionKey: (challenge) => ipcRenderer.invoke('biometrics:getDecryptionKey', challenge),
23 getSecret: (key, version) => ipcRenderer.invoke('biometrics:getSecret', key, version),
24 setSecret: (key, data) => ipcRenderer.invoke('biometrics:setSecret', key, data),
25 deleteSecret: (key) => ipcRenderer.invoke('biometrics:deleteSecret', key),
28 getInstallInfo: () => ipcRenderer.invoke('installInfo:getInfo'),
29 setInstallSourceReported: () => ipcRenderer.invoke('installInfo:setInstallSourceReported'),
32 contextBridge.exposeInMainWorld('ctxBridge', contextBridgeApi);
33 disableMouseNavigation();