Initial commit
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import path from 'path';
|
||||
|
||||
import { contextBridge } from 'electron';
|
||||
import { electronAPI } from '@electron-toolkit/preload';
|
||||
import { exposeElectronTRPC } from 'electron-trpc/main';
|
||||
|
||||
try {
|
||||
contextBridge.exposeInMainWorld('electron', electronAPI);
|
||||
contextBridge.exposeInMainWorld('path', path);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
process.once('loaded', async () => {
|
||||
exposeElectronTRPC();
|
||||
});
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
import type path from 'path';
|
||||
|
||||
import { type ElectronAPI } from '@electron-toolkit/preload';
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
electron: ElectronAPI;
|
||||
path: typeof path;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user