@mtkruto/node 0.77.2 → 0.78.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 (143) hide show
  1. package/esm/0_errors.d.ts +1 -0
  2. package/esm/0_errors.d.ts.map +1 -1
  3. package/esm/0_errors.js +5 -0
  4. package/esm/3_errors.d.ts +6 -0
  5. package/esm/3_errors.d.ts.map +1 -1
  6. package/esm/3_errors.js +6 -0
  7. package/esm/3_types.d.ts +3 -0
  8. package/esm/3_types.d.ts.map +1 -1
  9. package/esm/3_types.js +3 -0
  10. package/esm/4_constants.d.ts +1 -0
  11. package/esm/4_constants.d.ts.map +1 -1
  12. package/esm/4_constants.js +2 -0
  13. package/esm/5_client.d.ts +6 -1
  14. package/esm/5_client.d.ts.map +1 -1
  15. package/esm/5_client.js +6 -1
  16. package/esm/_dnt.polyfills.d.ts +13 -13
  17. package/esm/_dnt.polyfills.d.ts.map +1 -1
  18. package/esm/_dnt.polyfills.js +11 -11
  19. package/esm/client/0_worker_request.d.ts +26 -0
  20. package/esm/client/0_worker_request.d.ts.map +1 -0
  21. package/esm/client/0_worker_request.js +20 -0
  22. package/esm/client/0_worker_response.d.ts +39 -0
  23. package/esm/client/0_worker_response.d.ts.map +1 -0
  24. package/esm/client/0_worker_response.js +20 -0
  25. package/esm/client/1_client_generic.d.ts +1602 -0
  26. package/esm/client/1_client_generic.d.ts.map +1 -0
  27. package/esm/client/1_client_generic.js +24 -0
  28. package/esm/client/2_account_manager.d.ts +6 -1
  29. package/esm/client/2_account_manager.d.ts.map +1 -1
  30. package/esm/client/2_account_manager.js +84 -0
  31. package/esm/client/2_context.d.ts +114 -0
  32. package/esm/client/2_context.d.ts.map +1 -0
  33. package/esm/client/2_context.js +453 -0
  34. package/esm/client/2_file_manager.d.ts.map +1 -1
  35. package/esm/client/2_file_manager.js +13 -6
  36. package/esm/client/2_sign_in.d.ts +25 -0
  37. package/esm/client/2_sign_in.d.ts.map +1 -0
  38. package/esm/client/2_sign_in.js +114 -0
  39. package/esm/client/{0_filters.d.ts → 3_filters.d.ts} +6 -3
  40. package/esm/client/3_filters.d.ts.map +1 -0
  41. package/esm/client/3_filters_test.d.ts.map +1 -0
  42. package/esm/client/{1_composer.d.ts → 4_composer.d.ts} +12 -11
  43. package/esm/client/4_composer.d.ts.map +1 -0
  44. package/esm/client/{1_composer.js → 4_composer.js} +17 -7
  45. package/esm/client/4_composer_test.d.ts.map +1 -0
  46. package/esm/client/5_client.d.ts +43 -179
  47. package/esm/client/5_client.d.ts.map +1 -1
  48. package/esm/client/5_client.js +141 -595
  49. package/esm/client/5_client_dispatcher.d.ts +1660 -0
  50. package/esm/client/5_client_dispatcher.d.ts.map +1 -0
  51. package/esm/client/5_client_dispatcher.js +2141 -0
  52. package/esm/client/6_client_worker.d.ts +27 -0
  53. package/esm/client/6_client_worker.d.ts.map +1 -0
  54. package/esm/client/6_client_worker.js +51 -0
  55. package/esm/types/0_bot_token_check_result.d.ts +29 -0
  56. package/esm/types/0_bot_token_check_result.d.ts.map +1 -0
  57. package/esm/types/0_bot_token_check_result.js +20 -0
  58. package/esm/types/0_code_check_result.d.ts +37 -0
  59. package/esm/types/0_code_check_result.d.ts.map +1 -0
  60. package/esm/types/0_code_check_result.js +20 -0
  61. package/esm/types/0_password_check_result.d.ts +33 -0
  62. package/esm/types/0_password_check_result.d.ts.map +1 -0
  63. package/esm/types/0_password_check_result.js +20 -0
  64. package/esm/types/1_chat_p.d.ts.map +1 -1
  65. package/esm/types/1_chat_p.js +2 -2
  66. package/esm/types/2_chat.d.ts +3 -3
  67. package/esm/types/2_chat.d.ts.map +1 -1
  68. package/package.json +1 -1
  69. package/script/0_errors.d.ts +1 -0
  70. package/script/0_errors.d.ts.map +1 -1
  71. package/script/0_errors.js +5 -0
  72. package/script/3_errors.d.ts +6 -0
  73. package/script/3_errors.d.ts.map +1 -1
  74. package/script/3_errors.js +11 -3
  75. package/script/3_types.d.ts +3 -0
  76. package/script/3_types.d.ts.map +1 -1
  77. package/script/3_types.js +3 -0
  78. package/script/4_constants.d.ts +1 -0
  79. package/script/4_constants.d.ts.map +1 -1
  80. package/script/4_constants.js +3 -1
  81. package/script/5_client.d.ts +6 -1
  82. package/script/5_client.d.ts.map +1 -1
  83. package/script/5_client.js +6 -1
  84. package/script/_dnt.polyfills.d.ts +13 -13
  85. package/script/_dnt.polyfills.d.ts.map +1 -1
  86. package/script/_dnt.polyfills.js +11 -11
  87. package/script/client/0_worker_request.d.ts +26 -0
  88. package/script/client/0_worker_request.d.ts.map +1 -0
  89. package/script/client/0_worker_request.js +21 -0
  90. package/script/client/0_worker_response.d.ts +39 -0
  91. package/script/client/0_worker_response.d.ts.map +1 -0
  92. package/script/client/0_worker_response.js +21 -0
  93. package/script/client/1_client_generic.d.ts +1602 -0
  94. package/script/client/1_client_generic.d.ts.map +1 -0
  95. package/script/client/1_client_generic.js +28 -0
  96. package/script/client/2_account_manager.d.ts +6 -1
  97. package/script/client/2_account_manager.d.ts.map +1 -1
  98. package/script/client/2_account_manager.js +84 -0
  99. package/script/client/2_context.d.ts +114 -0
  100. package/script/client/2_context.d.ts.map +1 -0
  101. package/script/client/2_context.js +457 -0
  102. package/script/client/2_file_manager.d.ts.map +1 -1
  103. package/script/client/2_file_manager.js +11 -4
  104. package/script/client/2_sign_in.d.ts +25 -0
  105. package/script/client/2_sign_in.d.ts.map +1 -0
  106. package/script/client/2_sign_in.js +118 -0
  107. package/script/client/{0_filters.d.ts → 3_filters.d.ts} +6 -3
  108. package/script/client/3_filters.d.ts.map +1 -0
  109. package/script/client/3_filters_test.d.ts.map +1 -0
  110. package/script/client/{1_composer.d.ts → 4_composer.d.ts} +12 -11
  111. package/script/client/4_composer.d.ts.map +1 -0
  112. package/script/client/{1_composer.js → 4_composer.js} +17 -7
  113. package/script/client/4_composer_test.d.ts.map +1 -0
  114. package/script/client/5_client.d.ts +43 -179
  115. package/script/client/5_client.d.ts.map +1 -1
  116. package/script/client/5_client.js +140 -594
  117. package/script/client/5_client_dispatcher.d.ts +1660 -0
  118. package/script/client/5_client_dispatcher.d.ts.map +1 -0
  119. package/script/client/5_client_dispatcher.js +2178 -0
  120. package/script/client/6_client_worker.d.ts +27 -0
  121. package/script/client/6_client_worker.d.ts.map +1 -0
  122. package/script/client/6_client_worker.js +55 -0
  123. package/script/types/0_bot_token_check_result.d.ts +29 -0
  124. package/script/types/0_bot_token_check_result.d.ts.map +1 -0
  125. package/script/types/0_bot_token_check_result.js +21 -0
  126. package/script/types/0_code_check_result.d.ts +37 -0
  127. package/script/types/0_code_check_result.d.ts.map +1 -0
  128. package/script/types/0_code_check_result.js +21 -0
  129. package/script/types/0_password_check_result.d.ts +33 -0
  130. package/script/types/0_password_check_result.d.ts.map +1 -0
  131. package/script/types/0_password_check_result.js +21 -0
  132. package/script/types/1_chat_p.d.ts.map +1 -1
  133. package/script/types/1_chat_p.js +2 -2
  134. package/script/types/2_chat.d.ts +3 -3
  135. package/script/types/2_chat.d.ts.map +1 -1
  136. package/esm/client/0_filters.d.ts.map +0 -1
  137. package/esm/client/0_filters_test.d.ts.map +0 -1
  138. package/esm/client/1_composer.d.ts.map +0 -1
  139. package/script/client/0_filters.d.ts.map +0 -1
  140. package/script/client/0_filters_test.d.ts.map +0 -1
  141. package/script/client/1_composer.d.ts.map +0 -1
  142. /package/esm/client/{0_filters.js → 3_filters.js} +0 -0
  143. /package/script/client/{0_filters.js → 3_filters.js} +0 -0
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.CHANNEL_DIFFERENCE_LIMIT_BOT = exports.CHANNEL_DIFFERENCE_LIMIT_USER = exports.MAX_CHANNEL_ID = exports.MAX_CHAT_ID = exports.STICKER_SET_NAME_TTL = exports.USERNAME_TTL = exports.SYSTEM_VERSION = exports.SYSTEM_LANG_CODE = exports.LANG_PACK = exports.LANG_CODE = exports.DEVICE_MODEL = exports.APP_VERSION = exports.INITIAL_DC = exports.PUBLIC_KEYS = void 0;
36
+ exports.DOWNLOAD_MAX_CHUNK_SIZE = exports.CHANNEL_DIFFERENCE_LIMIT_BOT = exports.CHANNEL_DIFFERENCE_LIMIT_USER = exports.MAX_CHANNEL_ID = exports.MAX_CHAT_ID = exports.STICKER_SET_NAME_TTL = exports.USERNAME_TTL = exports.SYSTEM_VERSION = exports.SYSTEM_LANG_CODE = exports.LANG_PACK = exports.LANG_CODE = exports.DEVICE_MODEL = exports.APP_VERSION = exports.INITIAL_DC = exports.PUBLIC_KEYS = void 0;
37
37
  /**
38
38
  * MTKruto - Cross-runtime JavaScript library for building Telegram clients
39
39
  * Copyright (C) 2023-2026 Roj <https://roj.im/>
@@ -54,6 +54,7 @@ exports.CHANNEL_DIFFERENCE_LIMIT_BOT = exports.CHANNEL_DIFFERENCE_LIMIT_USER = e
54
54
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
55
55
  */
