@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.
Files changed (89) hide show
  1. package/esm/4_constants.d.ts +1 -1
  2. package/esm/4_constants.js +1 -1
  3. package/esm/4_errors.d.ts +1 -1
  4. package/esm/client/0_params.d.ts +20 -0
  5. package/esm/client/0_password.d.ts +2 -2
  6. package/esm/client/0_types.d.ts +1 -0
  7. package/esm/client/1_composer.d.ts +3 -3
  8. package/esm/client/2_client_plain.d.ts +1 -4
  9. package/esm/client/2_client_plain.js +1 -4
  10. package/esm/client/2_message_manager.d.ts +9 -36
  11. package/esm/client/2_message_manager.js +73 -1
  12. package/esm/client/4_client.d.ts +90 -15
  13. package/esm/client/4_client.js +123 -12
  14. package/esm/storage/0_storage.d.ts +38 -38
  15. package/esm/storage/0_storage.js +2 -2
  16. package/esm/storage/0_utilities.d.ts +2 -2
  17. package/esm/storage/1_storage_indexed_db.d.ts +1 -1
  18. package/esm/storage/1_storage_local_storage.d.ts +1 -1
  19. package/esm/storage/1_storage_memory.d.ts +3 -3
  20. package/esm/storage/1_storage_session_storage.d.ts +1 -1
  21. package/esm/tl/0_tl_raw_writer.d.ts +9 -9
  22. package/esm/tl/1_tl_object.d.ts +1 -1
  23. package/esm/tl/1_tl_object.js +3 -3
  24. package/esm/tl/2_types.d.ts +4745 -0
  25. package/esm/tl/2_types.js +4745 -0
  26. package/esm/tl/3_functions.d.ts +2041 -28
  27. package/esm/tl/3_functions.js +2599 -586
  28. package/esm/tl/3_utilities.d.ts +3 -3
  29. package/esm/tl/4_tl_writer.d.ts +1 -1
  30. package/esm/types/0_chat_administrator_rights.d.ts +2 -2
  31. package/esm/types/0_chat_member_rights.d.ts +1 -1
  32. package/esm/types/0_message_entity.d.ts +1 -1
  33. package/esm/types/0_message_search_filter.d.ts +2 -1
  34. package/esm/types/1_bot_command_scope.d.ts +2 -1
  35. package/esm/types/1_keyboard_button.d.ts +1 -1
  36. package/esm/types/1_story_interactive_area.d.ts +1 -1
  37. package/esm/types/2_inline_keyboard_button.d.ts +1 -1
  38. package/esm/types/2_invite_link.d.ts +6 -6
  39. package/esm/types/2_invite_link.js +4 -4
  40. package/esm/types/3_reply_markup.d.ts +2 -2
  41. package/esm/types/4_inline_query_result.d.ts +2 -1
  42. package/esm/types/4_message.d.ts +1 -60
  43. package/esm/types/5_callback_query.d.ts +2 -2
  44. package/esm/utilities/0_cache_map.d.ts +1 -1
  45. package/package.json +1 -1
  46. package/script/4_constants.d.ts +1 -1
  47. package/script/4_constants.js +1 -1
  48. package/script/4_errors.d.ts +1 -1
  49. package/script/client/0_params.d.ts +20 -0
  50. package/script/client/0_password.d.ts +2 -2
  51. package/script/client/0_types.d.ts +1 -0
  52. package/script/client/1_composer.d.ts +3 -3
  53. package/script/client/2_client_plain.d.ts +1 -4
  54. package/script/client/2_client_plain.js +1 -4
  55. package/script/client/2_message_manager.d.ts +9 -36
  56. package/script/client/2_message_manager.js +72 -0
  57. package/script/client/4_client.d.ts +90 -15
  58. package/script/client/4_client.js +123 -12
  59. package/script/storage/0_storage.d.ts +38 -38
  60. package/script/storage/0_storage.js +2 -2
  61. package/script/storage/0_utilities.d.ts +2 -2
  62. package/script/storage/1_storage_indexed_db.d.ts +1 -1
  63. package/script/storage/1_storage_local_storage.d.ts +1 -1
  64. package/script/storage/1_storage_memory.d.ts +3 -3
  65. package/script/storage/1_storage_session_storage.d.ts +1 -1
  66. package/script/tl/0_tl_raw_writer.d.ts +9 -9
  67. package/script/tl/1_tl_object.d.ts +1 -1
  68. package/script/tl/1_tl_object.js +3 -3
  69. package/script/tl/2_types.d.ts +4745 -0
  70. package/script/tl/2_types.js +4745 -0
  71. package/script/tl/3_functions.d.ts +2041 -28
  72. package/script/tl/3_functions.js +2599 -586
  73. package/script/tl/3_utilities.d.ts +3 -3
  74. package/script/tl/4_tl_writer.d.ts +1 -1
  75. package/script/types/0_chat_administrator_rights.d.ts +2 -2
  76. package/script/types/0_chat_member_rights.d.ts +1 -1
  77. package/script/types/0_message_entity.d.ts +1 -1
  78. package/script/types/0_message_search_filter.d.ts +2 -1
  79. package/script/types/1_bot_command_scope.d.ts +2 -1
  80. package/script/types/1_keyboard_button.d.ts +1 -1
  81. package/script/types/1_story_interactive_area.d.ts +1 -1
  82. package/script/types/2_inline_keyboard_button.d.ts +1 -1
  83. package/script/types/2_invite_link.d.ts +6 -6
  84. package/script/types/2_invite_link.js +4 -4
  85. package/script/types/3_reply_markup.d.ts +2 -2
  86. package/script/types/4_inline_query_result.d.ts +2 -1
  87. package/script/types/4_message.d.ts +1 -60
  88. package/script/types/5_callback_query.d.ts +2 -2
  89. 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: () => string[];
