@mtkruto/node 0.0.991 → 0.0.993

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 (254) hide show
  1. package/esm/1_utilities.d.ts +12 -0
  2. package/esm/1_utilities.js +12 -0
  3. package/esm/2_connection.d.ts +2 -0
  4. package/esm/2_connection.js +2 -0
  5. package/esm/2_tl.d.ts +10 -0
  6. package/esm/2_tl.js +10 -0
  7. package/esm/3_storage.d.ts +6 -0
  8. package/esm/3_storage.js +6 -0
  9. package/esm/3_transport.d.ts +4 -0
  10. package/esm/3_transport.js +4 -0
  11. package/esm/3_types.d.ts +35 -0
  12. package/esm/3_types.js +35 -0
  13. package/esm/{constants.d.ts → 4_constants.d.ts} +2 -2
  14. package/esm/{constants.js → 4_constants.js} +1 -1
  15. package/esm/5_client.d.ts +2 -0
  16. package/esm/5_client.js +2 -0
  17. package/esm/client/0_html.d.ts +1 -1
  18. package/esm/client/0_html.js +1 -1
  19. package/esm/client/0_message.d.ts +1 -2
  20. package/esm/client/0_message.js +7 -14
  21. package/esm/client/0_password.d.ts +2 -2
  22. package/esm/client/0_password.js +2 -4
  23. package/esm/client/0_utilities.d.ts +3 -5
  24. package/esm/client/0_utilities.js +3 -22
  25. package/esm/client/1_client_abstract.d.ts +2 -2
  26. package/esm/client/1_client_abstract.js +3 -3
  27. package/esm/client/2_client_plain.d.ts +3 -3
  28. package/esm/client/2_client_plain.js +13 -20
  29. package/esm/client/3_client.d.ts +95 -18
  30. package/esm/client/3_client.js +124 -35
  31. package/esm/connection/0_connection.d.ts +1 -1
  32. package/esm/connection/1_connection_web_socket.js +1 -1
  33. package/esm/mod.d.ts +8 -21
  34. package/esm/mod.js +8 -21
  35. package/esm/storage/0_storage.d.ts +4 -5
  36. package/esm/storage/0_storage.js +3 -8
  37. package/esm/storage/0_utilities.js +2 -2
  38. package/esm/storage/1_storage_local_storage.d.ts +1 -1
  39. package/esm/storage/1_storage_memory.d.ts +1 -1
  40. package/esm/storage/1_storage_session_storage.d.ts +1 -1
  41. package/esm/tl/0_tl_raw_reader.js +1 -1
  42. package/esm/tl/0_tl_raw_writer.js +1 -1
  43. package/esm/tl/1_tl_object.js +1 -1
  44. package/esm/tl/3_deserialize.js +1 -1
  45. package/esm/tl/3_utilities.d.ts +3 -0
  46. package/esm/tl/3_utilities.js +20 -0
  47. package/esm/tl/4_tl_writer.js +1 -1
  48. package/esm/transport/0_obfuscation.d.ts +2 -2
  49. package/esm/transport/0_obfuscation.js +1 -2
  50. package/esm/transport/0_transport.d.ts +1 -2
  51. package/esm/transport/1_transport_abridged.d.ts +1 -1
  52. package/esm/transport/1_transport_abridged.js +1 -1
  53. package/esm/transport/1_transport_intermediate.d.ts +1 -1
  54. package/esm/transport/1_transport_intermediate.js +1 -1
  55. package/esm/transport/2_transport_provider.d.ts +1 -1
  56. package/esm/transport/2_transport_provider.js +1 -1
  57. package/esm/types/!0_file_id.js +6 -9
  58. package/esm/types/!0_misc.d.ts +7 -0
  59. package/esm/types/!0_misc.js +1 -0
  60. package/esm/types/0_audio.d.ts +3 -3
  61. package/esm/types/0_audio.js +1 -1
  62. package/esm/types/0_chat_administrator_rights.d.ts +1 -1
  63. package/esm/types/0_chat_administrator_rights.js +1 -1
  64. package/esm/types/0_chat_photo.d.ts +3 -3
  65. package/esm/types/0_chat_photo.js +1 -1
  66. package/esm/types/0_color.d.ts +2 -0
  67. package/esm/types/0_color.js +16 -0
  68. package/esm/types/0_contact.d.ts +2 -2
  69. package/esm/types/0_dice.d.ts +1 -1
  70. package/esm/types/0_force_reply.d.ts +1 -1
  71. package/esm/types/0_force_reply.js +1 -1
  72. package/esm/types/0_location.d.ts +1 -1
  73. package/esm/types/0_location.js +1 -2
  74. package/esm/types/0_mask_position.d.ts +1 -1
  75. package/esm/types/0_message_entity.d.ts +5 -5
  76. package/esm/types/0_message_entity.js +1 -1
  77. package/esm/types/0_poll_option.d.ts +1 -1
  78. package/esm/types/0_reply_keyboard_remove.d.ts +1 -1
  79. package/esm/types/0_reply_keyboard_remove.js +2 -2
  80. package/esm/types/0_thumbnail.d.ts +2 -2
  81. package/esm/types/0_thumbnail.js +1 -1
  82. package/esm/types/0_venue.d.ts +1 -1
  83. package/esm/types/0_venue.js +1 -2
  84. package/esm/types/0_voice.d.ts +3 -3
  85. package/esm/types/0_web_app_info.d.ts +2 -2
  86. package/esm/types/1_animation.d.ts +3 -3
  87. package/esm/types/1_animation.js +1 -1
  88. package/esm/types/1_chat.d.ts +5 -4
  89. package/esm/types/1_chat.js +8 -9
  90. package/esm/types/1_document.d.ts +4 -4
  91. package/esm/types/1_document.js +1 -1
  92. package/esm/types/1_inline_keyboard_button.d.ts +4 -4
  93. package/esm/types/1_inline_keyboard_button.js +2 -2
  94. package/esm/types/1_keyboard_button.d.ts +8 -8
  95. package/esm/types/1_keyboard_button.js +2 -2
  96. package/esm/types/1_photo.d.ts +2 -2
  97. package/esm/types/1_photo.js +1 -1
  98. package/esm/types/1_poll.d.ts +8 -8
  99. package/esm/types/1_poll.js +1 -1
  100. package/esm/types/1_sticker.d.ts +3 -3
  101. package/esm/types/1_sticker.js +1 -2
  102. package/esm/types/1_user.d.ts +4 -3
  103. package/esm/types/1_user.js +4 -4
  104. package/esm/types/1_video.d.ts +3 -3
  105. package/esm/types/1_video.js +1 -1
  106. package/esm/types/1_video_note.d.ts +2 -2
  107. package/esm/types/1_video_note.js +1 -1
  108. package/esm/types/2_game.d.ts +3 -3
  109. package/esm/types/2_game.js +2 -3
  110. package/esm/types/2_inline_keyboard_markup.d.ts +2 -2
  111. package/esm/types/2_inline_keyboard_markup.js +1 -1
  112. package/esm/types/2_inline_query.d.ts +19 -0
  113. package/esm/types/2_inline_query.js +41 -0
  114. package/esm/types/2_reply_keyboard_markup.d.ts +2 -2
  115. package/esm/types/2_reply_keyboard_markup.js +1 -1
  116. package/esm/types/3_message.d.ts +21 -23
  117. package/esm/types/3_message.js +16 -18
  118. package/esm/types/4_callback_query.d.ts +14 -0
  119. package/esm/types/4_callback_query.js +24 -0
  120. package/esm/utilities/0_base64.js +1 -1
  121. package/esm/utilities/0_crypto.js +1 -1
  122. package/esm/utilities/0_queue.js +1 -1
  123. package/esm/utilities/1_auth.js +1 -1
  124. package/package.json +1 -1
  125. package/script/1_utilities.d.ts +12 -0
  126. package/script/1_utilities.js +28 -0
  127. package/script/2_connection.d.ts +2 -0
  128. package/script/2_connection.js +18 -0
  129. package/script/2_tl.d.ts +10 -0
  130. package/script/2_tl.js +40 -0
  131. package/script/3_storage.d.ts +6 -0
  132. package/script/3_storage.js +22 -0
  133. package/script/3_transport.d.ts +4 -0
  134. package/script/3_transport.js +20 -0
  135. package/script/3_types.d.ts +35 -0
  136. package/script/3_types.js +51 -0
  137. package/script/{constants.d.ts → 4_constants.d.ts} +2 -2
  138. package/script/{constants.js → 4_constants.js} +1 -1
  139. package/script/5_client.d.ts +2 -0
  140. package/script/5_client.js +18 -0
  141. package/script/client/0_html.d.ts +1 -1
  142. package/script/client/0_html.js +2 -2
  143. package/script/client/0_message.d.ts +1 -2
  144. package/script/client/0_message.js +32 -39
  145. package/script/client/0_password.d.ts +2 -2
  146. package/script/client/0_password.js +20 -22
  147. package/script/client/0_utilities.d.ts +3 -5
  148. package/script/client/0_utilities.js +24 -68
  149. package/script/client/1_client_abstract.d.ts +2 -2
  150. package/script/client/1_client_abstract.js +6 -6
  151. package/script/client/2_client_plain.d.ts +3 -3
  152. package/script/client/2_client_plain.js +45 -52
  153. package/script/client/3_client.d.ts +95 -18
  154. package/script/client/3_client.js +368 -303
  155. package/script/connection/0_connection.d.ts +1 -1
  156. package/script/connection/1_connection_web_socket.js +5 -5
  157. package/script/mod.d.ts +8 -21
  158. package/script/mod.js +18 -33
  159. package/script/storage/0_storage.d.ts +4 -5
  160. package/script/storage/0_storage.js +11 -39
  161. package/script/storage/0_utilities.js +6 -6
  162. package/script/storage/1_storage_local_storage.d.ts +1 -1
  163. package/script/storage/1_storage_memory.d.ts +1 -1
  164. package/script/storage/1_storage_session_storage.d.ts +1 -1
  165. package/script/tl/0_tl_raw_reader.js +6 -6
  166. package/script/tl/0_tl_raw_writer.js +7 -7
  167. package/script/tl/1_tl_object.js +3 -3
  168. package/script/tl/3_deserialize.js +2 -2
  169. package/script/tl/3_utilities.d.ts +3 -0
  170. package/script/tl/3_utilities.js +48 -0
  171. package/script/tl/4_tl_writer.js +2 -2
  172. package/script/transport/0_obfuscation.d.ts +2 -2
  173. package/script/transport/0_obfuscation.js +5 -6
  174. package/script/transport/0_transport.d.ts +1 -2
  175. package/script/transport/1_transport_abridged.d.ts +1 -1
  176. package/script/transport/1_transport_abridged.js +3 -3
  177. package/script/transport/1_transport_intermediate.d.ts +1 -1
  178. package/script/transport/1_transport_intermediate.js +3 -3
  179. package/script/transport/2_transport_provider.d.ts +1 -1
  180. package/script/transport/2_transport_provider.js +2 -2
  181. package/script/types/!0_file_id.js +24 -27
  182. package/script/types/!0_misc.d.ts +7 -0
  183. package/script/types/!0_misc.js +2 -0
  184. package/script/types/0_audio.d.ts +3 -3
  185. package/script/types/0_audio.js +2 -25
  186. package/script/types/0_chat_administrator_rights.d.ts +1 -1
  187. package/script/types/0_chat_administrator_rights.js +2 -25
  188. package/script/types/0_chat_photo.d.ts +3 -3
  189. package/script/types/0_chat_photo.js +2 -25
  190. package/script/types/0_color.d.ts +2 -0
  191. package/script/types/{!0_id_color.js → 0_color.js} +10 -10
  192. package/script/types/0_contact.d.ts +2 -2
  193. package/script/types/0_dice.d.ts +1 -1
  194. package/script/types/0_force_reply.d.ts +1 -1
  195. package/script/types/0_force_reply.js +2 -25
  196. package/script/types/0_location.d.ts +1 -1
  197. package/script/types/0_location.js +5 -29
  198. package/script/types/0_mask_position.d.ts +1 -1
  199. package/script/types/0_message_entity.d.ts +5 -5
  200. package/script/types/0_message_entity.js +39 -62
  201. package/script/types/0_poll_option.d.ts +1 -1
  202. package/script/types/0_reply_keyboard_remove.d.ts +1 -1
  203. package/script/types/0_reply_keyboard_remove.js +4 -27
  204. package/script/types/0_thumbnail.d.ts +2 -2
  205. package/script/types/0_thumbnail.js +2 -25
  206. package/script/types/0_venue.d.ts +1 -1
  207. package/script/types/0_venue.js +2 -26
  208. package/script/types/0_voice.d.ts +3 -3
  209. package/script/types/0_web_app_info.d.ts +2 -2
  210. package/script/types/1_animation.d.ts +3 -3
  211. package/script/types/1_animation.js +2 -25
  212. package/script/types/1_chat.d.ts +5 -4
  213. package/script/types/1_chat.js +20 -44
  214. package/script/types/1_document.d.ts +4 -4
  215. package/script/types/1_document.js +2 -25
  216. package/script/types/1_inline_keyboard_button.d.ts +4 -4
  217. package/script/types/1_inline_keyboard_button.js +19 -42
  218. package/script/types/1_keyboard_button.d.ts +8 -8
  219. package/script/types/1_keyboard_button.js +24 -47
  220. package/script/types/1_photo.d.ts +2 -2
  221. package/script/types/1_photo.js +4 -27
  222. package/script/types/1_poll.d.ts +8 -8
  223. package/script/types/1_poll.js +2 -2
  224. package/script/types/1_sticker.d.ts +3 -3
  225. package/script/types/1_sticker.js +6 -30
  226. package/script/types/1_user.d.ts +4 -3
  227. package/script/types/1_user.js +6 -29
  228. package/script/types/1_video.d.ts +3 -3
  229. package/script/types/1_video.js +2 -25
  230. package/script/types/1_video_note.d.ts +2 -2
  231. package/script/types/1_video_note.js +2 -25
  232. package/script/types/2_game.d.ts +3 -3
  233. package/script/types/2_game.js +6 -30
  234. package/script/types/2_inline_keyboard_markup.d.ts +2 -2
  235. package/script/types/2_inline_keyboard_markup.js +3 -26
  236. package/script/types/2_inline_query.d.ts +19 -0
  237. package/script/types/2_inline_query.js +45 -0
  238. package/script/types/2_reply_keyboard_markup.d.ts +2 -2
  239. package/script/types/2_reply_keyboard_markup.js +3 -26
  240. package/script/types/3_message.d.ts +21 -23
  241. package/script/types/3_message.js +94 -119
  242. package/script/types/4_callback_query.d.ts +14 -0
  243. package/script/types/4_callback_query.js +28 -0
  244. package/script/utilities/0_base64.js +3 -3
  245. package/script/utilities/0_crypto.js +3 -3
  246. package/script/utilities/0_queue.js +2 -2
  247. package/script/utilities/1_auth.js +5 -5
  248. package/esm/types/!0_id_color.d.ts +0 -1
  249. package/esm/types/!0_id_color.js +0 -16
  250. package/script/types/!0_id_color.d.ts +0 -1
  251. /package/esm/{deps.d.ts → 0_deps.d.ts} +0 -0
  252. /package/esm/{deps.js → 0_deps.js} +0 -0
  253. /package/script/{deps.d.ts → 0_deps.d.ts} +0 -0
  254. /package/script/{deps.js → 0_deps.js} +0 -0
