@mtkruto/node 0.69.0 → 0.70.1

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 (565) hide show
  1. package/esm/0_deps.d.ts +3 -1
  2. package/esm/0_deps.d.ts.map +1 -1
  3. package/esm/0_deps.js +3 -1
  4. package/esm/3_types.d.ts +35 -35
  5. package/esm/3_types.d.ts.map +1 -1
  6. package/esm/3_types.js +35 -35
  7. package/esm/_dnt.polyfills.d.ts +20 -13
  8. package/esm/_dnt.polyfills.d.ts.map +1 -1
  9. package/esm/_dnt.polyfills.js +120 -11
  10. package/esm/client/0_abortable_loop.d.ts +27 -0
  11. package/esm/client/0_abortable_loop.d.ts.map +1 -0
  12. package/esm/client/0_abortable_loop.js +49 -0
  13. package/esm/client/0_client_abstract.d.ts +1 -0
  14. package/esm/client/0_client_abstract.d.ts.map +1 -1
  15. package/esm/client/0_client_abstract.js +3 -0
  16. package/esm/client/0_filters.d.ts +9 -3
  17. package/esm/client/0_filters.d.ts.map +1 -1
  18. package/esm/client/0_filters.js +4 -1
  19. package/esm/client/0_params.d.ts +1 -1
  20. package/esm/client/0_password.d.ts +2 -2
  21. package/esm/client/0_password.d.ts.map +1 -1
  22. package/esm/client/0_storage_operations.d.ts +53 -71
  23. package/esm/client/0_storage_operations.d.ts.map +1 -1
  24. package/esm/client/0_storage_operations.js +241 -238
  25. package/esm/client/0_update_processor.d.ts +2 -2
  26. package/esm/client/0_update_processor.d.ts.map +1 -1
  27. package/esm/client/0_utilities.d.ts +2 -2
  28. package/esm/client/0_utilities.d.ts.map +1 -1
  29. package/esm/client/1_types.d.ts +2 -2
  30. package/esm/client/1_types.d.ts.map +1 -1
  31. package/esm/client/2_account_manager.js +5 -5
  32. package/esm/client/2_business_connection_manager.d.ts +1 -1
  33. package/esm/client/2_business_connection_manager.d.ts.map +1 -1
  34. package/esm/client/2_business_connection_manager.js +3 -3
  35. package/esm/client/2_client_encrypted.d.ts +1 -1
  36. package/esm/client/2_client_encrypted.d.ts.map +1 -1
  37. package/esm/client/2_client_encrypted.js +26 -23
  38. package/esm/client/2_file_manager.js +2 -2
  39. package/esm/client/2_network_statistics_manager.d.ts +2 -2
  40. package/esm/client/2_network_statistics_manager.d.ts.map +1 -1
  41. package/esm/client/2_network_statistics_manager.js +30 -4
  42. package/esm/client/2_payment_manager.d.ts +1 -1
  43. package/esm/client/2_payment_manager.d.ts.map +1 -1
  44. package/esm/client/2_payment_manager.js +2 -2
  45. package/esm/client/2_reaction_manager.d.ts +1 -1
  46. package/esm/client/2_reaction_manager.d.ts.map +1 -1
  47. package/esm/client/2_reaction_manager.js +2 -2
  48. package/esm/client/2_translations_manager.d.ts +1 -1
  49. package/esm/client/2_translations_manager.d.ts.map +1 -1
  50. package/esm/client/2_translations_manager.js +15 -11
  51. package/esm/client/2_update_manager.d.ts +4 -2
  52. package/esm/client/2_update_manager.d.ts.map +1 -1
  53. package/esm/client/2_update_manager.js +62 -80
  54. package/esm/client/3_message_manager.d.ts +2 -2
  55. package/esm/client/3_message_manager.d.ts.map +1 -1
  56. package/esm/client/3_message_manager.js +5 -5
  57. package/esm/client/3_video_chat_manager.d.ts +1 -1
  58. package/esm/client/3_video_chat_manager.d.ts.map +1 -1
  59. package/esm/client/4_callback_query_manager.d.ts +1 -1
  60. package/esm/client/4_callback_query_manager.d.ts.map +1 -1
  61. package/esm/client/4_callback_query_manager.js +1 -1
  62. package/esm/client/4_chat_list_manager.d.ts +2 -3
  63. package/esm/client/4_chat_list_manager.d.ts.map +1 -1
  64. package/esm/client/4_chat_list_manager.js +10 -265
  65. package/esm/client/4_chat_manager.d.ts +2 -2
  66. package/esm/client/4_chat_manager.d.ts.map +1 -1
  67. package/esm/client/4_chat_manager.js +7 -7
  68. package/esm/client/4_gift_manager.js +3 -3
  69. package/esm/client/4_inline_query_manager.d.ts +1 -1
  70. package/esm/client/4_inline_query_manager.d.ts.map +1 -1
  71. package/esm/client/4_inline_query_manager.js +3 -3
  72. package/esm/client/4_link_preview_manager.d.ts +1 -1
  73. package/esm/client/4_link_preview_manager.d.ts.map +1 -1
  74. package/esm/client/4_link_preview_manager.js +3 -3
  75. package/esm/client/4_poll_manager.d.ts +1 -1
  76. package/esm/client/4_poll_manager.d.ts.map +1 -1
  77. package/esm/client/4_poll_manager.js +1 -1
  78. package/esm/client/4_story_manager.d.ts +1 -1
  79. package/esm/client/4_story_manager.d.ts.map +1 -1
  80. package/esm/client/4_story_manager.js +7 -7
  81. package/esm/client/5_client.d.ts +15 -9
  82. package/esm/client/5_client.d.ts.map +1 -1
  83. package/esm/client/5_client.js +420 -382
  84. package/esm/deps/jsr.io/@std/cache/0.2.0/_serialize_arg_list.d.ts +12 -0
  85. package/esm/deps/jsr.io/@std/cache/0.2.0/_serialize_arg_list.d.ts.map +1 -0
  86. package/esm/deps/jsr.io/@std/cache/0.2.0/_serialize_arg_list.js +69 -0
  87. package/esm/deps/jsr.io/@std/cache/0.2.0/lru_cache.d.ts +112 -0
  88. package/esm/deps/jsr.io/@std/cache/0.2.0/lru_cache.d.ts.map +1 -0
  89. package/esm/deps/jsr.io/@std/cache/0.2.0/lru_cache.js +140 -0
  90. package/esm/deps/jsr.io/@std/cache/0.2.0/memoize.d.ts +111 -0
  91. package/esm/deps/jsr.io/@std/cache/0.2.0/memoize.d.ts.map +1 -0
  92. package/esm/deps/jsr.io/@std/cache/0.2.0/memoize.js +82 -0
  93. package/esm/deps/jsr.io/@std/encoding/1.0.7/hex.d.ts +39 -0
  94. package/esm/deps/jsr.io/@std/encoding/1.0.7/hex.d.ts.map +1 -0
  95. package/esm/deps/jsr.io/@std/encoding/1.0.7/hex.js +109 -0
  96. package/esm/session/1_session.d.ts +1 -0
  97. package/esm/session/1_session.d.ts.map +1 -1
  98. package/esm/session/1_session.js +3 -0
  99. package/esm/session/2_session_encrypted.d.ts +2 -2
  100. package/esm/session/2_session_encrypted.d.ts.map +1 -1
  101. package/esm/session/2_session_encrypted.js +198 -135
  102. package/esm/storage/0_storage.d.ts +1 -0
  103. package/esm/storage/0_storage.d.ts.map +1 -1
  104. package/esm/storage/2_storage_indexed_db.d.ts +1 -0
  105. package/esm/storage/2_storage_indexed_db.d.ts.map +1 -1
  106. package/esm/storage/2_storage_indexed_db.js +3 -0
  107. package/esm/storage/2_storage_local_storage.node.d.ts +1 -0
  108. package/esm/storage/2_storage_local_storage.node.d.ts.map +1 -1
  109. package/esm/storage/2_storage_local_storage.node.js +3 -0
  110. package/esm/storage/2_storage_memory.d.ts +1 -0
  111. package/esm/storage/2_storage_memory.d.ts.map +1 -1
  112. package/esm/storage/2_storage_memory.js +3 -0
  113. package/esm/storage/2_storage_session_storage.d.ts +1 -0
  114. package/esm/storage/2_storage_session_storage.d.ts.map +1 -1
  115. package/esm/storage/2_storage_session_storage.js +3 -0
  116. package/esm/tl/0_utilities.d.ts +1 -0
  117. package/esm/tl/0_utilities.d.ts.map +1 -1
  118. package/esm/tl/0_utilities.js +20 -1
  119. package/esm/tl/1_telegram_api.d.ts +810 -254
  120. package/esm/tl/1_telegram_api.d.ts.map +1 -1
  121. package/esm/tl/1_telegram_api.js +912 -213
  122. package/esm/tl/1_tl_reader.d.ts +2 -2
  123. package/esm/tl/1_tl_reader.d.ts.map +1 -1
  124. package/esm/tl/1_tl_writer.d.ts +2 -2
  125. package/esm/tl/1_tl_writer.d.ts.map +1 -1
  126. package/esm/tl/2_mtproto.d.ts +1 -1
  127. package/esm/tl/2_mtproto.d.ts.map +1 -1
  128. package/esm/tl/2_telegram.d.ts +1 -1
  129. package/esm/tl/2_telegram.d.ts.map +1 -1
  130. package/esm/types/0_file_source.d.ts +1 -1
  131. package/esm/types/0_file_source.d.ts.map +1 -1
  132. package/esm/types/1_chat_p.d.ts +10 -0
  133. package/esm/types/1_chat_p.d.ts.map +1 -1
  134. package/esm/types/1_chat_p.js +4 -0
  135. package/esm/types/2_chat.d.ts +2 -5
  136. package/esm/types/2_chat.d.ts.map +1 -1
  137. package/esm/types/2_chat.js +10 -15
  138. package/esm/types/{0_message_entity.d.ts → 2_message_entity.d.ts} +3 -3
  139. package/esm/types/{0_message_entity.d.ts.map → 2_message_entity.d.ts.map} +1 -1
  140. package/esm/types/{0_message_entity.js → 2_message_entity.js} +7 -7
  141. package/esm/types/2_message_reaction_count.d.ts +2 -3
  142. package/esm/types/2_message_reaction_count.d.ts.map +1 -1
  143. package/esm/types/2_message_reaction_count.js +4 -6
  144. package/esm/types/2_poll_answer.d.ts +2 -3
  145. package/esm/types/2_poll_answer.d.ts.map +1 -1
  146. package/esm/types/2_poll_answer.js +4 -5
  147. package/esm/types/2_story_interactive_area.d.ts +2 -2
  148. package/esm/types/2_story_interactive_area.d.ts.map +1 -1
  149. package/esm/types/2_story_interactive_area.js +2 -2
  150. package/esm/types/{1_story_privacy.d.ts → 2_story_privacy.d.ts} +3 -3
  151. package/esm/types/{1_story_privacy.d.ts.map → 2_story_privacy.d.ts.map} +1 -1
  152. package/esm/types/{1_story_privacy.js → 2_story_privacy.js} +10 -10
  153. package/{script/types/1_user.d.ts → esm/types/2_user.d.ts} +5 -1
  154. package/esm/types/2_user.d.ts.map +1 -0
  155. package/esm/types/{1_user.js → 2_user.js} +24 -0
  156. package/esm/types/{2_business_connection.d.ts → 3_business_connection.d.ts} +4 -4
  157. package/esm/types/3_business_connection.d.ts.map +1 -0
  158. package/esm/types/{2_business_connection.js → 3_business_connection.js} +10 -3
  159. package/{script/types/2_chat_member.d.ts → esm/types/3_chat_member.d.ts} +6 -4
  160. package/esm/types/{2_chat_member.d.ts.map → 3_chat_member.d.ts.map} +1 -1
  161. package/esm/types/{2_chat_member.js → 3_chat_member.js} +5 -5
  162. package/esm/types/{2_chat_settings.d.ts → 3_chat_settings.d.ts} +2 -2
  163. package/{script/types/2_chat_settings.d.ts.map → esm/types/3_chat_settings.d.ts.map} +1 -1
  164. package/esm/types/{2_chat_settings.js → 3_chat_settings.js} +1 -1
  165. package/esm/types/{2_chosen_inline_result.d.ts → 3_chosen_inline_result.d.ts} +4 -4
  166. package/esm/types/3_chosen_inline_result.d.ts.map +1 -0
  167. package/esm/types/{2_chosen_inline_result.js → 3_chosen_inline_result.js} +3 -3
  168. package/esm/types/{2_forward_header.d.ts → 3_forward_header.d.ts} +4 -5
  169. package/esm/types/3_forward_header.d.ts.map +1 -0
  170. package/esm/types/{2_forward_header.js → 3_forward_header.js} +11 -12
  171. package/{script/types/2_game.d.ts → esm/types/3_game.d.ts} +2 -2
  172. package/esm/types/3_game.d.ts.map +1 -0
  173. package/esm/types/{2_gift_upgraded_component.d.ts → 3_gift_upgraded_component.d.ts} +2 -2
  174. package/esm/types/{2_gift_upgraded_component.d.ts.map → 3_gift_upgraded_component.d.ts.map} +1 -1
  175. package/esm/types/{2_gift_upgraded_component.js → 3_gift_upgraded_component.js} +1 -1
  176. package/esm/types/{2_inline_query.d.ts → 3_inline_query.d.ts} +4 -4
  177. package/esm/types/3_inline_query.d.ts.map +1 -0
  178. package/esm/types/{2_inline_query.js → 3_inline_query.js} +5 -5
  179. package/{script/types/1_input_media.d.ts → esm/types/3_input_media.d.ts} +2 -2
  180. package/esm/types/{1_input_media.d.ts.map → 3_input_media.d.ts.map} +1 -1
  181. package/{script/types/2_invite_link.d.ts → esm/types/3_invite_link.d.ts} +4 -4
  182. package/{script/types/2_invite_link.d.ts.map → esm/types/3_invite_link.d.ts.map} +1 -1
  183. package/esm/types/{2_invite_link.js → 3_invite_link.js} +5 -5
  184. package/{script/types/2_message_reactions.d.ts → esm/types/3_message_reactions.d.ts} +5 -6
  185. package/esm/types/3_message_reactions.d.ts.map +1 -0
  186. package/esm/types/{2_message_reactions.js → 3_message_reactions.js} +10 -12
  187. package/esm/types/{1_poll_option.d.ts → 3_poll_option.d.ts} +2 -2
  188. package/esm/types/{1_poll_option.d.ts.map → 3_poll_option.d.ts.map} +1 -1
  189. package/esm/types/{1_poll_option.js → 3_poll_option.js} +1 -1
  190. package/esm/types/{2_pre_checkout_query.d.ts → 3_pre_checkout_query.d.ts} +4 -4
  191. package/esm/types/3_pre_checkout_query.d.ts.map +1 -0
  192. package/esm/types/{2_pre_checkout_query.js → 3_pre_checkout_query.js} +5 -5
  193. package/{script/types/1_reply_quote.d.ts → esm/types/3_reply_quote.d.ts} +2 -2
  194. package/esm/types/{1_reply_quote.d.ts.map → 3_reply_quote.d.ts.map} +1 -1
  195. package/esm/types/{1_reply_quote.js → 3_reply_quote.js} +1 -1
  196. package/esm/types/3_story.d.ts +4 -5
  197. package/esm/types/3_story.d.ts.map +1 -1
  198. package/esm/types/3_story.js +6 -7
  199. package/esm/types/{3_chat_member_updated.d.ts → 4_chat_member_updated.d.ts} +6 -7
  200. package/esm/types/4_chat_member_updated.d.ts.map +1 -0
  201. package/esm/types/{3_chat_member_updated.js → 4_chat_member_updated.js} +13 -14
  202. package/esm/types/{3_gift.d.ts → 4_gift.d.ts} +6 -6
  203. package/esm/types/{3_gift.d.ts.map → 4_gift.d.ts.map} +1 -1
  204. package/esm/types/{3_gift.js → 4_gift.js} +7 -7
  205. package/esm/types/{3_join_request.d.ts → 4_join_request.d.ts} +6 -7
  206. package/esm/types/4_join_request.d.ts.map +1 -0
  207. package/esm/types/{3_join_request.js → 4_join_request.js} +17 -18
  208. package/esm/types/{2_poll.d.ts → 4_poll.d.ts} +3 -3
  209. package/esm/types/{2_poll.d.ts.map → 4_poll.d.ts.map} +1 -1
  210. package/esm/types/{2_poll.js → 4_poll.js} +2 -2
  211. package/{script/types/2_reply_to.d.ts → esm/types/4_reply_to.d.ts} +2 -2
  212. package/esm/types/{2_reply_to.d.ts.map → 4_reply_to.d.ts.map} +1 -1
  213. package/esm/types/{4_claimed_gift.d.ts → 5_claimed_gift.d.ts} +5 -6
  214. package/esm/types/5_claimed_gift.d.ts.map +1 -0
  215. package/esm/types/{4_claimed_gift.js → 5_claimed_gift.js} +4 -4
  216. package/esm/types/{4_link_preview.d.ts → 5_link_preview.d.ts} +4 -4
  217. package/{script/types/4_link_preview.d.ts.map → esm/types/5_link_preview.d.ts.map} +1 -1
  218. package/esm/types/{4_link_preview.js → 5_link_preview.js} +3 -3
  219. package/esm/types/{5_claimed_gifts.d.ts → 6_claimed_gifts.d.ts} +4 -4
  220. package/esm/types/6_claimed_gifts.d.ts.map +1 -0
  221. package/esm/types/{5_claimed_gifts.js → 6_claimed_gifts.js} +4 -4
  222. package/esm/types/{5_message.d.ts → 6_message.d.ts} +10 -11
  223. package/esm/types/6_message.d.ts.map +1 -0
  224. package/esm/types/{5_message.js → 6_message.js} +41 -66
  225. package/{script/types/5_message_content.d.ts → esm/types/6_message_content.d.ts} +3 -3
  226. package/esm/types/{5_message_content.d.ts.map → 6_message_content.d.ts.map} +1 -1
  227. package/{script/types/6_callback_query.d.ts → esm/types/7_callback_query.d.ts} +5 -5
  228. package/esm/types/{6_callback_query.d.ts.map → 7_callback_query.d.ts.map} +1 -1
  229. package/esm/types/{6_callback_query.js → 7_callback_query.js} +5 -5
  230. package/{script/types/6_chat_list_item.d.ts → esm/types/7_chat_list_item.d.ts} +6 -7
  231. package/esm/types/7_chat_list_item.d.ts.map +1 -0
  232. package/esm/types/{6_chat_list_item.js → 7_chat_list_item.js} +11 -11
  233. package/{script/types/6_inline_query_result.d.ts → esm/types/7_inline_query_result.d.ts} +3 -3
  234. package/esm/types/{6_inline_query_result.d.ts.map → 7_inline_query_result.d.ts.map} +1 -1
  235. package/esm/types/{6_inline_query_result.js → 7_inline_query_result.js} +1 -1
  236. package/esm/types/{6_saved_chat.d.ts → 7_saved_chat.d.ts} +4 -5
  237. package/esm/types/7_saved_chat.d.ts.map +1 -0
  238. package/esm/types/{6_saved_chat.js → 7_saved_chat.js} +4 -4
  239. package/esm/types/{6_topic.d.ts → 7_topic.d.ts} +2 -2
  240. package/esm/types/{6_topic.d.ts.map → 7_topic.d.ts.map} +1 -1
  241. package/esm/types/{7_inline_query_answer.d.ts → 8_inline_query_answer.d.ts} +2 -2
  242. package/esm/types/{7_inline_query_answer.d.ts.map → 8_inline_query_answer.d.ts.map} +1 -1
  243. package/esm/types/{7_inline_query_answer.js → 8_inline_query_answer.js} +1 -1
  244. package/{script/types/7_saved_chats.d.ts → esm/types/8_saved_chats.d.ts} +5 -5
  245. package/esm/types/8_saved_chats.d.ts.map +1 -0
  246. package/esm/types/{7_saved_chats.js → 8_saved_chats.js} +3 -3
  247. package/esm/types/{7_update.d.ts → 8_update.d.ts} +35 -16
  248. package/esm/types/8_update.d.ts.map +1 -0
  249. package/esm/types/_file_id.d.ts +1 -1
  250. package/esm/types/_file_id.d.ts.map +1 -1
  251. package/esm/types/_getters.d.ts +0 -7
  252. package/esm/types/_getters.d.ts.map +1 -1
  253. package/esm/utilities/0_hash.d.ts +2 -2
  254. package/esm/utilities/0_hash.d.ts.map +1 -1
  255. package/esm/utilities/0_misc.d.ts +1 -0
  256. package/esm/utilities/0_misc.d.ts.map +1 -1
  257. package/esm/utilities/0_misc.js +14 -1
  258. package/esm/utilities/0_part_stream.d.ts +1 -1
  259. package/esm/utilities/0_part_stream.d.ts.map +1 -1
  260. package/package.json +1 -1
  261. package/script/0_deps.d.ts +3 -1
  262. package/script/0_deps.d.ts.map +1 -1
  263. package/script/0_deps.js +6 -1
  264. package/script/3_types.d.ts +35 -35
  265. package/script/3_types.d.ts.map +1 -1
  266. package/script/3_types.js +35 -35
  267. package/script/_dnt.polyfills.d.ts +20 -13
  268. package/script/_dnt.polyfills.d.ts.map +1 -1
  269. package/script/_dnt.polyfills.js +120 -11
  270. package/script/client/0_abortable_loop.d.ts +27 -0
  271. package/script/client/0_abortable_loop.d.ts.map +1 -0
  272. package/script/client/0_abortable_loop.js +53 -0
  273. package/script/client/0_client_abstract.d.ts +1 -0
  274. package/script/client/0_client_abstract.d.ts.map +1 -1
  275. package/script/client/0_client_abstract.js +3 -0
  276. package/script/client/0_filters.d.ts +9 -3
  277. package/script/client/0_filters.d.ts.map +1 -1
  278. package/script/client/0_filters.js +4 -1
  279. package/script/client/0_params.d.ts +1 -1
  280. package/script/client/0_password.d.ts +2 -2
  281. package/script/client/0_password.d.ts.map +1 -1
  282. package/script/client/0_storage_operations.d.ts +53 -71
  283. package/script/client/0_storage_operations.d.ts.map +1 -1
  284. package/script/client/0_storage_operations.js +239 -236
  285. package/script/client/0_update_processor.d.ts +2 -2
  286. package/script/client/0_update_processor.d.ts.map +1 -1
  287. package/script/client/0_utilities.d.ts +2 -2
  288. package/script/client/0_utilities.d.ts.map +1 -1
  289. package/script/client/1_types.d.ts +2 -2
  290. package/script/client/1_types.d.ts.map +1 -1
  291. package/script/client/2_account_manager.js +5 -5
  292. package/script/client/2_business_connection_manager.d.ts +1 -1
  293. package/script/client/2_business_connection_manager.d.ts.map +1 -1
  294. package/script/client/2_business_connection_manager.js +3 -3
  295. package/script/client/2_client_encrypted.d.ts +1 -1
  296. package/script/client/2_client_encrypted.d.ts.map +1 -1
  297. package/script/client/2_client_encrypted.js +26 -23
  298. package/script/client/2_file_manager.js +2 -2
  299. package/script/client/2_network_statistics_manager.d.ts +2 -2
  300. package/script/client/2_network_statistics_manager.d.ts.map +1 -1
  301. package/script/client/2_network_statistics_manager.js +30 -4
  302. package/script/client/2_payment_manager.d.ts +1 -1
  303. package/script/client/2_payment_manager.d.ts.map +1 -1
  304. package/script/client/2_payment_manager.js +2 -2
  305. package/script/client/2_reaction_manager.d.ts +1 -1
  306. package/script/client/2_reaction_manager.d.ts.map +1 -1
  307. package/script/client/2_reaction_manager.js +2 -2
  308. package/script/client/2_translations_manager.d.ts +1 -1
  309. package/script/client/2_translations_manager.d.ts.map +1 -1
  310. package/script/client/2_translations_manager.js +15 -11
  311. package/script/client/2_update_manager.d.ts +4 -2
  312. package/script/client/2_update_manager.d.ts.map +1 -1
  313. package/script/client/2_update_manager.js +62 -80
  314. package/script/client/3_message_manager.d.ts +2 -2
  315. package/script/client/3_message_manager.d.ts.map +1 -1
  316. package/script/client/3_message_manager.js +5 -5
  317. package/script/client/3_video_chat_manager.d.ts +1 -1
  318. package/script/client/3_video_chat_manager.d.ts.map +1 -1
  319. package/script/client/4_callback_query_manager.d.ts +1 -1
  320. package/script/client/4_callback_query_manager.d.ts.map +1 -1
  321. package/script/client/4_callback_query_manager.js +1 -1
  322. package/script/client/4_chat_list_manager.d.ts +2 -3
  323. package/script/client/4_chat_list_manager.d.ts.map +1 -1
  324. package/script/client/4_chat_list_manager.js +9 -264
  325. package/script/client/4_chat_manager.d.ts +2 -2
  326. package/script/client/4_chat_manager.d.ts.map +1 -1
  327. package/script/client/4_chat_manager.js +7 -7
  328. package/script/client/4_gift_manager.js +3 -3
  329. package/script/client/4_inline_query_manager.d.ts +1 -1
  330. package/script/client/4_inline_query_manager.d.ts.map +1 -1
  331. package/script/client/4_inline_query_manager.js +3 -3
  332. package/script/client/4_link_preview_manager.d.ts +1 -1
  333. package/script/client/4_link_preview_manager.d.ts.map +1 -1
  334. package/script/client/4_link_preview_manager.js +3 -3
  335. package/script/client/4_poll_manager.d.ts +1 -1
  336. package/script/client/4_poll_manager.d.ts.map +1 -1
  337. package/script/client/4_poll_manager.js +1 -1
  338. package/script/client/4_story_manager.d.ts +1 -1
  339. package/script/client/4_story_manager.d.ts.map +1 -1
  340. package/script/client/4_story_manager.js +7 -7
  341. package/script/client/5_client.d.ts +15 -9
  342. package/script/client/5_client.d.ts.map +1 -1
  343. package/script/client/5_client.js +418 -380
  344. package/script/deps/jsr.io/@std/cache/0.2.0/_serialize_arg_list.d.ts +12 -0
  345. package/script/deps/jsr.io/@std/cache/0.2.0/_serialize_arg_list.d.ts.map +1 -0
  346. package/script/deps/jsr.io/@std/cache/0.2.0/_serialize_arg_list.js +72 -0
  347. package/script/deps/jsr.io/@std/cache/0.2.0/lru_cache.d.ts +112 -0
  348. package/script/deps/jsr.io/@std/cache/0.2.0/lru_cache.d.ts.map +1 -0
  349. package/script/deps/jsr.io/@std/cache/0.2.0/lru_cache.js +144 -0
  350. package/script/deps/jsr.io/@std/cache/0.2.0/memoize.d.ts +111 -0
  351. package/script/deps/jsr.io/@std/cache/0.2.0/memoize.d.ts.map +1 -0
  352. package/script/deps/jsr.io/@std/cache/0.2.0/memoize.js +85 -0
  353. package/script/deps/jsr.io/@std/encoding/1.0.7/hex.d.ts +39 -0
  354. package/script/deps/jsr.io/@std/encoding/1.0.7/hex.d.ts.map +1 -0
  355. package/script/deps/jsr.io/@std/encoding/1.0.7/hex.js +113 -0
  356. package/script/session/1_session.d.ts +1 -0
  357. package/script/session/1_session.d.ts.map +1 -1
  358. package/script/session/1_session.js +3 -0
  359. package/script/session/2_session_encrypted.d.ts +2 -2
  360. package/script/session/2_session_encrypted.d.ts.map +1 -1
  361. package/script/session/2_session_encrypted.js +197 -134
  362. package/script/storage/0_storage.d.ts +1 -0
  363. package/script/storage/0_storage.d.ts.map +1 -1
  364. package/script/storage/2_storage_indexed_db.d.ts +1 -0
  365. package/script/storage/2_storage_indexed_db.d.ts.map +1 -1
  366. package/script/storage/2_storage_indexed_db.js +3 -0
  367. package/script/storage/2_storage_local_storage.node.d.ts +1 -0
  368. package/script/storage/2_storage_local_storage.node.d.ts.map +1 -1
  369. package/script/storage/2_storage_local_storage.node.js +3 -0
  370. package/script/storage/2_storage_memory.d.ts +1 -0
  371. package/script/storage/2_storage_memory.d.ts.map +1 -1
  372. package/script/storage/2_storage_memory.js +3 -0
  373. package/script/storage/2_storage_session_storage.d.ts +1 -0
  374. package/script/storage/2_storage_session_storage.d.ts.map +1 -1
  375. package/script/storage/2_storage_session_storage.js +3 -0
  376. package/script/tl/0_utilities.d.ts +1 -0
  377. package/script/tl/0_utilities.d.ts.map +1 -1
  378. package/script/tl/0_utilities.js +20 -0
  379. package/script/tl/1_telegram_api.d.ts +810 -254
  380. package/script/tl/1_telegram_api.d.ts.map +1 -1
  381. package/script/tl/1_telegram_api.js +912 -213
  382. package/script/tl/1_tl_reader.d.ts +2 -2
  383. package/script/tl/1_tl_reader.d.ts.map +1 -1
  384. package/script/tl/1_tl_writer.d.ts +2 -2
  385. package/script/tl/1_tl_writer.d.ts.map +1 -1
  386. package/script/tl/2_mtproto.d.ts +1 -1
  387. package/script/tl/2_mtproto.d.ts.map +1 -1
  388. package/script/tl/2_telegram.d.ts +1 -1
  389. package/script/tl/2_telegram.d.ts.map +1 -1
  390. package/script/types/0_file_source.d.ts +1 -1
  391. package/script/types/0_file_source.d.ts.map +1 -1
  392. package/script/types/1_chat_p.d.ts +10 -0
  393. package/script/types/1_chat_p.d.ts.map +1 -1
  394. package/script/types/1_chat_p.js +5 -0
  395. package/script/types/2_chat.d.ts +2 -5
  396. package/script/types/2_chat.d.ts.map +1 -1
  397. package/script/types/2_chat.js +10 -15
  398. package/script/types/{0_message_entity.d.ts → 2_message_entity.d.ts} +3 -3
  399. package/script/types/{0_message_entity.d.ts.map → 2_message_entity.d.ts.map} +1 -1
  400. package/script/types/{0_message_entity.js → 2_message_entity.js} +7 -7
  401. package/script/types/2_message_reaction_count.d.ts +2 -3
  402. package/script/types/2_message_reaction_count.d.ts.map +1 -1
  403. package/script/types/2_message_reaction_count.js +4 -6
  404. package/script/types/2_poll_answer.d.ts +2 -3
  405. package/script/types/2_poll_answer.d.ts.map +1 -1
  406. package/script/types/2_poll_answer.js +4 -5
  407. package/script/types/2_story_interactive_area.d.ts +2 -2
  408. package/script/types/2_story_interactive_area.d.ts.map +1 -1
  409. package/script/types/2_story_interactive_area.js +2 -2
  410. package/script/types/{1_story_privacy.d.ts → 2_story_privacy.d.ts} +3 -3
  411. package/script/types/{1_story_privacy.d.ts.map → 2_story_privacy.d.ts.map} +1 -1
  412. package/script/types/{1_story_privacy.js → 2_story_privacy.js} +10 -10
  413. package/{esm/types/1_user.d.ts → script/types/2_user.d.ts} +5 -1
  414. package/script/types/2_user.d.ts.map +1 -0
  415. package/script/types/{1_user.js → 2_user.js} +25 -0
  416. package/script/types/{2_business_connection.d.ts → 3_business_connection.d.ts} +4 -4
  417. package/script/types/3_business_connection.d.ts.map +1 -0
  418. package/script/types/{2_business_connection.js → 3_business_connection.js} +10 -3
  419. package/{esm/types/2_chat_member.d.ts → script/types/3_chat_member.d.ts} +6 -4
  420. package/script/types/{2_chat_member.d.ts.map → 3_chat_member.d.ts.map} +1 -1
  421. package/script/types/{2_chat_member.js → 3_chat_member.js} +5 -5
  422. package/script/types/{2_chat_settings.d.ts → 3_chat_settings.d.ts} +2 -2
  423. package/{esm/types/2_chat_settings.d.ts.map → script/types/3_chat_settings.d.ts.map} +1 -1
  424. package/script/types/{2_chat_settings.js → 3_chat_settings.js} +2 -2
  425. package/script/types/{2_chosen_inline_result.d.ts → 3_chosen_inline_result.d.ts} +4 -4
  426. package/script/types/3_chosen_inline_result.d.ts.map +1 -0
  427. package/script/types/{2_chosen_inline_result.js → 3_chosen_inline_result.js} +4 -4
  428. package/script/types/{2_forward_header.d.ts → 3_forward_header.d.ts} +4 -5
  429. package/script/types/3_forward_header.d.ts.map +1 -0
  430. package/script/types/{2_forward_header.js → 3_forward_header.js} +11 -12
  431. package/{esm/types/2_game.d.ts → script/types/3_game.d.ts} +2 -2
  432. package/script/types/3_game.d.ts.map +1 -0
  433. package/script/types/{2_gift_upgraded_component.d.ts → 3_gift_upgraded_component.d.ts} +2 -2
  434. package/script/types/{2_gift_upgraded_component.d.ts.map → 3_gift_upgraded_component.d.ts.map} +1 -1
  435. package/script/types/{2_gift_upgraded_component.js → 3_gift_upgraded_component.js} +2 -2
  436. package/script/types/{2_inline_query.d.ts → 3_inline_query.d.ts} +4 -4
  437. package/script/types/3_inline_query.d.ts.map +1 -0
  438. package/script/types/{2_inline_query.js → 3_inline_query.js} +5 -5
  439. package/{esm/types/1_input_media.d.ts → script/types/3_input_media.d.ts} +2 -2
  440. package/script/types/{1_input_media.d.ts.map → 3_input_media.d.ts.map} +1 -1
  441. package/{esm/types/2_invite_link.d.ts → script/types/3_invite_link.d.ts} +4 -4
  442. package/{esm/types/2_invite_link.d.ts.map → script/types/3_invite_link.d.ts.map} +1 -1
  443. package/script/types/{2_invite_link.js → 3_invite_link.js} +5 -5
  444. package/{esm/types/2_message_reactions.d.ts → script/types/3_message_reactions.d.ts} +5 -6
  445. package/script/types/3_message_reactions.d.ts.map +1 -0
  446. package/script/types/{2_message_reactions.js → 3_message_reactions.js} +10 -12
  447. package/script/types/{1_poll_option.d.ts → 3_poll_option.d.ts} +2 -2
  448. package/script/types/{1_poll_option.d.ts.map → 3_poll_option.d.ts.map} +1 -1
  449. package/script/types/{1_poll_option.js → 3_poll_option.js} +2 -2
  450. package/script/types/{2_pre_checkout_query.d.ts → 3_pre_checkout_query.d.ts} +4 -4
  451. package/script/types/3_pre_checkout_query.d.ts.map +1 -0
  452. package/script/types/{2_pre_checkout_query.js → 3_pre_checkout_query.js} +5 -5
  453. package/{esm/types/1_reply_quote.d.ts → script/types/3_reply_quote.d.ts} +2 -2
  454. package/script/types/{1_reply_quote.d.ts.map → 3_reply_quote.d.ts.map} +1 -1
  455. package/script/types/{1_reply_quote.js → 3_reply_quote.js} +2 -2
  456. package/script/types/3_story.d.ts +4 -5
  457. package/script/types/3_story.d.ts.map +1 -1
  458. package/script/types/3_story.js +8 -9
  459. package/script/types/{3_chat_member_updated.d.ts → 4_chat_member_updated.d.ts} +6 -7
  460. package/script/types/4_chat_member_updated.d.ts.map +1 -0
  461. package/script/types/{3_chat_member_updated.js → 4_chat_member_updated.js} +13 -14
  462. package/script/types/{3_gift.d.ts → 4_gift.d.ts} +6 -6
  463. package/script/types/{3_gift.d.ts.map → 4_gift.d.ts.map} +1 -1
  464. package/script/types/{3_gift.js → 4_gift.js} +9 -9
  465. package/script/types/{3_join_request.d.ts → 4_join_request.d.ts} +6 -7
  466. package/script/types/4_join_request.d.ts.map +1 -0
  467. package/script/types/{3_join_request.js → 4_join_request.js} +17 -18
  468. package/script/types/{2_poll.d.ts → 4_poll.d.ts} +3 -3
  469. package/script/types/{2_poll.d.ts.map → 4_poll.d.ts.map} +1 -1
  470. package/script/types/{2_poll.js → 4_poll.js} +5 -5
  471. package/{esm/types/2_reply_to.d.ts → script/types/4_reply_to.d.ts} +2 -2
  472. package/script/types/{2_reply_to.d.ts.map → 4_reply_to.d.ts.map} +1 -1
  473. package/script/types/{4_claimed_gift.d.ts → 5_claimed_gift.d.ts} +5 -6
  474. package/script/types/5_claimed_gift.d.ts.map +1 -0
  475. package/script/types/{4_claimed_gift.js → 5_claimed_gift.js} +5 -5
  476. package/script/types/{4_link_preview.d.ts → 5_link_preview.d.ts} +4 -4
  477. package/{esm/types/4_link_preview.d.ts.map → script/types/5_link_preview.d.ts.map} +1 -1
  478. package/script/types/{4_link_preview.js → 5_link_preview.js} +3 -3
  479. package/script/types/{5_claimed_gifts.d.ts → 6_claimed_gifts.d.ts} +4 -4
  480. package/script/types/6_claimed_gifts.d.ts.map +1 -0
  481. package/script/types/{5_claimed_gifts.js → 6_claimed_gifts.js} +4 -4
  482. package/script/types/{5_message.d.ts → 6_message.d.ts} +10 -11
  483. package/script/types/6_message.d.ts.map +1 -0
  484. package/script/types/{5_message.js → 6_message.js} +45 -70
  485. package/{esm/types/5_message_content.d.ts → script/types/6_message_content.d.ts} +3 -3
  486. package/script/types/{5_message_content.d.ts.map → 6_message_content.d.ts.map} +1 -1
  487. package/{esm/types/6_callback_query.d.ts → script/types/7_callback_query.d.ts} +5 -5
  488. package/script/types/{6_callback_query.d.ts.map → 7_callback_query.d.ts.map} +1 -1
  489. package/script/types/{6_callback_query.js → 7_callback_query.js} +5 -5
  490. package/{esm/types/6_chat_list_item.d.ts → script/types/7_chat_list_item.d.ts} +6 -7
  491. package/script/types/7_chat_list_item.d.ts.map +1 -0
  492. package/script/types/{6_chat_list_item.js → 7_chat_list_item.js} +11 -11
  493. package/{esm/types/6_inline_query_result.d.ts → script/types/7_inline_query_result.d.ts} +3 -3
  494. package/script/types/{6_inline_query_result.d.ts.map → 7_inline_query_result.d.ts.map} +1 -1
  495. package/script/types/{6_inline_query_result.js → 7_inline_query_result.js} +3 -3
  496. package/script/types/{6_saved_chat.d.ts → 7_saved_chat.d.ts} +4 -5
  497. package/script/types/7_saved_chat.d.ts.map +1 -0
  498. package/script/types/{6_saved_chat.js → 7_saved_chat.js} +4 -4
  499. package/script/types/{6_topic.d.ts → 7_topic.d.ts} +2 -2
  500. package/script/types/{6_topic.d.ts.map → 7_topic.d.ts.map} +1 -1
  501. package/script/types/{7_inline_query_answer.d.ts → 8_inline_query_answer.d.ts} +2 -2
  502. package/script/types/{7_inline_query_answer.d.ts.map → 8_inline_query_answer.d.ts.map} +1 -1
  503. package/script/types/{7_inline_query_answer.js → 8_inline_query_answer.js} +2 -2
  504. package/{esm/types/7_saved_chats.d.ts → script/types/8_saved_chats.d.ts} +5 -5
  505. package/script/types/8_saved_chats.d.ts.map +1 -0
  506. package/script/types/{7_saved_chats.js → 8_saved_chats.js} +3 -3
  507. package/script/types/{7_update.d.ts → 8_update.d.ts} +35 -16
  508. package/script/types/8_update.d.ts.map +1 -0
  509. package/script/types/_file_id.d.ts +1 -1
  510. package/script/types/_file_id.d.ts.map +1 -1
  511. package/script/types/_getters.d.ts +0 -7
  512. package/script/types/_getters.d.ts.map +1 -1
  513. package/script/utilities/0_hash.d.ts +2 -2
  514. package/script/utilities/0_hash.d.ts.map +1 -1
  515. package/script/utilities/0_misc.d.ts +1 -0
  516. package/script/utilities/0_misc.d.ts.map +1 -1
  517. package/script/utilities/0_misc.js +14 -0
  518. package/script/utilities/0_part_stream.d.ts +1 -1
  519. package/script/utilities/0_part_stream.d.ts.map +1 -1
  520. package/esm/types/1_user.d.ts.map +0 -1
  521. package/esm/types/2_business_connection.d.ts.map +0 -1
  522. package/esm/types/2_chosen_inline_result.d.ts.map +0 -1
  523. package/esm/types/2_forward_header.d.ts.map +0 -1
  524. package/esm/types/2_game.d.ts.map +0 -1
  525. package/esm/types/2_inline_query.d.ts.map +0 -1
  526. package/esm/types/2_message_reactions.d.ts.map +0 -1
  527. package/esm/types/2_pre_checkout_query.d.ts.map +0 -1
  528. package/esm/types/3_chat_member_updated.d.ts.map +0 -1
  529. package/esm/types/3_join_request.d.ts.map +0 -1
  530. package/esm/types/4_claimed_gift.d.ts.map +0 -1
  531. package/esm/types/5_claimed_gifts.d.ts.map +0 -1
  532. package/esm/types/5_message.d.ts.map +0 -1
  533. package/esm/types/6_chat_list_item.d.ts.map +0 -1
  534. package/esm/types/6_saved_chat.d.ts.map +0 -1
  535. package/esm/types/7_saved_chats.d.ts.map +0 -1
  536. package/esm/types/7_update.d.ts.map +0 -1
  537. package/script/types/1_user.d.ts.map +0 -1
  538. package/script/types/2_business_connection.d.ts.map +0 -1
  539. package/script/types/2_chosen_inline_result.d.ts.map +0 -1
  540. package/script/types/2_forward_header.d.ts.map +0 -1
  541. package/script/types/2_game.d.ts.map +0 -1
  542. package/script/types/2_inline_query.d.ts.map +0 -1
  543. package/script/types/2_message_reactions.d.ts.map +0 -1
  544. package/script/types/2_pre_checkout_query.d.ts.map +0 -1
  545. package/script/types/3_chat_member_updated.d.ts.map +0 -1
  546. package/script/types/3_join_request.d.ts.map +0 -1
  547. package/script/types/4_claimed_gift.d.ts.map +0 -1
  548. package/script/types/5_claimed_gifts.d.ts.map +0 -1
  549. package/script/types/5_message.d.ts.map +0 -1
  550. package/script/types/6_chat_list_item.d.ts.map +0 -1
  551. package/script/types/6_saved_chat.d.ts.map +0 -1
  552. package/script/types/7_saved_chats.d.ts.map +0 -1
  553. package/script/types/7_update.d.ts.map +0 -1
  554. /package/esm/types/{2_game.js → 3_game.js} +0 -0
  555. /package/esm/types/{1_input_media.js → 3_input_media.js} +0 -0
  556. /package/esm/types/{2_reply_to.js → 4_reply_to.js} +0 -0
  557. /package/esm/types/{5_message_content.js → 6_message_content.js} +0 -0
  558. /package/esm/types/{6_topic.js → 7_topic.js} +0 -0
  559. /package/esm/types/{7_update.js → 8_update.js} +0 -0
  560. /package/script/types/{2_game.js → 3_game.js} +0 -0
  561. /package/script/types/{1_input_media.js → 3_input_media.js} +0 -0
  562. /package/script/types/{2_reply_to.js → 4_reply_to.js} +0 -0
  563. /package/script/types/{5_message_content.js → 6_message_content.js} +0 -0
  564. /package/script/types/{6_topic.js → 7_topic.js} +0 -0
  565. /package/script/types/{7_update.js → 8_update.js} +0 -0
