import * as electron from "electron" ; import { GET_DEVICE , GET_DEVICES , GET_TRANSPORT_DELEGATE , IS_OPENED , GET_DEVICE_ID , CONNECT , TRY_CONNECT_DEBUG_LINK , DISCONNECT , WRITE_CHUNK , READ_CHUNK , } from "./utils" ; export const CLIENT_TAG = "apiHDWalletKeepKeyElectronClient" ; export const Client = { getDevices ( ) { return electron . ipcRenderer . invoke ( GET_DEVICES ) ; } , getDevice ( serialNumber ? ) { return electron . ipcRenderer . invoke ( GET_DEVICE , serialNumber ) ; } , getTransportDelegate ( handle ) { return electron . ipcRenderer . invoke ( GET_TRANSPORT_DELEGATE , handle ) ; } , isOpened ( handle ) { return electron . ipcRenderer . invoke ( IS_OPENED , handle ) ; } , getDeviceID ( handle ) { return electron . ipcRenderer . invoke ( GET_DEVICE_ID , handle ) ; } , connect ( handle ) { return electron . ipcRenderer . invoke ( CONNECT , handle ) ; } , tryConnectDebugLink ( handle ) { return electron . ipcRenderer . invoke ( TRY_CONNECT_DEBUG_LINK , handle ) ; } , disconnect ( handle ) { return electron . ipcRenderer . invoke ( DISCONNECT , handle ) ; } , writeChunk ( handle , buf , debugLink ? ) { return electron . ipcRenderer . invoke ( WRITE_CHUNK , handle , buf , debugLink ) ; } , readChunk ( handle , debugLink ? ) { return electron . ipcRenderer . invoke ( READ_CHUNK , handle , debugLink ) ; } , expose ( ) { electron . contextBridge . exposeInMainWorld ( CLIENT_TAG , Client ) ; } } ; export type Client = typeof Client ;