1 |
|
2 | import { Message, Opts, Telegram, Update } from './core/types/typegram';
|
3 | import { UnionKeys } from './deunionize';
|
4 | export { Markup } from './markup';
|
5 | export declare type ChatAction = Opts<'sendChatAction'>['action'];
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | declare type MakeExtra<M extends keyof Telegram, K extends keyof Omit<Opts<M>, 'chat_id'> = never> = Omit<Opts<M>, 'chat_id' | K>;
|
12 | export declare type ExtraAddStickerToSet = MakeExtra<'addStickerToSet', 'name' | 'user_id'>;
|
13 | export declare type ExtraAnimation = MakeExtra<'sendAnimation', 'animation'>;
|
14 | export declare type ExtraAnswerCbQuery = MakeExtra<'answerCallbackQuery', 'text' | 'callback_query_id'>;
|
15 | export declare type ExtraAnswerInlineQuery = MakeExtra<'answerInlineQuery', 'inline_query_id' | 'results'>;
|
16 | export declare type ExtraAudio = MakeExtra<'sendAudio', 'audio'>;
|
17 | export declare type ExtraContact = MakeExtra<'sendContact', 'phone_number' | 'first_name'>;
|
18 | export declare type ExtraCopyMessage = MakeExtra<'copyMessage', 'from_chat_id' | 'message_id'>;
|
19 | export declare type ExtraCreateChatInviteLink = MakeExtra<'createChatInviteLink'>;
|
20 | export declare type ExtraCreateNewStickerSet = MakeExtra<'createNewStickerSet', 'name' | 'title' | 'user_id'>;
|
21 | export declare type ExtraDice = MakeExtra<'sendDice'>;
|
22 | export declare type ExtraDocument = MakeExtra<'sendDocument', 'document'>;
|
23 | export declare type ExtraEditChatInviteLink = MakeExtra<'editChatInviteLink', 'invite_link'>;
|
24 | export declare type ExtraEditMessageCaption = MakeExtra<'editMessageCaption', 'message_id' | 'inline_message_id' | 'caption'>;
|
25 | export declare type ExtraEditMessageLiveLocation = MakeExtra<'editMessageLiveLocation', 'message_id' | 'inline_message_id' | 'latitude' | 'longitude'>;
|
26 | export declare type ExtraEditMessageMedia = MakeExtra<'editMessageMedia', 'message_id' | 'inline_message_id' | 'media'>;
|
27 | export declare type ExtraEditMessageText = MakeExtra<'editMessageText', 'message_id' | 'inline_message_id' | 'text'>;
|
28 | export declare type ExtraGame = MakeExtra<'sendGame', 'game_short_name'>;
|
29 | export declare type NewInvoiceParameters = MakeExtra<'sendInvoice', 'disable_notification' | 'reply_to_message_id' | 'allow_sending_without_reply' | 'reply_markup'>;
|
30 | export declare type ExtraInvoice = MakeExtra<'sendInvoice', keyof NewInvoiceParameters>;
|
31 | export declare type ExtraKickChatMember = MakeExtra<'kickChatMember', 'user_id' | 'until_date'>;
|
32 | export declare type ExtraLocation = MakeExtra<'sendLocation', 'latitude' | 'longitude'>;
|
33 | export declare type ExtraMediaGroup = MakeExtra<'sendMediaGroup', 'media'>;
|
34 | export declare type ExtraPhoto = MakeExtra<'sendPhoto', 'photo'>;
|
35 | export declare type ExtraPoll = MakeExtra<'sendPoll', 'question' | 'options' | 'type'>;
|
36 | export declare type ExtraPromoteChatMember = MakeExtra<'promoteChatMember', 'user_id'>;
|
37 | export declare type ExtraReplyMessage = MakeExtra<'sendMessage', 'text'>;
|
38 | export declare type ExtraRestrictChatMember = MakeExtra<'restrictChatMember', 'user_id'>;
|
39 | export declare type ExtraSetMyCommands = MakeExtra<'setMyCommands', 'commands'>;
|
40 | export declare type ExtraSetWebhook = MakeExtra<'setWebhook', 'url'>;
|
41 | export declare type ExtraSticker = MakeExtra<'sendSticker', 'sticker'>;
|
42 | export declare type ExtraStopPoll = MakeExtra<'stopPoll', 'message_id'>;
|
43 | export declare type ExtraVenue = MakeExtra<'sendVenue', 'latitude' | 'longitude' | 'title' | 'address'>;
|
44 | export declare type ExtraVideo = MakeExtra<'sendVideo', 'video'>;
|
45 | export declare type ExtraVideoNote = MakeExtra<'sendVideoNote', 'video_note'>;
|
46 | export declare type ExtraVoice = MakeExtra<'sendVoice', 'voice'>;
|
47 |
|
48 | export declare type UpdateType = Exclude<UnionKeys<Update>, keyof Update>;
|
49 |
|
50 | export declare type MessageSubType = 'forward_date' | Exclude<UnionKeys<Message>, keyof Message.CaptionableMessage | 'entities' | 'media_group_id'>;
|
51 | declare type ExtractPartial<T extends object, U extends object> = T extends unknown ? Required<T> extends U ? T : never : never;
|
52 |
|
53 |
|
54 |
|
55 | export declare type MountMap = {
|
56 | [T in UpdateType]: Extract<Update, Record<T, object>>;
|
57 | } & {
|
58 | [T in MessageSubType]: {
|
59 | message: ExtractPartial<Update.MessageUpdate['message'], Record<T, unknown>>;
|
60 | update_id: number;
|
61 | };
|
62 | };
|
63 |
|
\ | No newline at end of file |