teleproto 203.0.1 → 203.1.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 (106) hide show
  1. package/CryptoFile.js +22 -8
  2. package/Helpers.d.ts +7 -8
  3. package/Helpers.js +32 -32
  4. package/Password.d.ts +1 -2
  5. package/Password.js +2 -3
  6. package/README.md +2 -18
  7. package/Utils.d.ts +1 -2
  8. package/Utils.js +32 -33
  9. package/Version.d.ts +1 -1
  10. package/Version.js +1 -1
  11. package/client/2fa.js +1 -2
  12. package/client/TelegramClient.d.ts +6 -5
  13. package/client/TelegramClient.js +22 -8
  14. package/client/auth.d.ts +0 -1
  15. package/client/auth.js +30 -17
  16. package/client/bots.js +1 -2
  17. package/client/buttons.js +1 -2
  18. package/client/chats.d.ts +0 -1
  19. package/client/chats.js +11 -11
  20. package/client/dialogs.js +3 -3
  21. package/client/downloads.d.ts +3 -4
  22. package/client/downloads.js +39 -23
  23. package/client/fs.js +5 -1
  24. package/client/index.js +22 -8
  25. package/client/messageParse.d.ts +1 -1
  26. package/client/messageParse.js +4 -4
  27. package/client/messages.js +25 -21
  28. package/client/os.js +22 -8
  29. package/client/telegramBaseClient.d.ts +0 -1
  30. package/client/telegramBaseClient.js +1 -1
  31. package/client/updates.d.ts +3 -1
  32. package/client/updates.js +10 -10
  33. package/client/uploads.d.ts +0 -1
  34. package/client/uploads.js +5 -5
  35. package/client/users.js +12 -13
  36. package/crypto/AuthKey.d.ts +1 -2
  37. package/crypto/CTR.d.ts +1 -2
  38. package/crypto/CTR.js +2 -21
  39. package/crypto/IGE.d.ts +0 -1
  40. package/crypto/RSA.d.ts +1 -2
  41. package/crypto/RSA.js +2 -2
  42. package/crypto/converters.js +5 -5
  43. package/crypto/crypto.d.ts +12 -20
  44. package/crypto/crypto.js +27 -86
  45. package/crypto/words.d.ts +2 -2
  46. package/crypto/words.js +3 -4
  47. package/errors/Common.d.ts +0 -1
  48. package/errors/index.js +6 -3
  49. package/events/CallbackQuery.d.ts +1 -2
  50. package/events/common.js +2 -2
  51. package/extensions/BinaryReader.d.ts +3 -4
  52. package/extensions/BinaryWriter.d.ts +0 -1
  53. package/extensions/Logger.d.ts +3 -5
  54. package/extensions/Logger.js +45 -24
  55. package/extensions/MessagePacker.d.ts +1 -2
  56. package/extensions/PromisedNetSockets.d.ts +3 -4
  57. package/extensions/PromisedNetSockets.js +22 -8
  58. package/extensions/PromisedWebSockets.d.ts +3 -4
  59. package/extensions/html.js +135 -120
  60. package/extensions/net.js +5 -1
  61. package/extensions/socks.js +5 -1
  62. package/index.js +22 -8
  63. package/network/Authenticator.js +3 -4
  64. package/network/MTProtoSender.d.ts +1 -2
  65. package/network/MTProtoSender.js +20 -1
  66. package/network/MTProtoState.d.ts +3 -4
  67. package/network/RequestState.d.ts +0 -1
  68. package/network/connection/Connection.d.ts +1 -3
  69. package/network/connection/Connection.js +5 -0
  70. package/network/connection/TCPAbridged.d.ts +3 -4
  71. package/network/connection/TCPFull.d.ts +1 -2
  72. package/network/connection/TCPMTProxy.d.ts +4 -5
  73. package/network/connection/TCPObfuscated.d.ts +1 -2
  74. package/package.json +6 -28
  75. package/requestIter.js +6 -4
  76. package/sessions/StringSession.d.ts +1 -2
  77. package/sessions/index.js +0 -2
  78. package/tl/MTProtoRequest.d.ts +0 -1
  79. package/tl/core/GZIPPacked.d.ts +5 -6
  80. package/tl/core/RPCResult.d.ts +0 -1
  81. package/tl/custom/button.d.ts +1 -2
  82. package/tl/custom/button.js +3 -3
  83. package/tl/custom/chatGetter.d.ts +0 -1
  84. package/tl/custom/chatGetter.js +7 -5
  85. package/tl/custom/dialog.d.ts +0 -1
  86. package/tl/custom/dialog.js +3 -3
  87. package/tl/custom/draft.d.ts +0 -1
  88. package/tl/custom/draft.js +3 -3
  89. package/tl/custom/file.d.ts +0 -1
  90. package/tl/custom/file.js +3 -3
  91. package/tl/custom/forward.d.ts +0 -1
  92. package/tl/custom/forward.js +3 -3
  93. package/tl/custom/inlineResult.d.ts +0 -1
  94. package/tl/custom/inlineResult.js +3 -3
  95. package/tl/custom/inlineResults.d.ts +0 -1
  96. package/tl/custom/inlineResults.js +3 -3
  97. package/tl/custom/message.d.ts +1 -2
  98. package/tl/custom/message.js +26 -12
  99. package/tl/custom/messageButton.d.ts +1 -2
  100. package/tl/custom/messageButton.js +3 -3
  101. package/tl/custom/senderGetter.d.ts +0 -1
  102. package/tl/generationHelpers.d.ts +2 -3
  103. package/tl/generationHelpers.js +18 -18
  104. package/tl/patched/index.js +1 -2
  105. package/sessions/CacheApiSession.d.ts +0 -18
  106. package/sessions/CacheApiSession.js +0 -99
