-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpreload.js
More file actions
19 lines (19 loc) · 768 Bytes
/
preload.js
File metadata and controls
19 lines (19 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// electron/preload.ts
const electron_1 = require("electron");
electron_1.contextBridge.exposeInMainWorld("electronAPI", {
saveFile: (code) => {
console.log("💾 saveFile called");
return electron_1.ipcRenderer.invoke("save-file", code);
},
openFile: () => {
console.log("📂 openFile called from renderer");
return electron_1.ipcRenderer.invoke("open-file");
},
deployCode: (code) => {
console.log("🚀 deployCode called from renderer");
return electron_1.ipcRenderer.invoke("deploy-code", code); // ✅ ADD THIS
},
deployToCloudflare: (code) => electron_1.ipcRenderer.invoke("deploy-to-cloudflare", code),
});