/**
 * Minimal Telegram Bot API client using raw fetch().
 * Supports long polling, markdown messages, inline keyboards, and message splitting.
 */
export interface TelegramConfig {
    botToken: string;
    /** Only accept messages from this Telegram user ID. */
    allowedUserId: number;
}
export interface TelegramUpdate {
    update_id: number;
    message?: {
        message_id: number;
        from: {
            id: number;
            first_name: string;
        };
        chat: {
            id: number;
            type: string;
            title?: string;
        };
        text?: string;
        voice?: {
            file_id: string;
            duration: number;
            mime_type?: string;
            file_size?: number;
        };
    };
    callback_query?: {
        id: string;
        from: {
            id: number;
        };
        message: {
            chat: {
                id: number;
            };
        };
        data: string;
    };
    my_chat_member?: {
        chat: {
            id: number;
            type: string;
            title?: string;
        };
        from: {
            id: number;
        };
        new_chat_member: {
            status: string;
        };
    };
}
export interface InlineButton {
    text: string;
    callback_data: string;
}
/** Incoming message with chat context. */
export interface TelegramMessage {
    text: string;
    chatId: number;
    chatType: "private" | "group" | "supergroup" | "channel";
    chatTitle?: string;
}
/** Incoming voice note with chat context. */
export interface TelegramVoiceMessage {
    fileId: string;
    duration: number;
    chatId: number;
    chatType: "private" | "group" | "supergroup" | "channel";
    chatTitle?: string;
}
export declare class TelegramBot {
    private token;
    private allowedUserId;
    private offset;
    private running;
    private onMessage;
    private onVoiceMessage;
    private onCallback;
    private onBotAdded;
    private onBotRemoved;
    constructor(config: TelegramConfig);
    /** Register handler for incoming text messages. */
    onText(handler: (msg: TelegramMessage) => void): void;
    /** Register handler for incoming voice notes. */
    onVoice(handler: (msg: TelegramVoiceMessage) => void): void;
    /** Register handler for inline keyboard button presses. */
    onCallbackQuery(handler: (data: string, chatId: number) => void): void;
    /** Register handler for when the bot is added to a group. */
    onAddedToGroup(handler: (chatId: number, chatTitle?: string) => void): void;
    /** Register handler for when the bot is removed from a group. */
    onRemovedFromGroup(handler: (chatId: number) => void): void;
    /** Start long polling. Blocks until stop() is called. */
    start(): Promise<void>;
    /** Stop long polling. */
    stop(): void;
    /** Send a text message to a specific chat. Converts markdown and splits long messages. */
    send(chatId: number, text: string, buttons?: InlineButton[][]): Promise<void>;
    /** Send a plain text message (no markdown parsing) to a specific chat. */
    sendPlain(chatId: number, text: string): Promise<void>;
    /** Send a typing indicator to a specific chat. */
    sendTyping(chatId: number): Promise<void>;
    /** Get a direct download URL for a Telegram file. */
    getFileUrl(fileId: string): Promise<string>;
    private getUpdates;
    private handleUpdate;
    private apiCall;
}
//# sourceMappingURL=telegram.d.ts.map