@mtkruto/browser 0.125.0 → 0.127.0

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 (59) hide show
  1. package/esm/3_types.d.ts +3 -0
  2. package/esm/3_types.d.ts.map +1 -1
  3. package/esm/3_types.js +3 -0
  4. package/esm/client/0_params.d.ts +6 -0
  5. package/esm/client/0_params.d.ts.map +1 -1
  6. package/esm/client/1_client_generic.d.ts +108 -8
  7. package/esm/client/1_client_generic.d.ts.map +1 -1
  8. package/esm/client/2_story_album_manager.d.ts +36 -0
  9. package/esm/client/2_story_album_manager.d.ts.map +1 -0
  10. package/esm/client/2_story_album_manager.js +99 -0
  11. package/esm/client/4_chat_manager.d.ts +3 -0
  12. package/esm/client/4_chat_manager.d.ts.map +1 -1
  13. package/esm/client/4_chat_manager.js +18 -0
  14. package/esm/client/4_story_manager.js +4 -4
  15. package/esm/client/6_client.d.ts +108 -8
  16. package/esm/client/6_client.d.ts.map +1 -1
  17. package/esm/client/6_client.js +138 -7
  18. package/esm/client/6_client_dispatcher.d.ts +109 -8
  19. package/esm/client/6_client_dispatcher.d.ts.map +1 -1
  20. package/esm/client/6_client_dispatcher.js +134 -7
  21. package/esm/types/2_story_album_icon.d.ts +35 -0
  22. package/esm/types/2_story_album_icon.d.ts.map +1 -0
  23. package/esm/types/2_story_album_icon.js +20 -0
  24. package/esm/types/3_story_album.d.ts +32 -0
  25. package/esm/types/3_story_album.d.ts.map +1 -0
  26. package/esm/types/3_story_album.js +50 -0
  27. package/esm/types/4_album_story_list.d.ts +33 -0
  28. package/esm/types/4_album_story_list.d.ts.map +1 -0
  29. package/esm/types/4_album_story_list.js +32 -0
  30. package/package.json +1 -1
  31. package/script/3_types.d.ts +3 -0
  32. package/script/3_types.d.ts.map +1 -1
  33. package/script/3_types.js +3 -0
  34. package/script/client/0_params.d.ts +6 -0
  35. package/script/client/0_params.d.ts.map +1 -1
  36. package/script/client/1_client_generic.d.ts +108 -8
  37. package/script/client/1_client_generic.d.ts.map +1 -1
  38. package/script/client/2_story_album_manager.d.ts +36 -0
  39. package/script/client/2_story_album_manager.d.ts.map +1 -0
  40. package/script/client/2_story_album_manager.js +103 -0
  41. package/script/client/4_chat_manager.d.ts +3 -0
  42. package/script/client/4_chat_manager.d.ts.map +1 -1
  43. package/script/client/4_chat_manager.js +18 -0
  44. package/script/client/4_story_manager.js +4 -4
  45. package/script/client/6_client.d.ts +108 -8
  46. package/script/client/6_client.d.ts.map +1 -1
  47. package/script/client/6_client.js +138 -7
  48. package/script/client/6_client_dispatcher.d.ts +109 -8
  49. package/script/client/6_client_dispatcher.d.ts.map +1 -1
  50. package/script/client/6_client_dispatcher.js +134 -7
  51. package/script/types/2_story_album_icon.d.ts +35 -0
  52. package/script/types/2_story_album_icon.d.ts.map +1 -0
  53. package/script/types/2_story_album_icon.js +21 -0
  54. package/script/types/3_story_album.d.ts +32 -0
  55. package/script/types/3_story_album.d.ts.map +1 -0
  56. package/script/types/3_story_album.js +53 -0
  57. package/script/types/4_album_story_list.d.ts +33 -0
  58. package/script/types/4_album_story_list.d.ts.map +1 -0
  59. package/script/types/4_album_story_list.js +35 -0
@@ -2009,6 +2009,34 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2009
2009
  async getSimilarBots(chatId) {
2010
2010
  return await this.#dispatch("getSimilarBots", chatId);
2011
2011
  }
2012
+ /**
2013
+ * Get the count of online members in a chat. User-only.
2014
+ *
2015
+ * @method ch
2016
+ * @param chatId The identifier of a chat.
2017
+ * @returns The count of online members in the chat.
2018
+ */
2019
+ async getOnlineCount(chatId) {
2020
+ return await this.#dispatch("getOnlineCount", chatId);
2021
+ }
2022
+ /**
2023
+ * Enable chat history for new members. User-only.
2024
+ *
2025
+ * @method ch
2026
+ * @param chatId The identifier of a chat.
2027
+ */
2028
+ async enableChatHistoryForNewMembers(chatId) {
2029
+ return await this.#dispatch("enableChatHistoryForNewMembers", chatId);
2030
+ }
2031
+ /**
2032
+ * Disable chat history for new members. User-only.
2033
+ *
2034
+ * @method ch
2035
+ * @param chatId The identifier of a chat.
2036
+ */
2037
+ async disableChatHistoryForNewMembers(chatId) {
2038
+ return await this.#dispatch("disableChatHistoryForNewMembers", chatId);
2039
+ }
2012
2040
  //
