UNPKG

2.9 kBTypeScriptView Raw
1import { InlineKeyboardButton, KeyboardButton, KeyboardButtonRequestChat, KeyboardButtonRequestUsers } from './core/types/typegram';
2type Hideable<B> = B & {
3 hide: boolean;
4};
5export declare function text(text: string, hide?: boolean): Hideable<KeyboardButton.CommonButton>;
6export declare function contactRequest(text: string, hide?: boolean): Hideable<KeyboardButton.RequestContactButton>;
7export declare function locationRequest(text: string, hide?: boolean): Hideable<KeyboardButton.RequestLocationButton>;
8export declare function pollRequest(text: string, type?: 'quiz' | 'regular', hide?: boolean): Hideable<KeyboardButton.RequestPollButton>;
9export declare function userRequest(text: string,
10/** Must fit in a signed 32 bit int */
11request_id: number, extra?: Omit<KeyboardButtonRequestUsers, 'request_id' | 'text'>, hide?: boolean): Hideable<KeyboardButton.RequestUsersButton>;
12export declare function botRequest(text: string,
13/** Must fit in a signed 32 bit int */
14request_id: number, extra?: Omit<KeyboardButtonRequestUsers, 'request_id' | 'user_is_bot' | 'text'>, hide?: boolean): Hideable<KeyboardButton.RequestUsersButton>;
15type KeyboardButtonRequestGroup = Omit<KeyboardButtonRequestChat, 'request_id' | 'chat_is_channel'>;
16export declare function groupRequest(text: string,
17/** Must fit in a signed 32 bit int */
18request_id: number, extra?: KeyboardButtonRequestGroup, hide?: boolean): Hideable<KeyboardButton.RequestChatButton>;
19type KeyboardButtonRequestChannel = Omit<KeyboardButtonRequestChat, 'request_id' | 'chat_is_channel' | 'chat_is_forum'>;
20export declare function channelRequest(text: string,
21/** Must fit in a signed 32 bit int */
22request_id: number, extra?: KeyboardButtonRequestChannel, hide?: boolean): Hideable<KeyboardButton.RequestChatButton>;
23export declare function url(text: string, url: string, hide?: boolean): Hideable<InlineKeyboardButton.UrlButton>;
24export declare function callback(text: string, data: string, hide?: boolean): Hideable<InlineKeyboardButton.CallbackButton>;
25export declare function switchToChat(text: string, value: string, hide?: boolean): Hideable<InlineKeyboardButton.SwitchInlineButton>;
26export declare function switchToCurrentChat(text: string, value: string, hide?: boolean): Hideable<InlineKeyboardButton.SwitchInlineCurrentChatButton>;
27export declare function game(text: string, hide?: boolean): Hideable<InlineKeyboardButton.GameButton>;
28export declare function pay(text: string, hide?: boolean): Hideable<InlineKeyboardButton.PayButton>;
29export declare function login(text: string, url: string, opts?: {
30 forward_text?: string;
31 bot_username?: string;
32 request_write_access?: boolean;
33}, hide?: boolean): Hideable<InlineKeyboardButton.LoginButton>;
34export declare function webApp(text: string, url: string, hide?: boolean): Hideable<InlineKeyboardButton.WebAppButton>;
35export {};
36//# sourceMappingURL=button.d.ts.map
\No newline at end of file