@mtkruto/node 0.1.155 → 0.1.157
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/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/4_errors.d.ts +1 -1
- package/esm/client/0_params.d.ts +20 -0
- package/esm/client/0_password.d.ts +2 -2
- package/esm/client/0_types.d.ts +1 -0
- package/esm/client/1_composer.d.ts +3 -3
- package/esm/client/2_client_plain.d.ts +1 -4
- package/esm/client/2_client_plain.js +1 -4
- package/esm/client/2_message_manager.d.ts +9 -36
- package/esm/client/2_message_manager.js +73 -1
- package/esm/client/4_client.d.ts +90 -15
- package/esm/client/4_client.js +123 -12
- package/esm/storage/0_storage.d.ts +38 -38
- package/esm/storage/0_storage.js +2 -2
- package/esm/storage/0_utilities.d.ts +2 -2
- package/esm/storage/1_storage_indexed_db.d.ts +1 -1
- package/esm/storage/1_storage_local_storage.d.ts +1 -1
- package/esm/storage/1_storage_memory.d.ts +3 -3
- package/esm/storage/1_storage_session_storage.d.ts +1 -1
- package/esm/tl/0_tl_raw_writer.d.ts +9 -9
- package/esm/tl/1_tl_object.d.ts +1 -1
- package/esm/tl/1_tl_object.js +3 -3
- package/esm/tl/2_types.d.ts +4745 -0
- package/esm/tl/2_types.js +4745 -0
- package/esm/tl/3_functions.d.ts +2041 -28
- package/esm/tl/3_functions.js +2599 -586
- package/esm/tl/3_utilities.d.ts +3 -3
- package/esm/tl/4_tl_writer.d.ts +1 -1
- package/esm/types/0_chat_administrator_rights.d.ts +2 -2
- package/esm/types/0_chat_member_rights.d.ts +1 -1
- package/esm/types/0_message_entity.d.ts +1 -1
- package/esm/types/0_message_search_filter.d.ts +2 -1
- package/esm/types/1_bot_command_scope.d.ts +2 -1
- package/esm/types/1_keyboard_button.d.ts +1 -1
- package/esm/types/1_story_interactive_area.d.ts +1 -1
- package/esm/types/2_inline_keyboard_button.d.ts +1 -1
- package/esm/types/2_invite_link.d.ts +6 -6
- package/esm/types/2_invite_link.js +4 -4
- package/esm/types/3_reply_markup.d.ts +2 -2
- package/esm/types/4_inline_query_result.d.ts +2 -1
- package/esm/types/4_message.d.ts +1 -60
- package/esm/types/5_callback_query.d.ts +2 -2
- package/esm/utilities/0_cache_map.d.ts +1 -1
- package/package.json +1 -1
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/4_errors.d.ts +1 -1
- package/script/client/0_params.d.ts +20 -0
- package/script/client/0_password.d.ts +2 -2
- package/script/client/0_types.d.ts +1 -0
- package/script/client/1_composer.d.ts +3 -3
- package/script/client/2_client_plain.d.ts +1 -4
- package/script/client/2_client_plain.js +1 -4
- package/script/client/2_message_manager.d.ts +9 -36
- package/script/client/2_message_manager.js +72 -0
- package/script/client/4_client.d.ts +90 -15
- package/script/client/4_client.js +123 -12
- package/script/storage/0_storage.d.ts +38 -38
- package/script/storage/0_storage.js +2 -2
- package/script/storage/0_utilities.d.ts +2 -2
- package/script/storage/1_storage_indexed_db.d.ts +1 -1
- package/script/storage/1_storage_local_storage.d.ts +1 -1
- package/script/storage/1_storage_memory.d.ts +3 -3
- package/script/storage/1_storage_session_storage.d.ts +1 -1
- package/script/tl/0_tl_raw_writer.d.ts +9 -9
- package/script/tl/1_tl_object.d.ts +1 -1
- package/script/tl/1_tl_object.js +3 -3
- package/script/tl/2_types.d.ts +4745 -0
- package/script/tl/2_types.js +4745 -0
- package/script/tl/3_functions.d.ts +2041 -28
- package/script/tl/3_functions.js +2599 -586
- package/script/tl/3_utilities.d.ts +3 -3
- package/script/tl/4_tl_writer.d.ts +1 -1
- package/script/types/0_chat_administrator_rights.d.ts +2 -2
- package/script/types/0_chat_member_rights.d.ts +1 -1
- package/script/types/0_message_entity.d.ts +1 -1
- package/script/types/0_message_search_filter.d.ts +2 -1
- package/script/types/1_bot_command_scope.d.ts +2 -1
- package/script/types/1_keyboard_button.d.ts +1 -1
- package/script/types/1_story_interactive_area.d.ts +1 -1
- package/script/types/2_inline_keyboard_button.d.ts +1 -1
- package/script/types/2_invite_link.d.ts +6 -6
- package/script/types/2_invite_link.js +4 -4
- package/script/types/3_reply_markup.d.ts +2 -2
- package/script/types/4_inline_query_result.d.ts +2 -1
- package/script/types/4_message.d.ts +1 -60
- package/script/types/5_callback_query.d.ts +2 -2
- package/script/utilities/0_cache_map.d.ts +1 -1
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
import { MaybePromise } from "../1_utilities.js";
|
|
2
|
-
import { AnyEntity, enums, TLObject, types } from "../2_tl.js";
|
|
2
|
+
import { AnyEntity, enums, ReadObject, TLObject, types } from "../2_tl.js";
|
|
3
3
|
import { DC } from "../3_transport.js";
|
|
4
4
|
export declare const K: {
|
|
5
5
|
session: {
|
|
6
6
|
P: (string: string) => string;
|
|
7
|
-
serverSalt: () =>
|
|
7
|
+
serverSalt: () => StorageKeyPart[];
|
|
8
8
|
};
|
|
9
9
|
auth: {
|
|
10
10
|
P: (string: string) => string;
|
|
11
|
-
dc: () =>
|
|
12
|
-
key: () =>
|
|
13
|
-
accountType: () =>
|
|
11
|
+
dc: () => StorageKeyPart[];
|
|
12
|
+
key: () => StorageKeyPart[];
|
|
13
|
+
accountType: () => StorageKeyPart[];
|
|
14
14
|
};
|
|
15
15
|
updates: {
|
|
16
16
|
P: (string: string) => string;
|
|
17
|
-
state: () =>
|
|
18
|
-
all: () =>
|
|
19
|
-
updates: (boxId: bigint) =>
|
|
20
|
-
update: (boxId: bigint, id: bigint) =>
|
|
21
|
-
channelPts: (channelId: bigint) =>
|
|
17
|
+
state: () => StorageKeyPart[];
|
|
18
|
+
all: () => StorageKeyPart[];
|
|
19
|
+
updates: (boxId: bigint) => StorageKeyPart[];
|
|
20
|
+
update: (boxId: bigint, id: bigint) => StorageKeyPart[];
|
|
21
|
+
channelPts: (channelId: bigint) => StorageKeyPart[];
|
|
22
22
|
};
|
|
23
23
|
cache: {
|
|
24
24
|
P: (string: string) => string;
|
|
25
|
-
usernames: () =>
|
|
26
|
-
username: (v: string) =>
|
|
27
|
-
peers: () =>
|
|
28
|
-
peer: (id: number) =>
|
|
29
|
-
stickerSetNames: () =>
|
|
30
|
-
stickerSetName: (id: bigint, accessHash: bigint) =>
|
|
31
|
-
files: () =>
|
|
32
|
-
file: (fileId: bigint) =>
|
|
33
|
-
fileParts: () =>
|
|
34
|
-
filePart: (fileId: bigint, n: number) =>
|
|
35
|
-
customEmojiDocuments: () =>
|
|
36
|
-
customEmojiDocument: (id: bigint) =>
|
|
25
|
+
usernames: () => StorageKeyPart[];
|
|
26
|
+
username: (v: string) => StorageKeyPart[];
|
|
27
|
+
peers: () => StorageKeyPart[];
|
|
28
|
+
peer: (id: number) => StorageKeyPart[];
|
|
29
|
+
stickerSetNames: () => StorageKeyPart[];
|
|
30
|
+
stickerSetName: (id: bigint, accessHash: bigint) => StorageKeyPart[];
|
|
31
|
+
files: () => StorageKeyPart[];
|
|
32
|
+
file: (fileId: bigint) => StorageKeyPart[];
|
|
33
|
+
fileParts: () => StorageKeyPart[];
|
|
34
|
+
filePart: (fileId: bigint, n: number) => StorageKeyPart[];
|
|
35
|
+
customEmojiDocuments: () => StorageKeyPart[];
|
|
36
|
+
customEmojiDocument: (id: bigint) => StorageKeyPart[];
|
|
37
37
|
};
|
|
38
38
|
messages: {
|
|
39
39
|
P: (string: string) => string;
|
|
40
|
-
messages: (chatId: number) =>
|
|
41
|
-
message: (chatId: number, messageId: number) =>
|
|
42
|
-
allMessageRefs: () =>
|
|
43
|
-
messageRef: (messageId: number) =>
|
|
40
|
+
messages: (chatId: number) => StorageKeyPart[];
|
|
41
|
+
message: (chatId: number, messageId: number) => StorageKeyPart[];
|
|
42
|
+
allMessageRefs: () => StorageKeyPart[];
|
|
43
|
+
messageRef: (messageId: number) => StorageKeyPart[];
|
|
44
44
|
};
|
|
45
45
|
chatlists: {
|
|
46
46
|
P: (string: string) => string;
|
|
47
|
-
hasAllChats: (listId: number) =>
|
|
48
|
-
chats: (listId: number) =>
|
|
49
|
-
chat: (listId: number, chatId: number) =>
|
|
50
|
-
pinnedChats: (listId: number) =>
|
|
47
|
+
hasAllChats: (listId: number) => StorageKeyPart[];
|
|
48
|
+
chats: (listId: number) => StorageKeyPart[];
|
|
49
|
+
chat: (listId: number, chatId: number) => StorageKeyPart[];
|
|
50
|
+
pinnedChats: (listId: number) => StorageKeyPart[];
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
53
|
export type StorageKeyPart = string | number | bigint;
|
|
@@ -70,7 +70,7 @@ export declare abstract class Storage {
|
|
|
70
70
|
abstract get supportsFiles(): boolean;
|
|
71
71
|
abstract branch(id: string): Storage;
|
|
72
72
|
get isMemoryStorage(): boolean;
|
|
73
|
-
setDc(dc: DC | null):
|
|
73
|
+
setDc(dc: DC | null): Promise<void>;
|
|
74
74
|
getDc(): MaybePromise<DC | null>;
|
|
75
75
|
getAuthKey(): Promise<Uint8Array | null>;
|
|
76
76
|
setAuthKey(authKey: Uint8Array | null): Promise<void>;
|
|
@@ -82,9 +82,9 @@ export declare abstract class Storage {
|
|
|
82
82
|
updateUsernames(id: number, usernames: string[]): Promise<void>;
|
|
83
83
|
getUsername(username: string): Promise<[number, Date] | null>;
|
|
84
84
|
setTlObject(key: readonly StorageKeyPart[], value: TLObject | null): Promise<void>;
|
|
85
|
-
getTlObject(keyOrBuffer: TLObject | Uint8Array | readonly StorageKeyPart[]): Promise<
|
|
85
|
+
getTlObject(keyOrBuffer: TLObject | Uint8Array | readonly StorageKeyPart[]): Promise<ReadObject | null>;
|
|
86
86
|
setState(state: enums.updates.State): Promise<void>;
|
|
87
|
-
getState(): Promise<
|
|
87
|
+
getState(): Promise<enums.updates.State | null>;
|
|
88
88
|
setMessage(chatId: number, messageId: number, message: enums.Message | null): Promise<void>;
|
|
89
89
|
deleteMessages(): Promise<void>;
|
|
90
90
|
getMessageChat(messageId: number): MaybePromise<number | null>;
|
|
@@ -93,9 +93,9 @@ export declare abstract class Storage {
|
|
|
93
93
|
setChannelPts(channelId: bigint, pts: number): Promise<void>;
|
|
94
94
|
getChannelPts(channelId: bigint): MaybePromise<number | null>;
|
|
95
95
|
setEntity(entity: AnyEntity): Promise<void>;
|
|
96
|
-
getEntity(key: number): Promise<
|
|
96
|
+
getEntity(key: number): Promise<ReadObject | null>;
|
|
97
97
|
setAccountType(type: "user" | "bot"): Promise<void>;
|
|
98
|
-
getAccountType(): Promise<"
|
|
98
|
+
getAccountType(): Promise<"user" | "bot" | null>;
|
|
99
99
|
updateStickerSetName(id: bigint, accessHash: bigint, name: string): Promise<void>;
|
|
100
100
|
getStickerSetName(id: bigint, accessHash: bigint): MaybePromise<[string, Date] | null>;
|
|
101
101
|
setServerSalt(serverSalt: bigint): Promise<void>;
|
|
@@ -114,14 +114,14 @@ export declare abstract class Storage {
|
|
|
114
114
|
getPinnedChats(listId: number): Promise<number[] | null>;
|
|
115
115
|
getHistory(chatId: number, offsetId: number, limit: number): Promise<enums.Message[]>;
|
|
116
116
|
getFile(id: bigint): Promise<[number, number] | null>;
|
|
117
|
-
iterFileParts(id: bigint, partCount: number, offset: number): AsyncGenerator<Uint8Array
|
|
117
|
+
iterFileParts(id: bigint, partCount: number, offset: number): AsyncGenerator<Uint8Array>;
|
|
118
118
|
saveFilePart(id: bigint, index: number, bytes: Uint8Array): Promise<void>;
|
|
119
119
|
setFilePartCount(id: bigint, partCount: number, chunkSize: number): Promise<void>;
|
|
120
120
|
setCustomEmojiDocument(id: bigint, document: types.Document): Promise<void>;
|
|
121
|
-
getCustomEmojiDocument(id: bigint): Promise<[
|
|
121
|
+
getCustomEmojiDocument(id: bigint): Promise<[types.Document, Date] | null>;
|
|
122
122
|
setUpdate(boxId: bigint, update: enums.Update): Promise<void>;
|
|
123
123
|
deleteUpdates(): Promise<void>;
|
|
124
|
-
getFirstUpdate(boxId: bigint): Promise<
|
|
124
|
+
getFirstUpdate(boxId: bigint): Promise<[readonly StorageKeyPart[], enums.Update] | null>;
|
|
125
125
|
assertUser(source: string): Promise<void>;
|
|
126
126
|
assertBot(source: string): Promise<void>;
|
|
127
127
|
deleteFiles(): Promise<void>;
|
|
@@ -11,7 +11,7 @@ export declare enum ValueType {
|
|
|
11
11
|
export declare const WEB_STORAGE_PREFIX_EXP: RegExp;
|
|
12
12
|
export declare function toString(value: unknown): string;
|
|
13
13
|
export declare function fromString<T>(string: string): T;
|
|
14
|
-
export declare function fixKey(key: readonly StorageKeyPart[]):
|
|
15
|
-
export declare function restoreKey(key: readonly StorageKeyPart[]):
|
|
14
|
+
export declare function fixKey(key: readonly StorageKeyPart[]): IDBValidKey[];
|
|
15
|
+
export declare function restoreKey(key: readonly StorageKeyPart[]): StorageKeyPart[];
|
|
16
16
|
export declare function getPrefixKeyRange(prefix: any): IDBKeyRange;
|
|
17
17
|
export declare function isInRange(key: StorageKeyPart[], start: readonly StorageKeyPart[], end: readonly StorageKeyPart[]): boolean;
|
|
@@ -16,6 +16,6 @@ export declare class StorageIndexedDB extends Storage {
|
|
|
16
16
|
getMany<T>(filter: GetManyFilter, params?: {
|
|
17
17
|
limit?: number;
|
|
18
18
|
reverse?: boolean;
|
|
19
|
-
}, tx_?: IDBTransaction): AsyncGenerator<[readonly StorageKeyPart[], T]
|
|
19
|
+
}, tx_?: IDBTransaction): AsyncGenerator<[readonly StorageKeyPart[], T]>;
|
|
20
20
|
incr(key: readonly StorageKeyPart[], by: number): Promise<void>;
|
|
21
21
|
}
|
|
@@ -10,7 +10,7 @@ export declare class StorageLocalStorage extends Storage implements Storage {
|
|
|
10
10
|
getMany<T>(filter: GetManyFilter, params?: {
|
|
11
11
|
limit?: number;
|
|
12
12
|
reverse?: boolean;
|
|
13
|
-
}): Generator<[readonly StorageKeyPart[], T]
|
|
13
|
+
}): Generator<[readonly StorageKeyPart[], T]>;
|
|
14
14
|
set(key_: readonly StorageKeyPart[], value: unknown): void;
|
|
15
15
|
incr(key: readonly StorageKeyPart[], by: number): void;
|
|
16
16
|
}
|
|
@@ -8,14 +8,14 @@ export declare class StorageMemory extends Storage implements Storage {
|
|
|
8
8
|
get isMemoryStorage(): boolean;
|
|
9
9
|
initialize(): Promise<void>;
|
|
10
10
|
getMap(key: readonly StorageKeyPart[]): Map<string, unknown>;
|
|
11
|
-
getMaps(): Map<string, unknown>
|
|
11
|
+
getMaps(): [Map<string, unknown>, Map<string, unknown>];
|
|
12
12
|
branch(id: string): Storage;
|
|
13
13
|
get supportsFiles(): boolean;
|
|
14
|
-
get<T>(key: readonly StorageKeyPart[]):
|
|
14
|
+
get<T>(key: readonly StorageKeyPart[]): T | null;
|
|
15
15
|
getMany<T>(filter: GetManyFilter, params?: {
|
|
16
16
|
limit?: number;
|
|
17
17
|
reverse?: boolean;
|
|
18
|
-
}): Generator<[readonly StorageKeyPart[], T]
|
|
18
|
+
}): Generator<[readonly StorageKeyPart[], T]>;
|
|
19
19
|
set(key_: readonly StorageKeyPart[], value: unknown): MaybePromise<void>;
|
|
20
20
|
incr(key: readonly StorageKeyPart[], by: number): void;
|
|
21
21
|
}
|
|
@@ -11,7 +11,7 @@ export declare class StorageSessionStorage extends Storage implements Storage {
|
|
|
11
11
|
getMany<T>(filter: GetManyFilter, params?: {
|
|
12
12
|
limit?: number;
|
|
13
13
|
reverse?: boolean;
|
|
14
|
-
}): Generator<[readonly StorageKeyPart[], T]
|
|
14
|
+
}): Generator<[readonly StorageKeyPart[], T]>;
|
|
15
15
|
set(key_: readonly StorageKeyPart[], value: unknown): MaybePromise<void>;
|
|
16
16
|
incr(key: readonly StorageKeyPart[], by: number): void;
|
|
17
17
|
}
|
|
@@ -2,13 +2,13 @@ export declare class TLRawWriter {
|
|
|
2
2
|
protected _buffer: Uint8Array;
|
|
3
3
|
constructor();
|
|
4
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
|
-
writeDouble(double: number): this;
|
|
10
|
-
writeInt128(int: bigint, signed?: boolean): this;
|
|
11
|
-
writeInt256(int: bigint, signed?: boolean): this;
|
|
12
|
-
writeBytes(bytes: Uint8Array): this;
|
|
13
|
-
writeString(string: string): this;
|
|
5
|
+
write(buffer: Uint8Array): typeof this;
|
|
6
|
+
writeInt24(int: number, signed?: boolean): typeof this;
|
|
7
|
+
writeInt32(int: number, signed?: boolean): typeof this;
|
|
8
|
+
writeInt64(int: bigint, signed?: boolean): typeof this;
|
|
9
|
+
writeDouble(double: number): typeof this;
|
|
10
|
+
writeInt128(int: bigint, signed?: boolean): typeof this;
|
|
11
|
+
writeInt256(int: bigint, signed?: boolean): typeof this;
|
|
12
|
+
writeBytes(bytes: Uint8Array): typeof this;
|
|
13
|
+
writeString(string: string): typeof this;
|
|
14
14
|
}
|
|
@@ -33,7 +33,7 @@ export declare abstract class TLObject {
|
|
|
33
33
|
get [length](): number;
|
|
34
34
|
[serialize](): Uint8Array;
|
|
35
35
|
[as]<T extends TLObjectConstructor<InstanceType<T>>>(constructor: T): InstanceType<T>;
|
|
36
|
-
toJSON():
|
|
36
|
+
toJSON(): object;
|
|
37
37
|
}
|
|
38
38
|
export interface TLObjectConstructor<T = TLObject> {
|
|
39
39
|
new (params: any): T;
|
package/script/tl/1_tl_object.js
CHANGED
|
@@ -8,9 +8,9 @@ exports.id = Symbol("id");
|
|
|
8
8
|
exports.params = Symbol("params");
|
|
9
9
|
exports.paramDesc = Symbol("paramDesc");
|
|
10
10
|
exports.length = Symbol("length");
|
|
11
|
-
exports.serialize = Symbol();
|
|
12
|
-
exports.as = Symbol();
|
|
13
|
-
exports.name = Symbol();
|
|
11
|
+
exports.serialize = Symbol("serialize");
|
|
12
|
+
exports.as = Symbol("as");
|
|
13
|
+
exports.name = Symbol("name");
|
|
14
14
|
function isOptionalParam(ntype) {
|
|
15
15
|
return ntype.includes("?");
|
|
16
16
|
}
|