2013
2041
  // ========================= CALLBACK QUERIES ========================= //
2014
2042
  //
@@ -2263,6 +2291,105 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2263
2291
  return await this.#dispatch("removeStoryFromHighlights", chatId, storyId);
2264
2292
  }
2265
2293
  //
2294
+ // ========================= STORY ALBUMS ========================= //
2295
+ //
2296
+ /**
2297
+ * Create a story album. User-only.
2298
+ *
2299
+ * @method sa
2300
+ * @param chatId The identifier of the chat to create the album in.
2301
+ * @param name The name of the album.
2302
+ * @param storyIds The initial stories inside the album.
2303
+ */
2304
+ async createStoryAlbum(chatId, name, storyIds) {
2305
+ return await this.#dispatch("createStoryAlbum", chatId, name, storyIds);
2306
+ }
2307
+ /**
2308
+ * Set the name of a story album. User-only.
2309
+ *
2310
+ * @method sa
2311
+ * @param chatId The identifier of the chat including the album.
2312
+ * @param albumId The identifier of the album to rename.
2313
+ * @param name The new name of the album.
2314
+ */
2315
+ async setStoryAlbumName(chatId, albumId, name) {
2316
+ return await this.#dispatch("setStoryAlbumName", chatId, albumId, name);
2317
+ }
2318
+ /**
2319
+ * Add multiple stories to an album. User-only.
2320
+ *
2321
+ * @method sa
2322
+ * @param chatId The identifier of the chat including the album.
2323
+ * @param albumId The identifier of an album.
2324
+ * @param storyIds The identifiers of the stories to add.
2325
+ */
2326
+ async addStoriesToAlbum(chatId, albumId, storyIds) {
2327
+ return await this.#dispatch("addStoriesToAlbum", chatId, albumId, storyIds);
2328
+ }
2329
+ /**
2330
+ * Add a single story to an album. User-only.
2331
+ *
2332
+ * @method sa
2333
+ * @param chatId The identifier of the chat including the album.
2334
+ * @param albumId The identifier of an album.
2335
+ * @param storyIds The identifier of the story to add.
2336
+ */
2337
+ async addStoryToAlbum(chatId, albumId, storyId) {
2338
+ return await this.#dispatch("addStoryToAlbum", chatId, albumId, storyId);
2339
+ }
2340
+ /**
2341
+ * Remove multiple stories from an album. User-only.
2342
+ *
2343
+ * @method sa
2344
+ * @param chatId The identifier of the chat including the album.
2345
+ * @param albumId The identifier of an album.
2346
+ * @param storyIds The identifiers of the stories to remove.
2347
+ */
2348
+ async removeStoriesFromAlbum(chatId, albumId, storyIds) {
2349
+ return await this.#dispatch("removeStoriesFromAlbum", chatId, albumId, storyIds);
2350
+ }
2351
+ /**
2352
+ * Remove a single story from an album. User-only.
2353
+ *
2354
+ * @method sa
2355
+ * @param chatId The identifier of the chat including the album.
2356
+ * @param albumId The identifier of an album.
2357
+ * @param storyIds The identifier of the story to remove.
2358
+ */
2359
+ async removeStoryFromAlbum(chatId, albumId, storyId) {
2360
+ return await this.#dispatch("removeStoryFromAlbum", chatId, albumId, storyId);
2361
+ }
2362
+ /**
2363
+ * Reorder stories in an album. User-only.
2364
+ *
2365
+ * @method sa
2366
+ * @param chatId The identifier of the chat including the album.
2367
+ * @param albumId The identifier of an album.
2368
+ * @param storyIds The new order of stories.
2369
+ */
2370
+ async reorderStoriesInAlbum(chatId, albumId, storyIds) {
2371
+ return await this.#dispatch("reorderStoriesInAlbum", chatId, albumId, storyIds);
2372
+ }
2373
+ /**
2374
+ * Get story albums in a chat. User-only.
2375
+ *
2376
+ * @method sa
2377
+ * @param chatId The identifier of a chat including albums.
2378
+ */
2379
+ async getStoryAlbums(chatId) {
2380
+ return await this.#dispatch("getStoryAlbums", chatId);
2381
+ }
2382
+ /**
2383
+ * Get stories inside an album. User-only.
2384
+ *
2385
+ * @method sa
2386
+ * @param chatId The identifier of the chat including albums.
2387
+ * @param albumId The identifier of an album.
2388
+ */
2389
+ async getStoriesInAlbum(chatId, albumId) {
2390
+ return await this.#dispatch("getStoriesInAlbum", chatId, albumId);
2391
+ }
2392
+ //
2266
2393
  // ========================= MISC ========================= //
