import type * as Interfaces from '@puregram/api'; import type { ButtonStyleParams, CallbackData } from './types.js'; interface TextButtonParams { text: string; payload: CallbackData; } interface UrlButtonParams { text: string; url: string; } interface WebAppButtonParams { text: string; url: string; } interface SwitchToCurrentChatButtonParams { text: string; query: string; } interface SwitchToChatButtonParams { text: string; query: string; } interface SwitchToChosenChatButtonParams { text: string; query?: string; allowUserChats?: boolean; allowBotChats?: boolean; allowGroupChats?: boolean; allowChannelChats?: boolean; } interface CopyButtonParams { text: string; copy: string; } interface GameButtonParams { text: string; game: Interfaces.TelegramCallbackGame; } interface PayButtonParams { text: string; } interface LoginButtonParams { text: string; loginUrl: Interfaces.TelegramLoginUrl; } type TextButtonParamsWithStyle = TextButtonParams & ButtonStyleParams; type UrlButtonParamsWithStyle = UrlButtonParams & ButtonStyleParams; type WebAppButtonParamsWithStyle = WebAppButtonParams & ButtonStyleParams; type SwitchToCurrentChatButtonParamsWithStyle = SwitchToCurrentChatButtonParams & ButtonStyleParams; type SwitchToChatButtonParamsWithStyle = SwitchToChatButtonParams & ButtonStyleParams; type SwitchToChosenChatButtonParamsWithStyle = SwitchToChosenChatButtonParams & ButtonStyleParams; type CopyButtonParamsWithStyle = CopyButtonParams & ButtonStyleParams; type GameButtonParamsWithStyle = GameButtonParams & ButtonStyleParams; type PayButtonParamsWithStyle = PayButtonParams & ButtonStyleParams; type LoginButtonParamsWithStyle = LoginButtonParams & ButtonStyleParams; /** inline keyboard */ export declare class InlineKeyboard { /** empty inline keyboard. That's literally it */ static empty: InlineKeyboard; private buttons; constructor(rows?: (Interfaces.TelegramInlineKeyboardButton | Interfaces.TelegramInlineKeyboardButton[])[]); /** 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; /** assemble a builder of buttons */ static keyboard(rows: (Interfaces.TelegramInlineKeyboardButton | Interfaces.TelegramInlineKeyboardButton[])[]): InlineKeyboard; /** construct an `InlineKeyboard` from an existing `InlineKeyboardMarkup` JSON */ static from(markup: Interfaces.TelegramInlineKeyboardMarkup): InlineKeyboard; /** generate text button */ static textButton(params: TextButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** an alias for `textButton` */ static text(params: TextButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** generate URL button */ static urlButton(params: UrlButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** an alias for `urlButton` */ static url(params: UrlButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** generate Web App button */ static webAppButton(params: WebAppButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** an alias for `webAppButton` */ static webApp(params: WebAppButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** generate button that will switch to current chat and type the query */ static switchToCurrentChatButton(params: SwitchToCurrentChatButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** an alias for `switchToCurrentChatButton` */ static switchToCurrentChat(params: SwitchToCurrentChatButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** generate button that will prompt user to select one of their chats */ static switchToChatButton(params: SwitchToChatButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** an alias for `switchToChatButton` */ static switchToChat(params: SwitchToChatButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** * generate button that will prompt user to select one of their chats of the * specified type, open that chat and insert the bot's username and the * specified inline query in the input field */ static switchToChosenChatButton(params: SwitchToChosenChatButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** an alias for `switchToChosenChatButton` */ static switchToChosenChat(params: SwitchToChosenChatButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** description of the button that copies the specified text to the clipboard */ static copyButton(params: CopyButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** an alias for `copyButton` */ static copy(params: CopyButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** generate game button */ static gameButton(params: GameButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** an alias for `gameButton` */ static game(params: GameButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** generate pay button */ static payButton(params: PayButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** an alias for `payButton` */ static pay(params: PayButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** generate login button */ static loginButton(params: LoginButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** an alias for `loginButton` */ static login(params: LoginButtonParamsWithStyle): Interfaces.TelegramInlineKeyboardButton; /** 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 `InlineKeyboardMarkup` interface */ toJSON(): { inline_keyboard: Interfaces.TelegramInlineKeyboardButton[][]; }; /** clones the keyboard (creates a new one with the same set of buttons) */ clone(): InlineKeyboard; /** deletes a button with the specified payload */ delete(payload: string): this; toString(): string; private addRow; } export {}; //# sourceMappingURL=inline-keyboard.d.ts.map