@mtkruto/node 0.148.0 → 0.151.0

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.
Files changed (133) hide show
  1. package/esm/3_types.d.ts +4 -0
  2. package/esm/3_types.d.ts.map +1 -1
  3. package/esm/3_types.js +4 -0
  4. package/esm/client/0_params.d.ts +18 -4
  5. package/esm/client/0_params.d.ts.map +1 -1
  6. package/esm/client/0_utilities.d.ts +1 -1
  7. package/esm/client/0_utilities.d.ts.map +1 -1
  8. package/esm/client/1_client_generic.d.ts +34 -6
  9. package/esm/client/1_client_generic.d.ts.map +1 -1
  10. package/esm/client/2_file_manager.d.ts.map +1 -1
  11. package/esm/client/2_file_manager.js +20 -0
  12. package/esm/client/3_filters.d.ts.map +1 -1
  13. package/esm/client/3_filters.js +4 -1
  14. package/esm/client/3_message_manager.d.ts +5 -2
  15. package/esm/client/3_message_manager.d.ts.map +1 -1
  16. package/esm/client/3_message_manager.js +326 -76
  17. package/esm/client/4_context.d.ts.map +1 -1
  18. package/esm/client/4_context.js +5 -1
  19. package/esm/client/6_client.d.ts +34 -6
  20. package/esm/client/6_client.d.ts.map +1 -1
  21. package/esm/client/6_client.js +43 -5
  22. package/esm/client/6_client_dispatcher.d.ts +34 -6
  23. package/esm/client/6_client_dispatcher.d.ts.map +1 -1
  24. package/esm/client/6_client_dispatcher.js +38 -4
  25. package/esm/tl/1_telegram_api.d.ts +120 -29
  26. package/esm/tl/1_telegram_api.d.ts.map +1 -1
  27. package/esm/tl/1_telegram_api.js +124 -26
  28. package/esm/types/0_message_counters.d.ts +1 -1
  29. package/esm/types/0_message_counters.d.ts.map +1 -1
  30. package/esm/types/0_upload_progress.d.ts +2 -0
  31. package/esm/types/0_upload_progress.d.ts.map +1 -1
  32. package/esm/types/1_chat_p.d.ts +2 -0
  33. package/esm/types/1_chat_p.d.ts.map +1 -1
  34. package/esm/types/1_chat_p.js +3 -2
  35. package/esm/types/1_input_poll_media.d.ts +128 -0
  36. package/esm/types/1_input_poll_media.d.ts.map +1 -0
  37. package/esm/types/1_input_poll_media.js +20 -0
  38. package/esm/types/2_message_entity.d.ts +16 -0
  39. package/esm/types/2_message_entity.d.ts.map +1 -1
  40. package/esm/types/2_message_entity.js +51 -45
  41. package/esm/types/3_checklist_item.d.ts +1 -1
  42. package/esm/types/3_checklist_item.d.ts.map +1 -1
  43. package/esm/types/3_input_poll_option.d.ts +3 -0
  44. package/esm/types/3_input_poll_option.d.ts.map +1 -1
  45. package/esm/types/3_message_reactions.d.ts +1 -1
  46. package/esm/types/3_message_reactions.d.ts.map +1 -1
  47. package/esm/types/3_rich_text_component.d.ts +268 -0
  48. package/esm/types/3_rich_text_component.d.ts.map +1 -0
  49. package/esm/types/3_rich_text_component.js +161 -0
  50. package/esm/types/4_gift.d.ts +1 -1
  51. package/esm/types/4_page_block.d.ts +479 -0
  52. package/esm/types/4_page_block.d.ts.map +1 -0
  53. package/esm/types/4_page_block.js +552 -0
  54. package/esm/types/4_poll.d.ts +1 -1
  55. package/esm/types/4_poll.d.ts.map +1 -1
  56. package/esm/types/4_reply_to.d.ts +4 -0
  57. package/esm/types/4_reply_to.d.ts.map +1 -1
  58. package/esm/types/5_input_rich_text.d.ts +38 -0
  59. package/esm/types/5_input_rich_text.d.ts.map +1 -0
  60. package/esm/types/5_input_rich_text.js +20 -0
  61. package/esm/types/6_message.d.ts +22 -1
  62. package/esm/types/6_message.d.ts.map +1 -1
  63. package/esm/types/6_message.js +30 -0
  64. package/esm/utilities/0_misc.d.ts +1 -0
  65. package/esm/utilities/0_misc.d.ts.map +1 -1
  66. package/esm/utilities/0_misc.js +1 -0
  67. package/package.json +1 -1
  68. package/script/3_types.d.ts +4 -0
  69. package/script/3_types.d.ts.map +1 -1
  70. package/script/3_types.js +4 -0
  71. package/script/client/0_params.d.ts +18 -4
  72. package/script/client/0_params.d.ts.map +1 -1
  73. package/script/client/0_utilities.d.ts +1 -1
  74. package/script/client/0_utilities.d.ts.map +1 -1
  75. package/script/client/1_client_generic.d.ts +34 -6
  76. package/script/client/1_client_generic.d.ts.map +1 -1
  77. package/script/client/2_file_manager.d.ts.map +1 -1
  78. package/script/client/2_file_manager.js +20 -0
  79. package/script/client/3_filters.d.ts.map +1 -1
  80. package/script/client/3_filters.js +4 -1
  81. package/script/client/3_message_manager.d.ts +5 -2
  82. package/script/client/3_message_manager.d.ts.map +1 -1
  83. package/script/client/3_message_manager.js +325 -75
  84. package/script/client/4_context.d.ts.map +1 -1
  85. package/script/client/4_context.js +5 -1
  86. package/script/client/6_client.d.ts +34 -6
  87. package/script/client/6_client.d.ts.map +1 -1
  88. package/script/client/6_client.js +42 -4
  89. package/script/client/6_client_dispatcher.d.ts +34 -6
  90. package/script/client/6_client_dispatcher.d.ts.map +1 -1
  91. package/script/client/6_client_dispatcher.js +38 -4
  92. package/script/tl/1_telegram_api.d.ts +120 -29
  93. package/script/tl/1_telegram_api.d.ts.map +1 -1
  94. package/script/tl/1_telegram_api.js +124 -26
  95. package/script/types/0_message_counters.d.ts +1 -1
  96. package/script/types/0_message_counters.d.ts.map +1 -1
  97. package/script/types/0_upload_progress.d.ts +2 -0
  98. package/script/types/0_upload_progress.d.ts.map +1 -1
  99. package/script/types/1_chat_p.d.ts +2 -0
  100. package/script/types/1_chat_p.d.ts.map +1 -1
  101. package/script/types/1_chat_p.js +3 -2
  102. package/script/types/1_input_poll_media.d.ts +128 -0
  103. package/script/types/1_input_poll_media.d.ts.map +1 -0
  104. package/script/types/1_input_poll_media.js +21 -0
  105. package/script/types/2_message_entity.d.ts +16 -0
  106. package/script/types/2_message_entity.d.ts.map +1 -1
  107. package/script/types/2_message_entity.js +53 -45
  108. package/script/types/3_checklist_item.d.ts +1 -1
  109. package/script/types/3_checklist_item.d.ts.map +1 -1
  110. package/script/types/3_input_poll_option.d.ts +3 -0
  111. package/script/types/3_input_poll_option.d.ts.map +1 -1
  112. package/script/types/3_message_reactions.d.ts +1 -1
  113. package/script/types/3_message_reactions.d.ts.map +1 -1
  114. package/script/types/3_rich_text_component.d.ts +268 -0
  115. package/script/types/3_rich_text_component.d.ts.map +1 -0
  116. package/script/types/3_rich_text_component.js +165 -0
  117. package/script/types/4_gift.d.ts +1 -1
  118. package/script/types/4_page_block.d.ts +479 -0
  119. package/script/types/4_page_block.d.ts.map +1 -0
  120. package/script/types/4_page_block.js +569 -0
  121. package/script/types/4_poll.d.ts +1 -1
  122. package/script/types/4_poll.d.ts.map +1 -1
  123. package/script/types/4_reply_to.d.ts +4 -0
  124. package/script/types/4_reply_to.d.ts.map +1 -1
  125. package/script/types/5_input_rich_text.d.ts +38 -0
  126. package/script/types/5_input_rich_text.d.ts.map +1 -0
  127. package/script/types/5_input_rich_text.js +21 -0
  128. package/script/types/6_message.d.ts +22 -1
  129. package/script/types/6_message.d.ts.map +1 -1
  130. package/script/types/6_message.js +30 -0
  131. package/script/utilities/0_misc.d.ts +1 -0
  132. package/script/utilities/0_misc.d.ts.map +1 -1
  133. package/script/utilities/0_misc.js +2 -1
