import { BusinessCallbackQuery, CallbackQuery, InlineCallbackQuery, MaybeArray, MaybePromise } from '@mtcute/core'; import { UpdateFilter } from './filters/types.js'; /** * Callback data builder, inspired by [aiogram](https://github.com/aiogram/aiogram). * * This can be used to simplify management of different callbacks. * * [Learn more in the docs](/guide/topics/keyboards.html#callback-data-builders) */ export declare class CallbackDataBuilder { prefix: string; private readonly _fields; sep: string; /** * @param prefix Prefix for the data. Use something unique across your bot. * @param fields Field names in the order they will be serialized. */ constructor(prefix: string, ...fields: T[]); /** * Build a callback data string * * @param obj Object containing the data */ build(obj: Record): string; /** * Parse callback data to object * * @param data Callback data as string * @param safe If `true`, will return `null` instead of throwing on invalid data */ parse(data: string, safe?: false): Record; parse(data: string, safe: true): Record | null; /** * Create a filter for this callback data. * * You can either pass an object with field names as keys and values as strings or regexes, * which will be compiled to a RegExp, or a function that will be called with the parsed data. * Note that the strings will be passed to `RegExp` **directly**, so you may want to escape them. * * When using a function, you can either return a boolean, or an object with field names as keys * and values as strings or regexes. In the latter case, the resulting object will be matched * against the parsed data the same way as if you passed it directly. * * @param params */ filter(params?: ((upd: Update, parsed: Record) => MaybePromise>> | boolean>) | Partial>>): UpdateFilter; }>; }