@mtkruto/node 0.0.820 → 0.0.822

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 (148) hide show
  1. package/esm/_dnt.test_shims.d.ts +10 -0
  2. package/esm/client/client.d.ts +114 -0
  3. package/esm/client/client.js +126 -1
  4. package/esm/tl/0_tl_raw_reader_test.d.ts +1 -0
  5. package/esm/tl/0_tl_raw_writer_test.d.ts +1 -0
  6. package/esm/tl/1_tl_object_test.d.ts +1 -0
  7. package/{types → esm}/tl/2_types.d.ts +48 -48
  8. package/esm/tl/2_types.js +180 -180
  9. package/esm/tl/2_types_test.d.ts +1 -0
  10. package/esm/tl/3_deserialize_test.d.ts +1 -0
  11. package/{types → esm}/tl/3_functions.d.ts +13 -13
  12. package/esm/tl/3_functions.js +39 -39
  13. package/esm/tl/3_functions_test.d.ts +1 -0
  14. package/esm/utilities/0_bigint_test.d.ts +1 -0
  15. package/esm/utilities/0_buffer_test.d.ts +1 -0
  16. package/{types → esm}/utilities/1_password.d.ts +1 -1
  17. package/esm/utilities/1_password.js +2 -1
  18. package/esm/utilities/1_password_test.d.ts +1 -0
  19. package/package.json +5 -12
  20. package/script/_dnt.shims.d.ts +10 -0
  21. package/script/_dnt.test_shims.d.ts +10 -0
  22. package/script/client/client.d.ts +114 -0
  23. package/script/client/client.js +127 -2
  24. package/script/client/client_abstract.d.ts +16 -0
  25. package/script/client/client_plain.d.ts +9 -0
  26. package/script/connection/connection.d.ts +7 -0
  27. package/script/connection/connection_web_socket.d.ts +13 -0
  28. package/script/constants.d.ts +12 -0
  29. package/script/deps/deno.land/std@0.186.0/fmt/colors.d.ts +270 -0
  30. package/script/deps/deno.land/std@0.186.0/testing/_diff.d.ts +26 -0
  31. package/script/deps/deno.land/std@0.186.0/testing/_format.d.ts +1 -0
  32. package/script/deps/deno.land/std@0.186.0/testing/asserts.d.ts +284 -0
  33. package/script/deps/deno.land/x/crc32@v0.2.0/mod.d.ts +15 -0
  34. package/script/deps/deno.land/x/tgcrypto@0.1.3/mod.d.ts +47 -0
  35. package/script/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.d.ts +2 -0
  36. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/gzip/gzip.d.ts +16 -0
  37. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/utils/uint8.d.ts +1 -0
  38. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/deflate.d.ts +29 -0
  39. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/inflate.d.ts +23 -0
  40. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/mod.d.ts +2 -0
  41. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/adler32.d.ts +1 -0
  42. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/crc32.d.ts +2 -0
  43. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/deflate.d.ts +78 -0
  44. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/gzheader.d.ts +12 -0
  45. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inffast.d.ts +1 -0
  46. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inflate.d.ts +47 -0
  47. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inftrees.d.ts +1 -0
  48. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/messages.d.ts +12 -0
  49. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/status.d.ts +30 -0
  50. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/trees.d.ts +5 -0
  51. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/zstream.d.ts +14 -0
  52. package/script/deps.d.ts +4 -0
  53. package/script/mod.d.ts +24 -0
  54. package/script/session/session.d.ts +12 -0
  55. package/script/session/session_local_storage.d.ts +7 -0
  56. package/script/session/session_memory.d.ts +5 -0
  57. package/script/tl/0_tl_raw_reader.d.ts +13 -0
  58. package/script/tl/0_tl_raw_reader_test.d.ts +1 -0
  59. package/script/tl/0_tl_raw_writer.d.ts +13 -0
  60. package/script/tl/0_tl_raw_writer_test.d.ts +1 -0
  61. package/script/tl/1_tl_object.d.ts +40 -0
  62. package/script/tl/1_tl_object_test.d.ts +1 -0
  63. package/script/tl/2_types.d.ts +14815 -0
  64. package/script/tl/2_types.js +180 -180
  65. package/script/tl/2_types_test.d.ts +1 -0
  66. package/script/tl/3_deserialize.d.ts +3 -0
  67. package/script/tl/3_deserialize_test.d.ts +1 -0
  68. package/script/tl/3_functions.d.ts +6122 -0
  69. package/script/tl/3_functions.js +39 -39
  70. package/script/tl/3_functions_test.d.ts +1 -0
  71. package/script/tl/3_tl_reader.d.ts +6 -0
  72. package/script/tl/3_tl_writer.d.ts +5 -0
  73. package/script/tl/4_rpc_result.d.ts +8 -0
  74. package/script/tl/5_message.d.ts +11 -0
  75. package/script/tl/6_message_container.d.ts +9 -0
  76. package/script/transport/transport.d.ts +15 -0
  77. package/script/transport/transport_abridged.d.ts +11 -0
  78. package/script/transport/transport_intermediate.d.ts +11 -0
  79. package/script/transport/transport_provider.d.ts +17 -0
  80. package/script/types.d.ts +1 -0
  81. package/script/utilities/0_bigint.d.ts +5 -0
  82. package/script/utilities/0_bigint_test.d.ts +1 -0
  83. package/script/utilities/0_buffer.d.ts +2 -0
  84. package/script/utilities/0_buffer_test.d.ts +1 -0
  85. package/script/utilities/0_crypto.d.ts +8 -0
  86. package/script/utilities/0_hash.d.ts +2 -0
  87. package/script/utilities/1_auth.d.ts +1 -0
  88. package/script/utilities/1_message.d.ts +10 -0
  89. package/script/utilities/1_obfuscation.d.ts +6 -0
  90. package/script/utilities/1_password.d.ts +11 -0
  91. package/script/utilities/1_password.js +2 -1
  92. package/script/utilities/1_password_test.d.ts +1 -0
  93. package/types/client/client.d.ts +0 -50
  94. /package/{types → esm}/_dnt.shims.d.ts +0 -0
  95. /package/{types → esm}/client/client_abstract.d.ts +0 -0
  96. /package/{types → esm}/client/client_plain.d.ts +0 -0
  97. /package/{types → esm}/connection/connection.d.ts +0 -0
  98. /package/{types → esm}/connection/connection_web_socket.d.ts +0 -0
  99. /package/{types → esm}/constants.d.ts +0 -0
  100. /package/{types → esm}/deps/deno.land/std@0.186.0/fmt/colors.d.ts +0 -0
  101. /package/{types → esm}/deps/deno.land/std@0.186.0/testing/_diff.d.ts +0 -0
  102. /package/{types → esm}/deps/deno.land/std@0.186.0/testing/_format.d.ts +0 -0
  103. /package/{types → esm}/deps/deno.land/std@0.186.0/testing/asserts.d.ts +0 -0
  104. /package/{types → esm}/deps/deno.land/x/crc32@v0.2.0/mod.d.ts +0 -0
  105. /package/{types → esm}/deps/deno.land/x/tgcrypto@0.1.3/mod.d.ts +0 -0
  106. /package/{types → esm}/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.d.ts +0 -0
  107. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/gzip/gzip.d.ts +0 -0
  108. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/utils/uint8.d.ts +0 -0
  109. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/deflate.d.ts +0 -0
  110. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/inflate.d.ts +0 -0
  111. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/mod.d.ts +0 -0
  112. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/adler32.d.ts +0 -0
  113. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/crc32.d.ts +0 -0
  114. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/deflate.d.ts +0 -0
  115. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/gzheader.d.ts +0 -0
  116. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inffast.d.ts +0 -0
  117. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inflate.d.ts +0 -0
  118. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inftrees.d.ts +0 -0
  119. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/messages.d.ts +0 -0
  120. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/status.d.ts +0 -0
  121. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/trees.d.ts +0 -0
  122. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/zstream.d.ts +0 -0
  123. /package/{types → esm}/deps.d.ts +0 -0
  124. /package/{types → esm}/mod.d.ts +0 -0
  125. /package/{types → esm}/session/session.d.ts +0 -0
  126. /package/{types → esm}/session/session_local_storage.d.ts +0 -0
  127. /package/{types → esm}/session/session_memory.d.ts +0 -0
  128. /package/{types → esm}/tl/0_tl_raw_reader.d.ts +0 -0
  129. /package/{types → esm}/tl/0_tl_raw_writer.d.ts +0 -0
  130. /package/{types → esm}/tl/1_tl_object.d.ts +0 -0
  131. /package/{types → esm}/tl/3_deserialize.d.ts +0 -0
  132. /package/{types → esm}/tl/3_tl_reader.d.ts +0 -0
  133. /package/{types → esm}/tl/3_tl_writer.d.ts +0 -0
  134. /package/{types → esm}/tl/4_rpc_result.d.ts +0 -0
  135. /package/{types → esm}/tl/5_message.d.ts +0 -0
  136. /package/{types → esm}/tl/6_message_container.d.ts +0 -0
  137. /package/{types → esm}/transport/transport.d.ts +0 -0
  138. /package/{types → esm}/transport/transport_abridged.d.ts +0 -0
  139. /package/{types → esm}/transport/transport_intermediate.d.ts +0 -0
  140. /package/{types → esm}/transport/transport_provider.d.ts +0 -0
  141. /package/{types → esm}/types.d.ts +0 -0
  142. /package/{types → esm}/utilities/0_bigint.d.ts +0 -0
  143. /package/{types → esm}/utilities/0_buffer.d.ts +0 -0
  144. /package/{types → esm}/utilities/0_crypto.d.ts +0 -0
  145. /package/{types → esm}/utilities/0_hash.d.ts +0 -0
  146. /package/{types → esm}/utilities/1_auth.d.ts +0 -0
  147. /package/{types → esm}/utilities/1_message.d.ts +0 -0
  148. /package/{types → esm}/utilities/1_obfuscation.d.ts +0 -0
