@mtkruto/node 0.148.0 → 0.150.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.
- package/esm/3_types.d.ts +3 -0
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +3 -0
- package/esm/client/0_params.d.ts +8 -0
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_utilities.d.ts +1 -1
- package/esm/client/0_utilities.d.ts.map +1 -1
- package/esm/client/1_client_generic.d.ts +20 -2
- package/esm/client/1_client_generic.d.ts.map +1 -1
- package/esm/client/3_filters.d.ts.map +1 -1
- package/esm/client/3_filters.js +4 -1
- package/esm/client/3_message_manager.d.ts +4 -2
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +84 -1
- package/esm/client/6_client.d.ts +20 -2
- package/esm/client/6_client.d.ts.map +1 -1
- package/esm/client/6_client.js +22 -0
- package/esm/client/6_client_dispatcher.d.ts +20 -2
- package/esm/client/6_client_dispatcher.d.ts.map +1 -1
- package/esm/client/6_client_dispatcher.js +22 -0
- package/esm/tl/1_telegram_api.d.ts +120 -29
- package/esm/tl/1_telegram_api.d.ts.map +1 -1
- package/esm/tl/1_telegram_api.js +124 -26
- package/esm/types/2_message_entity.d.ts +16 -0
- package/esm/types/2_message_entity.d.ts.map +1 -1
- package/esm/types/2_message_entity.js +51 -45
- package/esm/types/3_rich_text_component.d.ts +268 -0
- package/esm/types/3_rich_text_component.d.ts.map +1 -0
- package/esm/types/3_rich_text_component.js +161 -0
- package/esm/types/4_page_block.d.ts +479 -0
- package/esm/types/4_page_block.d.ts.map +1 -0
- package/esm/types/4_page_block.js +552 -0
- package/esm/types/5_input_rich_text.d.ts +38 -0
- package/esm/types/5_input_rich_text.d.ts.map +1 -0
- package/esm/types/5_input_rich_text.js +20 -0
- package/esm/types/6_message.d.ts +20 -1
- package/esm/types/6_message.d.ts.map +1 -1
- package/esm/types/6_message.js +26 -0
- package/package.json +1 -1
- package/script/3_types.d.ts +3 -0
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +3 -0
- package/script/client/0_params.d.ts +8 -0
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_utilities.d.ts +1 -1
- package/script/client/0_utilities.d.ts.map +1 -1
- package/script/client/1_client_generic.d.ts +20 -2
- package/script/client/1_client_generic.d.ts.map +1 -1
- package/script/client/3_filters.d.ts.map +1 -1
- package/script/client/3_filters.js +4 -1
- package/script/client/3_message_manager.d.ts +4 -2
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +83 -0
- package/script/client/6_client.d.ts +20 -2
- package/script/client/6_client.d.ts.map +1 -1
- package/script/client/6_client.js +22 -0
- package/script/client/6_client_dispatcher.d.ts +20 -2
- package/script/client/6_client_dispatcher.d.ts.map +1 -1
- package/script/client/6_client_dispatcher.js +22 -0
- package/script/tl/1_telegram_api.d.ts +120 -29
- package/script/tl/1_telegram_api.d.ts.map +1 -1
- package/script/tl/1_telegram_api.js +124 -26
- package/script/types/2_message_entity.d.ts +16 -0
- package/script/types/2_message_entity.d.ts.map +1 -1
- package/script/types/2_message_entity.js +53 -45
- package/script/types/3_rich_text_component.d.ts +268 -0
- package/script/types/3_rich_text_component.d.ts.map +1 -0
- package/script/types/3_rich_text_component.js +165 -0
- package/script/types/4_page_block.d.ts +479 -0
- package/script/types/4_page_block.d.ts.map +1 -0
- package/script/types/4_page_block.js +569 -0
- package/script/types/5_input_rich_text.d.ts +38 -0
- package/script/types/5_input_rich_text.d.ts.map +1 -0
- package/script/types/5_input_rich_text.js +21 -0
- package/script/types/6_message.d.ts +20 -1
- package/script/types/6_message.d.ts.map +1 -1
- package/script/types/6_message.js +26 -0
|
@@ -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
|
+
}
|
|
@@ -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"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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 });
|