@mtkruto/browser 0.127.0 → 0.129.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/esm/0_deps.d.ts +4 -3
  2. package/esm/0_deps.d.ts.map +1 -1
  3. package/esm/0_deps.js +4 -3
  4. package/esm/3_types.d.ts +7 -0
  5. package/esm/3_types.d.ts.map +1 -1
  6. package/esm/3_types.js +7 -0
  7. package/esm/client/0_params.d.ts +12 -0
  8. package/esm/client/0_params.d.ts.map +1 -1
  9. package/esm/client/1_client_generic.d.ts +96 -19
  10. package/esm/client/1_client_generic.d.ts.map +1 -1
  11. package/esm/client/2_account_manager.d.ts +8 -1
  12. package/esm/client/2_account_manager.d.ts.map +1 -1
  13. package/esm/client/2_account_manager.js +38 -1
  14. package/esm/client/3_message_manager.d.ts +5 -1
  15. package/esm/client/3_message_manager.d.ts.map +1 -1
  16. package/esm/client/3_message_manager.js +21 -1
  17. package/esm/client/4_chat_manager.d.ts +4 -3
  18. package/esm/client/4_chat_manager.d.ts.map +1 -1
  19. package/esm/client/4_chat_manager.js +11 -3
  20. package/esm/client/4_context.d.ts +2 -2
  21. package/esm/client/4_context.d.ts.map +1 -1
  22. package/esm/client/6_client.d.ts +95 -18
  23. package/esm/client/6_client.d.ts.map +1 -1
  24. package/esm/client/6_client.js +121 -20
  25. package/esm/client/6_client_dispatcher.d.ts +96 -19
  26. package/esm/client/6_client_dispatcher.d.ts.map +1 -1
  27. package/esm/client/6_client_dispatcher.js +122 -21
  28. package/esm/types/0_calling_code.d.ts +27 -0
  29. package/esm/types/0_calling_code.d.ts.map +1 -0
  30. package/esm/types/0_calling_code.js +26 -0
  31. package/esm/types/0_timezone.d.ts +31 -0
  32. package/esm/types/0_timezone.d.ts.map +1 -0
  33. package/esm/types/0_timezone.js +26 -0
  34. package/esm/types/1_available_reactions.d.ts +54 -0
  35. package/esm/types/1_available_reactions.d.ts.map +1 -0
  36. package/esm/types/1_available_reactions.js +30 -0
  37. package/esm/types/1_chat_p.d.ts +1 -1
  38. package/esm/types/1_chat_p.d.ts.map +1 -1
  39. package/esm/types/1_chat_p.js +1 -1
  40. package/esm/types/1_country.d.ts +30 -0
  41. package/esm/types/1_country.d.ts.map +1 -0
  42. package/esm/types/1_country.js +30 -0
  43. package/esm/types/2_user.d.ts +1 -1
  44. package/esm/types/2_user.d.ts.map +1 -1
  45. package/esm/types/2_user.js +2 -2
  46. package/esm/types/3_app_support.d.ts +27 -0
  47. package/esm/types/3_app_support.d.ts.map +1 -0
  48. package/esm/types/3_app_support.js +24 -0
  49. package/esm/types/3_blocked_user.d.ts +31 -0
  50. package/esm/types/3_blocked_user.d.ts.map +1 -0
  51. package/esm/types/3_blocked_user.js +33 -0
  52. package/esm/types/4_blocked_user_list.d.ts +31 -0
  53. package/esm/types/4_blocked_user_list.d.ts.map +1 -0
  54. package/esm/types/4_blocked_user_list.js +25 -0
  55. package/package.json +1 -1
  56. package/script/0_deps.d.ts +4 -3
  57. package/script/0_deps.d.ts.map +1 -1
  58. package/script/0_deps.js +13 -12
  59. package/script/3_types.d.ts +7 -0
  60. package/script/3_types.d.ts.map +1 -1
  61. package/script/3_types.js +7 -0
  62. package/script/client/0_params.d.ts +12 -0
  63. package/script/client/0_params.d.ts.map +1 -1
  64. package/script/client/1_client_generic.d.ts +96 -19
  65. package/script/client/1_client_generic.d.ts.map +1 -1
  66. package/script/client/2_account_manager.d.ts +8 -1
  67. package/script/client/2_account_manager.d.ts.map +1 -1
  68. package/script/client/2_account_manager.js +37 -0
  69. package/script/client/3_message_manager.d.ts +5 -1
  70. package/script/client/3_message_manager.d.ts.map +1 -1
  71. package/script/client/3_message_manager.js +20 -0
  72. package/script/client/4_chat_manager.d.ts +4 -3
  73. package/script/client/4_chat_manager.d.ts.map +1 -1
  74. package/script/client/4_chat_manager.js +9 -1
  75. package/script/client/4_context.d.ts +2 -2
  76. package/script/client/4_context.d.ts.map +1 -1
  77. package/script/client/6_client.d.ts +95 -18
  78. package/script/client/6_client.d.ts.map +1 -1
  79. package/script/client/6_client.js +121 -20
  80. package/script/client/6_client_dispatcher.d.ts +96 -19
  81. package/script/client/6_client_dispatcher.d.ts.map +1 -1
  82. package/script/client/6_client_dispatcher.js +122 -21
  83. package/script/types/0_calling_code.d.ts +27 -0
  84. package/script/types/0_calling_code.d.ts.map +1 -0
  85. package/script/types/0_calling_code.js +29 -0
  86. package/script/types/0_timezone.d.ts +31 -0
  87. package/script/types/0_timezone.d.ts.map +1 -0
  88. package/script/types/0_timezone.js +29 -0
  89. package/script/types/1_available_reactions.d.ts +54 -0
  90. package/script/types/1_available_reactions.d.ts.map +1 -0
  91. package/script/types/1_available_reactions.js +33 -0
  92. package/script/types/1_chat_p.d.ts +1 -1
  93. package/script/types/1_chat_p.d.ts.map +1 -1
  94. package/script/types/1_chat_p.js +1 -1
  95. package/script/types/1_country.d.ts +30 -0
  96. package/script/types/1_country.d.ts.map +1 -0
  97. package/script/types/1_country.js +33 -0
  98. package/script/types/2_user.d.ts +1 -1
  99. package/script/types/2_user.d.ts.map +1 -1
  100. package/script/types/2_user.js +2 -2
  101. package/script/types/3_app_support.d.ts +27 -0
  102. package/script/types/3_app_support.d.ts.map +1 -0
  103. package/script/types/3_app_support.js +27 -0
  104. package/script/types/3_blocked_user.d.ts +31 -0
  105. package/script/types/3_blocked_user.d.ts.map +1 -0
  106. package/script/types/3_blocked_user.js +36 -0
  107. package/script/types/4_blocked_user_list.d.ts +31 -0
  108. package/script/types/4_blocked_user_list.d.ts.map +1 -0
  109. package/script/types/4_blocked_user_list.js +28 -0
  110. package/esm/deps/jsr.io/@std/async/1.2.0/_util.d.ts +0 -2
  111. package/esm/deps/jsr.io/@std/async/1.2.0/_util.d.ts.map +0 -1
  112. package/esm/deps/jsr.io/@std/async/1.2.0/_util.js +0 -6
  113. package/esm/deps/jsr.io/@std/async/1.2.0/abortable.d.ts +0 -107
  114. package/esm/deps/jsr.io/@std/async/1.2.0/abortable.d.ts.map +0 -1
  115. package/esm/deps/jsr.io/@std/async/1.2.0/abortable.js +0 -46
  116. package/esm/deps/jsr.io/@std/async/1.2.0/deadline.d.ts +0 -37
  117. package/esm/deps/jsr.io/@std/async/1.2.0/deadline.d.ts.map +0 -1
  118. package/esm/deps/jsr.io/@std/async/1.2.0/deadline.js +0 -41
  119. package/esm/deps/jsr.io/@std/async/1.2.0/debounce.d.ts +0 -44
  120. package/esm/deps/jsr.io/@std/async/1.2.0/debounce.d.ts.map +0 -1
  121. package/esm/deps/jsr.io/@std/async/1.2.0/debounce.js +0 -57
  122. package/esm/deps/jsr.io/@std/async/1.2.0/mod.d.ts +0 -22
  123. package/esm/deps/jsr.io/@std/async/1.2.0/mod.d.ts.map +0 -1
  124. package/esm/deps/jsr.io/@std/async/1.2.0/mod.js +0 -23
  125. package/esm/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.d.ts +0 -111
  126. package/esm/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.d.ts.map +0 -1
  127. package/esm/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.js +0 -154
  128. package/esm/deps/jsr.io/@std/async/1.2.0/retry.d.ts +0 -155
  129. package/esm/deps/jsr.io/@std/async/1.2.0/retry.d.ts.map +0 -1
  130. package/esm/deps/jsr.io/@std/async/1.2.0/retry.js +0 -147
  131. package/esm/deps/jsr.io/@std/async/1.2.0/tee.d.ts +0 -43
  132. package/esm/deps/jsr.io/@std/async/1.2.0/tee.d.ts.map +0 -1
  133. package/esm/deps/jsr.io/@std/async/1.2.0/tee.js +0 -79
  134. package/script/deps/jsr.io/@std/async/1.2.0/_util.d.ts +0 -2
  135. package/script/deps/jsr.io/@std/async/1.2.0/_util.d.ts.map +0 -1
  136. package/script/deps/jsr.io/@std/async/1.2.0/_util.js +0 -9
  137. package/script/deps/jsr.io/@std/async/1.2.0/abortable.d.ts +0 -107
  138. package/script/deps/jsr.io/@std/async/1.2.0/abortable.d.ts.map +0 -1
  139. package/script/deps/jsr.io/@std/async/1.2.0/abortable.js +0 -49
  140. package/script/deps/jsr.io/@std/async/1.2.0/deadline.d.ts +0 -37
  141. package/script/deps/jsr.io/@std/async/1.2.0/deadline.d.ts.map +0 -1
  142. package/script/deps/jsr.io/@std/async/1.2.0/deadline.js +0 -44
  143. package/script/deps/jsr.io/@std/async/1.2.0/debounce.d.ts +0 -44
  144. package/script/deps/jsr.io/@std/async/1.2.0/debounce.d.ts.map +0 -1
  145. package/script/deps/jsr.io/@std/async/1.2.0/debounce.js +0 -60
  146. package/script/deps/jsr.io/@std/async/1.2.0/mod.d.ts +0 -22
  147. package/script/deps/jsr.io/@std/async/1.2.0/mod.d.ts.map +0 -1
  148. package/script/deps/jsr.io/@std/async/1.2.0/mod.js +0 -39
  149. package/script/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.d.ts +0 -111
  150. package/script/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.d.ts.map +0 -1
  151. package/script/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.js +0 -158
  152. package/script/deps/jsr.io/@std/async/1.2.0/retry.d.ts +0 -155
  153. package/script/deps/jsr.io/@std/async/1.2.0/retry.d.ts.map +0 -1
  154. package/script/deps/jsr.io/@std/async/1.2.0/retry.js +0 -152
  155. package/script/deps/jsr.io/@std/async/1.2.0/tee.d.ts +0 -43
  156. package/script/deps/jsr.io/@std/async/1.2.0/tee.d.ts.map +0 -1
  157. package/script/deps/jsr.io/@std/async/1.2.0/tee.js +0 -82
