@mtkruto/node 0.0.79 → 0.0.820
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.
- package/esm/client/client.js +13 -7
- package/esm/client/client_plain.js +4 -3
- package/esm/connection/connection_web_socket.js +3 -1
- package/esm/mod.js +1 -0
- package/esm/session/session.js +21 -1
- package/esm/tl/1_tl_object.js +14 -7
- package/esm/tl/3_tl_reader.js +1 -1
- package/esm/tl/3_tl_writer.js +2 -1
- package/esm/tl/5_message.js +2 -2
- package/esm/utilities/0_buffer.js +6 -1
- package/esm/utilities/1_message.js +5 -11
- package/package.json +1 -1
- package/script/client/client.js +13 -7
- package/script/client/client_plain.js +4 -3
- package/script/connection/connection_web_socket.js +3 -1
- package/script/mod.js +3 -1
- package/script/session/session.js +21 -1
- package/script/tl/1_tl_object.js +15 -8
- package/script/tl/3_tl_reader.js +2 -2
- package/script/tl/3_tl_writer.js +2 -1
- package/script/tl/5_message.js +1 -1
- package/script/utilities/0_buffer.js +6 -1
- package/script/utilities/1_message.js +3 -9
- package/types/client/client.d.ts +2 -2
- package/types/mod.d.ts +1 -0
- package/types/session/session.d.ts +5 -1
- package/types/tl/1_tl_object.d.ts +5 -2
- package/types/tl/3_functions.d.ts +216 -216
- package/types/utilities/1_message.d.ts +2 -2
- /package/esm/tl/{3_tl_object_deserializer.js → 3_deserialize.js} +0 -0
- /package/script/tl/{3_tl_object_deserializer.js → 3_deserialize.js} +0 -0
- /package/types/tl/{3_tl_object_deserializer.d.ts → 3_deserialize.d.ts} +0 -0
package/types/client/client.d.ts
CHANGED
|
@@ -38,10 +38,10 @@ export declare class Client extends ClientAbstract {
|
|
|
38
38
|
systemLangCode?: string;
|
|
39
39
|
systemVersion?: string;
|
|
40
40
|
});
|
|
41
|
+
private shouldLoadSession;
|
|
41
42
|
setDc(dc: DC): void;
|
|
42
|
-
private sessionLoaded;
|
|
43
43
|
connect(): Promise<void>;
|
|
44
|
-
authorize(params: string | AuthorizeUserParams): Promise<void>;
|
|
44
|
+
authorize(params: string | types.AuthExportedAuthorization | AuthorizeUserParams): Promise<void>;
|
|
45
45
|
private receiveLoop;
|
|
46
46
|
private pingLoop;
|
|
47
47
|
invoke<T extends (functions.Function<unknown> | types.Type) = functions.Function<unknown>>(function_: T): Promise<T extends functions.Function<unknown> ? T["__R"] : void>;
|
package/types/mod.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const utils: {
|
|
|
4
4
|
checkPassword: typeof checkPassword;
|
|
5
5
|
getRandomId: typeof getRandomId;
|
|
6
6
|
};
|
|
7
|
+
export { as } from "./tl/1_tl_object.js";
|
|
7
8
|
export * as types from "./tl/2_types.js";
|
|
8
9
|
export * as functions from "./tl/3_functions.js";
|
|
9
10
|
export * from "./tl/4_rpc_result.js";
|
|
@@ -2,7 +2,11 @@ import { MaybePromise } from "../types.js";
|
|
|
2
2
|
import { DC } from "../transport/transport_provider.js";
|
|
3
3
|
export declare abstract class Session {
|
|
4
4
|
dc: DC | null;
|
|
5
|
-
|
|
5
|
+
private _authKeyId;
|
|
6
|
+
private _authKey;
|
|
6
7
|
abstract load(): MaybePromise<void>;
|
|
7
8
|
abstract save(): MaybePromise<void>;
|
|
9
|
+
get authKeyId(): Promise<bigint | null>;
|
|
10
|
+
set authKey(authKey: Uint8Array | null);
|
|
11
|
+
get authKey(): Uint8Array | null;
|
|
8
12
|
}
|
|
@@ -16,6 +16,8 @@ export declare const id: unique symbol;
|
|
|
16
16
|
export declare const params: unique symbol;
|
|
17
17
|
export declare const paramDesc: unique symbol;
|
|
18
18
|
export declare const length: unique symbol;
|
|
19
|
+
export declare const serialize: unique symbol;
|
|
20
|
+
export declare const as: unique symbol;
|
|
19
21
|
export declare function isOptionalParam(ntype: string): boolean;
|
|
20
22
|
export declare function analyzeOptionalParam(ntype: string): {
|
|
21
23
|
flagField: string;
|
|
@@ -26,11 +28,12 @@ export declare abstract class TLObject {
|
|
|
26
28
|
protected abstract get [params](): Params;
|
|
27
29
|
protected static get [paramDesc](): ParamDesc;
|
|
28
30
|
get [length](): number;
|
|
29
|
-
serialize(): Uint8Array;
|
|
31
|
+
[serialize](): Uint8Array;
|
|
32
|
+
[as]<T extends TLObjectConstructor<InstanceType<T>>>(constructor: T): InstanceType<T>;
|
|
30
33
|
}
|
|
31
34
|
export type MaybeVectorTLObject = TLObject | Array<MaybeVectorTLObject | TLObject>;
|
|
32
35
|
export interface TLObjectConstructor<T = TLObject> {
|
|
33
|
-
new (params:
|
|
36
|
+
new (params: any): T;
|
|
34
37
|
[paramDesc]: ParamDesc;
|
|
35
38
|
}
|
|
36
39
|
export declare function isTLObjectConstructor(t: unknown): t is typeof TLObject;
|