import type { Api, Context as BaseContext } from 'grammy'; import type { Message } from 'grammy/types'; import type { MenuLike } from './menu-like.ts'; /** Generic Method which is able to send a menu to a context (given a path where it is) */ export type SendMenuFunc = (menu: MenuLike, context: Context, path: string) => Promise; /** * Method which is able to send a menu to a chat. * Generated via `generateSendMenuToChatFunction`. */ export type SendMenuToChatFunction = (chatId: string | number, context: Context, other?: Readonly>) => Promise; /** * Method which is able to edit a message in a chat into a menu. * Generated via `generateEditMessageIntoMenuFunction`. */ export type EditMessageIntoMenuFunction = (chatId: number | string, messageId: number, context: Context, other?: Readonly>) => Promise; /** * Reply a menu to a context as a new message * @param menu menu to be shown * @param context current grammY context to reply the menu to it * @param path path of the menu * @param other optional additional options */ export declare function replyMenuToContext(menu: MenuLike, context: Context, path: string, other?: Readonly>): Promise; /** * Edit the context into the menu. If thats not possible the current message is deleted and a new message is replied * @param menu menu to be shown * @param context current grammY context to edit the menu into * @param path path of the menu * @param other optional additional options */ export declare function editMenuOnContext(menu: MenuLike, context: Context, path: string, other?: Readonly>): Promise; /** * Delete the message on the context. * If thats not possible the reply markup (keyboard) is removed. The user can not press any buttons on that old message. * @param context context of the message to be deleted */ export declare function deleteMenuFromContext(context: Context): Promise; /** * Deletes to menu of the current context and replies a new one ensuring the menu is at the end of the chat. * @param menu menu to be shown * @param context current grammY context to send the menu to * @param path path of the menu * @param other optional additional options */ export declare function resendMenuToContext(menu: MenuLike, context: Context, path: string, other?: Readonly>): Promise; /** * Generate a function to send the menu towards a chat from external events * @param telegram The Telegram object to do the API calls with later on * @param menu menu to be shown * @param path path of the menu */ export declare function generateSendMenuToChatFunction(telegram: Api, menu: MenuLike, path: string): SendMenuToChatFunction; /** * Edit the message into the the menu. * This fails when the current message is not compatible with the menu (you cant edit a media message into a text message and vice versa) * @param telegram The Telegram object to do the API calls with later on * @param menu menu to be shown * @param path path of the menu */ export declare function generateEditMessageIntoMenuFunction(telegram: Api, menu: MenuLike, path: string): EditMessageIntoMenuFunction;