@@ -151,7 +151,7 @@ export interface Middleware {
151151}
152152
153153/** This type helper makes the 2nd function param required if params/requestBody are required; otherwise, optional */
154- export type MaybeOptionalInit < Params extends Record < HttpMethod , { } > , Location extends keyof Params > = RequiredKeysOf <
154+ export type MaybeOptionalInit < Params , Location extends keyof Params > = RequiredKeysOf <
155155 FetchOptions < FilterKeys < Params , Location > >
156156> extends never
157157 ? FetchOptions < FilterKeys < Params , Location > > | undefined
@@ -174,7 +174,7 @@ export type ClientMethod<
174174 ...init : InitParam < Init >
175175) => Promise < FetchResponse < Paths [ Path ] [ Method ] , Init , Media > > ;
176176
177- export type ClientForPath < PathInfo extends Record < HttpMethod , { } > , Media extends MediaType > = {
177+ export type ClientForPath < PathInfo , Media extends MediaType > = {
178178 [ Method in keyof PathInfo as Uppercase < string & Method > ] : < Init extends MaybeOptionalInit < PathInfo , Method > > (
179179 ...init : InitParam < Init >
180180 ) => Promise < FetchResponse < PathInfo [ Method ] , Init , Media > > ;
@@ -221,10 +221,7 @@ export default function createClient<Paths extends {}, Media extends MediaType =
221221 clientOptions ?: ClientOptions ,
222222) : Client < Paths , Media > ;
223223
224- export type PathBasedClient <
225- Paths extends Record < string , Record < HttpMethod , { } > > ,
226- Media extends MediaType = MediaType ,
227- > = {
224+ export type PathBasedClient < Paths , Media extends MediaType = MediaType > = {
228225 [ Path in keyof Paths ] : ClientForPath < Paths [ Path ] , Media > ;
229226} ;
230227
0 commit comments