Skip to content

Commit

Permalink
fix(client): invalid suggestion for client options when call (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
unnoq authored Feb 18, 2025
1 parent 452a5e1 commit 3cb80cf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/client/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ export type ClientOptions<TClientContext extends ClientContext> =
& { signal?: AbortSignal, lastEventId?: string | undefined }
& (Record<never, never> extends TClientContext ? { context?: TClientContext } : { context: TClientContext })

export type ClientRest<TClientContext extends ClientContext, TInput> =
| [input: TInput, options: ClientOptions<TClientContext>]
| (Record<never, never> extends TClientContext ? (undefined extends TInput ? [input?: TInput] : [input: TInput]) : never)
export type ClientRest<TClientContext extends ClientContext, TInput> = Record<never, never> extends TClientContext
? undefined extends TInput
? [input?: TInput, options?: ClientOptions<TClientContext>]
: [input: TInput, options?: ClientOptions<TClientContext>]
: [input: TInput, options: ClientOptions<TClientContext>]

export type ClientPromiseResult<TOutput, TError extends Error> = Promise<TOutput> & { __error?: { type: TError } }

Expand Down

0 comments on commit 3cb80cf

Please sign in to comment.