@telegram.ts/types 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,141 +1,128 @@
1
- import type {
2
- ChosenInlineResult,
3
- InlineQuery
4
- } from "./inlineTypes.js";
1
+ import type { ChosenInlineResult, InlineQuery } from "./inlineTypes.js";
5
2
  import type {
6
3
  Chat,
7
4
  ChatJoinRequest,
8
5
  ChatMemberUpdated,
9
- User
6
+ User,
10
7
  } from "./manageTypes.js";
11
- import type {
12
- CallbackQuery
13
- } from "./markupTypes.js";
14
- import type {
15
- Message,
16
- Poll,
17
- PollAnswer
18
- } from "./messageTypes.js";
19
- import type {
20
- PreCheckoutQuery,
21
- ShippingQuery
22
- } from "./invoiceTypes.js";
8
+ import type { CallbackQuery } from "./markupTypes.js";
9
+ import type { Message, Poll, PollAnswer } from "./messageTypes.js";
10
+ import type { PreCheckoutQuery, ShippingQuery } from "./invoiceTypes.js";
23
11
 
24
12
  /**
25
- * Namespace used internally to define more accurate message update types.
26
- */
13
+ * Namespace used internally to define more accurate message update types.
14
+ */
27
15
  export declare namespace Update {
28
16
  /**
29
- * Internal type holding properties that message updates in channels share.
30
- */
17
+ * Internal type holding properties that message updates in channels share.
18
+ */
31
19
  interface Channel {
32
20
  chat: Chat.ChannelChat;
33
21
  }
34
22
 
35
23
  /**
36
- * Internal type holding properties that message updates outside of channels share.
37
- */
24
+ * Internal type holding properties that message updates outside of channels share.
25
+ */
38
26
  interface NonChannel {
39
- chat: Exclude < Chat,
40
- Chat.ChannelChat >;
27
+ chat: Exclude<Chat, Chat.ChannelChat>;
41
28
  from: User;
42
29
  }
43
30
 
44
31
  /**
45
- * Internal type holding properties that updates about edited messages share.
46
- */
32
+ * Internal type holding properties that updates about edited messages share.
33
+ */
47
34
  interface Edited {
48
35
  /**
49
- * Date the message was last edited in Unix time.
50
- */
36
+ * Date the message was last edited in Unix time.
37
+ */
51
38
  edit_date: number;
52
39
  }
53
40
  }
54
41
 
55
42
  /**
56
- * This object represents an incoming update.
57
- * At most one of the optional parameters can be present in any given update.
58
- */
43
+ * This object represents an incoming update.
44
+ * At most one of the optional parameters can be present in any given update.
45
+ */
59
46
  export interface Update {
60
47
  /**
61
- * The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially.
62
- * This ID becomes especially handy if you're using webhooks, as it allows you to ignore repeated updates or restore the correct update sequence if they get out of order.
63
- * If there are no new updates for at least a week, the identifier of the next update will be chosen randomly instead of sequentially.
64
- */
48
+ * The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially.
49
+ * This ID becomes especially handy if you're using webhooks, as it allows you to ignore repeated updates or restore the correct update sequence if they get out of order.
50
+ * If there are no new updates for at least a week, the identifier of the next update will be chosen randomly instead of sequentially.
51
+ */
65
52
  update_id: number;
66
53
 
67
54
  /**
68
- * New incoming message of any kind - text, photo, sticker, etc.
69
- */
55
+ * New incoming message of any kind - text, photo, sticker, etc.
56
+ */
70
57
  message?: Message & Update.NonChannel;
71
58
 
72
59
  /**
73
- * New version of a message known to the bot that has been edited.
74
- */
60
+ * New version of a message known to the bot that has been edited.
61
+ */
75
62
  edited_message?: Message & Update.Edited & Update.NonChannel;
76
63
 
77
64
  /**
78
- * New incoming channel post of any kind - text, photo, sticker, etc.
79
- */
65
+ * New incoming channel post of any kind - text, photo, sticker, etc.
66
+ */
80
67
  channel_post?: Message & Update.Channel;
81
68
 
82
69
  /**
83
- * New version of a channel post known to the bot that has been edited.
84
- */
70
+ * New version of a channel post known to the bot that has been edited.
71
+ */
85
72
  edited_channel_post?: Message & Update.Edited & Update.Channel;
86
73
 
87
74
  /**
88
- * New incoming inline query.
89
- */
75
+ * New incoming inline query.
76
+ */
90
77
  inline_query?: InlineQuery;
91
78
 
92
79
  /**
93
- * The result of an inline query that was chosen by a user and sent to their chat partner.
94
- * Please refer to our documentation on collecting feedback for details on how to enable these updates for your bot.
95
- */
80
+ * The result of an inline query that was chosen by a user and sent to their chat partner.
81
+ * Please refer to our documentation on collecting feedback for details on how to enable these updates for your bot.
82
+ */
96
83
  chosen_inline_result?: ChosenInlineResult;
97
84
 
98
85
  /**
99
- * New incoming callback query.
100
- */
86
+ * New incoming callback query.
87
+ */
101
88
  callback_query?: CallbackQuery;
102
89
 
103
90
  /**
104
- * New incoming shipping query. Only for invoices with flexible price.
105
- */
91
+ * New incoming shipping query. Only for invoices with flexible price.
92
+ */
106
93
  shipping_query?: ShippingQuery;
107
94
 
108
95
  /**
109
- * New incoming pre-checkout query. Contains full information about checkout.
110
- */
96
+ * New incoming pre-checkout query. Contains full information about checkout.
97
+ */
111
98
  pre_checkout_query?: PreCheckoutQuery;
112
99
 
113
100
  /**
114
- * New poll state. Bots receive updates only about stopped polls and polls sent by the bot.
115
- */
101
+ * New poll state. Bots receive updates only about stopped polls and polls sent by the bot.
102
+ */
116
103
  poll?: Poll;
117
104
 
118
105
  /**
119
- * A user changed their answer in a non-anonymous poll.
120
- * Bots receive new votes only in polls that were sent by the bot itself.
121
- */
106
+ * A user changed their answer in a non-anonymous poll.
107
+ * Bots receive new votes only in polls that were sent by the bot itself.
108
+ */
122
109
  poll_answer?: PollAnswer;
123
110
 
124
111
  /**
125
- * The bot's chat member status was updated in a chat.
126
- * For private chats, this update is received only when the bot is blocked or unblocked by the user.
127
- */
112
+ * The bot's chat member status was updated in a chat.
113
+ * For private chats, this update is received only when the bot is blocked or unblocked by the user.
114
+ */
128
115
  my_chat_member?: ChatMemberUpdated;
129
116
 
130
117
  /**
131
- * A chat member's status was updated in a chat.
132
- * The bot must be an administrator in the chat and must explicitly specify "chat_member" in the list of allowed_updates to receive these updates.
133
- */
118
+ * A chat member's status was updated in a chat.
119
+ * The bot must be an administrator in the chat and must explicitly specify "chat_member" in the list of allowed_updates to receive these updates.
120
+ */
134
121
  chat_member?: ChatMemberUpdated;
135
122
 
136
123
  /**
137
- * A request to join the chat has been sent.
138
- * The bot must have the can_invite_users administrator right in the chat to receive these updates.
139
- */
124
+ * A request to join the chat has been sent.
125
+ * The bot must have the can_invite_users administrator right in the chat to receive these updates.
126
+ */
140
127
  chat_join_request?: ChatJoinRequest;
141
- }
128
+ }