import type { SurfaceAdapterContext } from '../types.js'; /** * Capabilities an ingress mode lends to update handling. * * Both the webhook route and the getUpdates poller process updates through the * SAME function below; this is the only thing that differs between them. The * poller passes a live Bot API sender; a webhook caller may pass one too, and * omits it only where no bot token is resolvable. */ export interface TelegramUpdateDeps { readonly sendMessage?: ((input: { readonly chatId: string; readonly text: string; readonly threadId?: string | undefined; }) => Promise) | undefined; } /** * HTTP entry point for webhook mode. * * Everything here is webhook-SPECIFIC: the shared-secret header check and the * request body read. Telegram sends the secret token only on webhook POSTs, so * this check must not sit in the shared path, a polled update carries no * headers and would be rejected by it. */ export declare function handleTelegramSurfaceWebhook(req: Request, context: SurfaceAdapterContext, deps?: TelegramUpdateDeps): Promise; /** * Handle one Telegram Update object, policy, route binding, standard bot * commands, control commands, and task dispatch. * * Shared verbatim by webhook mode and getUpdates polling so the two can never * drift into different behaviour for the same message. The Response return * shape is what the webhook route replies with; the poller reads it only for * logging. */ export declare function processTelegramUpdate(payload: Record, context: SurfaceAdapterContext, deps?: TelegramUpdateDeps): Promise; //# sourceMappingURL=index.d.ts.map