@mtkruto/browser 0.127.0 → 0.129.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.
- package/esm/0_deps.d.ts +4 -3
- package/esm/0_deps.d.ts.map +1 -1
- package/esm/0_deps.js +4 -3
- package/esm/3_types.d.ts +7 -0
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +7 -0
- package/esm/client/0_params.d.ts +12 -0
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/1_client_generic.d.ts +96 -19
- package/esm/client/1_client_generic.d.ts.map +1 -1
- package/esm/client/2_account_manager.d.ts +8 -1
- package/esm/client/2_account_manager.d.ts.map +1 -1
- package/esm/client/2_account_manager.js +38 -1
- package/esm/client/3_message_manager.d.ts +5 -1
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +21 -1
- package/esm/client/4_chat_manager.d.ts +4 -3
- package/esm/client/4_chat_manager.d.ts.map +1 -1
- package/esm/client/4_chat_manager.js +11 -3
- package/esm/client/4_context.d.ts +2 -2
- package/esm/client/4_context.d.ts.map +1 -1
- package/esm/client/6_client.d.ts +95 -18
- package/esm/client/6_client.d.ts.map +1 -1
- package/esm/client/6_client.js +121 -20
- package/esm/client/6_client_dispatcher.d.ts +96 -19
- package/esm/client/6_client_dispatcher.d.ts.map +1 -1
- package/esm/client/6_client_dispatcher.js +122 -21
- package/esm/types/0_calling_code.d.ts +27 -0
- package/esm/types/0_calling_code.d.ts.map +1 -0
- package/esm/types/0_calling_code.js +26 -0
- package/esm/types/0_timezone.d.ts +31 -0
- package/esm/types/0_timezone.d.ts.map +1 -0
- package/esm/types/0_timezone.js +26 -0
- package/esm/types/1_available_reactions.d.ts +54 -0
- package/esm/types/1_available_reactions.d.ts.map +1 -0
- package/esm/types/1_available_reactions.js +30 -0
- package/esm/types/1_chat_p.d.ts +1 -1
- package/esm/types/1_chat_p.d.ts.map +1 -1
- package/esm/types/1_chat_p.js +1 -1
- package/esm/types/1_country.d.ts +30 -0
- package/esm/types/1_country.d.ts.map +1 -0
- package/esm/types/1_country.js +30 -0
- package/esm/types/2_user.d.ts +1 -1
- package/esm/types/2_user.d.ts.map +1 -1
- package/esm/types/2_user.js +2 -2
- package/esm/types/3_app_support.d.ts +27 -0
- package/esm/types/3_app_support.d.ts.map +1 -0
- package/esm/types/3_app_support.js +24 -0
- package/esm/types/3_blocked_user.d.ts +31 -0
- package/esm/types/3_blocked_user.d.ts.map +1 -0
- package/esm/types/3_blocked_user.js +33 -0
- package/esm/types/4_blocked_user_list.d.ts +31 -0
- package/esm/types/4_blocked_user_list.d.ts.map +1 -0
- package/esm/types/4_blocked_user_list.js +25 -0
- package/package.json +1 -1
- package/script/0_deps.d.ts +4 -3
- package/script/0_deps.d.ts.map +1 -1
- package/script/0_deps.js +13 -12
- package/script/3_types.d.ts +7 -0
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +7 -0
- package/script/client/0_params.d.ts +12 -0
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/1_client_generic.d.ts +96 -19
- package/script/client/1_client_generic.d.ts.map +1 -1
- package/script/client/2_account_manager.d.ts +8 -1
- package/script/client/2_account_manager.d.ts.map +1 -1
- package/script/client/2_account_manager.js +37 -0
- package/script/client/3_message_manager.d.ts +5 -1
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +20 -0
- package/script/client/4_chat_manager.d.ts +4 -3
- package/script/client/4_chat_manager.d.ts.map +1 -1
- package/script/client/4_chat_manager.js +9 -1
- package/script/client/4_context.d.ts +2 -2
- package/script/client/4_context.d.ts.map +1 -1
- package/script/client/6_client.d.ts +95 -18
- package/script/client/6_client.d.ts.map +1 -1
- package/script/client/6_client.js +121 -20
- package/script/client/6_client_dispatcher.d.ts +96 -19
- package/script/client/6_client_dispatcher.d.ts.map +1 -1
- package/script/client/6_client_dispatcher.js +122 -21
- package/script/types/0_calling_code.d.ts +27 -0
- package/script/types/0_calling_code.d.ts.map +1 -0
- package/script/types/0_calling_code.js +29 -0
- package/script/types/0_timezone.d.ts +31 -0
- package/script/types/0_timezone.d.ts.map +1 -0
- package/script/types/0_timezone.js +29 -0
- package/script/types/1_available_reactions.d.ts +54 -0
- package/script/types/1_available_reactions.d.ts.map +1 -0
- package/script/types/1_available_reactions.js +33 -0
- package/script/types/1_chat_p.d.ts +1 -1
- package/script/types/1_chat_p.d.ts.map +1 -1
- package/script/types/1_chat_p.js +1 -1
- package/script/types/1_country.d.ts +30 -0
- package/script/types/1_country.d.ts.map +1 -0
- package/script/types/1_country.js +33 -0
- package/script/types/2_user.d.ts +1 -1
- package/script/types/2_user.d.ts.map +1 -1
- package/script/types/2_user.js +2 -2
- package/script/types/3_app_support.d.ts +27 -0
- package/script/types/3_app_support.d.ts.map +1 -0
- package/script/types/3_app_support.js +27 -0
- package/script/types/3_blocked_user.d.ts +31 -0
- package/script/types/3_blocked_user.d.ts.map +1 -0
- package/script/types/3_blocked_user.js +36 -0
- package/script/types/4_blocked_user_list.d.ts +31 -0
- package/script/types/4_blocked_user_list.d.ts.map +1 -0
- package/script/types/4_blocked_user_list.js +28 -0
- package/esm/deps/jsr.io/@std/async/1.2.0/_util.d.ts +0 -2
- package/esm/deps/jsr.io/@std/async/1.2.0/_util.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/async/1.2.0/_util.js +0 -6
- package/esm/deps/jsr.io/@std/async/1.2.0/abortable.d.ts +0 -107
- package/esm/deps/jsr.io/@std/async/1.2.0/abortable.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/async/1.2.0/abortable.js +0 -46
- package/esm/deps/jsr.io/@std/async/1.2.0/deadline.d.ts +0 -37
- package/esm/deps/jsr.io/@std/async/1.2.0/deadline.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/async/1.2.0/deadline.js +0 -41
- package/esm/deps/jsr.io/@std/async/1.2.0/debounce.d.ts +0 -44
- package/esm/deps/jsr.io/@std/async/1.2.0/debounce.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/async/1.2.0/debounce.js +0 -57
- package/esm/deps/jsr.io/@std/async/1.2.0/mod.d.ts +0 -22
- package/esm/deps/jsr.io/@std/async/1.2.0/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/async/1.2.0/mod.js +0 -23
- package/esm/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.d.ts +0 -111
- package/esm/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.js +0 -154
- package/esm/deps/jsr.io/@std/async/1.2.0/retry.d.ts +0 -155
- package/esm/deps/jsr.io/@std/async/1.2.0/retry.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/async/1.2.0/retry.js +0 -147
- package/esm/deps/jsr.io/@std/async/1.2.0/tee.d.ts +0 -43
- package/esm/deps/jsr.io/@std/async/1.2.0/tee.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/async/1.2.0/tee.js +0 -79
- package/script/deps/jsr.io/@std/async/1.2.0/_util.d.ts +0 -2
- package/script/deps/jsr.io/@std/async/1.2.0/_util.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/async/1.2.0/_util.js +0 -9
- package/script/deps/jsr.io/@std/async/1.2.0/abortable.d.ts +0 -107
- package/script/deps/jsr.io/@std/async/1.2.0/abortable.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/async/1.2.0/abortable.js +0 -49
- package/script/deps/jsr.io/@std/async/1.2.0/deadline.d.ts +0 -37
- package/script/deps/jsr.io/@std/async/1.2.0/deadline.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/async/1.2.0/deadline.js +0 -44
- package/script/deps/jsr.io/@std/async/1.2.0/debounce.d.ts +0 -44
- package/script/deps/jsr.io/@std/async/1.2.0/debounce.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/async/1.2.0/debounce.js +0 -60
- package/script/deps/jsr.io/@std/async/1.2.0/mod.d.ts +0 -22
- package/script/deps/jsr.io/@std/async/1.2.0/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/async/1.2.0/mod.js +0 -39
- package/script/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.d.ts +0 -111
- package/script/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/async/1.2.0/mux_async_iterator.js +0 -158
- package/script/deps/jsr.io/@std/async/1.2.0/retry.d.ts +0 -155
- package/script/deps/jsr.io/@std/async/1.2.0/retry.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/async/1.2.0/retry.js +0 -152
- package/script/deps/jsr.io/@std/async/1.2.0/tee.d.ts +0 -43
- package/script/deps/jsr.io/@std/async/1.2.0/tee.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/async/1.2.0/tee.js +0 -82
|
@@ -0,0 +1,54 @@
|
|
|
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 { Api } from "../2_tl.js";
|
|
21
|
+
import { type Reaction } from "./0_reaction.js";
|
|
22
|
+
/**
|
|
23
|
+
* An available reactions value allowing no type of reactions.
|
|
24
|
+
* @unlisted
|
|
25
|
+
*/
|
|
26
|
+
export interface AvailableReactionsNone {
|
|
27
|
+
/** @discriminator */
|
|
28
|
+
type: "none";
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* An available reactions value allowing a specific set of reactions.
|
|
32
|
+
* @unlisted
|
|
33
|
+
*/
|
|
34
|
+
export interface AvailableReactionsSome {
|
|
35
|
+
/** @discriminator */
|
|
36
|
+
type: "some";
|
|
37
|
+
/** The allowed reactions. */
|
|
38
|
+
reactions: Reaction[];
|
|
39
|
+
/** The maximum number of allowed reactions on a single message. */
|
|
40
|
+
maxReactionCount: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* An available reactions value allowing all types of reactions.
|
|
44
|
+
* @unlisted
|
|
45
|
+
*/
|
|
46
|
+
export interface AvailableReactionsAll {
|
|
47
|
+
/** @discriminator */
|
|
48
|
+
type: "all";
|
|
49
|
+
/** The maximum number of allowed reactions on a single message. */
|
|
50
|
+
maxReactionCount: number;
|
|
51
|
+
}
|
|
52
|
+
export type AvailableReactions = AvailableReactionsNone | AvailableReactionsSome | AvailableReactionsAll;
|
|
53
|
+
export declare function availableReactionsToTlObject(chatAvailableReactions: AvailableReactions): Api.ChatReactions;
|
|
54
|
+
//# sourceMappingURL=1_available_reactions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1_available_reactions.d.ts","sourceRoot":"","sources":["../../src/types/1_available_reactions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,QAAQ,EAAsB,MAAM,iBAAiB,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,qBAAqB;IACrB,IAAI,EAAE,KAAK,CAAC;IACZ,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GAAG,sBAAsB,GAAG,qBAAqB,CAAC;AAEzG,wBAAgB,4BAA4B,CAAC,sBAAsB,EAAE,kBAAkB,GAAG,GAAG,CAAC,aAAa,CAS1G"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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.availableReactionsToTlObject = availableReactionsToTlObject;
|
|
23
|
+
const _0_reaction_js_1 = require("./0_reaction.js");
|
|
24
|
+
function availableReactionsToTlObject(chatAvailableReactions) {
|
|
25
|
+
switch (chatAvailableReactions.type) {
|
|
26
|
+
case "none":
|
|
27
|
+
return { _: "chatReactionsNone" };
|
|
28
|
+
case "some":
|
|
29
|
+
return { _: "chatReactionsSome", reactions: chatAvailableReactions.reactions.map(_0_reaction_js_1.reactionToTlObject) };
|
|
30
|
+
case "all":
|
|
31
|
+
return { _: "chatReactionsAll" };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -82,7 +82,7 @@ export interface ChatPPrivate extends _ChatPBase {
|
|
|
82
82
|
/** The reason why the user has been restricted. */
|
|
83
83
|
restrictionReason?: RestrictionReason[];
|
|
84
84
|
/** Whether the user is a bot that has been added to the attachment menu by the current user. */
|
|
85
|
-
|
|
85
|
+
isAddedToAttachmentsMenu?: boolean;
|
|
86
86
|
/** Whether the user is a bot that has been added to the attachment menu by the current user. */
|
|
87
87
|
hasMainMiniApp?: boolean;
|
|
88
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1_chat_p.d.ts","sourceRoot":"","sources":["../../src/types/1_chat_p.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAA8B,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC/F,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE1E,gBAAgB;AAChB,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,OAAO,GACP,YAAY,GACZ,SAAS,CAAC;AAEd,gBAAgB;AAChB,MAAM,WAAW,UAAU;IACzB,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,4BAA4B;IA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AAY,GAAG,eAAe,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IACzE,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,WAAW,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;CAC/E;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,YAAY,CAE/D"}
|
package/script/types/1_chat_p.js
CHANGED
|
@@ -59,7 +59,7 @@ function constructChatP(chat) {
|
|
|
59
59
|
isSupport: chat.support || false,
|
|
60
60
|
isRestricted: chat.restricted || false,
|
|
61
61
|
restrictionReason: chat.restriction_reason?.map((v) => (0, _0_restriction_reason_js_1.constructRestrictionReason)(v)),
|
|
62
|
-
|
|
62
|
+
isAddedToAttachmentsMenu: chat.bot ? chat.attach_menu_enabled || false : undefined,
|
|
63
63
|
hasMainMiniApp: chat.bot ? chat.attach_menu_enabled || false : undefined,
|
|
64
64
|
};
|
|
65
65
|
if (_2_tl_js_1.Api.is("userProfilePhoto", chat.photo)) {
|
|
@@ -0,0 +1,30 @@
|
|
|
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 { Api } from "../2_tl.js";
|
|
21
|
+
import { type CallingCode } from "./0_calling_code.js";
|
|
22
|
+
export interface Country {
|
|
23
|
+
defaultName: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
code: string;
|
|
26
|
+
callingCodes: CallingCode[];
|
|
27
|
+
isHidden: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare function constructCountry(country: Api.help_Country): Country;
|
|
30
|
+
//# sourceMappingURL=1_country.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1_country.d.ts","sourceRoot":"","sources":["../../src/types/1_country.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,WAAW,EAAwB,MAAM,qBAAqB,CAAC;AAE7E,MAAM,WAAW,OAAO;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,YAAY,GAAG,OAAO,CAQnE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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.constructCountry = constructCountry;
|
|
23
|
+
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
24
|
+
const _0_calling_code_js_1 = require("./0_calling_code.js");
|
|
25
|
+
function constructCountry(country) {
|
|
26
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
27
|
+
defaultName: country.default_name,
|
|
28
|
+
name: country.name,
|
|
29
|
+
code: country.iso2,
|
|
30
|
+
callingCodes: country.country_codes.map(_0_calling_code_js_1.constructCallingCode),
|
|
31
|
+
isHidden: country.hidden ?? false,
|
|
32
|
+
});
|
|
33
|
+
}
|
package/script/types/2_user.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ export interface User {
|
|
|
74
74
|
/** The reason why the user has been restricted. */
|
|
75
75
|
restrictionReason?: RestrictionReason[];
|
|
76
76
|
/** Whether the user is a bot that has been added to the attachment menu by the current user. */
|
|
77
|
-
|
|
77
|
+
isAddedToAttachmentsMenu?: boolean;
|
|
78
78
|
/** Whether the user is a bot that has a main mini app. */
|
|
79
79
|
hasMainMiniApp?: boolean;
|
|
80
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_user.d.ts","sourceRoot":"","sources":["../../src/types/2_user.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,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AAC;IAC1B,gCAAgC;IAChC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,uFAAuF;IACvF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,MAAM,EAAE,OAAO,CAAC;IAChB,yCAAyC;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,qCAAqC;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,eAAe,EAAE,OAAO,CAAC;IACzB,0CAA0C;IAC1C,aAAa,EAAE,OAAO,CAAC;IACvB,oDAAoD;IACpD,MAAM,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,MAAM,EAAE,OAAO,CAAC;IAChB,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAC;IACnB,0CAA0C;IAC1C,UAAU,EAAE,OAAO,CAAC;IACpB,4CAA4C;IAC5C,SAAS,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,YAAY,EAAE,OAAO,CAAC;IACtB,mDAAmD;IACnD,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACxC,gGAAgG;IAChG,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,0DAA0D;IAC1D,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,GAAG,IAAI,CAoCnD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CA8BxD"}
|
package/script/types/2_user.js
CHANGED
|
@@ -55,7 +55,7 @@ function constructUser(user_) {
|
|
|
55
55
|
isSupport: user_.support || false,
|
|
56
56
|
isRestricted: user_.restricted || false,
|
|
57
57
|
restrictionReason: user_.restriction_reason?.map((v) => (0, _0_restriction_reason_js_1.constructRestrictionReason)(v)),
|
|
58
|
-
|
|
58
|
+
isAddedToAttachmentsMenu: user_.bot ? user_.attach_menu_enabled || false : undefined,
|
|
59
59
|
hasMainMiniApp: user_.bot ? user_.bot_has_main_app || false : undefined,
|
|
60
60
|
};
|
|
61
61
|
if (_2_tl_js_1.Api.is("userProfilePhoto", user_.photo)) {
|
|
@@ -89,7 +89,7 @@ function constructUser2(chatP) {
|
|
|
89
89
|
isSupport: chatP.isSupport,
|
|
90
90
|
isRestricted: chatP.isRestricted,
|
|
91
91
|
restrictionReason: chatP.restrictionReason,
|
|
92
|
-
|
|
92
|
+
isAddedToAttachmentsMenu: chatP.isAddedToAttachmentsMenu,
|
|
93
93
|
hasMainMiniApp: chatP.hasMainMiniApp,
|
|
94
94
|
};
|
|
95
95
|
return (0, _1_utilities_js_1.cleanObject)(user);
|
|
@@ -0,0 +1,27 @@
|
|
|
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 User } from "./2_user.js";
|
|
22
|
+
export interface AppSupport {
|
|
23
|
+
phoneNumber: string;
|
|
24
|
+
user: User;
|
|
25
|
+
}
|
|
26
|
+
export declare function constructAppSupport(result: Api.help_Support): AppSupport;
|
|
27
|
+
//# sourceMappingURL=3_app_support.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"3_app_support.d.ts","sourceRoot":"","sources":["../../src/types/3_app_support.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAiB,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,YAAY,GAAG,UAAU,CAExE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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.constructAppSupport = constructAppSupport;
|
|
23
|
+
const _2_tl_js_1 = require("../2_tl.js");
|
|
24
|
+
const _2_user_js_1 = require("./2_user.js");
|
|
25
|
+
function constructAppSupport(result) {
|
|
26
|
+
return { phoneNumber: result.phone_number, user: (0, _2_user_js_1.constructUser)(_2_tl_js_1.Api.as("user", result.user)) };
|
|
27
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { Api } from "../2_tl.js";
|
|
21
|
+
import type { PeerGetter } from "./1_chat_p.js";
|
|
22
|
+
import { type User } from "./2_user.js";
|
|
23
|
+
/** A blocked user. */
|
|
24
|
+
export interface BlockedUser {
|
|
25
|
+
/** The blocked user. */
|
|
26
|
+
user: User;
|
|
27
|
+
/** The point in time in which the user was blocked. */
|
|
28
|
+
blockedAt: number;
|
|
29
|
+
}
|
|
30
|
+
export declare function constructBlockedUser(peerBlocked: Api.PeerBlocked, getPeer: PeerGetter): BlockedUser;
|
|
31
|
+
//# sourceMappingURL=3_blocked_user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"3_blocked_user.d.ts","sourceRoot":"","sources":["../../src/types/3_blocked_user.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAkB,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAExD,sBAAsB;AACtB,MAAM,WAAW,WAAW;IAC1B,wBAAwB;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,GAAG,WAAW,CAanG"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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.constructBlockedUser = constructBlockedUser;
|
|
23
|
+
const _0_deps_js_1 = require("../0_deps.js");
|
|
24
|
+
const _2_user_js_1 = require("./2_user.js");
|
|
25
|
+
function constructBlockedUser(peerBlocked, getPeer) {
|
|
26
|
+
const maybeChatP = getPeer(peerBlocked.peer_id);
|
|
27
|
+
if (maybeChatP === null || maybeChatP[0].type !== "private") {
|
|
28
|
+
(0, _0_deps_js_1.unreachable)();
|
|
29
|
+
}
|
|
30
|
+
const user = (0, _2_user_js_1.constructUser2)(maybeChatP[0]);
|
|
31
|
+
const blockedAt = peerBlocked.date;
|
|
32
|
+
return {
|
|
33
|
+
user,
|
|
34
|
+
blockedAt,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { Api } from "../2_tl.js";
|
|
21
|
+
import type { PeerGetter } from "./1_chat_p.js";
|
|
22
|
+
import { type BlockedUser } from "./3_blocked_user.js";
|
|
23
|
+
/** A list of blocked users. */
|
|
24
|
+
export interface BlockedUserList {
|
|
25
|
+
/** The blocked users. */
|
|
26
|
+
blockedUsers: BlockedUser[];
|
|
27
|
+
/** The total number of blocked users. */
|
|
28
|
+
count: number;
|
|
29
|
+
}
|
|
30
|
+
export declare function constructBlockedUserList(result: Api.contacts_Blocked, getPeer: PeerGetter): BlockedUserList;
|
|
31
|
+
//# sourceMappingURL=4_blocked_user_list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"4_blocked_user_list.d.ts","sourceRoot":"","sources":["../../src/types/4_blocked_user_list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,KAAK,WAAW,EAAwB,MAAM,qBAAqB,CAAC;AAE7E,+BAA+B;AAC/B,MAAM,WAAW,eAAe;IAC9B,yBAAyB;IACzB,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,EAAE,OAAO,EAAE,UAAU,GAAG,eAAe,CAI3G"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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.constructBlockedUserList = constructBlockedUserList;
|
|
23
|
+
const _3_blocked_user_js_1 = require("./3_blocked_user.js");
|
|
24
|
+
function constructBlockedUserList(result, getPeer) {
|
|
25
|
+
const blockedUsers = result.blocked.map((v) => (0, _3_blocked_user_js_1.constructBlockedUser)(v, getPeer));
|
|
26
|
+
const count = "count" in result ? result.count : result.blocked.length;
|
|
27
|
+
return { blockedUsers, count };
|
|
28
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_util.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.2.0/_util.ts"],"names":[],"mappings":"AAGA,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,UAIf"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
export function exponentialBackoffWithJitter(cap, base, attempt, multiplier, jitter) {
|
|
4
|
-
const exp = Math.min(cap, base * multiplier ** attempt);
|
|
5
|
-
return (1 - jitter * Math.random()) * exp;
|
|
6
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Make a {@linkcode Promise} abortable with the given signal.
|
|
3
|
-
*
|
|
4
|
-
* @throws {DOMException} If the signal is already aborted and `signal.reason`
|
|
5
|
-
* is undefined. Otherwise, throws `signal.reason`.
|
|
6
|
-
* @typeParam T The type of the provided and returned promise.
|
|
7
|
-
* @param p The promise to make abortable.
|
|
8
|
-
* @param signal The signal to abort the promise with.
|
|
9
|
-
* @returns A promise that can be aborted.
|
|
10
|
-
*
|
|
11
|
-
* @example Error-handling a timeout
|
|
12
|
-
* ```ts ignore
|
|
13
|
-
* import { abortable, delay } from "@std/async";
|
|
14
|
-
* import { assertRejects, assertEquals } from "@std/assert";
|
|
15
|
-
*
|
|
16
|
-
* const promise = delay(1_000);
|
|
17
|
-
*
|
|
18
|
-
* // Rejects with `DOMException` after 100 ms
|
|
19
|
-
* await assertRejects(
|
|
20
|
-
* () => abortable(promise, AbortSignal.timeout(100)),
|
|
21
|
-
* DOMException,
|
|
22
|
-
* "Signal timed out."
|
|
23
|
-
* );
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @example Error-handling an abort
|
|
27
|
-
* ```ts ignore
|
|
28
|
-
* import { abortable, delay } from "@std/async";
|
|
29
|
-
* import { assertRejects, assertEquals } from "@std/assert";
|
|
30
|
-
*
|
|
31
|
-
* const promise = delay(1_000);
|
|
32
|
-
* const controller = new AbortController();
|
|
33
|
-
* controller.abort(new Error("This is my reason"));
|
|
34
|
-
*
|
|
35
|
-
* // Rejects with `DOMException` immediately
|
|
36
|
-
* await assertRejects(
|
|
37
|
-
* () => abortable(promise, controller.signal),
|
|
38
|
-
* Error,
|
|
39
|
-
* "This is my reason"
|
|
40
|
-
* );
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
export declare function abortable<T>(p: Promise<T>, signal: AbortSignal): Promise<T>;
|
|
44
|
-
/**
|
|
45
|
-
* Make an {@linkcode AsyncIterable} abortable with the given signal.
|
|
46
|
-
*
|
|
47
|
-
* @throws {DOMException} If the signal is already aborted and `signal.reason`
|
|
48
|
-
* is undefined. Otherwise, throws `signal.reason`.
|
|
49
|
-
* @typeParam T The type of the provided and returned async iterable.
|
|
50
|
-
* @param p The async iterable to make abortable.
|
|
51
|
-
* @param signal The signal to abort the promise with.
|
|
52
|
-
* @returns An async iterable that can be aborted.
|
|
53
|
-
*
|
|
54
|
-
* @example Error-handling a timeout
|
|
55
|
-
* ```ts
|
|
56
|
-
* import { abortable, delay } from "@std/async";
|
|
57
|
-
* import { assertRejects, assertEquals } from "@std/assert";
|
|
58
|
-
*
|
|
59
|
-
* const asyncIter = async function* () {
|
|
60
|
-
* yield "Hello";
|
|
61
|
-
* await delay(1_000);
|
|
62
|
-
* yield "World";
|
|
63
|
-
* };
|
|
64
|
-
*
|
|
65
|
-
* const items: string[] = [];
|
|
66
|
-
* // Below throws `DOMException` after 100 ms and items become `["Hello"]`
|
|
67
|
-
* await assertRejects(
|
|
68
|
-
* async () => {
|
|
69
|
-
* for await (const item of abortable(asyncIter(), AbortSignal.timeout(100))) {
|
|
70
|
-
* items.push(item);
|
|
71
|
-
* }
|
|
72
|
-
* },
|
|
73
|
-
* DOMException,
|
|
74
|
-
* "Signal timed out."
|
|
75
|
-
* );
|
|
76
|
-
* assertEquals(items, ["Hello"]);
|
|
77
|
-
* ```
|
|
78
|
-
*
|
|
79
|
-
* @example Error-handling an abort
|
|
80
|
-
* ```ts
|
|
81
|
-
* import { abortable, delay } from "@std/async";
|
|
82
|
-
* import { assertRejects, assertEquals } from "@std/assert";
|
|
83
|
-
*
|
|
84
|
-
* const asyncIter = async function* () {
|
|
85
|
-
* yield "Hello";
|
|
86
|
-
* await delay(1_000);
|
|
87
|
-
* yield "World";
|
|
88
|
-
* };
|
|
89
|
-
* const controller = new AbortController();
|
|
90
|
-
* controller.abort(new Error("This is my reason"));
|
|
91
|
-
*
|
|
92
|
-
* const items: string[] = [];
|
|
93
|
-
* // Below throws `DOMException` immediately
|
|
94
|
-
* await assertRejects(
|
|
95
|
-
* async () => {
|
|
96
|
-
* for await (const item of abortable(asyncIter(), controller.signal)) {
|
|
97
|
-
* items.push(item);
|
|
98
|
-
* }
|
|
99
|
-
* },
|
|
100
|
-
* Error,
|
|
101
|
-
* "This is my reason"
|
|
102
|
-
* );
|
|
103
|
-
* assertEquals(items, []);
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
106
|
-
export declare function abortable<T>(p: AsyncIterable<T>, signal: AbortSignal): AsyncGenerator<T>;
|
|
107
|
-
//# sourceMappingURL=abortable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"abortable.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.2.0/abortable.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAC7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH,wBAAgB,SAAS,CAAC,CAAC,EACzB,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EACnB,MAAM,EAAE,WAAW,GAClB,cAAc,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
2
|
-
// This module is browser compatible.
|
|
3
|
-
export function abortable(p, signal) {
|
|
4
|
-
if (p instanceof Promise) {
|
|
5
|
-
return abortablePromise(p, signal);
|
|
6
|
-
}
|
|
7
|
-
else {
|
|
8
|
-
return abortableAsyncIterable(p, signal);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
function abortablePromise(p, signal) {
|
|
12
|
-
const { promise, reject } = Promise.withResolvers();
|
|
13
|
-
const abort = () => reject(signal.reason);
|
|
14
|
-
if (signal.aborted)
|
|
15
|
-
abort();
|
|
16
|
-
signal.addEventListener("abort", abort, { once: true });
|
|
17
|
-
return Promise.race([promise, p]).finally(() => {
|
|
18
|
-
signal.removeEventListener("abort", abort);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
async function* abortableAsyncIterable(p, signal) {
|
|
22
|
-
signal.throwIfAborted();
|
|
23
|
-
const { promise, reject } = Promise.withResolvers();
|
|
24
|
-
const abort = () => reject(signal.reason);
|
|
25
|
-
signal.addEventListener("abort", abort, { once: true });
|
|
26
|
-
const it = p[Symbol.asyncIterator]();
|
|
27
|
-
try {
|
|
28
|
-
while (true) {
|
|
29
|
-
const race = Promise.race([promise, it.next()]);
|
|
30
|
-
race.catch(() => {
|
|
31
|
-
signal.removeEventListener("abort", abort);
|
|
32
|
-
});
|
|
33
|
-
const { done, value } = await race;
|
|
34
|
-
if (done) {
|
|
35
|
-
signal.removeEventListener("abort", abort);
|
|
36
|
-
const result = await it.return?.(value);
|
|
37
|
-
return result?.value;
|
|
38
|
-
}
|
|
39
|
-
yield value;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
catch (e) {
|
|
43
|
-
await it.return?.();
|
|
44
|
-
throw e;
|
|
45
|
-
}
|
|
46
|
-
}
|