import type * as Interfaces from '@puregram/api'; import type { ButtonStyleParams } from './types.js'; /** keyboard builder */ export declare class KeyboardBuilder { private rows; private currentRow; private isOneTime; private isResized; private isSelective; private isPersistent; private placeholder?; /** whether the builder has no buttons (committed rows + current row) */ get isEmpty(): boolean; /** number of rows that will be emitted (committed rows + current row if non-empty) */ get rowCount(): number; /** total number of buttons across all rows including the in-progress row */ get length(): number; /** construct a `KeyboardBuilder` from an existing `ReplyKeyboardMarkup` JSON */ static from(markup: Interfaces.TelegramReplyKeyboardMarkup): KeyboardBuilder; /** * generate text button * if none of the optional fields are used, * it will be sent as a message when the button is pressed */ textButton(text: string, params?: ButtonStyleParams): this; /** * if specified, pressing the button will open a list of suitable users * tapping on any user will send their identifier to the bot in a "user_shared" * service message. Available in private chats only */ requestUsersButton(text: string, params: Interfaces.TelegramKeyboardButtonRequestUsers & ButtonStyleParams): this; /** * if specified, pressing the button will open a list of suitable chats * tapping on a chat will send its identifier to the bot in a "chat_shared" * service message. Available in private chats only */ requestChatButton(text: string, params: Interfaces.TelegramKeyboardButtonRequestChat & ButtonStyleParams): this; /** * the user's current location will be sent when the button is pressed * * available in private chats only */ requestLocationButton(text: string, params?: ButtonStyleParams): this; /** * the user will be asked to create a poll and send it to the bot * when the button is pressed * * available in private chats only */ requestPollButton(text: string, params?: (Interfaces.TelegramPoll['type'] | { type?: Interfaces.TelegramPoll['type']; } & ButtonStyleParams)): this; /** * the user's phone number will be sent as a contact when * the button is pressed * * available in private chats only */ requestContactButton(text: string, params?: ButtonStyleParams): this; /** * the described Web App will be launched when the button is pressed * the Web App will be able to send a `web_app_data` service message * * available in private chats only */ webAppButton(text: string, url: string, params?: ButtonStyleParams): this; /** save current row of buttons in the general rows */ row(): this; /** * requests clients to hide the keyboard as soon as it's been used. The * keyboard will still be available, but clients will automatically display * the usual letter-keyboard in the chat — the user can press a special * button in the input field to see the custom keyboard again. Defaults to * `false` */ oneTime(oneTime?: boolean): this; /** * requests clients to resize the keyboard vertically for optimal fit (e.g., * make the keyboard smaller if there are just two rows of buttons). Defaults * to `false`, in which case the custom keyboard is always of the same height * as the app's standard keyboard */ resize(resize?: boolean): this; /** use this parameter if you want to show the keyboard to specific users only */ selective(selective?: boolean): this; /** * requests clients to always show the keyboard when the regular keyboard is * hidden. Defaults to `false`, in which case the custom keyboard can be * hidden and opened with a keyboard icon */ persistent(persistent?: boolean): this; /** the placeholder to be shown in the input field when the keyboard is active */ setPlaceholder(placeholder: string): this; /** conditionally apply a chain of mutations to the builder */ if(condition: boolean, then: (builder: this) => void, otherwise?: (builder: this) => void): this; /** clone current builder to new instance */ clone(): KeyboardBuilder; /** returns JSON which is compatible with Telegram's `ReplyKeyboardMarkup` interface */ toJSON(): Interfaces.TelegramReplyKeyboardMarkup; toString(): string; private addButton; private addWideButton; } //# sourceMappingURL=keyboard-builder.d.ts.map