-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreload.js
More file actions
47 lines (46 loc) · 1.58 KB
/
Copy pathpreload.js
File metadata and controls
47 lines (46 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const { contextBridge, ipcRenderer } = require("electron");
contextBridge.exposeInMainWorld("GalAssetBoxDesktop", {
platform: process.platform,
pickDirectory(role) {
return ipcRenderer.invoke("desktop:pick-directory", role);
},
scanDirectory(rootPath) {
return ipcRenderer.invoke("desktop:scan-directory", rootPath);
},
useDirectoryAsSource(targetPath) {
return ipcRenderer.invoke("desktop:use-directory-as-source", targetPath);
},
organizeAssets(payload) {
return ipcRenderer.invoke("desktop:organize-assets", payload);
},
readFileText(filePath) {
return ipcRenderer.invoke("desktop:read-file-text", filePath);
},
readFileArrayBuffer(filePath) {
return ipcRenderer.invoke("desktop:read-file-array-buffer", filePath);
},
writePluginOutput(payload) {
return ipcRenderer.invoke("desktop:write-plugin-output", payload);
},
writePluginRunReports(payload) {
return ipcRenderer.invoke("desktop:write-plugin-run-reports", payload);
},
getExtractorStatus() {
return ipcRenderer.invoke("desktop:get-extractor-status");
},
planExtraction(payload) {
return ipcRenderer.invoke("desktop:plan-extraction", payload);
},
extractCommonArchives(payload) {
return ipcRenderer.invoke("desktop:extract-common-archives", payload);
},
pickExtractorTool(toolId) {
return ipcRenderer.invoke("desktop:pick-extractor-tool", toolId);
},
clearExtractorTool(toolId) {
return ipcRenderer.invoke("desktop:clear-extractor-tool", toolId);
},
openPath(targetPath) {
return ipcRenderer.invoke("desktop:open-path", targetPath);
},
});