import type * as Interfaces from '@puregram/api'; import { RemoveKeyboard } from './remove.js'; import type { ButtonStyleParams, MaybeArray } from './types.js'; /** keyboard */ export declare class Keyboard { /** returns an "empty" keyboard (literally a `RemoveKeyboard` alias) */ static empty: RemoveKeyboard; private buttons; private isResized; private isOneTime; private isSelective; private isPersistent; private placeholder?; constructor(rows?: MaybeArray[]); get [Symbol.toStringTag](): string; /** whether the keyboard has no buttons */ get isEmpty(): boolean; /** number of rows in the keyboard */ get rowCount(): number; /** total number of buttons across all rows */ get length(): number; /** "Removes" a keyboard (literally a `RemoveKeyboard` alias) */ static remove(): RemoveKeyboard; /** assemble a builder of buttons */ static keyboard(rows: MaybeArray[]): Keyboard; /** construct a `Keyboard` from an existing `ReplyKeyboardMarkup` JSON */ static from(markup: Interfaces.TelegramReplyKeyboardMarkup): Keyboard; /** * generates text button * if none of the optional fields are used, * it will be sent as a message when the button is pressed */ static textButton(text: string, params?: ButtonStyleParams): Interfaces.TelegramKeyboardButton; /** an alias for `textButton` */ static text(text: string, params?: ButtonStyleParams): Interfaces.TelegramKeyboardButton; /** * 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 */ static requestUsersButton(text: string, params: Interfaces.TelegramKeyboardButtonRequestUsers & ButtonStyleParams): Interfaces.TelegramKeyboardButton; /** an alias for `requestUsersButton` */ static requestUsers(text: string, params: Interfaces.TelegramKeyboardButtonRequestUsers & ButtonStyleParams): Interfaces.TelegramKeyboardButton; /** * 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 */ static requestChatButton(text: string, params: Interfaces.TelegramKeyboardButtonRequestChat & ButtonStyleParams): Interfaces.TelegramKeyboardButton; /** an alias for `requestChatButton` */ static requestChat(text: string, params: Interfaces.TelegramKeyboardButtonRequestChat & ButtonStyleParams): Interfaces.TelegramKeyboardButton; /** * the user's phone number will be sent as a contact when * the button is pressed * * available in private chats only */ static requestContactButton(text: string, params?: ButtonStyleParams): Interfaces.TelegramKeyboardButton; /** an alias for `requestContactButton` */ static requestContact(text: string, params?: ButtonStyleParams): Interfaces.TelegramKeyboardButton; /** * the user's current location will be sent when the button is pressed * * available in private chats only */ static requestLocationButton(text: string, params?: ButtonStyleParams): Interfaces.TelegramKeyboardButton; /** an alias for `requestLocationButton` */ static requestLocation(text: string, params?: ButtonStyleParams): Interfaces.TelegramKeyboardButton; /** * 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 */ static requestPollButton(text: string, params?: (Interfaces.TelegramPoll['type'] | { type?: Interfaces.TelegramPoll['type']; } & ButtonStyleParams)): Interfaces.TelegramKeyboardButton; /** an alias for `requestPollButton` */ static requestPoll(text: string, params?: (Interfaces.TelegramPoll['type'] | { type?: Interfaces.TelegramPoll['type']; } & ButtonStyleParams)): Interfaces.TelegramKeyboardButton; /** * 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 */ static webAppButton(text: string, url: string, params?: ButtonStyleParams): Interfaces.TelegramKeyboardButton; /** an alias for `webAppButton` */ static webApp(text: string, url: string, params?: ButtonStyleParams): Interfaces.TelegramKeyboardButton; /** * 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; /** * 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; /** 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 keyboard */ if(condition: boolean, then: (keyboard: this) => void, otherwise?: (keyboard: this) => void): this; /** returns JSON which is compatible with Telegram's `ReplyKeyboardMarkup` interface */ toJSON(): Interfaces.TelegramReplyKeyboardMarkup; /** deletes a button with the specified payload */ delete(text: string): this; /** clones the keyboard (creates a new one with the same set of buttons) */ clone(): Keyboard; toString(): string; private addRow; } //# sourceMappingURL=keyboard.d.ts.map