56
56
  const dntShim = __importStar(require("./_dnt.shims.js"));
57
+ const _1_utilities_js_1 = require("./1_utilities.js");
57
58
  exports.PUBLIC_KEYS = Object.freeze([
58
59
  [
59
60
  1562291298945373506n,
@@ -120,3 +121,4 @@ exports.MAX_CHAT_ID = 999999999999;
120
121
  exports.MAX_CHANNEL_ID = 997852516352;
121
122
  exports.CHANNEL_DIFFERENCE_LIMIT_USER = 100;
122
123
  exports.CHANNEL_DIFFERENCE_LIMIT_BOT = 100_000;
124
+ exports.DOWNLOAD_MAX_CHUNK_SIZE = 1 * _1_utilities_js_1.megabyte;
@@ -18,7 +18,12 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  export * from "./client/0_params.js";
21
- export * from "./client/2_client_encrypted.js";
21
+ export * from "./client/0_worker_request.js";
22
+ export * from "./client/0_worker_response.js";
22
23
  export * from "./client/1_client_plain.js";
24
+ export * from "./client/2_client_encrypted.js";
25
+ export * from "./client/4_composer.js";
23
26
  export * from "./client/5_client.js";
27
+ export * from "./client/5_client_dispatcher.js";
28
+ export * from "./client/6_client_worker.js";
24
29
  //# sourceMappingURL=5_client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"5_client.d.ts","sourceRoot":"","sources":["../src/5_client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"5_client.d.ts","sourceRoot":"","sources":["../src/5_client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC"}
@@ -34,6 +34,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
34
34
  };
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  __exportStar(require("./client/0_params.js"), exports);
37
- __exportStar(require("./client/2_client_encrypted.js"), exports);
37
+ __exportStar(require("./client/0_worker_request.js"), exports);
38
+ __exportStar(require("./client/0_worker_response.js"), exports);
38
39
  __exportStar(require("./client/1_client_plain.js"), exports);
40
+ __exportStar(require("./client/2_client_encrypted.js"), exports);
41
+ __exportStar(require("./client/4_composer.js"), exports);
39
42
  __exportStar(require("./client/5_client.js"), exports);
43
+ __exportStar(require("./client/5_client_dispatcher.js"), exports);
44
+ __exportStar(require("./client/6_client_worker.js"), exports);
@@ -1,16 +1,3 @@
1
- declare global {
2
- interface ArrayConstructor {
3
- fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | Promise<T>> | ArrayLike<T | Promise<T>>): Promise<T[]>;
4
- fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>) => U, thisArg?: any): Promise<Awaited<U>[]>;
5
- }
6
- }
7
- export {};
8
- declare global {
9
- interface Error {
10
- cause?: unknown;
11
- }
12
- }
13
- export {};
14
1
  declare global {
15
2
  interface PromiseConstructor {
16
3
  /**
@@ -24,6 +11,19 @@ declare global {
24
11
  };
25
12
  }
26
13
  }
14
+ declare global {
15
+ interface ArrayConstructor {
16
+ fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | Promise<T>> | ArrayLike<T | Promise<T>>): Promise<T[]>;
17
+ fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>) => U, thisArg?: any): Promise<Awaited<U>[]>;
18
+ }
19
+ }
20
+ export {};
21
+ declare global {
22
+ interface Error {
23
+ cause?: unknown;
24
+ }
25
+ }
26
+ export {};
27
27
  /**
28
28
  * Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
29
29
  * but instead of using npm to install additional dependencies,
@@ -1 +1 @@
1
- {"version":3,"file":"_dnt.polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.polyfills.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,gBAAgB;QACxB,SAAS,CAAC,CAAC,EACP,mBAAmB,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAC7F,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;QAEhB,SAAS,CAAC,CAAC,EAAE,CAAC,EACV,mBAAmB,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,EACl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0B,EAAE,0BAA0B;CAC/D;AAiBD,eAAO,IAAI,6BAA6B,EA2BnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,6BAA6B,EA4DnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,oBAAoB,EAoB1B,kBAAkB,CAAC"}
@@ -1,6 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.import_meta_ponyfill = exports.import_meta_ponyfill_esmodule = exports.import_meta_ponyfill_commonjs = void 0;
4
+ // https://github.com/tc39/proposal-promise-with-resolvers/blob/3a78801e073e99217dbeb2c43ba7212f3bdc8b83/polyfills.js#L1C1-L9C2
5
+ if (Promise.withResolvers === undefined) {
6
+ Promise.withResolvers = () => {
7
+ const out = {};
8
+ out.promise = new Promise((resolve_, reject_) => {
9
+ out.resolve = resolve_;
10
+ out.reject = reject_;
11
+ });
12
+ return out;
13
+ };
14
+ }
4
15
  // From https://github.com/es-shims/array-from-async/blob/4a5ff83947b861f35b380d5d4f20da2f07698638/index.mjs
5
16
  // Tried to have dnt depend on the package instead, but it distributes as an
6
17
  // ES module, so doesn't work with CommonJS.
@@ -110,17 +121,6 @@ async function fromAsync(items, mapfn, thisArg) {
110
121
  if (!Array.fromAsync) {
111
122
  Array.fromAsync = fromAsync;
112
123
  }
113
- // https://github.com/tc39/proposal-promise-with-resolvers/blob/3a78801e073e99217dbeb2c43ba7212f3bdc8b83/polyfills.js#L1C1-L9C2
114
- if (Promise.withResolvers === undefined) {
115
- Promise.withResolvers = () => {
116
- const out = {};
117
- out.promise = new Promise((resolve_, reject_) => {
118
- out.resolve = resolve_;
119
- out.reject = reject_;
120
- });
121
- return out;
122
- };
123
- }
124
124
  /**
125
125
  * Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
126
126
  * but instead of using npm to install additional dependencies,
@@ -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 interface WorkerRequest {
21
+ clientId: number;
22
+ id: number;
23
+ method: "initClient" | string;
24
+ args: unknown[];
25
+ }
26
+ //# sourceMappingURL=0_worker_request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0_worker_request.d.ts","sourceRoot":"","sources":["../../src/client/0_worker_request.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC;IAC9B,IAAI,EAAE,OAAO,EAAE,CAAC;CACjB"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /**
3
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
4
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
5
+ *
6
+ * This file is part of MTKruto.
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU Lesser General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU Lesser General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Lesser General Public License
19
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,39 @@
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 interface WorkerError {
21
+ name: "TelegramError" | "ConnectionError" | "AccessError" | "InputError" | "TransportError" | "TLError";
22
+ args: any;
23
+ }
24
+ export declare namespace WorkerResponse {
25
+ interface Base {
26
+ clientId: number;
27
+ id: number;
28
+ }
29
+ interface Error extends Base {
30
+ isError: true;
31
+ data: WorkerError;
32
+ }
33
+ interface Data extends Base {
34
+ isError: false;
35
+ data: unknown;
36
+ }
37
+ }
38
+ export type WorkerResponse = WorkerResponse.Error | WorkerResponse.Data;
39
+ //# sourceMappingURL=0_worker_response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0_worker_response.d.ts","sourceRoot":"","sources":["../../src/client/0_worker_response.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,eAAe,GAAG,iBAAiB,GAAG,aAAa,GAAG,YAAY,GAAG,gBAAgB,GAAG,SAAS,CAAC;IAExG,IAAI,EAAE,GAAG,CAAC;CACX;AAED,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC,UAAiB,IAAI;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,EAAE,EAAE,MAAM,CAAC;KACZ;IAED,UAAiB,KAAM,SAAQ,IAAI;QACjC,OAAO,EAAE,IAAI,CAAC;QACd,IAAI,EAAE,WAAW,CAAC;KACnB;IAED,UAAiB,IAAK,SAAQ,IAAI;QAChC,OAAO,EAAE,KAAK,CAAC;QACf,IAAI,EAAE,OAAO,CAAC;KACf;CACF;AAED,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /**
3
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
4
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
5
+ *
6
+ * This file is part of MTKruto.
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU Lesser General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU Lesser General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Lesser General Public License
19
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });