From 3b4d2e282dfd7e561dbb0f7a2c4a910aafdc669a Mon Sep 17 00:00:00 2001 From: winstxnhdw Date: Tue, 14 May 2024 17:31:44 +0800 Subject: [PATCH] chore: remove `SupportedFrameworks` --- src/convenience/frameworks.ts | 6 ------ src/convenience/webhook.ts | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/convenience/frameworks.ts b/src/convenience/frameworks.ts index 8289b4d9..9cb88f34 100644 --- a/src/convenience/frameworks.ts +++ b/src/convenience/frameworks.ts @@ -16,12 +16,6 @@ const unauthorized = () => statusText: WRONG_TOKEN_ERROR, }); -/** - * HTTP Web frameworks for which grammY provides compatible callback out of the - * box. - */ -export type SupportedFrameworks = keyof typeof adapters; - /** * Abstraction over a request-response cycle, providing access to the update, as * well as a mechanism for responding to the request and to end it. diff --git a/src/convenience/webhook.ts b/src/convenience/webhook.ts index e0c966b6..aa275547 100644 --- a/src/convenience/webhook.ts +++ b/src/convenience/webhook.ts @@ -7,7 +7,6 @@ import { type Update } from "../types.ts"; import { adapters as nativeAdapters, type FrameworkAdapter, - type SupportedFrameworks, } from "./frameworks.ts"; const debugErr = d("grammy:error"); @@ -78,7 +77,7 @@ export function webhookCallback< : NonNullable["handlerReturn"]>; export function webhookCallback( bot: Bot, - adapter: SupportedFrameworks | FrameworkAdapter = defaultAdapter, + adapter: keyof typeof nativeAdapters | FrameworkAdapter = defaultAdapter, onTimeout: | WebhookOptions | WebhookOptions["onTimeout"] = "throw",