@@ -20,6 +20,7 @@
20
20
  */
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.constructUser = constructUser;
23
+ exports.constructUser2 = constructUser2;
23
24
  const _1_utilities_js_1 = require("../1_utilities.js");
24
25
  const _2_tl_js_1 = require("../2_tl.js");
25
26
  const _0_chat_photo_js_1 = require("./0_chat_photo.js");
@@ -44,9 +45,33 @@ function constructUser(user_) {
44
45
  isRestricted: user_.restricted || false,
45
46
  restrictionReason: user_.restriction_reason,
46
47
  addedToAttachmentMenu: user_.bot ? user_.attach_menu_enabled || false : undefined,
48
+ hasMainMiniApp: user_.bot ? user_.bot_has_main_app || false : undefined,
47
49
  };
48
50
  if (_2_tl_js_1.Api.is("userProfilePhoto", user_.photo)) {
49
51
  user.photo = (0, _0_chat_photo_js_1.constructChatPhoto)(user_.photo, user.id, user_.access_hash ?? 0n);
50
52
  }
51
53
  return (0, _1_utilities_js_1.cleanObject)(user);
52
54
  }
55
+ function constructUser2(chatP) {
56
+ const user = {
57
+ id: chatP.id,
58
+ color: chatP.color,
59
+ isBot: chatP.isBot,
60
+ firstName: chatP.firstName,
61
+ lastName: chatP.lastName,
62
+ username: chatP.username,
63
+ also: chatP.also,
64
+ photo: chatP.photo,
65
+ languageCode: chatP.languageCode,
66
+ isScam: chatP.isScam,
67
+ isFake: chatP.isFake,
68
+ isPremium: chatP.isPremium,
69
+ isVerified: chatP.isVerified,
70
+ isSupport: chatP.isSupport,
71
+ isRestricted: chatP.isRestricted,
72
+ restrictionReason: chatP.restrictionReason,
73
+ addedToAttachmentMenu: chatP.addedToAttachmentMenu,
74
+ hasMainMiniApp: chatP.hasMainMiniApp,
75
+ };
76
+ return (0, _1_utilities_js_1.cleanObject)(user);
77
+ }
@@ -18,8 +18,8 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  import type { Api } from "../2_tl.js";
21
- import type { EntityGetter } from "./_getters.js";
22
- import { type User } from "./1_user.js";
21
+ import { type PeerGetter } from "./1_chat_p.js";
22
+ import { type User } from "./2_user.js";
23
23
  /** A business connection. */
