File tree 1 file changed +4
-5
lines changed
packages/openapi-fetch/src
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -169,17 +169,16 @@ export interface Middleware {
169
169
onResponse ?: typeof onResponse ;
170
170
}
171
171
172
+ type PathMethods = Partial < Record < HttpMethod , { } > > ;
173
+
172
174
/** This type helper makes the 2nd function param required if params/requestBody are required; otherwise, optional */
173
- export type MaybeOptionalInit <
174
- P extends Record < HttpMethod , { } > ,
175
- M extends keyof P ,
176
- > =
175
+ export type MaybeOptionalInit < P extends PathMethods , M extends keyof P > =
177
176
HasRequiredKeys < FetchOptions < FilterKeys < P , M > > > extends never
178
177
? [ ( FetchOptions < FilterKeys < P , M > > | undefined ) ?]
179
178
: [ FetchOptions < FilterKeys < P , M > > ] ;
180
179
181
180
export type ClientMethod <
182
- Paths extends Record < string , Record < HttpMethod , { } > > ,
181
+ Paths extends Record < string , PathMethods > ,
183
182
M extends HttpMethod ,
184
183
> = <
185
184
P extends PathsWithMethod < Paths , M > ,
You can’t perform that action at this time.
0 commit comments