package/CryptoFile.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -11,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
11
15
  }) : function(o, v) {
12
16
  o["default"] = v;
13
17
  });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
21
35
  Object.defineProperty(exports, "__esModule", { value: true });
22
36
  const crypto = __importStar(require("crypto"));
23
37
  exports.default = crypto;
package/Helpers.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import bigInt from "big-integer";
3
2
  import type { EntityLike } from "./define";
4
3
  import type { Api } from "./tl";
@@ -25,7 +24,7 @@ export declare function betterConsoleLog(object: {
25
24
  /**
26
25
  * Helper to find if a given object is an array (or similar)
27
26
  */
28
- export declare const isArrayLike: <T>(x: any) => x is T[];
27
+ export declare const isArrayLike: <T>(x: any) => x is Array<T>;
29
28
  /**
30
29
  * Special case signed little ints
31
30
  * @param big
@@ -66,7 +65,7 @@ export declare function bigIntMod(n: bigInt.BigInteger, m: bigInt.BigInteger): b
66
65
  * @param count
67
66
  * @returns {Buffer}
68
67
  */
69
- export declare function generateRandomBytes(count: number): Buffer;
68
+ export declare function generateRandomBytes(count: number): Buffer<ArrayBuffer>;
70
69
  /**
71
70
  * Calculate the key based on Telegram guidelines, specifying whether it's the client or not
72
71
  * @param sharedKey
@@ -82,10 +81,10 @@ export declare function stripText(text: string, entities: Api.TypeMessageEntity[
82
81
  * @returns {{key: Buffer, iv: Buffer}}
83
82
  */
84
83
  export declare function generateKeyDataFromNonce(serverNonceBigInt: bigInt.BigInteger, newNonceBigInt: bigInt.BigInteger): Promise<{
85
- key: Buffer;
86
- iv: Buffer;
84
+ key: Buffer<ArrayBuffer>;
85
+ iv: Buffer<ArrayBuffer>;
87
86
  }>;
88
- export declare function convertToLittle(buf: Buffer): Buffer;
87
+ export declare function convertToLittle(buf: Buffer): Buffer<ArrayBuffer>;
89
88
  /**
90
89
  * Calculates the SHA1 digest for the given data
91
90
  * @param data
@@ -112,7 +111,7 @@ export declare function modExp(a: bigInt.BigInteger, b: bigInt.BigInteger, n: bi
112
111
  * @param signed {boolean}
113
112
  * @returns {Buffer}
114
113
  */
115
- export declare function getByteArray(integer: bigInt.BigInteger | number, signed?: boolean): Buffer;
114
+ export declare function getByteArray(integer: bigInt.BigInteger | number, signed?: boolean): Buffer<ArrayBufferLike>;
116
115
  export declare function returnBigInt(num: bigInt.BigInteger | string | number | bigint): bigInt.BigInteger;
117
116
  /**
118
117
  * Helper function to return the smaller big int in an array
@@ -137,7 +136,7 @@ export declare const sleep: (ms: number, isUnref?: boolean) => Promise<unknown>;
137
136
  * Helper to export two buffers of same length
138
137
  * @returns {Buffer}
139
138
  */
140
- export declare function bufferXor(a: Buffer, b: Buffer): Buffer;
139
+ export declare function bufferXor(a: Buffer, b: Buffer): Buffer<ArrayBuffer>;
141
140
  export declare function crc32(buf: Buffer | string): number;
142
141
  export declare class TotalList<T> extends Array<T> {
143
142
  total?: number;
package/Helpers.js CHANGED
@@ -3,7 +3,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports._entityType = exports._EntityType = exports.TotalList = exports.crc32 = exports.bufferXor = exports.sleep = exports.getRandomInt = exports.getMinBigInt = exports.returnBigInt = exports.getByteArray = exports.modExp = exports.sha256 = exports.sha1 = exports.convertToLittle = exports.generateKeyDataFromNonce = exports.stripText = exports.generateRandomBytes = exports.bigIntMod = exports.mod = exports.generateRandomLong = exports.readBufferFromBigInt = exports.toSignedLittleBuffer = exports.isArrayLike = exports.betterConsoleLog = exports.groupBy = exports.escapeRegex = exports.generateRandomBigInt = exports.readBigIntFromBuffer = void 0;
6
+ exports._EntityType = exports.TotalList = exports.sleep = exports.isArrayLike = void 0;
7
+ exports.readBigIntFromBuffer = readBigIntFromBuffer;
8
+ exports.generateRandomBigInt = generateRandomBigInt;
9
+ exports.escapeRegex = escapeRegex;
10
+ exports.groupBy = groupBy;
11
+ exports.betterConsoleLog = betterConsoleLog;
12
+ exports.toSignedLittleBuffer = toSignedLittleBuffer;
13
+ exports.readBufferFromBigInt = readBufferFromBigInt;
14
+ exports.generateRandomLong = generateRandomLong;
15
+ exports.mod = mod;
16
+ exports.bigIntMod = bigIntMod;
17
+ exports.generateRandomBytes = generateRandomBytes;
18
+ exports.stripText = stripText;
19
+ exports.generateKeyDataFromNonce = generateKeyDataFromNonce;
20
+ exports.convertToLittle = convertToLittle;
21
+ exports.sha1 = sha1;
22
+ exports.sha256 = sha256;
23
+ exports.modExp = modExp;
24
+ exports.getByteArray = getByteArray;
25
+ exports.returnBigInt = returnBigInt;
26
+ exports.getMinBigInt = getMinBigInt;
27
+ exports.getRandomInt = getRandomInt;
28
+ exports.bufferXor = bufferXor;
29
+ exports.crc32 = crc32;
30
+ exports._entityType = _entityType;
7
31
  const big_integer_1 = __importDefault(require("big-integer"));
8
32
  const CryptoFile_1 = __importDefault(require("./CryptoFile"));
9
33
  /**
@@ -25,15 +49,12 @@ function readBigIntFromBuffer(buffer, little = true, signed = false) {
25
49
  }
26
50
  return bigIntVar;
27
51
  }
28
- exports.readBigIntFromBuffer = readBigIntFromBuffer;
29
52
  function generateRandomBigInt() {
30
53
  return readBigIntFromBuffer(generateRandomBytes(8), false);
31
54
  }
32
- exports.generateRandomBigInt = generateRandomBigInt;
33
55
  function escapeRegex(string) {
34
56
  return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
35
57
  }
36
- exports.escapeRegex = escapeRegex;
37
58
  function groupBy(list, keyGetter) {
38
59
  const map = new Map();
39
60
  list.forEach((item) => {
@@ -48,7 +69,6 @@ function groupBy(list, keyGetter) {
48
69
  });
49
70
  return map;
50
71
  }
51
- exports.groupBy = groupBy;
52
72
  /**
53
73
  * Outputs the object in a better way by hiding all the private methods/attributes.
54
74
  * @param object - the class to use
@@ -64,7 +84,6 @@ function betterConsoleLog(object) {
64
84
  }
65
85
  return toPrint;
66
86
  }
67
- exports.betterConsoleLog = betterConsoleLog;
68
87
  /**
69
88
  * Helper to find if a given object is an array (or similar)
70
89
  */
@@ -105,7 +124,6 @@ function toSignedLittleBuffer(big, number = 8) {
105
124
  // smh hacks
106
125
  return Buffer.from(byteArray);
107
126
  }
108
- exports.toSignedLittleBuffer = toSignedLittleBuffer;
109
127
  /**
110
128
  * converts a big int to a buffer
111
129
  * @param bigIntVar {BigInteger}
@@ -136,7 +154,6 @@ function readBufferFromBigInt(bigIntVar, bytesNumber, little = true, signed = fa
136
154
  }
137
155
  return buffer;
138
156
  }
139
- exports.readBufferFromBigInt = readBufferFromBigInt;
140
157
  /**
141
158
  * Generates a random long integer (8 bytes), which is optionally signed
142
159
  * @returns {BigInteger}
@@ -144,7 +161,6 @@ exports.readBufferFromBigInt = readBufferFromBigInt;
144
161
  function generateRandomLong(signed = true) {
145
162
  return readBigIntFromBuffer(generateRandomBytes(8), true, signed);
146
163
  }
147
- exports.generateRandomLong = generateRandomLong;
148
164
  /**
149
165
  * .... really javascript
150
166
  * @param n {number}
@@ -154,7 +170,6 @@ exports.generateRandomLong = generateRandomLong;
154
170
  function mod(n, m) {
155
171
  return ((n % m) + m) % m;
156
172
  }
157
- exports.mod = mod;
158
173
  /**
159
174
  * returns a positive bigInt
160
175
  * @param n {bigInt.BigInteger}
@@ -164,7 +179,6 @@ exports.mod = mod;
164
179
  function bigIntMod(n, m) {
165
180
  return n.remainder(m).add(m).remainder(m);
166
181
  }
167
- exports.bigIntMod = bigIntMod;
168
182
  /**
169
183
  * Generates a random bytes array
170
184
  * @param count
@@ -173,7 +187,6 @@ exports.bigIntMod = bigIntMod;
173
187
  function generateRandomBytes(count) {
174
188
  return Buffer.from(CryptoFile_1.default.randomBytes(count));
175
189
  }
176
- exports.generateRandomBytes = generateRandomBytes;
177
190
  /**
178
191
  * Calculate the key based on Telegram guidelines, specifying whether it's the client or not
179
192
  * @param sharedKey
@@ -240,7 +253,6 @@ function stripText(text, entities) {
240
253
  }
241
254
  return text;
242
255
  }
243
- exports.stripText = stripText;
244
256
  /**
245
257
  * Generates the key data corresponding to the given nonces
246
258
  * @param serverNonceBigInt
@@ -266,7 +278,6 @@ async function generateKeyDataFromNonce(serverNonceBigInt, newNonceBigInt) {
266
278
  iv: ivBuffer,
267
279
  };
268
280
  }
269
- exports.generateKeyDataFromNonce = generateKeyDataFromNonce;
270
281
  function convertToLittle(buf) {
271
282
  const correct = Buffer.alloc(buf.length * 4);
272
283
  for (let i = 0; i < buf.length; i++) {
@@ -274,7 +285,6 @@ function convertToLittle(buf) {
274
285
  }
275
286
  return correct;
276
287
  }
277
- exports.convertToLittle = convertToLittle;
278
288
  /**
279
289
  * Calculates the SHA1 digest for the given data
280
290
  * @param data
@@ -286,7 +296,6 @@ function sha1(data) {
286
296
  // @ts-ignore
287
297
  return shaSum.digest();
288
298
  }
289
- exports.sha1 = sha1;
290
299
  /**
291
300
  * Calculates the SHA256 digest for the given data
292
301
  * @param data
@@ -298,7 +307,6 @@ function sha256(data) {
298
307
  // @ts-ignore
299
308
  return shaSum.digest();
300
309
  }
301
- exports.sha256 = sha256;
302
310
  /**
303
311
  * Fast mod pow for RSA calculation. a^b % n
304
312
  * @param a
@@ -322,7 +330,6 @@ function modExp(a, b, n) {
322
330
  }
323
331
  return result;
324
332
  }
325
- exports.modExp = modExp;
326
333
  /**
327
334
  * Gets the arbitrary-length byte array corresponding to the given integer
328
335
  * @param integer {number,BigInteger}
@@ -334,7 +341,6 @@ function getByteArray(integer, signed = false) {
334
341
  const byteLength = Math.floor((bits + 8 - 1) / 8);
335
342
  return readBufferFromBigInt(typeof integer == "number" ? (0, big_integer_1.default)(integer) : integer, byteLength, false, signed);
336
343
  }
337
- exports.getByteArray = getByteArray;
338
344
  function returnBigInt(num) {
339
345
  if (big_integer_1.default.isInstance(num)) {
340
346
  return num;
@@ -347,7 +353,6 @@ function returnBigInt(num) {
347
353
  }
348
354
  return (0, big_integer_1.default)(num);
349
355
  }
350
- exports.returnBigInt = returnBigInt;
351
356
  /**
352
357
  * Helper function to return the smaller big int in an array
353
358
  * @param arrayOfBigInts
@@ -367,7 +372,6 @@ function getMinBigInt(arrayOfBigInts) {
367
372
  }
368
373
  return smallest;
369
374
  }
370
- exports.getMinBigInt = getMinBigInt;
371
375
  /**
372
376
  * returns a random int from min (inclusive) and max (inclusive)
373
377
  * @param min
@@ -379,7 +383,6 @@ function getRandomInt(min, max) {
379
383
  max = Math.floor(max);
380
384
  return Math.floor(Math.random() * (max - min + 1)) + min;
381
385
  }
382
- exports.getRandomInt = getRandomInt;
383
386
  /**
384
387
  * Sleeps a specified amount of time
385
388
  * @param ms time in milliseconds
@@ -399,7 +402,6 @@ function bufferXor(a, b) {
399
402
  }
400
403
  return Buffer.from(res);
401
404
  }
402
- exports.bufferXor = bufferXor;
403
405
  // Taken from https://stackoverflow.com/questions/18638900/javascript-crc32/18639999#18639999
404
406
  function makeCRCTable() {
405
407
  let c;
@@ -428,7 +430,6 @@ function crc32(buf) {
428
430
  }
429
431
  return (crc ^ -1) >>> 0;
430
432
  }
431
- exports.crc32 = crc32;
432
433
  class TotalList extends Array {
433
434
  constructor() {
434
435
  super();
@@ -447,13 +448,13 @@ function _entityType(entity) {
447
448
  throw new Error(`${entity} is not a TLObject, cannot determine entity type`);
448
449
  }
449
450
  if (![
450
- 0x2d45687,
451
- 0xc91c90b6,
452
- 0xe669bf46,
453
- 0x40f202fd,
454
- 0x2da17977,
455
- 0xc5af5d94,
456
- 0x1f4661b9,
451
+ 0x2d45687, // crc32('Peer')
452
+ 0xc91c90b6, // crc32('InputPeer')
453
+ 0xe669bf46, // crc32('InputUser')
454
+ 0x40f202fd, // crc32('InputChannel')
455
+ 0x2da17977, // crc32('User')
456
+ 0xc5af5d94, // crc32('Chat')
457
+ 0x1f4661b9, // crc32('UserFull')
457
458
  0xd49a2697, // crc32('ChatFull')
458
459
  ].includes(entity.SUBCLASS_OF_ID)) {
459
460
  throw new Error(`${entity} does not have any entity type`);
@@ -474,4 +475,3 @@ function _entityType(entity) {
474
475
  // 'Empty' in name or not found, we don't care, not a valid entity.
475
476
  throw new Error(`${entity} does not have any entity type`);
476
477
  }
477
- exports._entityType = _entityType;
package/Password.d.ts CHANGED
@@ -1,11 +1,10 @@
1
- /// <reference types="node" />
2
1
  import { Api } from "./tl";
3
2
  /**
4
3
  *
5
4
  * @param algo {constructors.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow}
6
5
  * @param password
7
6
  */
8
- declare function computeDigest(algo: Api.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow, password: string): Promise<Buffer>;
7
+ declare function computeDigest(algo: Api.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow, password: string): Promise<Buffer<ArrayBufferLike>>;
9
8
  /**
10
9
  *
11
10
  * @param request {constructors.account.Password}
package/Password.js CHANGED
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.computeDigest = exports.computeCheck = void 0;
6
+ exports.computeCheck = computeCheck;
7
+ exports.computeDigest = computeDigest;
7
8
  const tl_1 = require("./tl");
8
9
  const Helpers_1 = require("./Helpers");
9
10
  const big_integer_1 = __importDefault(require("big-integer"));
@@ -182,7 +183,6 @@ async function computeDigest(algo, password) {
182
183
  const value = (0, Helpers_1.modExp)((0, big_integer_1.default)(algo.g), (0, Helpers_1.readBigIntFromBuffer)(await computeHash(algo, password), false), (0, Helpers_1.readBigIntFromBuffer)(algo.p, false));
183
184
  return bigNumForHash(value);
184
185
  }
185
- exports.computeDigest = computeDigest;
186
186
  /**
187
187
  *
188
188
  * @param request {constructors.account.Password}
@@ -268,4 +268,3 @@ async function computeCheck(request, password) {
268
268
  M1: M1,
269
269
  });
270
270
  }
271
- exports.computeCheck = computeCheck;
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # teleproto
2
2
 
3
- A modern Telegram client library written in TypeScript for Node.js and browsers, forked from [GramJS](https://github.com/gram-js/gramjs) with performance and size improvements.
3
+ A modern Telegram client library written in TypeScript for Node.js, forked from [GramJS](https://github.com/gram-js/gramjs) with performance and size improvements.
4
4
 
5
5
  ## Quick Start
6
6
 
@@ -72,14 +72,6 @@ const storeSession = new StoreSession("session_folder");
72
72
  const client = new TelegramClient(storeSession, apiId, apiHash, {});
73
73
  ```
74
74
 
75
- ## Browser Support
76
-
77
- teleproto works in browsers with frontend frameworks like React and Vue. To generate a browser bundle:
78
-
79
- ```bash
80
- node generate_webpack.js
81
- ```
82
-
83
75
  ## API Usage
84
76
 
85
77
  ### Calling Raw API Methods
@@ -100,12 +92,4 @@ client.addEventHandler(async (event) => {
100
92
  await event.message.reply("Hi there!");
101
93
  }
102
94
  }, new NewMessage({}));
103
- ```
104
-
105
- ## Documentation
106
-
107
- For detailed documentation, visit our [documentation site](https://teleproto.dev).
108
-
109
- ## Need Help?
110
-
111
- If you have questions about teleproto, feel free to open an issue or join our community.
95
+ ```
package/Utils.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import bigInt from "big-integer";
3
2
  import type { ParseInterface } from "./client/messageParse";
4
3
  import { CustomFile } from "./client/uploads";
@@ -81,7 +80,7 @@ export declare function getInputChatPhoto(photo: any): Api.TypeInputChatPhoto;
81
80
  * @param stripped{Buffer}
82
81
  * @returns {Buffer}
83
82
  */
84
- export declare function strippedPhotoToJpg(stripped: Buffer): Buffer;
83
+ export declare function strippedPhotoToJpg(stripped: Buffer): Buffer<ArrayBufferLike>;
85
84
  /**
86
85
  * Similar to :meth:`get_input_peer`, but for photos
87
86
  */