import type { ResolvedWebhookOptions } from './options.js'; export interface ParsedRequest { method: string; headers: Record; body: Record | undefined; } export interface WebhookResponse { status: number; body: string; contentType: string; } export interface WebhookHandlerDeps { /** dispatches a raw update through the configured chain */ dispatch: (raw: Record) => Promise; /** registers an in-flight promise so `shutdown()` can drain it */ trackInFlight: (p: Promise) => void; /** ensures `tg.start()` has resolved before dispatch */ ensureStarted: () => Promise; /** routes uncaught dispatch errors through the configured funnel */ reportError: (err: Error, raw: Record) => void; } export type WebhookHandler = (req: ParsedRequest) => Promise; export declare function createHandler(options: ResolvedWebhookOptions, deps: WebhookHandlerDeps): WebhookHandler; //# sourceMappingURL=handler.d.ts.map