@@ -199,13 +199,24 @@ export type ClientMethod<
199199 ...init : InitParam < Init >
200200) => Promise < FetchResponse < Paths [ Path ] [ Method ] , Init , Media > > ;
201201
202+ export type ClientRequestMethod < Paths extends Record < string , Record < HttpMethod , { } > > , Media extends MediaType > = <
203+ Method extends HttpMethod ,
204+ Path extends PathsWithMethod < Paths , Method > ,
205+ Init extends MaybeOptionalInit < Paths [ Path ] , Method > ,
206+ > (
207+ method : Method ,
208+ url : Path ,
209+ ...init : InitParam < Init >
210+ ) => Promise < FetchResponse < Paths [ Path ] [ Method ] , Init , Media > > ;
211+
202212export type ClientForPath < PathInfo extends Record < string | number , any > , Media extends MediaType > = {
203213 [ Method in keyof PathInfo as Uppercase < string & Method > ] : < Init extends MaybeOptionalInit < PathInfo , Method > > (
204214 ...init : InitParam < Init >
205215 ) => Promise < FetchResponse < PathInfo [ Method ] , Init , Media > > ;
206216} ;
207217
208218export interface Client < Paths extends { } , Media extends MediaType = MediaType > {
219+ request : ClientRequestMethod < Paths , Media > ;
209220 /** Call a GET endpoint */
210221 GET : ClientMethod < Paths , "get" , Media > ;
211222 /** Call a PUT endpoint */
0 commit comments