Fix calling tools JS
This commit is contained in:
parent
5f0080a7d7
commit
29eb07c159
23 changed files with 27 additions and 23 deletions
25
ts/windows/calling-tools/preload.ts
Normal file
25
ts/windows/calling-tools/preload.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Copyright 2024 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { contextBridge, ipcRenderer } from 'electron';
|
||||
import type { Event } from 'electron/renderer';
|
||||
import { MinimalSignalContext } from '../minimalContext';
|
||||
|
||||
type RtcStatsReport = {
|
||||
conversationId: string;
|
||||
callId: string;
|
||||
reportJson: string;
|
||||
};
|
||||
|
||||
const Signal = {
|
||||
CallingToolsProps: {
|
||||
onRtcStatsReport: (
|
||||
callback: (event: Event, value: RtcStatsReport) => void
|
||||
) => ipcRenderer.on('calling:rtc-stats-report', callback),
|
||||
setRtcStatsInterval: (intervalMillis: number) => {
|
||||
ipcRenderer.send('calling:set-rtc-stats-interval', intervalMillis);
|
||||
},
|
||||
},
|
||||
};
|
||||
contextBridge.exposeInMainWorld('Signal', Signal);
|
||||
contextBridge.exposeInMainWorld('SignalContext', MinimalSignalContext);
|
Loading…
Add table
Add a link
Reference in a new issue