import type { TelegramBot } from "./telegram.js";
import type { GetUpdatesParams } from "./types/schemas.js";
export interface PollingOptions {
    /** Polling interval in milliseconds between successive `getUpdates` calls. */
    interval?: number;
    /** Whether to start polling automatically when the bot is constructed. */
    autoStart?: boolean;
    /** Parameters forwarded to `getUpdates`. */
    params?: GetUpdatesParams;
    /** @deprecated Use `params.timeout` instead. */
    timeout?: number;
}
export interface PollingStartOptions {
    restart?: boolean;
}
export interface PollingStopOptions {
    cancel?: boolean;
    reason?: string;
}
interface InternalParams extends GetUpdatesParams {
    offset: number;
    timeout: number;
}
export declare class TelegramBotPolling {
    private readonly bot;
    readonly interval: number;
    readonly params: InternalParams;
    private _abort;
    private _abortController?;
    private _activeRequest;
    private _pollingTimeout;
    private _running;
    constructor(bot: TelegramBot, options?: PollingOptions);
    /**
     * Start polling. If polling is already running, the call resolves immediately
     * unless `restart: true` is passed (in which case the previous loop is cancelled
     * before a fresh one is started).
     */
    start(options?: PollingStartOptions): Promise<void>;
    /**
     * Stop polling. Resolves once the current `getUpdates` call has completed.
     */
    stop(options?: PollingStopOptions): Promise<void>;
    isPolling(): boolean;
    private _emitError;
    private _scheduleNext;
    private _loop;
    private _poll;
    private _getUpdates;
}
export {};
//# sourceMappingURL=polling.d.ts.map