Simple monitor for displaying MIDI status for digital pianos.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

23 line
611 B

  1. import { contextBridge } from 'electron'
  2. import { electronAPI } from '@electron-toolkit/preload'
  3. // Custom APIs for renderer
  4. const api = {}
  5. // Use `contextBridge` APIs to expose Electron APIs to
  6. // renderer only if context isolation is enabled, otherwise
  7. // just add to the DOM global.
  8. if (process.contextIsolated) {
  9. try {
  10. contextBridge.exposeInMainWorld('electron', electronAPI)
  11. contextBridge.exposeInMainWorld('api', api)
  12. } catch (error) {
  13. console.error(error)
  14. }
  15. } else {
  16. // @ts-ignore (define in dts)
  17. window.electron = electronAPI
  18. // @ts-ignore (define in dts)
  19. window.api = api
  20. }