import { Evogram } from '../Client'; import { BusinessConnectionContext, BusinessMessagesDeletedContext, CallbackQueryContext, ChatJoinRequestContext, ChosenInlineResultContext, InlineQueryContext, MessageContext, PollAnswerContext, PollContext, ServiceMessage, ShippingQueryContext } from '../migrated'; import { Polling } from '../transports'; import { TelegramChatBoostRemoved, TelegramChatBoostUpdated, TelegramChatMemberUpdated, TelegramMessageReactionCountUpdated, TelegramMessageReactionUpdated, TelegramPreCheckoutQuery, TelegramUpdateType } from '../types'; export type UpdateHandler = (data: { context: T; client: Evogram; }) => any; export type UpdateHandlerMap = { [updateName in TelegramUpdateType]?: UpdateHandler[]; }; export declare class Updates { private client; constructor(client: Evogram); handlers: UpdateHandlerMap; polling: Polling; /** * Method for registering update handlers * @param {TelegramUpdateType} update Name of the update to be processed * @param {TelegramUpdateType} handler Callback function, which will be called on a new update * @return {Updates} Return this * * @example * client.updates.on("message", message => { * message.send("Hello, world!"); * }); */ on(update: 'message' | 'edited_message' | 'channel_post' | 'edited_channel_post' | 'business_message' | 'edited_business_message', handler: UpdateHandler): this; on(update: 'service_message', handler: UpdateHandler): this; on(update: 'business_connection', handler: UpdateHandler): this; on(update: 'deleted_business_messages', handler: UpdateHandler): this; on(update: 'message_reaction', handler: UpdateHandler): this; on(update: 'message_reaction_count', handler: UpdateHandler): this; on(update: 'inline_query', handler: UpdateHandler): this; on(update: 'chosen_inline_result', handler: UpdateHandler): this; on(update: 'callback_query', handler: UpdateHandler): this; on(update: 'shipping_query', handler: UpdateHandler): this; on(update: 'pre_checkout_query', handler: UpdateHandler): this; on(update: 'poll', handler: UpdateHandler): this; on(update: 'poll_answer', handler: UpdateHandler): this; on(update: 'my_chat_member' | 'chat_member', handler: UpdateHandler): this; on(update: 'chat_join_request', handler: UpdateHandler): this; on(update: 'chat_boost', handler: UpdateHandler): this; on(update: 'removed_chat_boost', handler: UpdateHandler): this; }