-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreload.js
More file actions
15 lines (14 loc) · 932 Bytes
/
Copy pathpreload.js
File metadata and controls
15 lines (14 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const { contextBridge, ipcRenderer, shell } = require('electron');
contextBridge.exposeInMainWorld('electronAPI', {
selectDirectory: () => ipcRenderer.invoke('select-directory'),
executeCode: (directory, code) => ipcRenderer.invoke('execute-code', directory, code),
quitApp: () => ipcRenderer.invoke('quit-app'),
getRecentDirectories: () => ipcRenderer.invoke('get-recent-directories'),
selectRecentDirectory: (directory) => ipcRenderer.invoke('select-recent-directory', directory),
openExternal: (url) => shell.openExternal(url),
getVersionInfo: (directory) => ipcRenderer.invoke('get-version-info', directory),
getCompletions: (directory) => ipcRenderer.invoke('get-completions', directory),
clearCompletionCache: (directory) => ipcRenderer.invoke('clear-completion-cache', directory),
promptPhpPath: () => ipcRenderer.invoke('prompt-php-path'),
clearPhpPath: () => ipcRenderer.invoke('clear-php-path')
});