()
| 1107 | * This is the only transport mode supported. |
| 1108 | */ |
| 1109 | export const getElectronAPI = (): ElectronAPI => { |
| 1110 | if (typeof window === 'undefined') { |
| 1111 | throw new Error('Cannot get API during SSR'); |
| 1112 | } |
| 1113 | |
| 1114 | if (!httpClientInstance) { |
| 1115 | httpClientInstance = getHttpApiClient(); |
| 1116 | } |
| 1117 | return httpClientInstance!; |
| 1118 | }; |
| 1119 | |
| 1120 | // Async version (same as sync since HTTP client is synchronously instantiated) |
| 1121 | export const getElectronAPIAsync = async (): Promise<ElectronAPI> => { |
no test coverage detected