Initial clean project import

This commit is contained in:
cat-shark
2026-06-19 18:41:41 +08:00
commit a13b804c7a
1306 changed files with 220568 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('oemTool', {
diagnostic: (message, payload) => ipcRenderer.invoke('oem-tool:diagnostic', { message, payload }),
pickImage: () => ipcRenderer.invoke('oem-tool:pick-image'),
pathToFileUrl: (filePath) => {
if (!filePath) return '';
const normalized = String(filePath).replace(/\\/g, '/').replace(/#/g, '%23');
return `file:///${encodeURI(normalized)}`;
},
runBatch: (jobs) => ipcRenderer.invoke('oem-tool:run-batch', jobs),
cancel: () => ipcRenderer.invoke('oem-tool:cancel'),
openOutputDir: () => ipcRenderer.invoke('oem-tool:open-output-dir'),
getStatus: () => ipcRenderer.invoke('oem-tool:get-status'),
onLog: (callback) => {
const listener = (_event, payload) => callback(payload);
ipcRenderer.on('oem-tool:log', listener);
return () => ipcRenderer.removeListener('oem-tool:log', listener);
},
});