Skip to content

Commit

Permalink
Fix type inference.
Browse files Browse the repository at this point in the history
  • Loading branch information
slinkydeveloper committed Jan 24, 2024
1 parent b18d775 commit efc13d2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/types/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 -------------------------------------------------------
Expand All @@ -26,7 +26,11 @@ type WithoutRpcContext<F> = F extends (
: never;

export type Client<M> = {
[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<infer O>
? (...args: P) => CombineablePromise<O>
: never;
};

export type SendClient<M> = {
Expand Down

0 comments on commit efc13d2

Please sign in to comment.