@@ -519,6 +519,90 @@ export class ClientDispatcher extends Composer {
519
519
  async suggestBirthday(userId, birthday) {
520
520
  return await this.#dispatch("suggestBirthday", userId, birthday);
521
521
  }
522
+ /**
523
+ * Block a user. User-only.
524
+ *
525
+ * @method ac
526
+ * @param userId The identifier of the user to block.
527
+ */
528
+ async blockUser(userId) {
529
+ return await this.#dispatch("blockUser", userId);
530
+ }
531
+ /**
532
+ * Unblock a user. User-only.
533
+ *
534
+ * @method ac
535
+ * @param userId The identifier of the user to unblock.
536
+ */
537
+ async unblockUser(userId) {
538
+ return await this.#dispatch("unblockUser", userId);
539
+ }
540
+ /**
541
+ * Get blocked users. User-only.
542
+ *
543
+ * @method ac
544
+ */
545
+ async getBlockedUsers(params) {
546
+ return await this.#dispatch("getBlockedUsers", params);
547
+ }
548
+ /**
549
+ * Add a bot to the attachments menu. User-only.
550
+ *
551
+ * @method ac
552
+ * @param botId The identifier of the bot to add to the attachments menu.
553
+ */
554
+ async addBotToAttachmentsMenu(botId, params) {
555
+ return await this.#dispatch("addBotToAttachmentsMenu", botId, params);
556
+ }
557
+ /**
558
+ * Remove a bot from the attachments menu. User-only.
559
+ *
560
+ * @method ac
561
+ * @param botId The identifier of the bot to remove from the attachments menu.
562
+ */
563
+ async removeBotFromAttachmentsMenu(botId) {
564
+ return await this.#dispatch("removeBotFromAttachmentsMenu", botId);
565
+ }
566
+ /**
567
+ * Get app support. User-only.
568
+ *
569
+ * @method ac
570
+ */
571
+ async getAppSupport() {
572
+ return await this.#dispatch("getAppSupport");
573
+ }
574
+ /**
575
+ * Get app support name. User-only.
576
+ *
577
+ * @method ac
578
+ */
579
+ async getAppSupportName() {
580
+ return await this.#dispatch("getAppSupportName");
581
+ }
582
+ /**
583
+ * Get owned bots. User-only.
584
+ *
585
+ * @method ac
586
+ */
587
+ async getOwnedBots() {
588
+ return await this.#dispatch("getOwnedBots");
589
+ }
590
+ /**
591
+ * Get timezones. User-only.
592
+ *
593
+ * @method ac
594
+ */
595
+ async getTimezones() {
596
+ return await this.#dispatch("getTimezones");
597
+ }
598
+ /**
599
+ * Get countries. User-only.
600
+ *
601
+ * @method ac
602
+ */
603
+ async getCountries(languageCode) {
604
+ return await this.#dispatch("getCountries", languageCode);
605
+ }
522
606
  //
523
607
  // ========================= MESSAGES ========================= //
524
608
  //
@@ -1125,13 +1209,30 @@ export class ClientDispatcher extends Composer {
1125
1209
  /**
1126
1210
  * Get a list of reactions made to a message. User-only.
1127
1211
  *
1212
+ * @method ms
1128
1213
  * @param chatId The identifier of a chat.
1129
1214
  * @param messageId The identifier of the message.
1130
- * @method ms
1131
1215
  */
1132
1216
  async getMessageReactions(chatId, messageId, params) {
1133
1217
  return await this.#dispatch("getMessageReactions", chatId, messageId, params);
1134
1218
  }
1219
+ /**
1220
+ * Set a reaction as default. User-only.
1221
+ *
1222
+ * @mehod ms
1223
+ * @param reaction The reaction to set as default.
1224
+ */
1225
+ async setDefaultReaction(reaction) {
1226
+ return await this.#dispatch("setDefaultReaction", reaction);
1227
+ }
1228
+ /**
1229
+ * Clear all message drafts. User-only.
1230
+ *
1231
+ * @mehod ms
1232
+ */
1233
+ async clearDrafts() {
1234
+ return await this.#dispatch("clearAllDrafts");
1235
+ }
1135
1236
  //
1136
1237
  // ========================= POLLS ========================= //
1137
1238
  //
@@ -2034,6 +2135,16 @@ export class ClientDispatcher extends Composer {
2034
2135
  async disableChatHistoryForNewMembers(chatId) {
2035
2136
  return await this.#dispatch("disableChatHistoryForNewMembers", chatId);
2036
2137
  }
2138
+ /**
2139
+ * Set the default send as chat of a chat. User-only.
2140
+ *
2141
+ * @method ch
2142
+ * @param chatId The identifier of a chat.
2143
+ * @param sendAs The new default send as chat.
2144
+ */
2145
+ async setDefaultSendAs(chatId, sendAs) {
2146
+ return await this.#dispatch("setDefaultSendAs", chatId, sendAs);
2147
+ }
2037
2148
  //
2038
2149
  // ========================= CALLBACK QUERIES ========================= //
2039
2150
  //
@@ -2192,6 +2303,14 @@ export class ClientDispatcher extends Composer {
2192
2303
  async removeReaction(chatId, messageId, reaction) {
2193
2304
  return await this.#dispatch("removeReaction", chatId, messageId, reaction);
2194
2305
  }
2306
+ /**
2307
+ * Clear recent reactions. User-only.
2308
+ *
2309
+ * @method re
2310
+ */
2311
+ async clearRecentReactions() {
2312
+ return await this.#dispatch("clearRecentReactions");
2313
+ }
2195
2314
  //
2196
2315
  // ========================= STORIES ========================= //
2197
2316
  //
@@ -2387,34 +2506,16 @@ export class ClientDispatcher extends Composer {
2387
2506
  return await this.#dispatch("getStoriesInAlbum", chatId, albumId);
2388
2507
  }
2389
2508
  //
2390
- // ========================= MISC ========================= //
2509
+ // ========================= NETWORK STATISTICS ========================= //
2391
2510
  //
2392
2511
  /**
2393
2512
  * Get network statistics. This might not always be available.
2394
2513
  *
2395
- * @method mc
2514
+ * @method ns
2396
2515
  */
2397
2516
  async getNetworkStatistics() {
2398
2517
  return await this.#dispatch("getNetworkStatistics");
2399
2518
  }
2400
- /**
2401
- * Block a user. User-only.
2402
- *
2403
- * @method mc
2404
- * @param userId The identifier of the user to block.
2405
- */
2406
- async blockUser(userId) {
2407
- return await this.#dispatch("blockUser", userId);
2408
- }
2409
- /**
2410
- * Unblock a user. User-only.
2411
- *
2412
- * @method mc
2413
- * @param userId The identifier of the user to unblock.
2414
- */
2415
- async unblockUser(userId) {
2416
- return await this.#dispatch("unblockUser", userId);
2417
- }
2418
2519
  //
2419
2520
  // ========================= VIDEO CHATS ========================= //
2420
2521
  //
@@ -0,0 +1,27 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import type { Api } from "../2_tl.js";
21
+ export interface CallingCode {
22
+ countryCode: string;
23
+ prefixes: string[];
24
+ patterns: string[];
25
+ }
26
+ export declare function constructCallingCode(countryCode: Api.help_CountryCode): CallingCode;
27
+ //# sourceMappingURL=0_calling_code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0_calling_code.d.ts","sourceRoot":"","sources":["../../src/types/0_calling_code.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,GAAG,CAAC,gBAAgB,GAAG,WAAW,CAMnF"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ export function constructCallingCode(countryCode) {
21
+ return {
22
+ countryCode: countryCode.country_code,
23
+ prefixes: countryCode.prefixes ?? [],
24
+ patterns: countryCode.patterns ?? [],
25
+ };
26
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import type { Api } from "../2_tl.js";
21
+ /** A timezone. */
22
+ export interface Timezone {
23
+ /** The identifier of the timezone. */
24
+ id: string;
25
+ /** The name of the timezone. */
26
+ name: string;
27
+ /** The UTC offset of the timezone. */
28
+ utcOffset: number;
29
+ }
30
+ export declare function constructTimezone(timezone: Api.Timezone): Timezone;
31
+ //# sourceMappingURL=0_timezone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0_timezone.d.ts","sourceRoot":"","sources":["../../src/types/0_timezone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,kBAAkB;AAClB,MAAM,WAAW,QAAQ;IACvB,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAMlE"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ export function constructTimezone(timezone) {
21
+ return {
22
+ id: timezone.id,
23
+ name: timezone.name,
24
+ utcOffset: timezone.utc_offset,
25
+ };
26
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import type { Api } from "../2_tl.js";
21
+ import { type Reaction } from "./0_reaction.js";
22
+ /**
23
+ * An available reactions value allowing no type of reactions.
24
+ * @unlisted
25
+ */
26
+ export interface AvailableReactionsNone {
27
+ /** @discriminator */
28
+ type: "none";
29
+ }
30
+ /**
31
+ * An available reactions value allowing a specific set of reactions.
32
+ * @unlisted
33
+ */
34
+ export interface AvailableReactionsSome {
35
+ /** @discriminator */
36
+ type: "some";
37
+ /** The allowed reactions. */
38
+ reactions: Reaction[];
39
+ /** The maximum number of allowed reactions on a single message. */
40
+ maxReactionCount: number;
41
+ }
42
+ /**
43
+ * An available reactions value allowing all types of reactions.
44
+ * @unlisted
45
+ */
46
+ export interface AvailableReactionsAll {
47
+ /** @discriminator */
48
+ type: "all";
49
+ /** The maximum number of allowed reactions on a single message. */
50
+ maxReactionCount: number;
51
+ }
52
+ export type AvailableReactions = AvailableReactionsNone | AvailableReactionsSome | AvailableReactionsAll;
53
+ export declare function availableReactionsToTlObject(chatAvailableReactions: AvailableReactions): Api.ChatReactions;
54
+ //# sourceMappingURL=1_available_reactions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1_available_reactions.d.ts","sourceRoot":"","sources":["../../src/types/1_available_reactions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,QAAQ,EAAsB,MAAM,iBAAiB,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,qBAAqB;IACrB,IAAI,EAAE,KAAK,CAAC;IACZ,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GAAG,sBAAsB,GAAG,qBAAqB,CAAC;AAEzG,wBAAgB,4BAA4B,CAAC,sBAAsB,EAAE,kBAAkB,GAAG,GAAG,CAAC,aAAa,CAS1G"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import { reactionToTlObject } from "./0_reaction.js";
21
+ export function availableReactionsToTlObject(chatAvailableReactions) {
22
+ switch (chatAvailableReactions.type) {
23
+ case "none":
24
+ return { _: "chatReactionsNone" };
25
+ case "some":
26
+ return { _: "chatReactionsSome", reactions: chatAvailableReactions.reactions.map(reactionToTlObject) };
27
+ case "all":
28
+ return { _: "chatReactionsAll" };
29
+ }
30
+ }
@@ -82,7 +82,7 @@ export interface ChatPPrivate extends _ChatPBase {
82
82
  /** The reason why the user has been restricted. */
83
83
  restrictionReason?: RestrictionReason[];
84
84
  /** Whether the user is a bot that has been added to the attachment menu by the current user. */
85
- isAddedToAttachmentMenu?: boolean;
85
+ isAddedToAttachmentsMenu?: boolean;
86
86
  /** Whether the user is a bot that has been added to the attachment menu by the current user. */
87
87
  hasMainMiniApp?: boolean;
88
88
  }
@@ -1 +1 @@
1
- {"version":3,"file":"1_chat_p.d.ts","sourceRoot":"","sources":["../../src/types/1_chat_p.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAA8B,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC/F,OAAO,EAAuB,KAAK,U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AAK,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;CAC/E;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,YAAY,CAE/D"}
@@ -55,7 +55,7 @@ export function constructChatP(chat) {
55
55
  isSupport: chat.support || false,
56
56
  isRestricted: chat.restricted || false,
57
57
  restrictionReason: chat.restriction_reason?.map((v) => constructRestrictionReason(v)),
58
- isAddedToAttachmentMenu: chat.bot ? chat.attach_menu_enabled || false : undefined,
58
+ isAddedToAttachmentsMenu: chat.bot ? chat.attach_menu_enabled || false : undefined,
59
59
  hasMainMiniApp: chat.bot ? chat.attach_menu_enabled || false : undefined,
60
60
  };
61
61
  if (Api.is("userProfilePhoto", chat.photo)) {
@@ -0,0 +1,30 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import type { Api } from "../2_tl.js";
21
+ import { type CallingCode } from "./0_calling_code.js";
22
+ export interface Country {
23
+ defaultName: string;
24
+ name?: string;
25
+ code: string;
26
+ callingCodes: CallingCode[];
27
+ isHidden: boolean;
28
+ }
29
+ export declare function constructCountry(country: Api.help_Country): Country;
30
+ //# sourceMappingURL=1_country.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1_country.d.ts","sourceRoot":"","sources":["../../src/types/1_country.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,WAAW,EAAwB,MAAM,qBAAqB,CAAC;AAE7E,MAAM,WAAW,OAAO;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,YAAY,GAAG,OAAO,CAQnE"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import { cleanObject } from "../1_utilities.js";
21
+ import { constructCallingCode } from "./0_calling_code.js";
22
+ export function constructCountry(country) {
23
+ return cleanObject({
24
+ defaultName: country.default_name,
25
+ name: country.name,
26
+ code: country.iso2,
27
+ callingCodes: country.country_codes.map(constructCallingCode),
28
+ isHidden: country.hidden ?? false,
29
+ });
30
+ }
@@ -74,7 +74,7 @@ export interface User {
74
74
  /** The reason why the user has been restricted. */
75
75
  restrictionReason?: RestrictionReason[];
76
76
  /** Whether the user is a bot that has been added to the attachment menu by the current user. */
77
- isAddedToAttachmentMenu?: boolean;
77
+ isAddedToAttachmentsMenu?: boolean;
78
78
  /** Whether the user is a bot that has a main mini app. */
79
79
  hasMainMiniApp?: boolean;
80
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"2_user.d.ts","sourceRoot":"","sources":["../../src/types/2_user.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAA8B,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC/F,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,cAAc;AACd,MAAM,WAAW,IAAI;IACnB,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,yBAAyB;IACzB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,gCAAgC;IAChC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,uFAAuF;IACvF,YAAY,CAAC,EAAE,MAAM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GAAgG;IAChG,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,0DAA0D;IAC1D,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,GAAG,IAAI,CAoCnD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CA8BxD"}
@@ -51,7 +51,7 @@ export function constructUser(user_) {
51
51
  isSupport: user_.support || false,
52
52
  isRestricted: user_.restricted || false,
53
53
  restrictionReason: user_.restriction_reason?.map((v) => constructRestrictionReason(v)),
54
- isAddedToAttachmentMenu: user_.bot ? user_.attach_menu_enabled || false : undefined,
54
+ isAddedToAttachmentsMenu: user_.bot ? user_.attach_menu_enabled || false : undefined,
55
55
  hasMainMiniApp: user_.bot ? user_.bot_has_main_app || false : undefined,
56
56
  };
57
57
  if (Api.is("userProfilePhoto", user_.photo)) {
@@ -85,7 +85,7 @@ export function constructUser2(chatP) {
85
85
  isSupport: chatP.isSupport,
86
86
  isRestricted: chatP.isRestricted,
87
87
  restrictionReason: chatP.restrictionReason,
88
- isAddedToAttachmentMenu: chatP.isAddedToAttachmentMenu,
88
+ isAddedToAttachmentsMenu: chatP.isAddedToAttachmentsMenu,
89
89
  hasMainMiniApp: chatP.hasMainMiniApp,
90
90
  };
91
91
  return cleanObject(user);
@@ -0,0 +1,27 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import { Api } from "../2_tl.js";
21
+ import { type User } from "./2_user.js";
22
+ export interface AppSupport {
23
+ phoneNumber: string;
24
+ user: User;
25
+ }
26
+ export declare function constructAppSupport(result: Api.help_Support): AppSupport;
27
+ //# sourceMappingURL=3_app_support.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"3_app_support.d.ts","sourceRoot":"","sources":["../../src/types/3_app_support.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAiB,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,YAAY,GAAG,UAAU,CAExE"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import { Api } from "../2_tl.js";
21
+ import { constructUser } from "./2_user.js";
22
+ export function constructAppSupport(result) {
23
+ return { phoneNumber: result.phone_number, user: constructUser(Api.as("user", result.user)) };
24
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import type { Api } from "../2_tl.js";
21
+ import type { PeerGetter } from "./1_chat_p.js";
22
+ import { type User } from "./2_user.js";
23
+ /** A blocked user. */
24
+ export interface BlockedUser {
25
+ /** The blocked user. */
26
+ user: User;
27
+ /** The point in time in which the user was blocked. */
28
+ blockedAt: number;
29
+ }
30
+ export declare function constructBlockedUser(peerBlocked: Api.PeerBlocked, getPeer: PeerGetter): BlockedUser;
31
+ //# sourceMappingURL=3_blocked_user.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"3_blocked_user.d.ts","sourceRoot":"","sources":["../../src/types/3_blocked_user.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAkB,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAExD,sBAAsB;AACtB,MAAM,WAAW,WAAW;IAC1B,wBAAwB;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,GAAG,WAAW,CAanG"}