From ebfc564961e9dbef7da534047e7e1d4c2a759ce7 Mon Sep 17 00:00:00 2001 From: slinkydeveloper Date: Wed, 24 Jan 2024 12:59:53 +0100 Subject: [PATCH] Fix type inference. --- src/types/router.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/types/router.ts b/src/types/router.ts index d70aded7..56ca1450 100644 --- a/src/types/router.ts +++ b/src/types/router.ts @@ -11,7 +11,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { RpcContext } from "../restate_context"; +import { CombineablePromise, RpcContext } from "../restate_context"; import { Event } from "../types/types"; // ----------- generics ------------------------------------------------------- @@ -26,7 +26,11 @@ type WithoutRpcContext = F extends ( : never; export type Client = { - [K in keyof M as M[K] extends never ? never : K]: M[K]; + [K in keyof M as M[K] extends never ? never : K]: M[K] extends ( + ...args: infer P + ) => PromiseLike + ? (...args: P) => CombineablePromise + : never; }; export type SendClient = {