1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-08-04 08:17:01 +00:00

webOS: Ported receiver to Electron 2.1.0 changes

This commit is contained in:
Michael Hollister 2025-05-09 10:44:26 -05:00
parent 61c1e9a9c1
commit e3c437a280
16 changed files with 2402 additions and 978 deletions

View file

@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { Opcode } from 'common/Packets';
import { Logger, LoggerType } from 'common/Logger';
const logger = new Logger('MainWindow', LoggerType.FRONTEND);
@ -55,7 +54,14 @@ if (TARGET === 'electron') {
window.targetAPI = {
onDeviceInfo: (callback: () => void) => preloadData.onDeviceInfoCb = callback,
getDeviceInfo: () => preloadData.deviceInfo,
getSessions: (callback: () => any) => preloadData.getSessionsCb = callback,
getSessions: (callback?: () => Promise<[any]>) => {
if (callback) {
preloadData.getSessionsCb = callback;
}
else {
return preloadData.getSessionsCb();
}
},
onConnect: (callback: (_, value: any) => void) => preloadData.onConnectCb = callback,
onDisconnect: (callback: (_, value: any) => void) => preloadData.onDisconnectCb = callback,
logger: loggerInterface,