@@ -0,0 +1,569 @@
1
+ "use strict";
2
+ /**
3
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
4
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
5
+ *
6
+ * This file is part of MTKruto.
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU Lesser General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU Lesser General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Lesser General Public License
19
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.constructPageBlockListItem = constructPageBlockListItem;
23
+ exports.pageBlockListItemToTlObject = pageBlockListItemToTlObject;
24
+ exports.constructPageBlockCaption = constructPageBlockCaption;
25
+ exports.pageBlockCaptionToTlObject = pageBlockCaptionToTlObject;
26
+ exports.constructPageBlockTableCell = constructPageBlockTableCell;
27
+ exports.pageBlockTableCellToTlObject = pageBlockTableCellToTlObject;
28
+ exports.constructPageBlockTableRow = constructPageBlockTableRow;
29
+ exports.pageBlockTableRowToTlObject = pageBlockTableRowToTlObject;
30
+ exports.constructPageBlockOrderedListItem = constructPageBlockOrderedListItem;
31
+ exports.pageBlockOrderedListItemToTlObject = pageBlockOrderedListItemToTlObject;
32
+ exports.constructPageBlockRelatedArticle = constructPageBlockRelatedArticle;
33
+ exports.pageBlockRelatedArticleToTlObject = pageBlockRelatedArticleToTlObject;
34
+ exports.constructPageBlock = constructPageBlock;
35
+ exports.pageBlockToTlObject = pageBlockToTlObject;
36
+ exports.collectMediaFileIds = collectMediaFileIds;
37
+ const _0_deps_js_1 = require("../0_deps.js");
38
+ const _1_utilities_js_1 = require("../1_utilities.js");
39
+ const _2_tl_js_1 = require("../2_tl.js");
40
+ const _file_id_js_1 = require("./_file_id.js");
41
+ const _0_location_js_1 = require("./0_location.js");
42
+ const _1_chat_p_js_1 = require("./1_chat_p.js");
43
+ const _1_photo_js_1 = require("./1_photo.js");
44
+ const _3_rich_text_component_js_1 = require("./3_rich_text_component.js");
45
+ function constructPageBlockListItem(pli, photos, documents) {
46
+ switch (pli._) {
47
+ case "pageListItemText":
48
+ return { type: "text", isCheckbox: !!pli.checkbox, isChecked: !!pli.checked, text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pli.text, photos) };
49
+ case "pageListItemBlocks":
50
+ return { type: "blockList", isCheckbox: !!pli.checkbox, isChecked: !!pli.checked, blocks: pli.blocks.map((v) => constructPageBlock(v, photos, documents)) };
51
+ }
52
+ }
53
+ function pageBlockListItemToTlObject(pbli) {
54
+ switch (pbli.type) {
55
+ case "text":
56
+ return { _: "pageListItemText", checkbox: pbli.isCheckbox || undefined, checked: pbli.isChecked || undefined, text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pbli.text) };
57
+ case "blockList":
58
+ return { _: "pageListItemBlocks", checkbox: pbli.isCheckbox || undefined, checked: pbli.isChecked || undefined, blocks: pbli.blocks.map(pageBlockToTlObject) };
59
+ }
60
+ }
61
+ function constructPageBlockCaption(pc, photos) {
62
+ return {
63
+ text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pc.text, photos),
64
+ credit: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pc.credit, photos),
65
+ };
66
+ }
67
+ function pageBlockCaptionToTlObject(pbc) {
68
+ return {
69
+ _: "pageCaption",
70
+ text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pbc.text),
71
+ credit: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pbc.credit),
72
+ };
73
+ }
74
+ function constructPageBlockTableCell(ptc, photos) {
75
+ return (0, _1_utilities_js_1.cleanObject)({
76
+ isHeader: !!ptc.header,
77
+ isCenterAligned: !!ptc.align_center,
78
+ isRightAligned: !!ptc.align_right,
79
+ isMiddleVerticallyAligned: !!ptc.valign_middle,
80
+ isBottomVerticallyAligned: !!ptc.valign_bottom,
81
+ text: ptc.text ? (0, _3_rich_text_component_js_1.constructRichTextComponent)(ptc.text, photos) : undefined,
82
+ colspan: ptc.colspan,
83
+ rowspan: ptc.rowspan,
84
+ });
85
+ }
86
+ function pageBlockTableCellToTlObject(pbtc) {
87
+ return {
88
+ _: "pageTableCell",
89
+ header: pbtc.isHeader || undefined,
90
+ align_center: pbtc.isCenterAligned || undefined,
91
+ align_right: pbtc.isRightAligned || undefined,
92
+ valign_middle: pbtc.isMiddleVerticallyAligned || undefined,
93
+ valign_bottom: pbtc.isBottomVerticallyAligned || undefined,
94
+ text: pbtc.text ? (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pbtc.text) : undefined,
95
+ colspan: pbtc.colspan,
96
+ rowspan: pbtc.rowspan,
97
+ };
98
+ }
99
+ function constructPageBlockTableRow(ptr, photos) {
100
+ return {
101
+ cells: ptr.cells.map((v) => constructPageBlockTableCell(v, photos)),
102
+ };
103
+ }
104
+ function pageBlockTableRowToTlObject(pbtr) {
105
+ return {
106
+ _: "pageTableRow",
107
+ cells: pbtr.cells.map(pageBlockTableCellToTlObject),
108
+ };
109
+ }
110
+ function constructPageBlockOrderedListItem(ploi, photos, documents) {
111
+ switch (ploi._) {
112
+ case "pageListOrderedItemText":
113
+ return (0, _1_utilities_js_1.cleanObject)({ type: "text", isCheckbox: !!ploi.checkbox, isChecked: !!ploi.checked, number: ploi.num, value: ploi.value, itemType: ploi.type, text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(ploi.text, photos) });
114
+ case "pageListOrderedItemBlocks":
115
+ return (0, _1_utilities_js_1.cleanObject)({ type: "blockList", isCheckbox: !!ploi.checkbox, isChecked: !!ploi.checked, number: ploi.num, value: ploi.value, itemType: ploi.type, blocks: ploi.blocks.map((v) => constructPageBlock(v, photos, documents)) });
116
+ }
117
+ (0, _0_deps_js_1.unreachable)();
118
+ }
119
+ function pageBlockOrderedListItemToTlObject(pboli) {
120
+ switch (pboli.type) {
121
+ case "text":
122
+ return { _: "pageListOrderedItemText", checkbox: pboli.isCheckbox || undefined, checked: pboli.isCheckbox || undefined, text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pboli.text), num: pboli.number, type: pboli.itemType, value: pboli.value };
123
+ case "blockList":
124
+ return { _: "pageListOrderedItemBlocks", checkbox: pboli.isCheckbox || undefined, checked: pboli.isCheckbox || undefined, blocks: pboli.blocks.map(pageBlockToTlObject), num: pboli.number, type: pboli.itemType, value: pboli.value };
125
+ }
126
+ }
127
+ function constructPageBlockRelatedArticle(pra) {
128
+ return (0, _1_utilities_js_1.cleanObject)({
129
+ url: pra.url,
130
+ linkPreviewId: String(pra.webpage_id),
131
+ title: pra.title,
132
+ description: pra.description,
133
+ photoId: pra.photo_id ? String(pra.photo_id) : undefined,
134
+ author: pra.author,
135
+ date: pra.published_date,
136
+ });
137
+ }
138
+ function pageBlockRelatedArticleToTlObject(pbra) {
139
+ return { _: "pageRelatedArticle", url: pbra.url, webpage_id: BigInt(pbra.linkPreviewId), title: pbra.title, description: pbra.description, photo_id: pbra.photoId ? BigInt(pbra.photoId) : undefined, author: pbra.author, published_date: pbra.date };
140
+ }
141
+ function constructPageBlock(pb, photos, documents) {
142
+ switch (pb._) {
143
+ case "pageBlockUnsupported":
144
+ return { type: "unsupported" };
145
+ case "pageBlockTitle":
146
+ return { type: "title", text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.text, photos) };
147
+ case "pageBlockSubtitle":
148
+ return { type: "subtitle", text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.text, photos) };
149
+ case "pageBlockAuthorDate":
150
+ return { type: "authorDate", author: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.author, photos), date: pb.published_date };
151
+ case "pageBlockHeader":
152
+ return { type: "header", text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.text, photos) };
153
+ case "pageBlockSubheader":
154
+ return { type: "subheader", text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.text, photos) };
155
+ case "pageBlockParagraph":
156
+ return { type: "paragraph", text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.text, photos) };
157
+ case "pageBlockPreformatted":
158
+ return (0, _1_utilities_js_1.cleanObject)({ type: "pre", text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.text, photos), language: pb.language || undefined });
159
+ case "pageBlockFooter":
160
+ return { type: "footer", text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.text, photos) };
161
+ case "pageBlockDivider":
162
+ return { type: "divider" };
163
+ case "pageBlockAnchor":
164
+ return { type: "anchor", name: pb.name };
165
+ case "pageBlockList":
166
+ return { type: "list", items: pb.items.map((v) => constructPageBlockListItem(v, photos, documents)) };
167
+ case "pageBlockBlockquote":
168
+ return { type: "blockQuote", text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.text, photos), caption: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.caption, photos) };
169
+ case "pageBlockPullquote":
170
+ return { type: "blockQuote", text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.text, photos), caption: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.caption, photos) };
171
+ case "pageBlockPhoto": {
172
+ const fileId = (0, _1_photo_js_1.constructPhoto)(_2_tl_js_1.Api.as("photo", photos.find((v) => v.id === pb.photo_id))).fileId;
173
+ return (0, _1_utilities_js_1.cleanObject)({ type: "photo", fileId, caption: constructPageBlockCaption(pb.caption, photos), isSpoiler: !!pb.spoiler, linkPreviewId: pb.webpage_id ? String(pb.webpage_id) : undefined, url: pb.url });
174
+ }
175
+ case "pageBlockVideo": {
176
+ const document = _2_tl_js_1.Api.as("document", documents.find((v) => v.id === pb.video_id));
177
+ const isAnimated = !!document.attributes.find((v) => _2_tl_js_1.Api.is("documentAttributeAnimated", v));
178
+ const fileId = {
179
+ type: _file_id_js_1.FileType.Video,
180
+ dcId: document.dc_id,
181
+ location: { type: "common", id: document.id, accessHash: document.access_hash },
182
+ fileReference: document.file_reference,
183
+ };
184
+ return { type: isAnimated ? "animation" : "video", fileId: (0, _file_id_js_1.serializeFileId)(fileId), caption: constructPageBlockCaption(pb.caption, photos), isSpoiler: !!pb.spoiler, isAutoplay: !!pb.autoplay, isLoop: !!pb.loop };
185
+ }
186
+ case "pageBlockCover":
187
+ return { type: "cover", cover: constructPageBlock(pb.cover, photos, documents) };
188
+ case "pageBlockEmbed":
189
+ return (0, _1_utilities_js_1.cleanObject)({ type: "embed", caption: constructPageBlockCaption(pb.caption, photos), isFullWidth: !!pb.full_width, isScrollingAllowed: !!pb.allow_scrolling, width: pb.w, height: pb.h, html: pb.html, url: pb.url, posterPhotoId: pb.poster_photo_id ? String(pb.poster_photo_id) : undefined });
190
+ case "pageBlockEmbedPost":
191
+ return (0, _1_utilities_js_1.cleanObject)({ type: "embedPost", caption: constructPageBlockCaption(pb.caption, photos), author: pb.author, authorPhotoId: String(pb.author_photo_id), blocks: pb.blocks.map((v) => constructPageBlock(v, photos, documents)), date: pb.date, linkPreviewId: String(pb.webpage_id), url: pb.url });
192
+ case "pageBlockCollage":
193
+ return (0, _1_utilities_js_1.cleanObject)({ type: "collage", caption: constructPageBlockCaption(pb.caption, photos), items: pb.items.map((v) => constructPageBlock(v, photos, documents)) });
194
+ case "pageBlockSlideshow":
195
+ return (0, _1_utilities_js_1.cleanObject)({ type: "slideshow", caption: constructPageBlockCaption(pb.caption, photos), items: pb.items.map((v) => constructPageBlock(v, photos, documents)) });
196
+ case "pageBlockChannel":
197
+ return (0, _1_utilities_js_1.cleanObject)({ type: "channel", chat: (0, _1_chat_p_js_1.constructChatP)(pb.channel) });
198
+ case "pageBlockAudio": {
199
+ const document = _2_tl_js_1.Api.as("document", documents.find((v) => v.id === pb.audio_id));
200
+ const audioAttribute = document.attributes.find((v) => _2_tl_js_1.Api.is("documentAttributeAudio", v));
201
+ if (!audioAttribute) {
202
+ (0, _0_deps_js_1.unreachable)();
203
+ }
204
+ const fileId = {
205
+ type: _file_id_js_1.FileType.Video,
206
+ dcId: document.dc_id,
207
+ location: { type: "common", id: document.id, accessHash: document.access_hash },
208
+ fileReference: document.file_reference,
209
+ };
210
+ return (0, _1_utilities_js_1.cleanObject)({ type: audioAttribute.voice ? "voice" : "audio", fileId: (0, _file_id_js_1.serializeFileId)(fileId), caption: constructPageBlockCaption(pb.caption, photos) });
211
+ }
212
+ case "pageBlockKicker":
213
+ return (0, _1_utilities_js_1.cleanObject)({ type: "kicker", text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.text, photos) });
214
+ case "pageBlockTable":
215
+ return (0, _1_utilities_js_1.cleanObject)({ type: "table", isBordered: !!pb.bordered, isStriped: !!pb.striped, title: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.title, photos), rows: pb.rows.map((v) => constructPageBlockTableRow(v, photos)) });
216
+ case "pageBlockOrderedList":
217
+ return (0, _1_utilities_js_1.cleanObject)({
218
+ type: "orderedList",
219
+ isReversed: !!pb.reversed,
220
+ items: pb.items.map((v) => constructPageBlockOrderedListItem(v, photos, documents)),
221
+ itemsType: pb.type,
222
+ start: pb.start,
223
+ });
224
+ case "pageBlockDetails":
225
+ return { type: "details", isOpen: !!pb.open, title: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.title, photos), blocks: pb.blocks.map((v) => constructPageBlock(v, photos, documents)) };
226
+ case "pageBlockRelatedArticles":
227
+ return {
228
+ type: "relatedArticles",
229
+ title: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.title, photos),
230
+ articles: pb.articles.map(constructPageBlockRelatedArticle),
231
+ };
232
+ case "pageBlockMap":
233
+ return {
234
+ type: "map",
235
+ caption: constructPageBlockCaption(pb.caption, photos),
236
+ width: pb.w,
237
+ height: pb.h,
238
+ zoom: pb.zoom,
239
+ location: (0, _0_location_js_1.constructLocation)(_2_tl_js_1.Api.as("geoPoint", pb.geo)),
240
+ };
241
+ case "pageBlockHeading1":
242
+ return { type: "heading1", text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.text, photos) };
243
+ case "pageBlockHeading2":
244
+ return { type: "heading2", text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.text, photos) };
245
+ case "pageBlockHeading3":
246
+ return { type: "heading3", text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.text, photos) };
247
+ case "pageBlockHeading4":
248
+ return { type: "heading4", text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.text, photos) };
249
+ case "pageBlockHeading5":
250
+ return { type: "heading5", text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.text, photos) };
251
+ case "pageBlockHeading6":
252
+ return { type: "heading6", text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.text, photos) };
253
+ case "pageBlockMath":
254
+ return { type: "math", code: pb.source };
255
+ case "pageBlockThinking":
256
+ return { type: "thinking", text: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.text, photos) };
257
+ case "inputPageBlockMap":
258
+ (0, _0_deps_js_1.unreachable)();
259
+ break;
260
+ case "pageBlockBlockquoteBlocks":
261
+ return { type: "blockQuoteBlocks", blocks: pb.blocks.map((v) => constructPageBlock(v, photos, documents)), caption: (0, _3_rich_text_component_js_1.constructRichTextComponent)(pb.caption, photos) };
262
+ }
263
+ (0, _0_deps_js_1.unreachable)();
264
+ }
265
+ function pageBlockToTlObject(pb) {
266
+ switch (pb.type) {
267
+ case "unsupported":
268
+ return { _: "pageBlockUnsupported" };
269
+ case "title":
270
+ return { _: "pageBlockTitle", text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.text) };
271
+ case "subtitle":
272
+ return { _: "pageBlockSubtitle", text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.text) };
273
+ case "authorDate":
274
+ return { _: "pageBlockAuthorDate", author: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.author), published_date: pb.date };
275
+ case "header":
276
+ return { _: "pageBlockHeader", text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.text) };
277
+ case "subheader":
278
+ return { _: "pageBlockSubheader", text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.text) };
279
+ case "paragraph":
280
+ return { _: "pageBlockParagraph", text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.text) };
281
+ case "pre":
282
+ return { _: "pageBlockPreformatted", text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.text), language: pb.language ?? "" };
283
+ case "footer":
284
+ return { _: "pageBlockFooter", text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.text) };
285
+ case "divider":
286
+ return { _: "pageBlockDivider" };
287
+ case "anchor":
288
+ return { _: "pageBlockAnchor", name: pb.name };
289
+ case "list":
290
+ return { _: "pageBlockList", items: pb.items.map(pageBlockListItemToTlObject) };
291
+ case "blockQuote":
292
+ return { _: "pageBlockBlockquote", text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.text), caption: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.caption) };
293
+ case "pullQuote":
294
+ return { _: "pageBlockPullquote", text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.text), caption: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.caption) };
295
+ case "photo": {
296
+ const location = (0, _file_id_js_1.deserializeFileId)(pb.fileId).location;
297
+ if (!("id" in location)) {
298
+ (0, _0_deps_js_1.unreachable)();
299
+ }
300
+ return { _: "pageBlockPhoto", photo_id: location.id, caption: pageBlockCaptionToTlObject(pb.caption), spoiler: pb.isSpoiler || undefined, url: pb.url, webpage_id: pb.linkPreviewId ? BigInt(pb.linkPreviewId) : undefined };
301
+ }
302
+ case "video":
303
+ case "animation": {
304
+ const location = (0, _file_id_js_1.deserializeFileId)(pb.fileId).location;
305
+ if (!("id" in location)) {
306
+ (0, _0_deps_js_1.unreachable)();
307
+ }
308
+ return { _: "pageBlockVideo", video_id: location.id, caption: pageBlockCaptionToTlObject(pb.caption), spoiler: pb.isSpoiler || undefined, autoplay: pb.isAutoplay || undefined, loop: pb.isLoop || undefined };
309
+ }
310
+ case "cover":
311
+ return { _: "pageBlockCover", cover: pageBlockToTlObject(pb.cover) };
312
+ case "embed":
313
+ return { _: "pageBlockEmbed", caption: pageBlockCaptionToTlObject(pb.caption), allow_scrolling: pb.isScrollingAllowed || undefined, full_width: pb.isFullWidth || undefined, w: pb.width, h: pb.height, html: pb.html, url: pb.url, poster_photo_id: pb.posterPhotoId ? BigInt(pb.posterPhotoId) : undefined };
314
+ case "embedPost":
315
+ return { _: "pageBlockEmbedPost", caption: pageBlockCaptionToTlObject(pb.caption), url: pb.url, author: pb.author, author_photo_id: BigInt(pb.authorPhotoId), blocks: pb.blocks.map(pageBlockToTlObject), date: pb.date, webpage_id: BigInt(pb.linkPreviewId) };
316
+ case "collage":
317
+ return { _: "pageBlockCollage", caption: pageBlockCaptionToTlObject(pb.caption), items: pb.items.map(pageBlockToTlObject) };
318
+ case "slideshow":
319
+ return { _: "pageBlockSlideshow", caption: pageBlockCaptionToTlObject(pb.caption), items: pb.items.map(pageBlockToTlObject) };
320
+ case "channel":
321
+ (0, _0_deps_js_1.unreachable)();
322
+ break;
323
+ case "audio":
324
+ case "voice": {
325
+ const location = (0, _file_id_js_1.deserializeFileId)(pb.fileId).location;
326
+ if (!("id" in location)) {
327
+ (0, _0_deps_js_1.unreachable)();
328
+ }
329
+ return { _: "pageBlockAudio", audio_id: location.id, caption: pageBlockCaptionToTlObject(pb.caption) };
330
+ }
331
+ case "kicker":
332
+ return { _: "pageBlockKicker", text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.text) };
333
+ case "math":
334
+ return { _: "pageBlockMath", source: pb.code };
335
+ case "table":
336
+ return { _: "pageBlockTable", title: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.title), rows: pb.rows.map(pageBlockTableRowToTlObject), bordered: pb.isBordered || undefined, striped: pb.isStriped || undefined };
337
+ case "orderedList":
338
+ return { _: "pageBlockOrderedList", items: pb.items.map(pageBlockOrderedListItemToTlObject), reversed: pb.isReversed || undefined, start: pb.start, type: pb.itemsType };
339
+ case "details":
340
+ return { _: "pageBlockDetails", title: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.title), blocks: pb.blocks.map(pageBlockToTlObject), open: pb.isOpen || undefined };
341
+ case "relatedArticles":
342
+ return { _: "pageBlockRelatedArticles", title: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.title), articles: pb.articles.map(pageBlockRelatedArticleToTlObject) };
343
+ case "map":
344
+ return { _: "inputPageBlockMap", geo: { _: "inputGeoPoint", lat: pb.location.latitude, long: pb.location.longitude, accuracy_radius: pb.location.horizontalAccuracy }, caption: pageBlockCaptionToTlObject(pb.caption), w: pb.width, h: pb.height, zoom: pb.zoom };
345
+ case "heading1":
346
+ return { _: "pageBlockHeading1", text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.text) };
347
+ case "heading2":
348
+ return { _: "pageBlockHeading2", text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.text) };
349
+ case "heading3":
350
+ return { _: "pageBlockHeading3", text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.text) };
351
+ case "heading4":
352
+ return { _: "pageBlockHeading4", text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.text) };
353
+ case "heading5":
354
+ return { _: "pageBlockHeading5", text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.text) };
355
+ case "heading6":
356
+ return { _: "pageBlockHeading6", text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.text) };
357
+ case "thinking":
358
+ return { _: "pageBlockThinking", text: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.text) };
359
+ case "blockQuoteBlocks":
360
+ return { _: "pageBlockBlockquoteBlocks", caption: (0, _3_rich_text_component_js_1.richTextComponentToTlObject)(pb.caption), blocks: pb.blocks.map(pageBlockToTlObject) };
361
+ }
362
+ (0, _0_deps_js_1.unreachable)();
363
+ }
364
+ function collectMediaFileIds(pageBlocks) {
365
+ const fileIds = new Array();
366
+ for (const m of collectPageBlockMedia(pageBlocks)) {
367
+ fileIds.push({ type: m.type, fileId: m.fileId });
368
+ }
369
+ for (const photo of collectRichTextComponentPhoto(collectRichTextComponents(pageBlocks))) {
370
+ fileIds.push({ type: "photo", fileId: photo.fileId });
371
+ }
372
+ return fileIds;
373
+ }
374
+ function collectRichTextComponentPhoto(components) {
375
+ const photos = new Array();
376
+ for (const component of components) {
377
+ for (const c of flattenRichTextComponent(component)) {
378
+ if (c.type === "photo") {
379
+ photos.push(c);
380
+ }
381
+ }
382
+ }
383
+ return photos;
384
+ }
385
+ function flattenRichTextComponent(component) {
386
+ const items = new Array();
387
+ switch (component.type) {
388
+ case "anchor":
389
+ case "dateTime":
390
+ case "bold":
391
+ case "italic":
392
+ case "underline":
393
+ case "strikethrough":
394
+ case "fixed":
395
+ case "link":
396
+ case "emailLink":
397
+ case "subscript":
398
+ case "superscript":
399
+ case "marked":
400
+ case "phoneNumberLink":
401
+ case "spoiler":
402
+ case "mention":
403
+ case "hashtag":
404
+ case "botCommand":
405
+ case "cashtag":
406
+ case "url":
407
+ case "email":
408
+ case "phoneNumber":
409
+ case "bankCard":
410
+ case "textMention":
411
+ for (const item of flattenRichTextComponent(component.text)) {
412
+ items.push(item);
413
+ }
414
+ break;
415
+ case "concatenate":
416
+ for (const c of component.components) {
417
+ for (const i of flattenRichTextComponent(c)) {
418
+ items.push(i);
419
+ }
420
+ }
421
+ }
422
+ return items;
423
+ }
424
+ function collectRichTextComponents(pageBlocks) {
425
+ const components = new Array();
426
+ for (const pb of pageBlocks) {
427
+ switch (pb.type) {
428
+ case "title":
429
+ case "subtitle":
430
+ case "header":
431
+ case "subheader":
432
+ case "paragraph":
433
+ case "pre":
434
+ case "footer":
435
+ case "kicker":
436
+ case "heading1":
437
+ case "heading2":
438
+ case "heading3":
439
+ case "heading4":
440
+ case "heading5":
441
+ case "heading6":
442
+ case "thinking":
443
+ components.push(pb.text);
444
+ break;
445
+ case "authorDate":
446
+ components.push(pb.author);
447
+ break;
448
+ case "list":
449
+ case "orderedList":
450
+ for (const item of pb.items) {
451
+ if (item.type === "text") {
452
+ components.push(item.text);
453
+ }
454
+ else {
455
+ for (const c of collectRichTextComponents(item.blocks)) {
456
+ components.push(c);
457
+ }
458
+ }
459
+ }
460
+ break;
461
+ case "blockQuote":
462
+ case "pullQuote":
463
+ components.push(pb.text);
464
+ components.push(pb.caption);
465
+ break;
466
+ case "photo":
467
+ case "video":
468
+ case "embed":
469
+ case "audio":
470
+ case "map":
471
+ components.push(pb.caption.text);
472
+ components.push(pb.caption.credit);
473
+ break;
474
+ case "cover":
475
+ for (const c of collectRichTextComponents([pb.cover])) {
476
+ components.push(c);
477
+ }
478
+ break;
479
+ case "collage":
480
+ case "slideshow":
481
+ components.push(pb.caption.text);
482
+ components.push(pb.caption.credit);
483
+ for (const c of collectRichTextComponents(pb.items)) {
484
+ components.push(c);
485
+ }
486
+ break;
487
+ case "embedPost":
488
+ components.push(pb.caption.text);
489
+ components.push(pb.caption.credit);
490
+ for (const c of collectRichTextComponents(pb.blocks)) {
491
+ components.push(c);
492
+ }
493
+ break;
494
+ case "math":
495
+ break;
496
+ case "table":
497
+ components.push(pb.title);
498
+ for (const row of pb.rows) {
499
+ for (const cell of row.cells) {
500
+ if (cell.text) {
501
+ components.push(cell.text);
502
+ }
503
+ }
504
+ }
505
+ break;
506
+ case "details":
507
+ components.push(pb.title);
508
+ for (const c of collectRichTextComponents(pb.blocks)) {
509
+ components.push(c);
510
+ }
511
+ break;
512
+ case "blockQuoteBlocks":
513
+ components.push(pb.caption);
514
+ for (const c of collectRichTextComponents(pb.blocks)) {
515
+ components.push(c);
516
+ }
517
+ break;
518
+ }
519
+ }
520
+ return components;
521
+ }
522
+ function collectPageBlockMedia(pageBlocks) {
523
+ const media = new Array();
524
+ for (const pb of pageBlocks) {
525
+ if (pb.type === "photo" || pb.type === "video" || pb.type === "audio" || pb.type === "voice" || pb.type === "animation") {
526
+ media.push(pb);
527
+ }
528
+ else {
529
+ switch (pb.type) {
530
+ case "list":
531
+ for (const item of pb.items) {
532
+ if (item.type === "blockList") {
533
+ for (const m of collectPageBlockMedia(item.blocks)) {
534
+ media.push(m);
535
+ }
536
+ }
537
+ }
538
+ break;
539
+ case "embedPost":
540
+ for (const m of collectPageBlockMedia(pb.blocks)) {
541
+ media.push(m);
542
+ }
543
+ break;
544
+ case "collage":
545
+ case "slideshow":
546
+ for (const m of collectPageBlockMedia(pb.items)) {
547
+ media.push(m);
548
+ }
549
+ break;
550
+ case "orderedList":
551
+ for (const item of pb.items) {
552
+ if (item.type === "blockList") {
553
+ for (const m of collectPageBlockMedia(item.blocks)) {
554
+ media.push(m);
555
+ }
556
+ }
557
+ }
558
+ break;
559
+ case "details":
560
+ case "blockQuoteBlocks":
561
+ for (const m of collectPageBlockMedia(pb.blocks)) {
562
+ media.push(m);
563
+ }
564
+ break;
565
+ }
566
+ }
567
+ }
568
+ return media;
569
+ }
@@ -40,7 +40,7 @@ export interface Poll {
40
40
  type: "regular" | "quiz";
41
41
  /** Whether the poll allows multiple answers. */
