mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 08:44:50 +00:00
Merge IrisStudio into studio/ with its history
git-subtree-dir: studio git-subtree-mainline:68ae3c8d3agit-subtree-split:1c50eaf776
This commit is contained in:
commit
4e226b93f4
92 files changed
+14197
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { contextBridge, ipcRenderer, type IpcRendererEvent } from 'electron'
|
||||
import type { StudioHost, ThemeChoice } from '../shared/bridge'
|
||||
|
||||
const host: StudioHost = {
|
||||
listBridges: () => ipcRenderer.invoke('studio:list-bridges'),
|
||||
initialLink: () => ipcRenderer.invoke('studio:initial-link'),
|
||||
onLink: (listener) => {
|
||||
const forward = (_event: IpcRendererEvent, link: string): void => listener(link)
|
||||
ipcRenderer.on('studio:link', forward)
|
||||
return () => ipcRenderer.removeListener('studio:link', forward)
|
||||
},
|
||||
setTheme: (theme: ThemeChoice) => ipcRenderer.send('studio:set-theme', theme),
|
||||
copyText: (text: string) => ipcRenderer.send('studio:copy-text', text)
|
||||
}
|
||||
|
||||
contextBridge.exposeInMainWorld('studio', host)
|
||||
Reference in new issue
Block a user