Skip to content

Commit

Permalink
fix(RequestInterface): restore catch all overload
Browse files Browse the repository at this point in the history
  • Loading branch information
levenleven authored and kachick committed Jun 27, 2022
1 parent 041199d commit b488f9c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/RequestInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@ export interface RequestInterface<D extends object = object> {
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
* @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
*/
(route: Route, options?: RequestParameters): Promise<OctokitResponse<any>>;
<R extends Route>(
route: keyof Endpoints | R,
options?: R extends keyof Endpoints
? Endpoints[R]["parameters"] & RequestParameters
: RequestParameters
): R extends keyof Endpoints
? Promise<Endpoints[R]["response"]>
: Promise<OctokitResponse<any>>;

/**
* Returns a new `request` with updated route and parameters
Expand Down

0 comments on commit b488f9c

Please sign in to comment.