/** A raw Bot API update. Only `update_id` is load-bearing here; everything else passes through. */ export interface TelegramUpdate { update_id: number; [key: string]: unknown; } export interface QueuePeek { /** The registered webhook URL, or null when the token polls (getUpdates works). */ webhookUrl: string | null; /** Updates waiting server-side (`getWebhookInfo.pending_update_count`). */ pending: number; /** The first updates in the queue, verbatim. Empty when a webhook is registered (polling * would 409) — the count above still tells the story. */ head: TelegramUpdate[]; } export interface DrainResult { drained: number; batches: number; lastUpdateId?: number; } export interface UpdateQueueOptions { token: string; /** Transport override for tests. Defaults to global fetch. */ fetch?: typeof globalThis.fetch; /** Bot API origin override (local Bot API servers). */ apiRoot?: string; } /** Peek/drain/count over one bot token's pending-update queue. See the module doc for the * destroy-on-read contract each verb upholds. */ export declare function updateQueue(options: UpdateQueueOptions): { /** Raw `getWebhookInfo`. */ webhookInfo(): Promise>; /** Updates waiting server-side, without touching any of them. */ count(): Promise; /** Non-destructive look: webhook state, pending count, and the first `limit` updates, * verbatim. Confirms NOTHING — repeat as often as you like. */ peek({ limit }?: { limit?: number; }): Promise; /** * Drain the queue, one-chance-safe. `onBatch` receives each raw batch and is AWAITED * before the offset advances — persist there, because the next `getUpdates` call is the * confirmation that destroys the batch server-side. An `onBatch` throw aborts the drain * with nothing confirmed beyond what `onBatch` already accepted; re-running resumes at * the unconfirmed tail. Ends after `quietPolls` consecutive empty long-polls. */ drain({ onBatch, limit, timeoutS, quietPolls, }: { onBatch: (updates: TelegramUpdate[]) => void | Promise; limit?: number; timeoutS?: number; quietPolls?: number; }): Promise; }; //# sourceMappingURL=updates.d.ts.map