@@ -0,0 +1,12 @@
1
+ import { MaybePromise } from "../types.js";
2
+ import { DC } from "../transport/transport_provider.js";
3
+ export declare abstract class Session {
4
+ dc: DC | null;
5
+ private _authKeyId;
6
+ private _authKey;
7
+ abstract load(): MaybePromise<void>;
8
+ abstract save(): MaybePromise<void>;
9
+ get authKeyId(): Promise<bigint | null>;
10
+ set authKey(authKey: Uint8Array | null);
11
+ get authKey(): Uint8Array | null;
12
+ }
@@ -0,0 +1,7 @@
1
+ import { Session } from "./session.js";
2
+ export declare class SessionLocalStorage extends Session implements Session {
3
+ private readonly key;
4
+ constructor(key: string);
5
+ load(): void;
6
+ save(): void;
7
+ }
@@ -0,0 +1,5 @@
1
+ import { Session } from "./session.js";
2
+ export declare class SessionMemory extends Session implements Session {
3
+ load(): void;
4
+ save(): void;
5
+ }
@@ -0,0 +1,13 @@
1
+ export declare class TLRawReader {
2
+ protected _buffer: Uint8Array;
3
+ constructor(_buffer: Uint8Array);
4
+ get buffer(): Uint8Array;
5
+ read(count: number): Uint8Array;
6
+ readInt24(signed?: boolean): number;
7
+ readInt32(signed?: boolean): number;
8
+ readInt64(signed?: boolean): bigint;
9
+ readInt128(signed?: boolean): bigint;
10
+ readInt256(signed?: boolean): bigint;
11
+ readBytes(): Uint8Array;
12
+ readString(): string;
13
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ export declare class TLRawWriter {
2
+ protected _buffer: Uint8Array;
3
+ constructor();
4
+ get buffer(): Uint8Array;
5
+ write(buffer: Uint8Array): this;
6
+ writeInt24(int: number, signed?: boolean): this;
7
+ writeInt32(int: number, signed?: boolean): this;
8
+ writeInt64(int: bigint, signed?: boolean): this;
9
+ writeInt128(int: bigint, signed?: boolean): this;
10
+ writeInt256(int: bigint, signed?: boolean): this;
11
+ writeBytes(bytes: Uint8Array): this;
12
+ writeString(string: string): this;
13
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,40 @@
1
+ type MaybeArrayOf<T> = T | T[];
2
+ type MaybeInArray<T> = T | [T];
3
+ export type ParamDesc = ([
4
+ string,
5
+ MaybeInArray<typeof TLObject | typeof Uint8Array | "string" | "number" | "bigint" | "boolean" | "true">,
6
+ string
7
+ ] | [string, typeof flags, "#"])[];
8
+ export type Param = null | MaybeArrayOf<string | number | bigint | boolean | Uint8Array | TLObject>;
9
+ export declare const flags: unique symbol;
10
+ export type Params = ([
11
+ Param,
12
+ MaybeInArray<typeof TLObject | typeof Uint8Array | "string" | "number" | "bigint" | "boolean" | "true">,
13
+ string
14
+ ] | [string, typeof flags, "#"])[];
15
+ export declare const id: unique symbol;
16
+ export declare const params: unique symbol;
17
+ export declare const paramDesc: unique symbol;
18
+ export declare const length: unique symbol;
19
+ export declare const serialize: unique symbol;
20
+ export declare const as: unique symbol;
21
+ export declare function isOptionalParam(ntype: string): boolean;
22
+ export declare function analyzeOptionalParam(ntype: string): {
23
+ flagField: string;
24
+ bitIndex: number;
25
+ };
26
+ export declare abstract class TLObject {
27
+ protected abstract get [id](): number;
28
+ protected abstract get [params](): Params;
29
+ protected static get [paramDesc](): ParamDesc;
30
+ get [length](): number;
31
+ [serialize](): Uint8Array;
32
+ [as]<T extends TLObjectConstructor<InstanceType<T>>>(constructor: T): InstanceType<T>;
33
+ }
34
+ export type MaybeVectorTLObject = TLObject | Array<MaybeVectorTLObject | TLObject>;
35
+ export interface TLObjectConstructor<T = TLObject> {
36
+ new (params: any): T;
37
+ [paramDesc]: ParamDesc;
38
+ }
39
+ export declare function isTLObjectConstructor(t: unknown): t is typeof TLObject;
40
+ export {};
@@ -0,0 +1 @@
1
+ export {};