@@ -150,7 +150,7 @@ export interface Middleware {
150
150
}
151
151
152
152
/** This type helper makes the 2nd function param required if params/requestBody are required; otherwise, optional */
153
- export type MaybeOptionalInit < Params extends Record < HttpMethod , { } > , Location extends keyof Params > = HasRequiredKeys <
153
+ export type MaybeOptionalInit < Params , Location extends keyof Params > = HasRequiredKeys <
154
154
FetchOptions < FilterKeys < Params , Location > >
155
155
> extends never
156
156
? FetchOptions < FilterKeys < Params , Location > > | undefined
@@ -173,7 +173,7 @@ export type ClientMethod<
173
173
...init : InitParam < Init >
174
174
) => Promise < FetchResponse < Paths [ Path ] [ Method ] , Init , Media > > ;
175
175
176
- export type ClientForPath < PathInfo extends Record < HttpMethod , { } > , Media extends MediaType > = {
176
+ export type ClientForPath < PathInfo , Media extends MediaType > = {
177
177
[ Method in keyof PathInfo as Uppercase < string & Method > ] : < Init extends MaybeOptionalInit < PathInfo , Method > > (
178
178
...init : InitParam < Init >
179
179
) => Promise < FetchResponse < PathInfo [ Method ] , Init , Media > > ;
@@ -220,10 +220,7 @@ export default function createClient<Paths extends {}, Media extends MediaType =
220
220
clientOptions ?: ClientOptions ,
221
221
) : Client < Paths , Media > ;
222
222
223
- export type PathBasedClient <
224
- Paths extends Record < string , Record < HttpMethod , { } > > ,
225
- Media extends MediaType = MediaType ,
226
- > = {
223
+ export type PathBasedClient < Paths , Media extends MediaType = MediaType > = {
227
224
[ Path in keyof Paths ] : ClientForPath < Paths [ Path ] , Media > ;
228
225
} ;
229
226
0 commit comments