1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-08-31 11:42:50 +00:00

Receivers: Added connect/disconenct notifications to player window

This commit is contained in:
Michael Hollister 2025-04-25 14:04:59 -05:00
parent a7cd81aa34
commit c54ce74dfd
11 changed files with 268 additions and 57 deletions

View file

@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { Opcode } from 'common/Packets';
declare global {
interface Window {
@ -22,11 +23,13 @@ if (TARGET === 'electron') {
})
electronAPI.contextBridge.exposeInMainWorld('targetAPI', {
onDeviceInfo: (callback: any) => electronAPI.ipcRenderer.on("device-info", callback),
onConnect: (callback: any) => electronAPI.ipcRenderer.on("connect", callback),
onDisconnect: (callback: any) => electronAPI.ipcRenderer.on("disconnect", callback),
onPing: (callback: any) => electronAPI.ipcRenderer.on("ping", callback),
onDeviceInfo: (callback: any) => electronAPI.ipcRenderer.on('device-info', callback),
getDeviceInfo: () => preloadData.deviceInfo,
sendSessionMessage: (opcode: Opcode, message: any) => electronAPI.ipcRenderer.send('send-session-message', { opcode: opcode, message: message }),
disconnectDevice: (session: string) => electronAPI.ipcRenderer.send('disconnect-device', session),
onConnect: (callback: any) => electronAPI.ipcRenderer.on('connect', callback),
onDisconnect: (callback: any) => electronAPI.ipcRenderer.on('disconnect', callback),
onPing: (callback: any) => electronAPI.ipcRenderer.on('ping', callback),
});
// @ts-ignore