24
24
  export interface BusinessConnection {
25
25
  /** The business connection's unique identifier. */
@@ -33,5 +33,5 @@ export interface BusinessConnection {
33
33
  /** Whether the connection is active. */
34
34
  isEnabled: boolean;
35
35
  }
36
- export declare function constructBusinessConnection(connection: Api.botBusinessConnection, getEntity: EntityGetter): Promise<BusinessConnection>;
37
- //# sourceMappingURL=2_business_connection.d.ts.map
36
+ export declare function constructBusinessConnection(connection: Api.botBusinessConnection, getPeer: PeerGetter): BusinessConnection;
37
+ //# sourceMappingURL=3_business_connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"3_business_connection.d.ts","sourceRoot":"","sources":["../../src/types/3_business_connection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAkB,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAExD,6BAA6B;AAC7B,MAAM,WAAW,kBAAkB;IACjC,mDAAmD;IACnD,EAAE,EAAE,MAAM,CAAC;IACX,6DAA6D;IAC7D,IAAI,EAAE,IAAI,CAAC;IACX,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,QAAQ,EAAE,OAAO,CAAC;IAClB,wCAAwC;IACxC,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,GAAG,CAAC,qBAAqB,EAAE,OAAO,EAAE,UAAU,GAAG,kBAAkB,CAa1H"}
@@ -20,11 +20,18 @@
20
20
  */
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.constructBusinessConnection = constructBusinessConnection;
23
- const _1_user_js_1 = require("./1_user.js");
24
- async function constructBusinessConnection(connection, getEntity) {
23
+ const _0_deps_js_1 = require("../0_deps.js");
24
+ const _1_chat_p_js_1 = require("./1_chat_p.js");
25
+ const _2_user_js_1 = require("./2_user.js");
26
+ function constructBusinessConnection(connection, getPeer) {
27
+ const peer = getPeer({ ...connection, _: "peerUser" });
28
+ if (!peer || !(0, _1_chat_p_js_1.isChatPUser)(peer[0])) {
29
+ (0, _0_deps_js_1.unreachable)();
30
+ }
31
+ const user = (0, _2_user_js_1.constructUser2)(peer[0]);
25
32
  return {
26
33
  id: connection.connection_id,
27
- user: (0, _1_user_js_1.constructUser)((await getEntity({ ...connection, _: "peerUser" }))),
34
+ user,
28
35
  date: connection.date,
29
36
  canReply: !!connection.rights?.reply,
30
37
  isEnabled: !connection.disabled,
@@ -18,10 +18,10 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  import { Api } from "../2_tl.js";
21
- import type { EntityGetter } from "./_getters.js";
22
21
  import { type ChatAdministratorRights } from "./0_chat_administrator_rights.js";
23
22
  import { type ChatMemberRights } from "./0_chat_member_rights.js";
24
- import { type User } from "./1_user.js";
23
+ import type { PeerGetter } from "./1_chat_p.js";
24
+ import { type User } from "./2_user.js";
25
25
  /** @unlisted */
26
26
  export type ChatMemberStatus = "creator" | "administrator" | "member" | "restricted" | "left" | "banned";
27
27
  /** @unlisted */
@@ -64,5 +64,7 @@ export interface ChatMemberBanned extends _ChatMemberBase {
64
64
  }
65
65
  /** A chat member. */
66
66
  export type ChatMember = ChatMemberCreator | ChatMemberAdministrator | ChatMemberMember | ChatMemberRestricted | ChatMemberLeft | ChatMemberBanned;
67
- export declare function constructChatMember(participant: Api.ChannelParticipant | Api.ChatParticipant, getEntity: EntityGetter): Promise<ChatMember>;
68
- //# sourceMappingURL=2_chat_member.d.ts.map
67
+ export declare function constructChatMember(participant: Api.ChannelParticipant | Api.ChatParticipant | (Omit<Api.ChannelParticipant, "peer"> & {
68
+ peer: ReturnType<typeof getPeer>;
69
+ }), getPeer: PeerGetter): ChatMember;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1 = require("../1_utilities.js");
25
25
  const _2_tl_js_1 = require("../2_tl.js");
26
26
  const _0_chat_administrator_rights_js_1 = require("./0_chat_administrator_rights.js");
27
27
  const _0_chat_member_rights_js_1 = require("./0_chat_member_rights.js");
28
- const _1_user_js_1 = require("./1_user.js");
29
- async function constructChatMember(participant, getEntity) {
30
- const user_ = "user_id" in participant ? await getEntity({ ...participant, _: "peerUser" }) : "peer" in participant ? _2_tl_js_1.Api.is("peerUser", participant.peer) ? await getEntity(participant.peer) : (0, _0_deps_js_1.unreachable)() : (0, _0_deps_js_1.unreachable)(); // TODO: support other peer types
31
- if (user_ === null)
28
+ const _2_user_js_1 = require("./2_user.js");
29
+ function constructChatMember(participant, getPeer) {
30
+ const peer = "user_id" in participant ? getPeer({ ...participant, _: "peerUser" }) : "peer" in participant ? Array.isArray(participant.peer) ? participant.peer : _2_tl_js_1.Api.is("peerUser", participant.peer) ? getPeer(participant.peer) : (0, _0_deps_js_1.unreachable)() : (0, _0_deps_js_1.unreachable)(); // TODO: support other peer types
31
+ if (peer === null || peer[0].type !== "private")
32
32
  (0, _0_deps_js_1.unreachable)();
33
- const user = (0, _1_user_js_1.constructUser)(user_);
33
+ const user = (0, _2_user_js_1.constructUser2)(peer[0]);
34
34
  if (_2_tl_js_1.Api.is("channelParticipant", participant) || _2_tl_js_1.Api.is("chatParticipant", participant)) {
35
35
  return {
36
36
  status: "member",
@@ -18,7 +18,7 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  import { Api } from "../2_tl.js";
21
- import { type User } from "./1_user.js";
21
+ import { type User } from "./2_user.js";
22
22
  export interface ChatSettings {
23
23
  report: boolean;
24
24
  addToContacts: boolean;
@@ -43,4 +43,4 @@ export interface ChatSettings {
43
43
  photoChangeDate?: number;
44
44
  }
45
45
  export declare function constructChatSettings(settings_: Api.messages_peerSettings): ChatSettings;
46
- //# sourceMappingURL=2_chat_settings.d.ts.map
46
+ //# sourceMappingURL=3_chat_settings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"2_chat_settings.d.ts","sourceRoot":"","sources":["../../src/types/2_chat_settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAiB,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,GAAG,CAAC,qBAAqB,GAAG,YAAY,CA4BxF"}
1
+ {"version":3,"file":"3_chat_settings.d.ts","sourceRoot":"","sources":["../../src/types/3_chat_settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAiB,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,GAAG,CAAC,qBAAqB,GAAG,YAAY,CA4BxF"}
@@ -22,7 +22,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.constructChatSettings = constructChatSettings;
23
23
  const _1_utilities_js_1 = require("../1_utilities.js");
24
24
  const _2_tl_js_1 = require("../2_tl.js");
25
- const _1_user_js_1 = require("./1_user.js");
25
+ const _2_user_js_1 = require("./2_user.js");
26
26
  function constructChatSettings(settings_) {
27
27
  const settings = {
28
28
  report: settings_.settings.report_spam || false,
@@ -48,7 +48,7 @@ function constructChatSettings(settings_) {
48
48
  };
49
49
  const bot = settings_.users.find((v) => v.id === settings_.settings.business_bot_id);
50
50
  if (_2_tl_js_1.Api.is("user", bot)) {
51
- settings.businessBot = (0, _1_user_js_1.constructUser)(bot);
51
+ settings.businessBot = (0, _2_user_js_1.constructUser)(bot);
52
52
  }
53
53
  return (0, _1_utilities_js_1.cleanObject)(settings);
54
54
  }
@@ -18,9 +18,9 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  import { Api } from "../2_tl.js";
21
- import type { EntityGetter } from "./_getters.js";
22
21
  import { type Location } from "./0_location.js";
23
- import { type User } from "./1_user.js";
22
+ import type { PeerGetter } from "./1_chat_p.js";
23
+ import { type User } from "./2_user.js";
24
24
  /** A chosen inline result. */
25
25
  export interface ChosenInlineResult {
26
26
  /** The identifier of the inline result that was chosen. */
@@ -34,5 +34,5 @@ export interface ChosenInlineResult {
34
34
  /** The query that was used to obtain the result. */
35
35
  query: string;
36
36
  }
37
- export declare function constructChosenInlineResult(ubis: Api.updateBotInlineSend, getEntity: EntityGetter): Promise<ChosenInlineResult>;
38
- //# sourceMappingURL=2_chosen_inline_result.d.ts.map
37
+ export declare function constructChosenInlineResult(ubis: Api.updateBotInlineSend, getPeer: PeerGetter): ChosenInlineResult;
38
+ //# sourceMappingURL=3_chosen_inline_result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"3_chosen_inline_result.d.ts","sourceRoot":"","sources":["../../src/types/3_chosen_inline_result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAiB,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAEvD,8BAA8B;AAC9B,MAAM,WAAW,kBAAkB;IACjC,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,IAAI,EAAE,IAAI,CAAC;IACX,qDAAqD;IACrD,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,6CAA6C;IAC7C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,GAAG,CAAC,mBAAmB,EAAE,OAAO,EAAE,UAAU,GAAG,kBAAkB,CAYlH"}
@@ -24,15 +24,15 @@ const _0_deps_js_1 = require("../0_deps.js");
24
24
  const _1_utilities_js_1 = require("../1_utilities.js");
25
25
  const _2_tl_js_1 = require("../2_tl.js");
26
26
  const _0_location_js_1 = require("./0_location.js");
27
- const _1_user_js_1 = require("./1_user.js");
28
- async function constructChosenInlineResult(ubis, getEntity) {
29
- const entity = await getEntity({ ...ubis, _: "peerUser" });
27
+ const _2_user_js_1 = require("./2_user.js");
28
+ function constructChosenInlineResult(ubis, getPeer) {
29
+ const entity = getPeer({ ...ubis, _: "peerUser" });
30
30
  if (!entity || !(_2_tl_js_1.Api.is("user", entity))) {
31
31
  (0, _0_deps_js_1.unreachable)();
32
32
  }
33
33
  return (0, _1_utilities_js_1.cleanObject)({
34
34
  resultId: ubis.id,
35
- from: (0, _1_user_js_1.constructUser)(entity),
35
+ from: (0, _2_user_js_1.constructUser)(entity),
36
36
  location: _2_tl_js_1.Api.is("geoPoint", ubis.geo) ? (0, _0_location_js_1.constructLocation)(ubis.geo) : undefined,
37
37
  inlineMessageId: ubis.msg_id === undefined ? undefined : (0, _1_utilities_js_1.base64EncodeUrlSafe)(_2_tl_js_1.Api.serializeObject(ubis.msg_id)),
38
38
  query: ubis.query,
@@ -18,9 +18,8 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  import type { Api } from "../2_tl.js";
21
- import type { EntityGetter } from "./_getters.js";
22
- import { type ChatPChannel, type ChatPSupergroup } from "./1_chat_p.js";
23
- import { type User } from "./1_user.js";
21
+ import type { ChatPChannel, ChatPSupergroup, PeerGetter } from "./1_chat_p.js";
22
+ import { type User } from "./2_user.js";
24
23
  /** @unlisted */
25
24
  export interface _ForwardHeaderCommon {
26
25
  date: number;
@@ -55,5 +54,5 @@ export interface ForwardHeaderUnsupported extends _ForwardHeaderCommon {
55
54
  type: "unsupported";
56
55
  }
57
56
  export type ForwardHeader = ForwardHeaderUser | ForwardHeaderChannel | ForwardHeaderSupergroup | ForwardHeaderHidden | ForwardHeaderUnsupported;
58
- export declare function constructForwardHeader(fwdHeader: Api.MessageFwdHeader, getEntity: EntityGetter): Promise<ForwardHeader>;
59
- //# sourceMappingURL=2_forward_header.d.ts.map
57
+ export declare function constructForwardHeader(fwdHeader: Api.MessageFwdHeader, getPeer: PeerGetter): ForwardHeader;
58
+ //# sourceMappingURL=3_forward_header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"3_forward_header.d.ts","sourceRoot":"","sources":["../../src/types/3_forward_header.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAkB,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAExD,gBAAgB;AAChB,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,gBAAgB;AAChB,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB;IAC7D,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,gBAAgB;AAChB,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE,qBAAqB;IACrB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,gBAAgB;AAChB,MAAM,WAAW,uBAAwB,SAAQ,oBAAoB;IACnE,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,gBAAgB;AAChB,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,gBAAgB;AAChB,MAAM,WAAW,wBAAyB,SAAQ,oBAAoB;IACpE,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,uBAAuB,GAAG,mBAAmB,GAAG,wBAAwB,CAAC;AAEhJ,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,GAAG,CAAC,gBAAgB,EAAE,OAAO,EAAE,UAAU,GAAG,aAAa,CA8C1G"}
@@ -22,43 +22,42 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.constructForwardHeader = constructForwardHeader;
23
23
  const _0_deps_js_1 = require("../0_deps.js");
24
24
  const _1_utilities_js_1 = require("../1_utilities.js");
25
- const _1_chat_p_js_1 = require("./1_chat_p.js");
26
- const _1_user_js_1 = require("./1_user.js");
27
- async function constructForwardHeader(fwdHeader, getEntity) {
25
+ const _2_user_js_1 = require("./2_user.js");
26
+ function constructForwardHeader(fwdHeader, getPeer) {
28
27
  if (fwdHeader.channel_post && fwdHeader.from_id?._ === "peerChannel") {
29
- const chat = await getEntity(fwdHeader.from_id);
30
- if (chat === null) {
28
+ const peer = getPeer(fwdHeader.from_id);
29
+ if (peer === null) {
31
30
  (0, _0_deps_js_1.unreachable)();
32
31
  }
33
32
  return (0, _1_utilities_js_1.cleanObject)({
34
33
  type: "channel",
35
34
  date: fwdHeader.date,
36
- chat: (0, _1_chat_p_js_1.constructChatP)(chat),
35
+ chat: peer[0],
37
36
  messageId: fwdHeader.channel_post,
38
37
  authorSignature: fwdHeader.post_author,
39
38
  });
40
39
  }
41
40
  else if (fwdHeader.from_id?._ === "peerChannel") {
42
- const chat = await getEntity(fwdHeader.from_id);
43
- if (chat === null) {
41
+ const peer = getPeer(fwdHeader.from_id);
42
+ if (peer === null) {
44
43
  (0, _0_deps_js_1.unreachable)();
45
44
  }
46
45
  return (0, _1_utilities_js_1.cleanObject)({
47
46
  type: "supergroup",
48
47
  date: fwdHeader.date,
49
- chat: (0, _1_chat_p_js_1.constructChatP)(chat),
48
+ chat: peer[0],
50
49
  title: fwdHeader.post_author,
51
50
  });
52
51
  }
53
52
  else if (fwdHeader.from_id?._ === "peerUser") {
54
- const user = await getEntity(fwdHeader.from_id);
55
- if (user === null) {
53
+ const peer = getPeer(fwdHeader.from_id);
54
+ if (peer === null || peer[0].type !== "private") {
56
55
  (0, _0_deps_js_1.unreachable)();
57
56
  }
58
57
  return {
59
58
  type: "user",
60
59
  date: fwdHeader.date,
61
- user: (0, _1_user_js_1.constructUser)(user),
60
+ user: (0, _2_user_js_1.constructUser2)(peer[0]),
62
61
  };
63
62
  }
64
63
  else if (fwdHeader.from_name) {
@@ -18,9 +18,9 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  import { Api } from "../2_tl.js";
21
- import type { MessageEntity } from "./0_message_entity.js";
22
21
  import { type Animation } from "./1_animation.js";
23
22
  import { type Photo } from "./1_photo.js";
23
+ import type { MessageEntity } from "./2_message_entity.js";
24
24
  /** A game. */
25
25
  export interface Game {
26
26
  /** The title of the game. */
@@ -37,4 +37,4 @@ export interface Game {
37
37
  animation?: Animation;
38
38
  }
39
39
  export declare function constructGame(media_: Api.messageMediaGame): Game;
40
- //# sourceMappingURL=2_game.d.ts.map
40
+ //# sourceMappingURL=3_game.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"3_game.d.ts","sourceRoot":"","sources":["../../src/types/3_game.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAkB,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,cAAc;AACd,MAAM,WAAW,IAAI;IACnB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,KAAK,EAAE,KAAK,CAAC;IACb,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,YAAY,CAAC,EAAE,aAAa,EAAE,CAAC;IAC/B,8DAA8D;IAC9D,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,GAAG,IAAI,CA0BhE"}
@@ -18,8 +18,8 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  import { Api } from "../2_tl.js";
21
- import { type MessageEntity } from "./0_message_entity.js";
22
21
  import { type Sticker } from "./1_sticker.js";
22
+ import { type MessageEntity } from "./2_message_entity.js";
23
23
  /**
24
24
  * The model of an upgraded gift.
25
25
  *
@@ -92,4 +92,4 @@ export interface GiftUpgradedComponentOriginalDetails {
92
92
  */
93
93
  export type GiftUpgradedComponent = GiftUpgradedComponentModel | GiftUpgradedComponentPattern | GiftUpgradedComponentBackdrop | GiftUpgradedComponentOriginalDetails;
94
94
  export declare function constructGiftUpgradedComponent(attribute: Api.StarGiftAttribute): GiftUpgradedComponent;
95
- //# sourceMappingURL=2_gift_upgraded_component.d.ts.map
95
+ //# sourceMappingURL=3_gift_upgraded_component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"2_gift_upgraded_component.d.ts","sourceRoot":"","sources":["../../src/types/2_gift_upgraded_component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAqB,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEjE;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,qBAAqB;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,uFAAuF;IACvF,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C,qBAAqB;IACrB,IAAI,EAAE,SAAS,CAAC;IAChB,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,yFAAyF;IACzF,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC5C,qBAAqB;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,0FAA0F;IAC1F,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,oCAAoC;IACnD,qBAAqB;IACrB,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,0BAA0B,GAAG,4BAA4B,GAAG,6BAA6B,GAAG,oCAAoC,CAAC;AAErK,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,GAAG,CAAC,iBAAiB,GAAG,qBAAqB,CA+DtG"}
1
+ {"version":3,"file":"3_gift_upgraded_component.d.ts","sourceRoot":"","sources":["../../src/types/3_gift_upgraded_component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAqB,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEnF;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,qBAAqB;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,uFAAuF;IACvF,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C,qBAAqB;IACrB,IAAI,EAAE,SAAS,CAAC;IAChB,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,yFAAyF;IACzF,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC5C,qBAAqB;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,0FAA0F;IAC1F,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,oCAAoC;IACnD,qBAAqB;IACrB,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,0BAA0B,GAAG,4BAA4B,GAAG,6BAA6B,GAAG,oCAAoC,CAAC;AAErK,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,GAAG,CAAC,iBAAiB,GAAG,qBAAqB,CA+DtG"}
@@ -24,8 +24,8 @@ const _0_deps_js_1 = require("../0_deps.js");
24
24
  const _1_utilities_js_1 = require("../1_utilities.js");
25
25
  const _2_tl_js_1 = require("../2_tl.js");
26
26
  const _file_id_js_1 = require("./_file_id.js");
27
- const _0_message_entity_js_1 = require("./0_message_entity.js");
28
27
  const _1_sticker_js_1 = require("./1_sticker.js");
28
+ const _2_message_entity_js_1 = require("./2_message_entity.js");
29
29
  function constructGiftUpgradedComponent(attribute) {
30
30
  const name = "name" in attribute ? attribute.name : "";
31
31
  const rarityLevel = "rarity_permille" in attribute ? attribute.rarity_permille : 0;
@@ -83,7 +83,7 @@ function constructGiftUpgradedComponent(attribute) {
83
83
  recipientId: Number(attribute.recipient_id),
84
84
  date: attribute.date,
85
85
  message: attribute.message?.text,
86
- entities: attribute.message ? attribute.message.entities.map(_0_message_entity_js_1.constructMessageEntity).filter((v) => !!v) : undefined,
86
+ entities: attribute.message ? attribute.message.entities.map(_2_message_entity_js_1.constructMessageEntity).filter((v) => !!v) : undefined,
87
87
  });
88
88
  default:
89
89
  (0, _0_deps_js_1.unreachable)();
@@ -18,9 +18,9 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  import { Api } from "../2_tl.js";
21
- import type { EntityGetter } from "./_getters.js";
22
21
  import { type Location } from "./0_location.js";
23
- import { type User } from "./1_user.js";
22
+ import type { PeerGetter } from "./1_chat_p.js";
23
+ import { type User } from "./2_user.js";
24
24
  /** An incoming inline query. */
25
25
  export interface InlineQuery {
26
26
  /** The identifier of the inline query. */
@@ -36,5 +36,5 @@ export interface InlineQuery {
36
36
  /** The location of the user who made the inline query. */
37
37
  location?: Location;
38
38
  }
39
- export declare function constructInlineQuery(query_: Api.updateBotInlineQuery, getEntity: EntityGetter): Promise<InlineQuery>;
40
- //# sourceMappingURL=2_inline_query.d.ts.map
39
+ export declare function constructInlineQuery(query_: Api.updateBotInlineQuery, getPeer: PeerGetter): InlineQuery;
40
+ //# sourceMappingURL=3_inline_query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"3_inline_query.d.ts","sourceRoot":"","sources":["../../src/types/3_inline_query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAkB,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAExD,gCAAgC;AAChC,MAAM,WAAW,WAAW;IAC1B,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,0CAA0C;IAC1C,IAAI,EAAE,IAAI,CAAC;IACX,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,6GAA6G;IAC7G,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,SAAS,CAAC;IACrE,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC,oBAAoB,EAAE,OAAO,EAAE,UAAU,GAAG,WAAW,CAmCvG"}
@@ -23,13 +23,13 @@ exports.constructInlineQuery = constructInlineQuery;
23
23
  const _0_deps_js_1 = require("../0_deps.js");
24
24
  const _2_tl_js_1 = require("../2_tl.js");
25
25
  const _0_location_js_1 = require("./0_location.js");
26
- const _1_user_js_1 = require("./1_user.js");
27
- async function constructInlineQuery(query_, getEntity) {
28
- const user_ = await getEntity({ _: "peerUser", user_id: query_.user_id });
29
- if (user_ === null) {
26
+ const _2_user_js_1 = require("./2_user.js");
27
+ function constructInlineQuery(query_, getPeer) {
28
+ const peer = getPeer({ _: "peerUser", user_id: query_.user_id });
29
+ if (peer === null) {
30
30
  (0, _0_deps_js_1.unreachable)();
31
31
  }
32
- const user = (0, _1_user_js_1.constructUser)(user_);
32
+ const user = (0, _2_user_js_1.constructUser2)(peer[0]);
33
33
  let chatType;
34
34
  if (query_.peer_type !== undefined) {
35
35
  if (_2_tl_js_1.Api.is("inlineQueryPeerTypeSameBotPM", query_.peer_type)) {
@@ -18,9 +18,9 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  import type { FileSource } from "./0_file_source.js";
21
- import type { MessageEntity } from "./0_message_entity.js";
22
21
  import type { ParseMode } from "./0_parse_mode.js";
23
22
  import type { SelfDestructOption } from "./0_self_destruct_option.js";
23
+ import type { MessageEntity } from "./2_message_entity.js";
24
24
  /** @unlisted */
25
25
  export interface _InputMediaCommon {
26
26
  /** The file name to assign if applicable. */
@@ -119,4 +119,4 @@ export interface InputMediaVideo extends _InputMediaCommon {
119
119
  selfDestruct?: SelfDestructOption;
120
120
  }
121
121
  export type InputMedia = InputMediaAnimation | InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo;
122
- //# sourceMappingURL=1_input_media.d.ts.map
122
+ //# sourceMappingURL=3_input_media.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"1_input_media.d.ts","sourceRoot":"","sources":["../../src/types/1_input_media.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,gBAAgB;AAChB,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,eAAe,CAAC,EAAE,aAAa,EAAE,CAAC;IAClC,4DAA4D;IAC5D,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,gBAAgB;AAChB,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D;;;OAGG;IACH,SAAS,EAAE,UAAU,CAAC;IACtB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8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,MAAM,MAAM,UAAU,GAAG,mBAAmB,GAAG,eAAe,GAAG,kBAAkB,GAAG,eAAe,GAAG,eAAe,CAAC"}
@@ -18,8 +18,8 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  import type { Api } from "../2_tl.js";
21
- import type { EntityGetter } from "./_getters.js";
22
- import { type User } from "./1_user.js";
21
+ import type { PeerGetter } from "./1_chat_p.js";
22
+ import { type User } from "./2_user.js";
23
23
  /** A chat invite link. */
24
24
  export interface InviteLink {
25
25
  /** The link itself. */
@@ -43,5 +43,5 @@ export interface InviteLink {
43
43
  /** The remaining duration (in seconds) until the subscription expires. */
44
44
  subscriptionExpiresIn?: number;
45
45
  }
46
- export declare function constructInviteLink(inviteLink_: Api.chatInviteExported, getEntity: EntityGetter): Promise<InviteLink>;
47
- //# sourceMappingURL=2_invite_link.d.ts.map
46
+ export declare function constructInviteLink(inviteLink_: Api.chatInviteExported, getPeer: PeerGetter): InviteLink;
47
+ //# sourceMappingURL=3_invite_link.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"2_invite_link.d.ts","sourceRoot":"","sources":["../../src/types/2_invite_link.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAiB,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAEvD,0BAA0B;AAC1B,MAAM,WAAW,UAAU;IACzB,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,OAAO,EAAE,IAAI,CAAC;IACd,gGAAgG;IAChG,gBAAgB,EAAE,OAAO,CAAC;IAE1B,0CAA0C;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,S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E,GAAG,CAAC,kBAAkB,EAAE,OAAO,EAAE,UAAU,GAAG,UAAU,CAyBxG"}
@@ -22,14 +22,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.constructInviteLink = constructInviteLink;
23
23
  const _0_deps_js_1 = require("../0_deps.js");
24
24
  const _1_utilities_js_1 = require("../1_utilities.js");
25
- const _1_user_js_1 = require("./1_user.js");
26
- async function constructInviteLink(inviteLink_, getEntity) {
27
- const entity = await getEntity({ _: "peerUser", user_id: inviteLink_.admin_id });
28
- if (!entity) {
25
+ const _2_user_js_1 = require("./2_user.js");
26
+ function constructInviteLink(inviteLink_, getPeer) {
27
+ const peer = getPeer({ _: "peerUser", user_id: inviteLink_.admin_id });
28
+ if (!peer) {
29
29
  (0, _0_deps_js_1.unreachable)();
30
30
  }
31
31
  const inviteLink = inviteLink_.link;
32
- const creator = (0, _1_user_js_1.constructUser)(entity);
32
+ const creator = (0, _2_user_js_1.constructUser2)(peer[0]);
33
33
  const requiresApproval = inviteLink_.request_needed ? true : false;
34
34
  const revoked = inviteLink_.revoked ? true : false;
35
35
  const title = inviteLink_.title;
@@ -17,11 +17,10 @@
17
17
  * You should have received a copy of the GNU Lesser General Public License
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
- import { Api } from "../2_tl.js";
21
- import type { EntityGetter } from "./_getters.js";
20
+ import type { Api } from "../2_tl.js";
22
21
  import { type Reaction } from "./0_reaction.js";
23
- import { type ChatP } from "./1_chat_p.js";
24
- import { type User } from "./1_user.js";
22
+ import type { ChatP, PeerGetter } from "./1_chat_p.js";
23
+ import { type User } from "./2_user.js";
25
24
  /** The reactions of a user to a messages in a group. */
26
25
  export interface MessageReactions {
27
26
  /** The chat containing the message the user reacted to. */
@@ -39,5 +38,5 @@ export interface MessageReactions {
39
38
  /** The current reactions. */
40
39
  newReactions: Reaction[];
41
40
  }
42
- export declare function constructMessageReactions(update: Api.updateBotMessageReaction, getEntity: EntityGetter): Promise<MessageReactions | null>;
43
- //# sourceMappingURL=2_message_reactions.d.ts.map
41
+ export declare function constructMessageReactions(update: Api.updateBotMessageReaction, getPeer: PeerGetter): MessageReactions | null;
42
+ //# sourceMappingURL=3_message_reactions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"3_message_reactions.d.ts","sourceRoot":"","sources":["../../src/types/3_message_reactions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAkB,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAExD,wDAAwD;AACxD,MAAM,WAAW,gBAAgB;IAC/B,2DAA2D;IAC3D,IAAI,EAAE,KAAK,CAAC;IACZ,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,8FAA8F;IAC9F,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,6FAA6F;IAC7F,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,YAAY,EAAE,QAAQ,EAAE,CAAC;IACzB,6BAA6B;IAC7B,YAAY,EAAE,QAAQ,EAAE,CAAC;CAC1B;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,GAAG,CAAC,wBAAwB,EAAE,OAAO,EAAE,UAAU,GAAG,gBAAgB,GAAG,IAAI,CAkC5H"}
@@ -21,31 +21,29 @@
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.constructMessageReactions = constructMessageReactions;
23
23
  const _1_utilities_js_1 = require("../1_utilities.js");
24
- const _2_tl_js_1 = require("../2_tl.js");
25
24
  const _0_reaction_js_1 = require("./0_reaction.js");
26
- const _1_chat_p_js_1 = require("./1_chat_p.js");
27
- const _1_user_js_1 = require("./1_user.js");
28
- async function constructMessageReactions(update, getEntity) {
25
+ const _2_user_js_1 = require("./2_user.js");
26
+ function constructMessageReactions(update, getPeer) {
29
27
  const date = update.date;
30
28
  const oldReactions = update.old_reactions.map((v) => (0, _0_reaction_js_1.constructReaction)(v));
31
29
  const newReactions = update.new_reactions.map((v) => (0, _0_reaction_js_1.constructReaction)(v));
32
30
  const messageId = update.msg_id;
33
- let entity = await getEntity(update.peer);
34
- if (!entity) {
31
+ let peer = getPeer(update.peer);
32
+ if (!peer) {
35
33
  return null;
36
34
  }
37
- const chat = (0, _1_chat_p_js_1.constructChatP)(entity);
35
+ const chat = peer[0];
38
36
  let user = undefined;
39
37
  let actorChat = undefined;
40
- entity = await getEntity(update.actor);
41
- if (!entity) {
38
+ peer = getPeer(update.actor);
39
+ if (!peer) {
42
40
  return null;
43
41
  }
44
- if (_2_tl_js_1.Api.is("user", entity)) {
45
- user = (0, _1_user_js_1.constructUser)(entity);
42
+ if (peer[0].type === "private") {
43
+ user = (0, _2_user_js_1.constructUser2)(peer[0]);
46
44
  }
47
45
  else {
48
- actorChat = (0, _1_chat_p_js_1.constructChatP)(entity);
46
+ actorChat = peer[0];
49
47
  }
50
48
  return (0, _1_utilities_js_1.cleanObject)({
51
49
  chat,
@@ -18,7 +18,7 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  import type { Api } from "../2_tl.js";
21
- import { type MessageEntity } from "./0_message_entity.js";
21
+ import { type MessageEntity } from "./2_message_entity.js";
22
22
  /** A poll option. */
23
23
  export interface PollOption {
24
24
  /** The option's text (1-100 characters). */
@@ -31,4 +31,4 @@ export interface PollOption {
31
31
  chosen: boolean;
32
32
  }
33
33
  export declare function constructPollOption(option: Api.PollAnswer, results: Array<Api.PollAnswerVoters>): PollOption;
34
- //# sourceMappingURL=1_poll_option.d.ts.map
34
+ //# sourceMappingURL=3_poll_option.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"1_poll_option.d.ts","sourceRoot":"","sources":["../../src/types/1_poll_option.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEnF,qBAAqB;AACrB,MAAM,WAAW,UAAU;IACzB,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,UAAU,CAQ5G"}
1
+ {"version":3,"file":"3_poll_option.d.ts","sourceRoot":"","sources":["../../src/types/3_poll_option.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEnF,qBAAqB;AACrB,MAAM,WAAW,UAAU;IACzB,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,UAAU,CAQ5G"}