2267
2394
  //
2268
2395
  /**
@@ -2529,7 +2656,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2529
2656
  // ========================= GIFT COLLECTIONS ========================= //
2530
2657
  //
2531
2658
  /**
2532
- * Get gift collections of a chat.
2659
+ * Get gift collections of a chat. User-only.
2533
2660
  *
2534
2661
  * @method gc
2535
2662
  * @param chatId The identifier of a chat to get gift collections for.
@@ -2538,7 +2665,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2538
2665
  return await this.#dispatch("getGiftCollections", chatId);
2539
2666
  }
2540
2667
  /**
2541
- * Create a gift collection.
2668
+ * Create a gift collection. User-only.
2542
2669
  *
2543
2670
  * @method gc
2544
2671
  * @param chatId The identifier of a chat to create the gift collection in.
@@ -2549,7 +2676,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2549
2676
  return await this.#dispatch("createGiftCollection", chatId, name, gifts);
2550
2677
  }
2551
2678
  /**
2552
- * Set the name of a gift collection.
2679
+ * Set the name of a gift collection. User-only.
2553
2680
  *
2554
2681
  * @method gc
2555
2682
  * @param chatId The identifier of the chat that includes the gift collection.
@@ -2560,7 +2687,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2560
2687
  return await this.#dispatch("setGiftCollectionName", chatId, collectionId, name);
2561
2688
  }
2562
2689
  /**
2563
- * Add gifts to a gift collection.
2690
+ * Add gifts to a gift collection. User-only.
2564
2691
  *
2565
2692
  * @method gc
2566
2693
  * @param chatId The identifier of the chat that includes the gift collection.
@@ -2571,7 +2698,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2571
2698
  return await this.#dispatch("addGiftsToCollection", chatId, collectionId, gifts);
2572
2699
  }
2573
2700
  /**
2574
- * Remove gifts from a gift collection.
2701
+ * Remove gifts from a gift collection. User-only.
2575
2702
  *
2576
2703
  * @method gc
2577
2704
  * @param chatId The identifier of the chat that includes the gift collection.
@@ -2582,7 +2709,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2582
2709
  return await this.#dispatch("removeGiftsFromCollection", chatId, collectionId, gifts);
2583
2710
  }
2584
2711
  /**
2585
- * Reorder gifts in a gift collection.
2712
+ * Reorder gifts in a gift collection. User-only.
2586
2713
  *
2587
2714
  * @method gc
2588
2715
  * @param chatId The identifier of the chat that includes the gift collection.
@@ -2593,7 +2720,7 @@ class ClientDispatcher extends _5_composer_js_1.Composer {
2593
2720
  return await this.#dispatch("reorderGiftsInCollection", chatId, collectionId, gifts);
2594
2721
  }
2595
2722
  /**
2596
- * Delete a gift collection.
2723
+ * Delete a gift collection. User-only.
2597
2724
  *
2598
2725
  * @method gc
2599
2726
  * @param chatId The identifier of the chat that includes the gift collection.
@@ -0,0 +1,35 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import type { Document } from "./1_document.js";
21
+ import type { Photo } from "./1_photo.js";
22
+ /** @unlisted */
23
+ export interface StoryAlbumIconPhoto {
24
+ /** @discriminator */
25
+ type: "photo";
26
+ photo: Photo;
27
+ }
28
+ /** @unlisted */
29
+ export interface StoryAlbumIconVideo {
30
+ /** @discriminator */
31
+ type: "video";
32
+ video: Document;
33
+ }
34
+ export type StoryAlbumIcon = StoryAlbumIconPhoto | StoryAlbumIconVideo;
35
+ //# sourceMappingURL=2_story_album_icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2_story_album_icon.d.ts","sourceRoot":"","sources":["../../src/types/2_story_album_icon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,gBAAgB;AAChB,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;CACd;AAED,gBAAgB;AAChB,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,QAAQ,CAAC;CACjB;AAED,MAAM,MAAM,cAAc,GAAG,mBAAmB,GAAG,mBAAmB,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /**
3
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
4
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
5
+ *
6
+ * This file is part of MTKruto.
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU Lesser General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU Lesser General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Lesser General Public License
19
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,32 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import { Api } from "../2_tl.js";
21
+ import type { StoryAlbumIcon } from "./2_story_album_icon.js";
22
+ /** A story album. */
23
+ export interface StoryAlbum {
24
+ /** The identifier of the album. */
25
+ id: number;
26
+ /** The name of the album. */
27
+ name: string;
28
+ /** The icon of the album. */
29
+ icon?: StoryAlbumIcon;
30
+ }
31
+ export declare function constructStoryAlbum(album: Api.StoryAlbum): StoryAlbum;
32
+ //# sourceMappingURL=3_story_album.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"3_story_album.d.ts","sourceRoot":"","sources":["../../src/types/3_story_album.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAIjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,qBAAqB;AACrB,MAAM,WAAW,UAAU;IACzB,mCAAmC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,CAAC,UAAU,GAAG,UAAU,CAwBrE"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /**
3
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
4
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
5
+ *
6
+ * This file is part of MTKruto.
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU Lesser General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU Lesser General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Lesser General Public License
19
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.constructStoryAlbum = constructStoryAlbum;
23
+ const _1_utilities_js_1 = require("../1_utilities.js");
24
+ const _2_tl_js_1 = require("../2_tl.js");
25
+ const _file_id_js_1 = require("./_file_id.js");
26
+ const _1_document_js_1 = require("./1_document.js");
27
+ const _1_photo_js_1 = require("./1_photo.js");
28
+ function constructStoryAlbum(album) {
29
+ let icon;
30
+ if (album.icon_photo) {
31
+ icon = {
32
+ type: "photo",
33
+ photo: (0, _1_photo_js_1.constructPhoto)(_2_tl_js_1.Api.as("photo", album.icon_photo)),
34
+ };
35
+ }
36
+ else if (_2_tl_js_1.Api.is("document", album.icon_video)) {
37
+ const fileId = {
38
+ type: _file_id_js_1.FileType.Video,
39
+ dcId: album.icon_video.dc_id,
40
+ fileReference: album.icon_video.file_reference,
41
+ location: { type: "common", id: album.icon_video.id, accessHash: album.icon_video.access_hash },
42
+ };
43
+ icon = {
44
+ type: "video",
45
+ video: (0, _1_document_js_1.constructDocument)(album.icon_video, { _: "documentAttributeFilename", file_name: "video.mp4" }, (0, _file_id_js_1.serializeFileId)(fileId), (0, _file_id_js_1.toUniqueFileId)(fileId)),
46
+ };
47
+ }
48
+ return (0, _1_utilities_js_1.cleanObject)({
49
+ id: album.album_id,
50
+ name: album.title,
51
+ icon,
52
+ });
53
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import { Api } from "../2_tl.js";
21
+ import type { PeerGetter } from "./1_chat_p.js";
22
+ import { type Story } from "./3_story.js";
23
+ /** A list of stories in a specific album. */
24
+ export interface AlbumStoryList {
25
+ /** The stories. */
26
+ stories: Story[];
27
+ /** The identifiers of the pinned stories. */
28
+ pinnedStoryIds: number[];
29
+ /** The total number of stories in this album. */
30
+ count: number;
31
+ }
32
+ export declare function constructAlbumStoryList(result: Api.stories_stories, peer: Api.peerUser | Api.peerChat | Api.peerChannel, getPeer: PeerGetter): AlbumStoryList;
33
+ //# sourceMappingURL=4_album_story_list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"4_album_story_list.d.ts","sourceRoot":"","sources":["../../src/types/4_album_story_list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAkB,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1D,6CAA6C;AAC7C,MAAM,WAAW,cAAc;IAC7B,mBAAmB;IACnB,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB,6CAA6C;IAC7C,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,GAAG,CAAC,eAAe,EAAE,IAAI,EAAE,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,GAAG,cAAc,CAS7J"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /**
3
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
4
+ * Copyright (C) 2023-2026 Roj <https://roj.im/>
5
+ *
6
+ * This file is part of MTKruto.
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU Lesser General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU Lesser General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Lesser General Public License
19
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.constructAlbumStoryList = constructAlbumStoryList;
23
+ const _1_utilities_js_1 = require("../1_utilities.js");
24
+ const _2_tl_js_1 = require("../2_tl.js");
25
+ const _3_story_js_1 = require("./3_story.js");
26
+ function constructAlbumStoryList(result, peer, getPeer) {
27
+ const stories = result.stories.filter((v) => _2_tl_js_1.Api.is("storyItem", v)).map((v) => (0, _3_story_js_1.constructStory)(v, peer, getPeer));
28
+ const pinnedStoryIds = result.pinned_to_top ?? [];
29
+ const count = result.count;
30
+ return (0, _1_utilities_js_1.cleanObject)({
31
+ stories,
32
+ pinnedStoryIds,
33
+ count,
34
+ });
35
+ }