feat: init window.affine (#2682)

(cherry picked from commit 8f6db00402)
This commit is contained in:
Himself65
2023-06-06 11:43:34 +08:00
committed by Alex Yang
parent db4a0fd57c
commit ea21ed6e0d
5 changed files with 155 additions and 20 deletions
+1 -18
View File
@@ -1,18 +1 @@
/**
* @module preload
*/
import { contextBridge } from 'electron';
import * as affineApis from './affine-apis';
/**
* The "Main World" is the JavaScript context that your main renderer code runs in.
* By default, the page you load in your renderer executes code in this world.
*
* @see https://www.electronjs.org/docs/api/context-bridge
*/
contextBridge.exposeInMainWorld('apis', affineApis.apis);
contextBridge.exposeInMainWorld('events', affineApis.events);
contextBridge.exposeInMainWorld('appInfo', affineApis.appInfo);
import './bootstrap';