Skip to content

Commit 3c030ca

Browse files
Fix type inference.
1 parent 037e69b commit 3c030ca

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/types/router.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/* eslint-disable @typescript-eslint/no-explicit-any */
1313

14-
import { RpcContext } from "../restate_context";
14+
import { CombineablePromise, RpcContext } from "../restate_context";
1515
import { Event } from "../types/types";
1616

1717
// ----------- generics -------------------------------------------------------
@@ -26,7 +26,11 @@ type WithoutRpcContext<F> = F extends (
2626
: never;
2727

2828
export type Client<M> = {
29-
[K in keyof M as M[K] extends never ? never : K]: M[K];
29+
[K in keyof M as M[K] extends never ? never : K]: M[K] extends (
30+
...args: infer P
31+
) => PromiseLike<infer O>
32+
? (...args: P) => CombineablePromise<O>
33+
: never;
3034
};
3135

3236
export type SendClient<M> = {

0 commit comments

Comments
 (0)