1- import type { InvokeFunction , InvokeMethod } from "../client" ;
1+ import type { InvokeFunction , InvokeMethod , InvokeMethodOptionalArgs } from "../client" ;
22
33/**
44 * @public
@@ -59,8 +59,10 @@ export type RecursiveRequired<T> = T extends Function
5959 */
6060type NarrowClientIOTypes < ClientType extends object > = {
6161 [ key in keyof ClientType ] : [ ClientType [ key ] ] extends [
62- InvokeFunction < infer InputTypes , infer OutputTypes , infer ConfigType >
62+ InvokeMethodOptionalArgs < infer FunctionInputTypes , infer FunctionOutputTypes >
6363 ]
64+ ? InvokeMethodOptionalArgs < NoUndefined < FunctionInputTypes > , NoUndefined < FunctionOutputTypes > >
65+ : [ ClientType [ key ] ] extends [ InvokeFunction < infer InputTypes , infer OutputTypes , infer ConfigType > ]
6466 ? InvokeFunction < NoUndefined < InputTypes > , NoUndefined < OutputTypes > , ConfigType >
6567 : [ ClientType [ key ] ] extends [ InvokeMethod < infer FunctionInputTypes , infer FunctionOutputTypes > ]
6668 ? InvokeMethod < NoUndefined < FunctionInputTypes > , NoUndefined < FunctionOutputTypes > >
@@ -74,8 +76,10 @@ type NarrowClientIOTypes<ClientType extends object> = {
7476 */
7577type UncheckedClientOutputTypes < ClientType extends object > = {
7678 [ key in keyof ClientType ] : [ ClientType [ key ] ] extends [
77- InvokeFunction < infer InputTypes , infer OutputTypes , infer ConfigType >
79+ InvokeMethodOptionalArgs < infer FunctionInputTypes , infer FunctionOutputTypes >
7880 ]
81+ ? InvokeMethodOptionalArgs < NoUndefined < FunctionInputTypes > , RecursiveRequired < FunctionOutputTypes > >
82+ : [ ClientType [ key ] ] extends [ InvokeFunction < infer InputTypes , infer OutputTypes , infer ConfigType > ]
7983 ? InvokeFunction < NoUndefined < InputTypes > , RecursiveRequired < OutputTypes > , ConfigType >
8084 : [ ClientType [ key ] ] extends [ InvokeMethod < infer FunctionInputTypes , infer FunctionOutputTypes > ]
8185 ? InvokeMethod < NoUndefined < FunctionInputTypes > , RecursiveRequired < FunctionOutputTypes > >
0 commit comments