42
42
  allowMultipleAnswers?: boolean;
43
- /** The indexes of correct options. */
43
+ /** The indexes of the correct options. */
44
44
  correctOptionIndexes?: number[];
45
45
  /** A text that is shown to the user when the poll is answered. */
46
46
  explanation?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"4_poll.d.ts","sourceRoot":"","sources":["../../src/types/4_poll.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE1E,cAAc;AACd,MAAM,WAAW,IAAI;IACnB,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,gBAAgB,EAAE,aAAa,EAAE,CAAC;IAClC,0BAA0B;IAC1B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,6DAA6D;IAC7D,eAAe,EAAE,MAAM,CAAC;IACxB,kCAAkC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,qCAAqC;IACrC,WAAW,EAAE,OAAO,CAAC;IACrB,4BAA4B;IAC5B,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IACzB,gDAAgD;IAChD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,sCAAsC;IACtC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,mBAAmB,CAAC,EAAE,aAAa,EAAE,CAAC;IACtC,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,GAAG,IAAI,CAqBhE"}
1
+ {"version":3,"file":"4_poll.d.ts","sourceRoot":"","sources":["../../src/types/4_poll.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE1E,cAAc;AACd,MAAM,WAAW,IAAI;IACnB,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,gBAAgB,EAAE,aAAa,EAAE,CAAC;IAClC,0BAA0B;IAC1B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,6DAA6D;IAC7D,eAAe,EAAE,MAAM,CAAC;IACxB,kCAAkC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,qCAAqC;IACrC,WAAW,EAAE,OAAO,CAAC;IACrB,4BAA4B;IAC5B,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IACzB,gDAAgD;IAChD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,0CAA0C;IAC1C,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,mBAAmB,CAAC,EAAE,aAAa,EAAE,CAAC;IACtC,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,GAAG,IAAI,CAqBhE"}
@@ -26,6 +26,10 @@ export interface ReplyToMessage {
26
26
  messageId: number;
27
27
  /** A quoted part of the message that is being replied to. */
28
28
  quote?: ReplyQuote;
29
+ /** The identifier of a poll option to reply to. */
30
+ pollOptionId?: number;
31
+ /** The identifier of a checklist item to reply to. */
32
+ checklistItemId?: number;
29
33
  }
30
34
  /**
31
35
  * Information on a story that a message is replying to.
@@ -1 +1 @@
1
- {"version":3,"file":"4_reply_to.d.ts","sourceRoot":"","sources":["../../src/types/4_reply_to.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,SAAS,CAAC;IAChB,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,wDAAwD;IACxD,MAAM,EAAE,EAAE,CAAC;IACX,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,oDAAoD;AACpD,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG,YAAY,CAAC"}
1
+ {"version":3,"file":"4_reply_to.d.ts","sourceRoot":"","sources":["../../src/types/4_reply_to.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,SAAS,CAAC;IAChB,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,wDAAwD;IACxD,MAAM,EAAE,EAAE,CAAC;IACX,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,oDAAoD;AACpD,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG,YAAY,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import type { PageBlock } from "./4_page_block.js";
21
+ /** @unlisted */
22
+ export interface InputRichTextBlocks {
23
+ type: "blocks";
24
+ blocks: PageBlock[];
25
+ }
26
+ /** @unlisted */
27
+ export interface InputRichTextMarkdown {
28
+ type: "markdown";
29
+ markdown: string;
30
+ }
31
+ /** @unlisted */
32
+ export interface InputRichTextHtml {
33
+ type: "html";
34
+ html: string;
35
+ }
36
+ /** Any type of input rich text. */
37
+ export type InputRichText = InputRichTextBlocks | InputRichTextMarkdown | InputRichTextHtml;
38
+ //# sourceMappingURL=5_input_rich_text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"5_input_rich_text.d.ts","sourceRoot":"","sources":["../../src/types/5_input_rich_text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,gBAAgB;AAChB,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,gBAAgB;AAChB,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,gBAAgB;AAChB,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,mCAAmC;AACnC,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,qBAAqB,GAAG,iBAAiB,CAAC"}