import type TelegramBot from 'node-telegram-bot-api'; import { type Question } from './questions'; import { Context, OnFinishFn } from './state'; import { type Options } from './config'; interface Dialog { /** Start dialog session with user * @param chatId ID of chat with target user * @param callback The callback which will be called when dialog session will be completed * @returns Promise which will be resolved as an object with named user's answers */ start(chatId: TelegramBot.ChatId, callback?: OnFinishFn, options?: Options): Promise; /** Break dialog session for user * @param chatId ID of chat of connected user * @param message Optional message which will be shown in a chat */ break(chatId: TelegramBot.ChatId, message?: string): Promise; } /** Class to make dialogs in Telegram bots*/ export declare class Dialogs { private bot; private state; private config; constructor(bot: TelegramBot, options?: Options); /** Create dialog * @param questions A list of questions */ create(questions: Question[], options?: Options): Dialog; /** Subscribe on messages to bot */ private messageHandler; /** Subscribe on callbacks */ private callbackHandler; /** handle user's answer */ private handleAnswer; /** handle callback */ private handleCallback; /** pick next question and send it */ private pickNextQuestion; /** Resend question once again */ private resendQuestion; /** Send current question to user */ private sendQuestion; } export {};