@lobehub/chat
Version:
Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.
19 lines (14 loc) • 515 B
text/typescript
import { electronAPI } from '@electron-toolkit/preload';
import { contextBridge } from 'electron';
import { invoke } from './invoke';
export const setupElectronApi = () => {
// Use `contextBridge` APIs to expose Electron APIs to
// renderer only if context isolation is enabled, otherwise
// just add to the DOM global.
try {
contextBridge.exposeInMainWorld('electron', electronAPI);
} catch (error) {
console.error(error);
}
contextBridge.exposeInMainWorld('electronAPI', { invoke });
};