7
+ serverSalt: () => StorageKeyPart[];
8
8
  };
9
9
  auth: {
10
10
  P: (string: string) => string;
11
- dc: () => string[];
12
- key: () => string[];
13
- accountType: () => string[];
11
+ dc: () => StorageKeyPart[];
12
+ key: () => StorageKeyPart[];
13
+ accountType: () => StorageKeyPart[];
14
14
  };
15
15
  updates: {
16
16
  P: (string: string) => string;
17
- state: () => string[];
18
- all: () => string[];
19
- updates: (boxId: bigint) => (string | bigint)[];
20
- update: (boxId: bigint, id: bigint) => (string | bigint)[];
21
- channelPts: (channelId: bigint) => (string | 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: () => string[];
26
- username: (v: string) => string[];
27
- peers: () => string[];
28
- peer: (id: number) => (string | number)[];
29
- stickerSetNames: () => string[];
30
- stickerSetName: (id: bigint, accessHash: bigint) => (string | bigint)[];
31
- files: () => string[];
32
- file: (fileId: bigint) => (string | bigint)[];
33
- fileParts: () => string[];
34
- filePart: (fileId: bigint, n: number) => (string | number | bigint)[];
35
- customEmojiDocuments: () => string[];
36
- customEmojiDocument: (id: bigint) => (string | 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) => (string | number)[];
41
- message: (chatId: number, messageId: number) => (string | number)[];
42
- allMessageRefs: () => string[];
43
- messageRef: (messageId: number) => (string | 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) => (string | number)[];
48
- chats: (listId: number) => (string | number)[];
49
- chat: (listId: number, chatId: number) => (string | number)[];
50
- pinnedChats: (listId: number) => (string | 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): MaybePromise<void>;
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<import("../2_tl.js").ReadObject | null>;
85
+ getTlObject(keyOrBuffer: TLObject | Uint8Array | readonly StorageKeyPart[]): Promise<ReadObject | null>;
86
86
  setState(state: enums.updates.State): Promise<void>;
87
- getState(): Promise<import("../tl/2_types.js").updates_State_ | null>;
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<import("../2_tl.js").ReadObject | null>;
96
+ getEntity(key: number): Promise<ReadObject | null>;
97
97
  setAccountType(type: "user" | "bot"): Promise<void>;
98
- getAccountType(): Promise<"bot" | "user" | null>;
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, void, unknown>;
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<[import("../tl/2_types.js").Document_, Date] | null>;
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<readonly [readonly StorageKeyPart[], import("../tl/2_types.js").UpdateNewMessage_ | import("../tl/2_types.js").UpdateMessageID_ | import("../tl/2_types.js").UpdateDeleteMessages_ | import("../tl/2_types.js").UpdateUserTyping_ | import("../tl/2_types.js").UpdateChatUserTyping_ | import("../tl/2_types.js").UpdateChatParticipants_ | import("../tl/2_types.js").UpdateUserStatus_ | import("../tl/2_types.js").UpdateUserName_ | import("../tl/2_types.js").UpdateNewAuthorization_ | import("../tl/2_types.js").UpdateNewEncryptedMessage_ | import("../tl/2_types.js").UpdateEncryptedChatTyping_ | import("../tl/2_types.js").UpdateEncryption_ | import("../tl/2_types.js").UpdateEncryptedMessagesRead_ | import("../tl/2_types.js").UpdateChatParticipantAdd_ | import("../tl/2_types.js").UpdateChatParticipantDelete_ | import("../tl/2_types.js").UpdateDcOptions_ | import("../tl/2_types.js").UpdateNotifySettings_ | import("../tl/2_types.js").UpdateServiceNotification_ | import("../tl/2_types.js").UpdatePrivacy_ | import("../tl/2_types.js").UpdateUserPhone_ | import("../tl/2_types.js").UpdateReadHistoryInbox_ | import("../tl/2_types.js").UpdateReadHistoryOutbox_ | import("../tl/2_types.js").UpdateWebPage_ | import("../tl/2_types.js").UpdateReadMessagesContents_ | import("../tl/2_types.js").UpdateChannelTooLong_ | import("../tl/2_types.js").UpdateChannel_ | import("../tl/2_types.js").UpdateNewChannelMessage_ | import("../tl/2_types.js").UpdateReadChannelInbox_ | import("../tl/2_types.js").UpdateDeleteChannelMessages_ | import("../tl/2_types.js").UpdateChannelMessageViews_ | import("../tl/2_types.js").UpdateChatParticipantAdmin_ | import("../tl/2_types.js").UpdateNewStickerSet_ | import("../tl/2_types.js").UpdateStickerSetsOrder_ | import("../tl/2_types.js").UpdateStickerSets_ | import("../tl/2_types.js").UpdateSavedGifs_ | import("../tl/2_types.js").UpdateBotInlineQuery_ | import("../tl/2_types.js").UpdateBotInlineSend_ | import("../tl/2_types.js").UpdateEditChannelMessage_ | import("../tl/2_types.js").UpdateBotCallbackQuery_ | import("../tl/2_types.js").UpdateEditMessage_ | import("../tl/2_types.js").UpdateInlineBotCallbackQuery_ | import("../tl/2_types.js").UpdateReadChannelOutbox_ | import("../tl/2_types.js").UpdateDraftMessage_ | import("../tl/2_types.js").UpdateReadFeaturedStickers_ | import("../tl/2_types.js").UpdateRecentStickers_ | import("../tl/2_types.js").UpdateConfig_ | import("../tl/2_types.js").UpdatePtsChanged_ | import("../tl/2_types.js").UpdateChannelWebPage_ | import("../tl/2_types.js").UpdateDialogPinned_ | import("../tl/2_types.js").UpdatePinnedDialogs_ | import("../tl/2_types.js").UpdateBotWebhookJSON_ | import("../tl/2_types.js").UpdateBotWebhookJSONQuery_ | import("../tl/2_types.js").UpdateBotShippingQuery_ | import("../tl/2_types.js").UpdateBotPrecheckoutQuery_ | import("../tl/2_types.js").UpdatePhoneCall_ | import("../tl/2_types.js").UpdateLangPackTooLong_ | import("../tl/2_types.js").UpdateLangPack_ | import("../tl/2_types.js").UpdateFavedStickers_ | import("../tl/2_types.js").UpdateChannelReadMessagesContents_ | import("../tl/2_types.js").UpdateContactsReset_ | import("../tl/2_types.js").UpdateChannelAvailableMessages_ | import("../tl/2_types.js").UpdateDialogUnreadMark_ | import("../tl/2_types.js").UpdateMessagePoll_ | import("../tl/2_types.js").UpdateChatDefaultBannedRights_ | import("../tl/2_types.js").UpdateFolderPeers_ | import("../tl/2_types.js").UpdatePeerSettings_ | import("../tl/2_types.js").UpdatePeerLocated_ | import("../tl/2_types.js").UpdateNewScheduledMessage_ | import("../tl/2_types.js").UpdateDeleteScheduledMessages_ | import("../tl/2_types.js").UpdateTheme_ | import("../tl/2_types.js").UpdateGeoLiveViewed_ | import("../tl/2_types.js").UpdateLoginToken_ | import("../tl/2_types.js").UpdateMessagePollVote_ | import("../tl/2_types.js").UpdateDialogFilter_ | import("../tl/2_types.js").UpdateDialogFilterOrder_ | import("../tl/2_types.js").UpdateDialogFilters_ | import("../tl/2_types.js").UpdatePhoneCallSignalingData_ | import("../tl/2_types.js").UpdateChannelMessageForwards_ | import("../tl/2_types.js").UpdateReadChannelDiscussionInbox_ | import("../tl/2_types.js").UpdateReadChannelDiscussionOutbox_ | import("../tl/2_types.js").UpdatePeerBlocked_ | import("../tl/2_types.js").UpdateChannelUserTyping_ | import("../tl/2_types.js").UpdatePinnedMessages_ | import("../tl/2_types.js").UpdatePinnedChannelMessages_ | import("../tl/2_types.js").UpdateChat_ | import("../tl/2_types.js").UpdateGroupCallParticipants_ | import("../tl/2_types.js").UpdateGroupCall_ | import("../tl/2_types.js").UpdatePeerHistoryTTL_ | import("../tl/2_types.js").UpdateChatParticipant_ | import("../tl/2_types.js").UpdateChannelParticipant_ | import("../tl/2_types.js").UpdateBotStopped_ | import("../tl/2_types.js").UpdateGroupCallConnection_ | import("../tl/2_types.js").UpdateBotCommands_ | import("../tl/2_types.js").UpdatePendingJoinRequests_ | import("../tl/2_types.js").UpdateBotChatInviteRequester_ | import("../tl/2_types.js").UpdateMessageReactions_ | import("../tl/2_types.js").UpdateAttachMenuBots_ | import("../tl/2_types.js").UpdateWebViewResultSent_ | import("../tl/2_types.js").UpdateBotMenuButton_ | import("../tl/2_types.js").UpdateSavedRingtones_ | import("../tl/2_types.js").UpdateTranscribedAudio_ | import("../tl/2_types.js").UpdateReadFeaturedEmojiStickers_ | import("../tl/2_types.js").UpdateUserEmojiStatus_ | import("../tl/2_types.js").UpdateRecentEmojiStatuses_ | import("../tl/2_types.js").UpdateRecentReactions_ | import("../tl/2_types.js").UpdateMoveStickerSetToTop_ | import("../tl/2_types.js").UpdateMessageExtendedMedia_ | import("../tl/2_types.js").UpdateChannelPinnedTopic_ | import("../tl/2_types.js").UpdateChannelPinnedTopics_ | import("../tl/2_types.js").UpdateUser_ | import("../tl/2_types.js").UpdateAutoSaveSettings_ | import("../tl/2_types.js").UpdateGroupInvitePrivacyForbidden_ | import("../tl/2_types.js").UpdateStory_ | import("../tl/2_types.js").UpdateReadStories_ | import("../tl/2_types.js").UpdateStoryID_ | import("../tl/2_types.js").UpdateStoriesStealthMode_ | import("../tl/2_types.js").UpdateSentStoryReaction_ | import("../tl/2_types.js").UpdateBotChatBoost_ | import("../tl/2_types.js").UpdateChannelViewForumAsMessages_ | import("../tl/2_types.js").UpdatePeerWallpaper_ | import("../tl/2_types.js").UpdateBotMessageReaction_ | import("../tl/2_types.js").UpdateBotMessageReactions_ | import("../tl/2_types.js").UpdateSavedDialogPinned_ | import("../tl/2_types.js").UpdatePinnedSavedDialogs_ | import("../tl/2_types.js").UpdateSavedReactionTags_] | null>;
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>;
@@ -74,8 +74,8 @@ class Storage {
74
74
  get isMemoryStorage() {
75
75
  return false;
76
76
  }
77
- setDc(dc) {
78
- return this.set(exports.K.auth.dc(), dc);
77
+ async setDc(dc) {
78
+ await this.set(exports.K.auth.dc(), dc);
79
79
  }
80
80
  getDc() {
81
81
  return this.get(exports.K.auth.dc());
@@ -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[]): (string | number)[];
15
- export declare function restoreKey(key: readonly StorageKeyPart[]): (string | number | bigint)[];
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], void, unknown>;
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], void, unknown>;
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[]): NonNullable<T> | null;
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], void, unknown>;
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], void, unknown>;
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(): Record<string, any>;
36
+ toJSON(): object;
37
37
  }
38
38
  export interface TLObjectConstructor<T = TLObject> {
39
39
  new (params: any): T;
@@ -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
  }