import { Api } from './api';
import { Composer } from './core/composer';
import { Context } from './core/context';
import { BotInfo, ClientOptions, UpdateType } from './core/network/api';
import { type WebhookOptions } from './core/network/webhook';
import type { MaybePromise } from './core/types';
type BotConfig<Ctx extends Context> = {
    clientOptions?: ClientOptions;
    contextType: new (...args: ConstructorParameters<typeof Context>) => Ctx;
};
type PollingLaunchOptions = Partial<{
    allowedUpdates: UpdateType[];
    retry: boolean;
}>;
type WebhookLaunchOptions = WebhookOptions & {
    allowedUpdates?: UpdateType[];
};
type StartPollingConfig = {
    mode: 'polling';
    options?: PollingLaunchOptions;
};
type StartWebhookConfig = {
    mode: 'webhook';
    options: WebhookLaunchOptions;
};
type StartConfig = StartPollingConfig | StartWebhookConfig;
export declare class Bot<Ctx extends Context = Context> extends Composer<Ctx> {
    api: Api;
    private readonly token;
    private abortController;
    botInfo?: BotInfo;
    private polling?;
    private webhook?;
    private pollingIsStarted;
    private webhookIsStarted;
    private config;
    constructor(token: string, config?: Partial<BotConfig<Ctx>>);
    private handleError;
    catch(handler: (err: unknown, ctx: Ctx) => MaybePromise<void>): this;
    start: (config?: StartConfig) => Promise<void>;
    startPolling: (options?: PollingLaunchOptions) => Promise<void>;
    webhookCallback(options: WebhookLaunchOptions): (req: import("node:http").IncomingMessage, res: import("node:http").ServerResponse) => void;
    createWebhook: (options: WebhookLaunchOptions) => Promise<(req: import("node:http").IncomingMessage, res: import("node:http").ServerResponse) => void>;
    startWebhook: (options: WebhookLaunchOptions) => Promise<void>;
    /** @deprecated Используйте stopPolling. В ближайших версиях будет удалено. */
    stop: () => void;
    stopPolling: () => void;
    stopWebhook: () => Promise<void>;
    private handleUpdate;
}
export {};
