Skip to content

Commit

Permalink
Revert "fix(RequestInterface): make types with VS Code Typeahead and …
Browse files Browse the repository at this point in the history
…TypeScript 4.7 (#399)"

This reverts commit b5fa0ce.
  • Loading branch information
kachick committed Jun 28, 2022
1 parent 5ef5f42 commit a1b9cd5
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/RequestInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,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`.
*/
<R extends keyof Endpoints>(
route: R,
options?: Endpoints[R]["parameters"] & RequestParameters
): Promise<Endpoints[R]["response"]>;

/**
* Sends a request based on endpoint options
*
* @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 a1b9cd5

Please sign in to comment.