1- import { contextBridge , ipcRenderer } from 'electron'
1+ import { NotificationConstructorOptions , contextBridge , ipcRenderer } from 'electron'
22import { electronAPI } from '@electron-toolkit/preload'
33import { IPC_EVENTS , PHONE_ISLAND_EVENTS } from '@shared/constants'
44import {
@@ -16,7 +16,6 @@ import { preloadBindings } from 'i18next-electron-fs-backend'
1616import { log } from '@shared/utils/logger'
1717
1818export interface IElectronAPI {
19-
2019 env : NodeJS . ProcessEnv
2120
2221 // Use `contextBridge` APIs to expose Electron APIs to
@@ -51,9 +50,12 @@ export interface IElectronAPI {
5150 onThemeChange ( callback : ( theme : AvailableThemes ) => void ) : void
5251 onOperatorsChange ( callback : ( updateOperators : OperatorData ) => void ) : void
5352 onQueueLoaded ( onQueueUpdate : ( queues : { [ queueId : string ] : any } ) => void ) : void
53+ onUpdateAppNotification ( showUpdateAppNotification : ( ) => void ) : void
54+ onLoadDataEnd ( callback : ( ) => void ) : void
5455
5556 //EMITTER - only emit, no response
5657 openDevTool ( hash : string ) : unknown
58+ sendNotification ( notificationoption : NotificationConstructorOptions , openUrl : string | undefined ) : void
5759 logout : ( ) => void
5860 startCall ( phoneNumber : string ) : void
5961 changeTheme ( theme : AvailableThemes ) : void
@@ -63,7 +65,8 @@ export interface IElectronAPI {
6365 resizePhoneIsland ( offsetWidth : number , offsetHeight : number ) : void
6466 sendInitializationCompleted ( id : string ) : void
6567 addPhoneIslandListener : ( event : PHONE_ISLAND_EVENTS , callback : ( ...args : any [ ] ) => void ) => void
66- openHostPage ( path : string ) : unknown
68+ openHostPage ( path : string ) : void
69+ openExternalPage ( url : string ) : void
6770 hideNethLink : ( ) => void
6871 exitNethLink : ( ) => void
6972 showPhoneIsland : ( ) => void
@@ -120,6 +123,7 @@ const api: IElectronAPI = {
120123 deviceDefaultChange : setEmitterSync < void > ( IPC_EVENTS . DEVICE_DEFAULT_CHANGE ) ,
121124
122125 //EMITTER - only emit, no response
126+ sendNotification : setEmitter ( IPC_EVENTS . SEND_NOTIFICATION ) ,
123127 openDevTool : setEmitter ( IPC_EVENTS . OPEN_DEV_TOOLS ) ,
124128 hideLoginWindow : setEmitter ( IPC_EVENTS . HIDE_LOGIN_WINDOW ) ,
125129 logout : setEmitter ( IPC_EVENTS . LOGOUT ) ,
@@ -130,6 +134,7 @@ const api: IElectronAPI = {
130134 changeTheme : setEmitter ( IPC_EVENTS . CHANGE_THEME ) ,
131135 sendSearchText : setEmitter ( IPC_EVENTS . SEARCH_TEXT ) ,
132136 openHostPage : setEmitter ( IPC_EVENTS . OPEN_HOST_PAGE ) ,
137+ openExternalPage : setEmitter ( IPC_EVENTS . OPEN_EXTERNAL_PAGE ) ,
133138 hideNethLink : setEmitter ( IPC_EVENTS . HIDE_NETH_LINK ) ,
134139 exitNethLink : setEmitter ( IPC_EVENTS . CLOSE_NETH_LINK ) ,
135140 showPhoneIsland : setEmitter ( IPC_EVENTS . SHOW_PHONE_ISLAND ) ,
@@ -162,6 +167,8 @@ const api: IElectronAPI = {
162167 onThemeChange : addListener ( IPC_EVENTS . ON_CHANGE_THEME ) ,
163168 onOperatorsChange : addListener ( IPC_EVENTS . OPERATORS_CHANGE ) ,
164169 onQueueLoaded : addListener ( IPC_EVENTS . QUEUE_LOADED ) ,
170+ onUpdateAppNotification : addListener ( IPC_EVENTS . UPDATE_APP_NOTIFICATION ) ,
171+ onLoadDataEnd : addListener ( IPC_EVENTS . LOAD_DATA_END ) ,
165172
166173 addPhoneIslandListener : ( event , callback ) => {
167174 const evName = `on-${ event } `
0 commit comments