import { MaybePromise, Peer } from '@mtcute/core'; import { BusinessMessageContext } from '../context/business-message.js'; import { CallbackQueryContext, MessageContext } from '../context/index.js'; /** * Function that determines how the state key is derived. * * The key is additionally prefixed with current scene, if any. * * @param msg Message or callback from which to derive the key * @param scene Current scene UID, or `null` if none */ export type StateKeyDelegate = (upd: MessageContext | BusinessMessageContext | CallbackQueryContext | Peer) => MaybePromise; /** * Default state key delegate. * * Derives key as follows: * - If private chat, `msg.chat.id` * - If group chat, `msg.chat.id + '_' + msg.sender.id` * - If channel, `msg.chat.id` * - If non-inline callback query: * - If in private chat (i.e. `upd.chatType === 'user'`), `upd.user.id` * - If in group/channel/supergroup (i.e. `upd.chatType !== 'user'`), `upd.chatId + '_' + upd.user.id` */ export declare const defaultStateKeyDelegate: StateKeyDelegate;