UNPKG

1.76 kBTypeScriptView Raw
1import { ForceReply, InlineKeyboardButton, InlineKeyboardMarkup, KeyboardButton, ReplyKeyboardMarkup, ReplyKeyboardRemove } from './core/types/typegram';
2declare type Hideable<B> = B & {
3 hide?: boolean;
4};
5declare type HideableKBtn = Hideable<KeyboardButton>;
6declare type HideableIKBtn = Hideable<InlineKeyboardButton>;
7export declare class Markup<T extends InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply> {
8 readonly reply_markup: T;
9 constructor(reply_markup: T);
10 selective<T extends ForceReply | ReplyKeyboardMarkup>(this: Markup<T>, value?: boolean): Markup<T>;
11 placeholder<T extends ForceReply | ReplyKeyboardMarkup>(this: Markup<T>, placeholder: string): Markup<T>;
12 resize(this: Markup<ReplyKeyboardMarkup>, value?: boolean): Markup<ReplyKeyboardMarkup>;
13 oneTime(this: Markup<ReplyKeyboardMarkup>, value?: boolean): Markup<ReplyKeyboardMarkup>;
14}
15export * as button from './button';
16export declare function removeKeyboard(): Markup<ReplyKeyboardRemove>;
17export declare function forceReply(): Markup<ForceReply>;
18export declare function keyboard(buttons: HideableKBtn[][]): Markup<ReplyKeyboardMarkup>;
19export declare function keyboard(buttons: HideableKBtn[], options?: Partial<KeyboardBuildingOptions<HideableKBtn>>): Markup<ReplyKeyboardMarkup>;
20export declare function inlineKeyboard(buttons: HideableIKBtn[][]): Markup<InlineKeyboardMarkup>;
21export declare function inlineKeyboard(buttons: HideableIKBtn[], options?: Partial<KeyboardBuildingOptions<HideableIKBtn>>): Markup<InlineKeyboardMarkup>;
22interface KeyboardBuildingOptions<B extends HideableKBtn | HideableIKBtn> {
23 wrap?: (btn: B, index: number, currentRow: B[]) => boolean;
24 columns: number;
25}
26//# sourceMappingURL=markup.d.ts.map
\No newline at end of file