diff --git a/packages/electron-trpc/src/main/createIPCHandler.ts b/packages/electron-trpc/src/main/createIPCHandler.ts index ce7ebe38..b8e7d7a1 100644 --- a/packages/electron-trpc/src/main/createIPCHandler.ts +++ b/packages/electron-trpc/src/main/createIPCHandler.ts @@ -6,6 +6,8 @@ import type { BrowserWindow, IpcMainInvokeEvent } from 'electron'; import { handleIPCOperation } from './handleIPCOperation'; import { ELECTRON_TRPC_CHANNEL } from '../constants'; +type Awaitable = T | Promise; + class IPCHandler { #windows: BrowserWindow[]; @@ -14,7 +16,7 @@ class IPCHandler { router, windows = [], }: { - createContext?: () => Promise>; + createContext?: () => Awaitable>; router: TRouter; windows?: BrowserWindow[]; }) {