@mtkruto/node 0.1.157 → 0.1.160

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 (83) hide show
  1. package/esm/4_constants.d.ts +2 -2
  2. package/esm/4_constants.js +2 -2
  3. package/esm/client/1_composer.d.ts +2 -2
  4. package/esm/client/1_composer.js +4 -4
  5. package/esm/client/1_file_manager.js +53 -56
  6. package/esm/client/2_message_manager.js +8 -11
  7. package/esm/client/4_client.d.ts +2 -2
  8. package/esm/client/4_client.js +4 -4
  9. package/esm/tl/2_types.d.ts +596 -1
  10. package/esm/tl/2_types.js +1824 -319
  11. package/esm/tl/3_functions.d.ts +374 -2
  12. package/esm/tl/3_functions.js +943 -31
  13. package/esm/types/0__file_id.d.ts +79 -54
  14. package/esm/types/0__file_id.js +259 -277
  15. package/esm/types/0_chat_photo.js +15 -21
  16. package/esm/types/0_giveaway_parameters.d.ts +5 -0
  17. package/esm/types/0_login_url.d.ts +4 -0
  18. package/esm/types/0_message_reference.d.ts +2 -0
  19. package/esm/types/0_price_tag.d.ts +2 -0
  20. package/esm/types/0_thumbnail.js +16 -14
  21. package/esm/types/1_giveaway.d.ts +2 -0
  22. package/esm/types/1_inline_query_result_button.d.ts +3 -0
  23. package/esm/types/1_photo.js +20 -14
  24. package/esm/types/1_poll.d.ts +13 -0
  25. package/esm/types/1_reaction_count.d.ts +2 -0
  26. package/esm/types/1_reply_quote.d.ts +3 -0
  27. package/esm/types/1_user.d.ts +13 -13
  28. package/esm/types/2_chosen_inline_result.d.ts +5 -0
  29. package/esm/types/2_game.d.ts +6 -0
  30. package/esm/types/2_game.js +11 -7
  31. package/esm/types/2_inactive_chat.d.ts +3 -0
  32. package/esm/types/2_inline_query.d.ts +6 -0
  33. package/esm/types/2_message_interactions.d.ts +5 -0
  34. package/esm/types/2_message_reaction_count.d.ts +4 -0
  35. package/esm/types/2_message_reactions.d.ts +7 -0
  36. package/esm/types/2_story_content.js +4 -7
  37. package/esm/types/4_inline_query_result.js +5 -5
  38. package/esm/types/4_message.js +21 -17
  39. package/esm/types/5_callback_query.d.ts +7 -0
  40. package/esm/utilities/0_buffer.d.ts +1 -1
  41. package/esm/utilities/0_buffer.js +26 -24
  42. package/package.json +1 -1
  43. package/script/4_constants.d.ts +2 -2
  44. package/script/4_constants.js +2 -2
  45. package/script/client/1_composer.d.ts +2 -2
  46. package/script/client/1_composer.js +4 -4
  47. package/script/client/1_file_manager.js +52 -55
  48. package/script/client/2_message_manager.js +6 -9
  49. package/script/client/4_client.d.ts +2 -2
  50. package/script/client/4_client.js +4 -4
  51. package/script/tl/2_types.d.ts +596 -1
  52. package/script/tl/2_types.js +1904 -345
  53. package/script/tl/3_functions.d.ts +374 -2
  54. package/script/tl/3_functions.js +977 -41
  55. package/script/types/0__file_id.d.ts +79 -54
  56. package/script/types/0__file_id.js +263 -280
  57. package/script/types/0_chat_photo.js +14 -20
  58. package/script/types/0_giveaway_parameters.d.ts +5 -0
  59. package/script/types/0_login_url.d.ts +4 -0
  60. package/script/types/0_message_reference.d.ts +2 -0
  61. package/script/types/0_price_tag.d.ts +2 -0
  62. package/script/types/0_thumbnail.js +15 -13
  63. package/script/types/1_giveaway.d.ts +2 -0
  64. package/script/types/1_inline_query_result_button.d.ts +3 -0
  65. package/script/types/1_photo.js +19 -13
  66. package/script/types/1_poll.d.ts +13 -0
  67. package/script/types/1_reaction_count.d.ts +2 -0
  68. package/script/types/1_reply_quote.d.ts +3 -0
  69. package/script/types/1_user.d.ts +13 -13
  70. package/script/types/2_chosen_inline_result.d.ts +5 -0
  71. package/script/types/2_game.d.ts +6 -0
  72. package/script/types/2_game.js +10 -6
  73. package/script/types/2_inactive_chat.d.ts +3 -0
  74. package/script/types/2_inline_query.d.ts +6 -0
  75. package/script/types/2_message_interactions.d.ts +5 -0
  76. package/script/types/2_message_reaction_count.d.ts +4 -0
  77. package/script/types/2_message_reactions.d.ts +7 -0
  78. package/script/types/2_story_content.js +3 -6
  79. package/script/types/4_inline_query_result.js +4 -4
  80. package/script/types/4_message.js +20 -16
  81. package/script/types/5_callback_query.d.ts +7 -0
  82. package/script/utilities/0_buffer.d.ts +1 -1
  83. package/script/utilities/0_buffer.js +26 -24
