init code for the trainer app

This commit is contained in:
Cipher Vance
2026-01-25 09:56:41 -06:00
parent b29d7481e7
commit 9eab5ed98b
47 changed files with 13572 additions and 25 deletions

27
electron/preload.cjs Normal file
View File

@@ -0,0 +1,27 @@
const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('electronAPI', {
getVersion: () => ipcRenderer.invoke('get-version'),
getPlatform: () => ipcRenderer.invoke('get-platform'),
onDeepLink: (callback) => {
ipcRenderer.on('deep-link', (event, data) => callback(data));
},
minimizeWindow: () => ipcRenderer.invoke('minimize-window'),
maximizeWindow: () => ipcRenderer.invoke('maximize-window'),
closeWindow: () => ipcRenderer.invoke('close-window'),
bluetooth: {
checkAvailability: () => ipcRenderer.invoke('bluetooth:check-availability'),
checkSystem: () => ipcRenderer.invoke('bluetooth:check-system'),
onDevicesUpdated: (callback) => {
ipcRenderer.on('bluetooth:devices-updated', (event, devices) => callback(devices));
},
selectDevice: (deviceId) => ipcRenderer.send('bluetooth:select-device', deviceId),
cancelSelection: () => ipcRenderer.send('bluetooth:cancel-selection'),
clearDevices: () => ipcRenderer.send('bluetooth:clear-devices'),
},
isElectron: true,
});