import { type Context as BaseContext } from 'grammy'; import type { RegExpLike } from './generic-types.ts'; import type { MenuLike } from './menu-like.ts'; import { type SendMenuFunc } from './send-menu.ts'; export type Options = { /** * Function which is used to send and update the menu. * * Defaults to `editMenuOnContext` */ readonly sendMenu?: SendMenuFunc; }; export declare class MenuMiddleware { #private; readonly rootTrigger: string | RegExpLike; constructor(rootTrigger: string | RegExpLike, rootMenu: MenuLike, options?: Options); /** * Send the root menu to the context. Shortcut for `replyMenuToContext(…)` * @param context Context where the root menu should be replied to * @example * const menuMiddleware = new MenuMiddleware('/', menuTemplate) * bot.command('start', async ctx => menuMiddleware.replyToContext(ctx)) */ replyToContext(context: Context, path?: string | RegExpLike): Promise; /** * The tree structure can be shown for debugging purposes. * You can take a look on the menu you created. */ tree(): string; middleware(): (context: Context, next: () => Promise) => void; }