@@ -1,8 +1,8 @@
1
1
  export declare enum FileType {
2
2
  Thumbnail = 0,
3
- ChatPhoto = 1,
3
+ ProfilePhoto = 1,
4
4
  Photo = 2,
5
- Voice = 3,
5
+ VoiceNote = 3,
6
6
  Video = 4,
7
7
  Document = 5,
8
8
  Encrypted = 6,
@@ -13,65 +13,90 @@ export declare enum FileType {
13
13
  EncryptedThumbnail = 11,
14
14
  Wallpaper = 12,
15
15
  VideoNote = 13,
16
- SecureRaw = 14,
17
- Secure = 15,
16
+ SecureDecrypted = 14,
17
+ SecureEncrypted = 15,
18
18
  Background = 16,
19
- DocumentAsFile = 17
19
+ DocumentAsFile = 17,
20
+ Ringtone = 18,
21
+ CallLog = 19,
22
+ PhotoStory = 20,
23
+ VideoStory = 21,
24
+ Size = 22,
25
+ None = 23
20
26
  }
21
- export declare enum ThumbnailSource {
27
+ export declare enum PhotoSourceType {
22
28
  Legacy = 0,
23
29
  Thumbnail = 1,
24
30
  ChatPhotoSmall = 2,
25
31
  ChatPhotoBig = 3,
26
- StickerSetThumbnail = 4
32
+ StickerSetThumbnail = 4,
33
+ FullLegacy = 5,
34
+ ChatPhotoSmallLegacy = 6,
35
+ ChatPhotoBigLegacy = 7,
36
+ StickerSetThumbnailLegacy = 8,
37
+ StickerSetThumbnailVersion = 9
27
38
  }
28
- interface FileIDParams {
39
+ type PhotoSource = {
40
+ type: PhotoSourceType.Legacy;
41
+ secret: bigint;
42
+ } | {
43
+ type: PhotoSourceType.Thumbnail;
44
+ fileType: FileType;
45
+ thumbnailType: number;
46
+ } | {
47
+ type: PhotoSourceType.ChatPhotoSmall;
48
+ chatId: bigint;
49
+ chatAccessHash: bigint;
50
+ } | {
51
+ type: PhotoSourceType.ChatPhotoBig;
52
+ chatId: bigint;
53
+ chatAccessHash: bigint;
54
+ } | {
55
+ type: PhotoSourceType.StickerSetThumbnail;
56
+ stickerSetId: bigint;
57
+ stickerSetAccessHash: bigint;
58
+ } | {
59
+ type: PhotoSourceType.FullLegacy;
60
+ volumeId: bigint;
61
+ localId: number;
62
+ secret: bigint;
63
+ } | {
64
+ type: PhotoSourceType.ChatPhotoSmallLegacy;
65
+ volumeId: bigint;
66
+ localId: number;
67
+ } | {
68
+ type: PhotoSourceType.ChatPhotoBigLegacy;
69
+ volumeId: bigint;
70
+ localId: number;
71
+ } | {
72
+ type: PhotoSourceType.StickerSetThumbnailLegacy;
73
+ volumeId: bigint;
74
+ localId: number;
75
+ } | {
76
+ type: PhotoSourceType.StickerSetThumbnailVersion;
77
+ version: number;
78
+ };
79
+ type FileLocation = {
80
+ type: "web";
81
+ url: string;
82
+ accessHash: bigint;
83
+ } | {
84
+ type: "photo";
85
+ id: bigint;
86
+ accessHash: bigint;
87
+ source: PhotoSource;
88
+ } | {
89
+ type: "common";
90
+ id: bigint;
91
+ accessHash: bigint;
92
+ };
93
+ export interface FileId {
94
+ type: FileType;
95
+ dcId: number;
29
96
  fileReference?: Uint8Array;
30
- url?: string;
31
- mediaId?: bigint;
32
- accessHash?: bigint;
33
- volumeId?: bigint;
34
- thumbnailSource?: ThumbnailSource;
35
- thumbnailFileType?: FileType;
36
- thumbnailSize?: string;
37
- secret?: bigint;
38
- localId?: number;
39
- chatId?: number;
40
- chatAccessHash?: bigint;
41
- stickerSetId?: bigint;
42
- stickerSetAccessHash?: bigint;
43
- }
44
- export declare class FileID {
45
- readonly fileType: FileType;
46
- readonly dcId: number;
47
- readonly params: FileIDParams;
48
- static MAJOR: number;
49
- static MINOR: number;
50
- readonly major: number;
51
- readonly minor: number;
52
- constructor(major: number | null | undefined, minor: number | null | undefined, fileType: FileType, dcId: number, params: FileIDParams);
53
- static decode(fileId: string): FileID;
54
- encode(major?: number, minor?: number): string;
55
- }
56
- export declare enum FileUniqueType {
57
- Web = 0,
58
- Photo = 1,
59
- Document = 2,
60
- Secure = 3,
61
- Encrypted = 4,
62
- Temp = 5
63
- }
64
- interface FileUniqueParams {
65
- url?: string;
66
- mediaId?: bigint;
67
- volumeId?: bigint;
68
- localId?: number;
69
- }
70
- export declare class FileUniqueID {
71
- private readonly fileUniqueType;
72
- private readonly params;
73
- constructor(fileUniqueType: FileUniqueType, params: FileUniqueParams);
74
- static decode(fileId: string): FileUniqueID;
75
- encode(): string;
97
+ location: FileLocation;
76
98
  }
99
+ export declare function deserializeFileId(fileId: string): FileId;
100
+ export declare function serializeFileId(fileId: FileId): string;
101
+ export declare function toUniqueFileId(fileId: FileId): string;
77
102
  export {};