@@ -1,86 +1,63 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.messageEntityToTlObject = exports.constructMessageEntity = void 0;
27
- const types = __importStar(require("../tl/2_types.js"));
4
+ const _2_tl_js_1 = require("../2_tl.js");
28
5
  function constructMessageEntity(obj) {
29
- if (obj instanceof types.MessageEntityMention) {
6
+ if (obj instanceof _2_tl_js_1.types.MessageEntityMention) {
30
7
  return { type: "mention", offset: obj.offset, length: obj.length };
31
8
  }
32
- else if (obj instanceof types.MessageEntityHashtag) {
9
+ else if (obj instanceof _2_tl_js_1.types.MessageEntityHashtag) {
33
10
  return { type: "hashtag", offset: obj.offset, length: obj.length };
34
11
  }
35
- else if (obj instanceof types.MessageEntityBotCommand) {
12
+ else if (obj instanceof _2_tl_js_1.types.MessageEntityBotCommand) {
36
13
  return { type: "bot_command", offset: obj.offset ?? 0, length: obj.length };
37
14
  }
38
- else if (obj instanceof types.MessageEntityURL) {
15
+ else if (obj instanceof _2_tl_js_1.types.MessageEntityURL) {
39
16
  return { type: "url", offset: obj.offset, length: obj.length };
40
17
  }
41
- else if (obj instanceof types.MessageEntityEmail) {
18
+ else if (obj instanceof _2_tl_js_1.types.MessageEntityEmail) {
42
19
  return { type: "email", offset: obj.offset, length: obj.length };
43
20
  }
44
- else if (obj instanceof types.MessageEntityBold) {
21
+ else if (obj instanceof _2_tl_js_1.types.MessageEntityBold) {
45
22
  return { type: "bold", offset: obj.offset, length: obj.length };
46
23
  }
47
- else if (obj instanceof types.MessageEntityItalic) {
24
+ else if (obj instanceof _2_tl_js_1.types.MessageEntityItalic) {
48
25
  return { type: "italic", offset: obj.offset, length: obj.length };
49
26
  }
50
- else if (obj instanceof types.MessageEntityCode) {
27
+ else if (obj instanceof _2_tl_js_1.types.MessageEntityCode) {
51
28
  return { type: "code", offset: obj.offset, length: obj.length };
52
29
  }
53
- else if (obj instanceof types.MessageEntityPre) {
30
+ else if (obj instanceof _2_tl_js_1.types.MessageEntityPre) {
54
31
  return { type: "pre", offset: obj.offset, length: obj.length, language: obj.language };
55
32
  }
56
- else if (obj instanceof types.MessageEntityTextURL) {
33
+ else if (obj instanceof _2_tl_js_1.types.MessageEntityTextURL) {
57
34
  return { type: "text_link", offset: obj.offset, length: obj.length, url: obj.url };
58
35
  }
59
- else if (obj instanceof types.MessageEntityMentionName) {
36
+ else if (obj instanceof _2_tl_js_1.types.MessageEntityMentionName) {
60
37
  return { type: "text_mention", offset: obj.offset, length: obj.length, userId: Number(obj.userId) };
61
38
  }
62
- else if (obj instanceof types.MessageEntityCashtag) {
39
+ else if (obj instanceof _2_tl_js_1.types.MessageEntityCashtag) {
63
40
  return { type: "cashtag", offset: obj.offset, length: obj.length };
64
41
  }
65
- else if (obj instanceof types.MessageEntityPhone) {
42
+ else if (obj instanceof _2_tl_js_1.types.MessageEntityPhone) {
66
43
  return { type: "phone_number", offset: obj.offset, length: obj.length };
67
44
  }
68
- else if (obj instanceof types.MessageEntityUnderline) {
45
+ else if (obj instanceof _2_tl_js_1.types.MessageEntityUnderline) {
69
46
  return { type: "underline", offset: obj.offset, length: obj.length };
70
47
  }
71
- else if (obj instanceof types.MessageEntityStrike) {
48
+ else if (obj instanceof _2_tl_js_1.types.MessageEntityStrike) {
72
49
  return { type: "strikethrough", offset: obj.offset, length: obj.length };
73
50
  }
74
- else if (obj instanceof types.MessageEntityBlockquote) {
51
+ else if (obj instanceof _2_tl_js_1.types.MessageEntityBlockquote) {
75
52
  return { type: "blockquote", offset: obj.offset, length: obj.length };
76
53
  }
77
- else if (obj instanceof types.MessageEntityBankCard) {
54
+ else if (obj instanceof _2_tl_js_1.types.MessageEntityBankCard) {
78
55
  return { type: "bank_card", offset: obj.offset, length: obj.length };
79
56
  }
80
- else if (obj instanceof types.MessageEntitySpoiler) {
57
+ else if (obj instanceof _2_tl_js_1.types.MessageEntitySpoiler) {
81
58
  return { type: "spoiler", offset: obj.offset, length: obj.length };
82
59
  }
83
- else if (obj instanceof types.MessageEntityCustomEmoji) {
60
+ else if (obj instanceof _2_tl_js_1.types.MessageEntityCustomEmoji) {
84
61
  return { type: "custom_emoji", offset: obj.offset, length: obj.length, customEmojiId: String(obj.documentId) };
85
62
  }
86
63
  else {
@@ -92,43 +69,43 @@ function messageEntityToTlObject(entity) {
92
69
  const { offset, length } = entity;
93
70
  switch (entity.type) {
94
71
  case "mention":
95
- return new types.MessageEntityMention({ offset, length });
72
+ return new _2_tl_js_1.types.MessageEntityMention({ offset, length });
96
73
  case "hashtag":
97
- return new types.MessageEntityHashtag({ offset, length });
74
+ return new _2_tl_js_1.types.MessageEntityHashtag({ offset, length });
98
75
  case "bot_command":
99
- return new types.MessageEntityBotCommand({ offset, length });
76
+ return new _2_tl_js_1.types.MessageEntityBotCommand({ offset, length });
100
77
  case "url":
101
- return new types.MessageEntityURL({ offset, length });
78
+ return new _2_tl_js_1.types.MessageEntityURL({ offset, length });
102
79
  case "email":
103
- return new types.MessageEntityEmail({ offset, length });
80
+ return new _2_tl_js_1.types.MessageEntityEmail({ offset, length });
104
81
  case "bold":
105
- return new types.MessageEntityBold({ offset, length });
82
+ return new _2_tl_js_1.types.MessageEntityBold({ offset, length });
106
83
  case "italic":
107
- return new types.MessageEntityItalic({ offset, length });
84
+ return new _2_tl_js_1.types.MessageEntityItalic({ offset, length });
108
85
  case "code":
109
- return new types.MessageEntityCode({ offset, length });
86
+ return new _2_tl_js_1.types.MessageEntityCode({ offset, length });
110
87
  case "pre":
111
- return new types.MessageEntityPre({ offset, length, language: entity.language });
88
+ return new _2_tl_js_1.types.MessageEntityPre({ offset, length, language: entity.language });
112
89
  case "text_link":
113
- return new types.MessageEntityTextURL({ offset, length, url: entity.url });
90
+ return new _2_tl_js_1.types.MessageEntityTextURL({ offset, length, url: entity.url });
114
91
  case "text_mention":
115
- return new types.MessageEntityMentionName({ offset, length, userId: BigInt(entity.userId) });
92
+ return new _2_tl_js_1.types.MessageEntityMentionName({ offset, length, userId: BigInt(entity.userId) });
116
93
  case "cashtag":
117
- return new types.MessageEntityCashtag({ offset, length });
94
+ return new _2_tl_js_1.types.MessageEntityCashtag({ offset, length });
118
95
  case "phone_number":
119
- return new types.MessageEntityPhone({ offset, length });
96
+ return new _2_tl_js_1.types.MessageEntityPhone({ offset, length });
120
97
  case "underline":
121
- return new types.MessageEntityUnderline({ offset, length });
98
+ return new _2_tl_js_1.types.MessageEntityUnderline({ offset, length });
122
99
  case "strikethrough":
123
- return new types.MessageEntityStrike({ offset, length });
100
+ return new _2_tl_js_1.types.MessageEntityStrike({ offset, length });
124
101
  case "blockquote":
125
- return new types.MessageEntityBlockquote({ offset, length });
102
+ return new _2_tl_js_1.types.MessageEntityBlockquote({ offset, length });
126
103
  case "bank_card":
127
- return new types.MessageEntityBankCard({ offset, length });
104
+ return new _2_tl_js_1.types.MessageEntityBankCard({ offset, length });
128
105
  case "spoiler":
129
- return new types.MessageEntitySpoiler({ offset, length });
106
+ return new _2_tl_js_1.types.MessageEntitySpoiler({ offset, length });
130
107
  case "custom_emoji":
131
- return new types.MessageEntityCustomEmoji({ offset, length, documentId: BigInt(entity.customEmojiId) });
108
+ return new _2_tl_js_1.types.MessageEntityCustomEmoji({ offset, length, documentId: BigInt(entity.customEmojiId) });
132
109
  }
133
110
  }
134
111
  exports.messageEntityToTlObject = messageEntityToTlObject;
@@ -1,4 +1,4 @@
1
- import * as types from "../tl/2_types.js";
1
+ import { types } from "../2_tl.js";
2
2
  export interface PollOption {
3
3
  /** Option text, 1-100 characters */
4
4
  text: string;
@@ -1,4 +1,4 @@
1
- import * as types from "../tl/2_types.js";
1
+ import { types } from "../2_tl.js";
2
2
  /** Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button. */
3
3
  export interface ReplyKeyboardRemove {
4
4
  /** Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use _one_time_keyboard_ in `ReplyKeyboardMarkup`) */
@@ -1,36 +1,13 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.replyKeyboardRemoveToTlObject = exports.constructReplyKeyboardRemove = void 0;
27
- const _0_object_js_1 = require("../utilities/0_object.js");
28
- const types = __importStar(require("../tl/2_types.js"));
4
+ const _1_utilities_js_1 = require("../1_utilities.js");
5
+ const _2_tl_js_1 = require("../2_tl.js");
29
6
  function constructReplyKeyboardRemove(replyMarkup_) {
30
- return (0, _0_object_js_1.cleanObject)({ removeKeyboard: true, selective: replyMarkup_.selective });
7
+ return (0, _1_utilities_js_1.cleanObject)({ removeKeyboard: true, selective: replyMarkup_.selective });
31
8
  }
32
9
  exports.constructReplyKeyboardRemove = constructReplyKeyboardRemove;
33
10
  function replyKeyboardRemoveToTlObject(replyMarkup) {
34
- return new types.ReplyKeyboardHide({ selective: replyMarkup.selective || undefined });
11
+ return new _2_tl_js_1.types.ReplyKeyboardHide({ selective: replyMarkup.selective || undefined });
35
12
  }
36
13
  exports.replyKeyboardRemoveToTlObject = replyKeyboardRemoveToTlObject;
@@ -1,9 +1,9 @@
1
- import * as types from "../tl/2_types.js";
1
+ import { types } from "../2_tl.js";
2
2
  /** This object represents thumbnail of a file or a sticker. */
3
3
  export interface Thumbnail {
4
4
  /** Identifier for this file, which can be used to download or reuse the file */
5
5
  fileId: string;
6
- /** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
6
+ /** Unique identifier for this file, which is supposed to be the same over time and for different users and bots. Can't be used to download or reuse the file. */
7
7
  fileUniqueId: string;
8
8
  /** Photo width */
9
9
  width: number;
@@ -1,33 +1,10 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.constructThumbnail = void 0;
27
- const types = __importStar(require("../tl/2_types.js"));
4
+ const _2_tl_js_1 = require("../2_tl.js");
28
5
  const _0_file_id_js_1 = require("./!0_file_id.js");
29
6
  function constructThumbnail(size, file) {
30
- const fileType = file instanceof types.Photo ? _0_file_id_js_1.FileType.Photo : _0_file_id_js_1.FileType.Document;
7
+ const fileType = file instanceof _2_tl_js_1.types.Photo ? _0_file_id_js_1.FileType.Photo : _0_file_id_js_1.FileType.Document;
31
8
  const fileId = new _0_file_id_js_1.FileID(null, null, fileType, file.dcId, {
32
9
  mediaId: file.id,
33
10
  accessHash: file.accessHash,
@@ -1,4 +1,4 @@
1
- import * as types from "../tl/2_types.js";
1
+ import { types } from "../2_tl.js";
2
2
  import { Location } from "./0_location.js";
3
3
  /** */
4
4
  export interface Venue {
@@ -1,33 +1,9 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.constructVenue = void 0;
27
- const _1_tl_object_js_1 = require("../tl/1_tl_object.js");
28
- const types = __importStar(require("../tl/2_types.js"));
4
+ const _2_tl_js_1 = require("../2_tl.js");
29
5
  function constructVenue(media_) {
30
- const geo = media_.geo[_1_tl_object_js_1.as](types.GeoPoint);
6
+ const geo = media_.geo[_2_tl_js_1.as](_2_tl_js_1.types.GeoPoint);
31
7
  return {
32
8
  location: {
33
9
  latitude: geo.lat,
@@ -1,15 +1,15 @@
1
- import * as types from "../tl/2_types.js";
1
+ import { types } from "../2_tl.js";
2
2
  /** This object represents a voice note. */
3
3
  export interface Voice {
4
4
  /** Identifier for this file, which can be used to download or reuse the file */
5
5
  fileId: string;
6
- /** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
6
+ /** Unique identifier for this file, which is supposed to be the same over time and for different users and bots. Can't be used to download or reuse the file. */
7
7
  fileUniqueId: string;
8
8
  /** Duration of the audio in seconds as defined by sender */
9
9
  duration: number;
10
10
  /** MIME type of the file as defined by sender */
11
11
  mimeType: string;
12
- /** File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. */
12
+ /** File size in bytes */
13
13
  fileSize: number;
14
14
  }
15
15
  export declare function constructVoice(document: types.Document, audioAttributes: types.DocumentAttributeAudio, fileId: string, fileUniqueId: string): Voice;
@@ -1,6 +1,6 @@
1
- /** Describes a [Web App](https://core.telegram.org/bots/webapps). */
1
+ /** Describes a Web App */
2
2
  export interface WebAppInfo {
3
- /** An HTTPS URL of a Web App to be opened with additional data as specified in [Initializing Web Apps](https://core.telegram.org/bots/webapps#initializing-web-apps) */
3
+ /** An HTTPS URL of a Web App to be opened with additional data */
4
4
  url: string;
5
5
  }
6
6
  export declare function constructWebAppInfo(url: string): WebAppInfo;
@@ -1,10 +1,10 @@
1
- import * as types from "../tl/2_types.js";
1
+ import { types } from "../2_tl.js";
2
2
  import { Thumbnail } from "./0_thumbnail.js";
3
3
  /** This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). */
4
4
  export interface Animation {
5
5
  /** Identifier for this file, which can be used to download or reuse the file */
6
6
  fileId: string;
7
- /** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
7
+ /** Unique identifier for this file, which is supposed to be the same over time and for different users and bots. Can't be used to download or reuse the file. */
8
8
  fileUniqueId: string;
9
9
  /** Video width as defined by sender */
10
10
  width: number;
@@ -18,7 +18,7 @@ export interface Animation {
18
18
  fileName?: string;
19
19
  /** MIME type of the file as defined by sender */
20
20
  mimeType: string;
21
- /** File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. */
21
+ /** File size in bytes */
22
22
  fileSize: number;
23
23
  }
24
24
  export declare function constructAnimation(document: types.Document, videoAttribute: types.DocumentAttributeVideo | undefined, fileAttribute: types.DocumentAttributeFilename | undefined, fileId: string, fileUniqueId: string): Animation;
@@ -1,30 +1,7 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.constructAnimation = void 0;
27
- const types = __importStar(require("../tl/2_types.js"));
4
+ const _2_tl_js_1 = require("../2_tl.js");
28
5
  const _0_thumbnail_js_1 = require("./0_thumbnail.js");
29
6
  function constructAnimation(document, videoAttribute, fileAttribute, fileId, fileUniqueId) {
30
7
  return {
@@ -33,7 +10,7 @@ function constructAnimation(document, videoAttribute, fileAttribute, fileId, fil
33
10
  width: videoAttribute?.w ?? 0,
34
11
  height: videoAttribute?.h ?? 0,
35
12
  duration: videoAttribute?.duration ?? 0,
36
- thumbnails: document.thumbs ? document.thumbs.map((v) => v instanceof types.PhotoSize ? (0, _0_thumbnail_js_1.constructThumbnail)(v, document) : null).filter((v) => v) : [],
13
+ thumbnails: document.thumbs ? document.thumbs.map((v) => v instanceof _2_tl_js_1.types.PhotoSize ? (0, _0_thumbnail_js_1.constructThumbnail)(v, document) : null).filter((v) => v) : [],
37
14
  fileName: fileAttribute?.fileName,
38
15
  mimeType: document.mimeType,
39
16
  fileSize: Number(document.size),
@@ -1,4 +1,5 @@
1
- import * as types from "../tl/2_types.js";
1
+ import { types } from "../2_tl.js";
2
+ import { Color } from "./0_color.js";
2
3
  import { ChatPhoto } from "./0_chat_photo.js";
3
4
  export declare enum ChatType {
4
5
  Private = "private",
@@ -8,11 +9,11 @@ export declare enum ChatType {
8
9
  }
9
10
  export declare namespace Chat {
10
11
  interface Base {
11
- /** Type of chat, can be either private”, group”, supergroup or channel */
12
+ /** Type of chat, can be either "private", "group", "supergroup" or "channel" */
12
13
  type: ChatType;
13
- /** Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */
14
+ /** Unique identifier for this chat */
14
15
  id: number;
15
- idColor: string;
16
+ color: Color;
16
17
  /** Chat photo. */
17
18
  photo?: ChatPhoto;
18
19
  }
@@ -1,34 +1,10 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.constructChat = exports.ChatType = void 0;
27
- const constants_js_1 = require("../constants.js");
28
- const _0_control_js_1 = require("../utilities/0_control.js");
29
- const _0_object_js_1 = require("../utilities/0_object.js");
30
- const types = __importStar(require("../tl/2_types.js"));
31
- const _0_id_color_js_1 = require("./!0_id_color.js");
4
+ const _1_utilities_js_1 = require("../1_utilities.js");
5
+ const _2_tl_js_1 = require("../2_tl.js");
6
+ const _4_constants_js_1 = require("../4_constants.js");
7
+ const _0_color_js_1 = require("./0_color.js");
32
8
  const _0_chat_photo_js_1 = require("./0_chat_photo.js");
33
9
  var ChatType;
34
10
  (function (ChatType) {
@@ -38,13 +14,13 @@ var ChatType;
38
14
  ChatType["Channel"] = "channel";
39
15
  })(ChatType = exports.ChatType || (exports.ChatType = {}));
40
16
  function constructChat(chat) {
41
- if (chat instanceof types.User) {
17
+ if (chat instanceof _2_tl_js_1.types.User) {
42
18
  const id = Number(chat.id);
43
19
  const chat_ = {
44
20
  type: ChatType.Private,
45
21
  isBot: chat.bot || false,
46
22
  id,
47
- idColor: (0, _0_id_color_js_1.getIdColor)(id),
23
+ color: (0, _0_color_js_1.getColor)(id),
48
24
  firstName: chat.firstName || "",
49
25
  lastName: chat.lastName,
50
26
  isScam: chat.scam || false,
@@ -56,33 +32,33 @@ function constructChat(chat) {
56
32
  chat_.isRestricted = chat.restricted || false;
57
33
  chat_.restrictionReason = chat.restrictionReason;
58
34
  }
59
- if (chat.photo instanceof types.UserProfilePhoto) {
35
+ if (chat.photo instanceof _2_tl_js_1.types.UserProfilePhoto) {
60
36
  chat_.photo = (0, _0_chat_photo_js_1.constructChatPhoto)(chat.photo, chat_.id, chat.accessHash ?? 0n);
61
37
  }
62
- return (0, _0_object_js_1.cleanObject)(chat_);
38
+ return (0, _1_utilities_js_1.cleanObject)(chat_);
63
39
  }
64
- else if (chat instanceof types.Chat) {
40
+ else if (chat instanceof _2_tl_js_1.types.Chat) {
65
41
  const id = Number(-chat.id);
66
42
  const chat_ = {
67
43
  type: ChatType.Group,
68
44
  id,
69
- idColor: (0, _0_id_color_js_1.getIdColor)(id),
45
+ color: (0, _0_color_js_1.getColor)(id),
70
46
  title: chat.title,
71
47
  isCreator: chat.creator || false,
72
48
  };
73
- if (chat.photo instanceof types.ChatPhoto) {
49
+ if (chat.photo instanceof _2_tl_js_1.types.ChatPhoto) {
74
50
  chat_.photo = (0, _0_chat_photo_js_1.constructChatPhoto)(chat.photo, chat_.id, 0n);
75
51
  }
76
- return (0, _0_object_js_1.cleanObject)(chat_);
52
+ return (0, _1_utilities_js_1.cleanObject)(chat_);
77
53
  }
78
- else if (chat instanceof types.Channel) {
54
+ else if (chat instanceof _2_tl_js_1.types.Channel) {
79
55
  let chat_;
80
56
  const { title, scam: isScam = false, fake: isFake = false, verified: isVerified = false, restricted: isRestricted = false, } = chat;
81
- const id = constants_js_1.ZERO_CHANNEL_ID + -Number(chat.id);
57
+ const id = _4_constants_js_1.ZERO_CHANNEL_ID + -Number(chat.id);
82
58
  if (chat.megagroup) {
83
59
  chat_ = {
84
60
  id,
85
- idColor: (0, _0_id_color_js_1.getIdColor)(id),
61
+ color: (0, _0_color_js_1.getColor)(id),
86
62
  type: ChatType.Supergroup,
87
63
  title,
88
64
  isScam,
@@ -93,10 +69,10 @@ function constructChat(chat) {
93
69
  };
94
70
  }
95
71
  else {
96
- const id = constants_js_1.ZERO_CHANNEL_ID + -Number(chat.id);
72
+ const id = _4_constants_js_1.ZERO_CHANNEL_ID + -Number(chat.id);
97
73
  chat_ = {
98
74
  id,
99
- idColor: (0, _0_id_color_js_1.getIdColor)(id),
75
+ color: (0, _0_color_js_1.getColor)(id),
100
76
  type: ChatType.Channel,
101
77
  title,
102
78
  isScam,
@@ -110,13 +86,13 @@ function constructChat(chat) {
110
86
  if (chat_.isRestricted) {
111
87
  chat_.restrictionReason = chat.restrictionReason;
112
88
  }
113
- if (chat.photo instanceof types.ChatPhoto) {
89
+ if (chat.photo instanceof _2_tl_js_1.types.ChatPhoto) {
114
90
  chat_.photo = (0, _0_chat_photo_js_1.constructChatPhoto)(chat.photo, chat_.id, chat.accessHash ?? 0n);
115
91
  }
116
- return (0, _0_object_js_1.cleanObject)(chat_);
92
+ return (0, _1_utilities_js_1.cleanObject)(chat_);
117
93
  }
118
94
  else {
119
- (0, _0_control_js_1.UNREACHABLE)();
95
+ (0, _1_utilities_js_1.UNREACHABLE)();
120
96
  }
121
97
  }
122
98
  exports.constructChat = constructChat;
@@ -1,10 +1,10 @@
1
- import * as types from "../tl/2_types.js";
1
+ import { types } from "../2_tl.js";
2
2
  import { Thumbnail } from "./0_thumbnail.js";
3
- /** This object represents a general file (as opposed to [photos](https://corefork.telegram.org/bots/api#photosize), [voice messages](https://corefork.telegram.org/bots/api#voice) and [audio files](https://corefork.telegram.org/bots/api#audio)). */
3
+ /** This object represents a general file (as opposed to photos, voice messages and audio files). */
4
4
  export interface Document {
5
5
  /** Identifier for this file, which can be used to download or reuse the file */
6
6
  fileId: string;
7
- /** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
7
+ /** Unique identifier for this file, which is supposed to be the same over time and for different users and bots. Can't be used to download or reuse the file. */
8
8
  fileUniqueId: string;
9
9
  /** Document thumbnail as defined by sender */
10
10
  thumbnails: Thumbnail[];
@@ -12,7 +12,7 @@ export interface Document {
12
12
  fileName: string;
13
13
  /** MIME type of the file as defined by sender */
14
14
  mimeType: string;
15
- /** File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. */
15
+ /** File size in bytes */
16
16
  fileSize: number;
17
17
  }
18
18
  export declare function constructDocument(document: types.Document, fileNameAttribute: types.DocumentAttributeFilename, fileId: string, fileUniqueId: string): Document;
@@ -1,36 +1,13 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.constructDocument = void 0;
27
- const types = __importStar(require("../tl/2_types.js"));
4
+ const _2_tl_js_1 = require("../2_tl.js");
28
5
  const _0_thumbnail_js_1 = require("./0_thumbnail.js");
29
6
  function constructDocument(document, fileNameAttribute, fileId, fileUniqueId) {
30
7
  return {
31
8
  fileId,
32
9
  fileUniqueId,
33
- thumbnails: document.thumbs ? document.thumbs.map((v) => v instanceof types.PhotoSize ? (0, _0_thumbnail_js_1.constructThumbnail)(v, document) : null).filter((v) => v) : [],
10
+ thumbnails: document.thumbs ? document.thumbs.map((v) => v instanceof _2_tl_js_1.types.PhotoSize ? (0, _0_thumbnail_js_1.constructThumbnail)(v, document) : null).filter((v) => v) : [],
34
11
  fileName: fileNameAttribute.fileName,
35
12
  mimeType: document.mimeType,
36
13
  fileSize: Number(document.size),