Prepping editor.
This commit is contained in:
13
editor/electron/preload.ts
Normal file
13
editor/electron/preload.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { contextBridge, ipcRenderer } from 'electron';
|
||||
|
||||
const API_HANDLERS = [
|
||||
"vnscene:test"
|
||||
];
|
||||
|
||||
contextBridge.exposeInMainWorld(
|
||||
'dawnapi',
|
||||
API_HANDLERS.reduce((acc, key) => {
|
||||
acc[key] = (...args:any) => ipcRenderer.invoke(key, ...args);
|
||||
return acc;
|
||||
}, {} as {[key:string]:()=>any})
|
||||
);
|
Reference in New Issue
Block a user