( event: EventType, data?: string, )
| 20 | * @returns A promise that resolves to the string response from the main process. |
| 21 | */ |
| 22 | export async function invokeMainEvent( |
| 23 | event: EventType, |
| 24 | data?: string, |
| 25 | ): Promise<string> { |
| 26 | try { |
| 27 | return await ipcRenderer.invoke(event, data); |
| 28 | } catch (err) { |
| 29 | // biome-ignore lint/suspicious/noConsole: preload environment is strictly sandboxed |
| 30 | console.error(`[IPC] invoke failed: ${event}`, err); |
| 31 | throw err; |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Invoke a main-process handler with structured `EventData` and await the result. |
no outgoing calls
no test coverage detected