@@ -151,7 +151,7 @@ export interface Middleware {
151
151
}
152
152
153
153
/** 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 <
155
155
FetchOptions < FilterKeys < Params , Location > >
156
156
> extends never
157
157
? FetchOptions < FilterKeys < Params , Location > > | undefined
@@ -174,7 +174,7 @@ export type ClientMethod<
174
174
...init : InitParam < Init >
175
175
) => Promise < FetchResponse < Paths [ Path ] [ Method ] , Init , Media > > ;
176
176
177
- export type ClientForPath < PathInfo extends Record < HttpMethod , { } > , Media extends MediaType > = {
177
+ export type ClientForPath < PathInfo , Media extends MediaType > = {
178
178
[ Method in keyof PathInfo as Uppercase < string & Method > ] : < Init extends MaybeOptionalInit < PathInfo , Method > > (
179
179
...init : InitParam < Init >
180
180
) => Promise < FetchResponse < PathInfo [ Method ] , Init , Media > > ;
@@ -221,10 +221,7 @@ export default function createClient<Paths extends {}, Media extends MediaType =
221
221
clientOptions ?: ClientOptions ,
222
222
) : Client < Paths , Media > ;
223
223
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 > = {
228
225
[ Path in keyof Paths ] : ClientForPath < Paths [ Path ] , Media > ;
229
226
} ;
230
227
0 commit comments