From 6170abaeb94df0f8df341dd89bf3952d2fa22ba4 Mon Sep 17 00:00:00 2001 From: Aleksey Levenstein Date: Mon, 27 Jun 2022 08:23:58 +0300 Subject: [PATCH] fix(RequestInterface): restore catch all overload --- src/RequestInterface.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/RequestInterface.ts b/src/RequestInterface.ts index aae4e930f..e1b247025 100644 --- a/src/RequestInterface.ts +++ b/src/RequestInterface.ts @@ -34,7 +34,14 @@ export interface RequestInterface { * @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>; + ( + route: keyof Endpoints | R, + options?: R extends keyof Endpoints + ? Endpoints[R]["parameters"] & RequestParameters + : RequestParameters + ): R extends keyof Endpoints + ? Promise + : Promise>; /** * Returns a new `request` with updated route and parameters