@types/telegram-web-app 9.1.2 → 9.5.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.
- telegram-web-app/README.md +1 -1
- telegram-web-app/index.d.ts +64 -24
- telegram-web-app/package.json +2 -2
telegram-web-app/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for telegram-web-app (https://telegram.or
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/telegram-web-app.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Mon, 16 Mar 2026 22:09:01 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
|
|
14
14
|
# Credits
|
telegram-web-app/index.d.ts
CHANGED
|
@@ -500,7 +500,7 @@ export interface WebApp {
|
|
|
500
500
|
*
|
|
501
501
|
* @since Bot API 8.0+
|
|
502
502
|
*/
|
|
503
|
-
shareMessage(msg_id:
|
|
503
|
+
shareMessage(msg_id: string, callback?: (success: boolean) => void): void;
|
|
504
504
|
|
|
505
505
|
/**
|
|
506
506
|
* A method that opens a dialog allowing the user to set the specified custom emoji as their status.
|
|
@@ -935,46 +935,73 @@ export interface BackButton {
|
|
|
935
935
|
* Web App in the Telegram interface.
|
|
936
936
|
*/
|
|
937
937
|
export interface BottomButton {
|
|
938
|
-
/**
|
|
938
|
+
/**
|
|
939
|
+
* **Bot API 9.5+**
|
|
940
|
+
*
|
|
941
|
+
* Unique identifier of the custom emoji shown
|
|
942
|
+
* before the text of the button.
|
|
943
|
+
*/
|
|
944
|
+
iconCustomEmojiId: string;
|
|
945
|
+
/**
|
|
946
|
+
* Current button text. Set to _Continue_ for the main button and
|
|
947
|
+
* _Cancel_ for the secondary button by default.
|
|
948
|
+
*/
|
|
939
949
|
text: string;
|
|
940
|
-
/**
|
|
950
|
+
/**
|
|
951
|
+
* Current button color. Set to _themeParams.button_color_ for the main button
|
|
952
|
+
* and _themeParams.bottom_bar_bg_color_ for the secondary button by default.
|
|
953
|
+
*/
|
|
941
954
|
color: string;
|
|
942
955
|
/**
|
|
943
|
-
* Current button text color. Set to
|
|
944
|
-
*
|
|
956
|
+
* Current button text color. Set to
|
|
957
|
+
* _themeParams.button_text_color_ for the main button and
|
|
958
|
+
* _themeParams.button_color_ for the secondary button by default.
|
|
945
959
|
*/
|
|
946
960
|
textColor: string;
|
|
947
|
-
/** Shows whether the button is visible. Set to
|
|
961
|
+
/** Shows whether the button is visible. Set to _false_ by default. */
|
|
948
962
|
isVisible: boolean;
|
|
949
|
-
/** Shows whether the button is active. Set to
|
|
963
|
+
/** Shows whether the button is active. Set to _true_ by default. */
|
|
950
964
|
isActive: boolean;
|
|
951
|
-
/**
|
|
965
|
+
/**
|
|
966
|
+
* **Bot API 7.10+**
|
|
967
|
+
*
|
|
968
|
+
* Shows whether the button has a shine effect. Set to _false_ by default.
|
|
969
|
+
*/
|
|
952
970
|
hasShineEffect: boolean;
|
|
953
971
|
/**
|
|
972
|
+
* **Bot API 7.10+**
|
|
973
|
+
*
|
|
954
974
|
* Position of the secondary button. Not defined for the main button.
|
|
955
|
-
* It applies only if both the main and secondary buttons are visible.
|
|
975
|
+
* It applies only if both the main and secondary buttons are visible.
|
|
976
|
+
* Set to _left_ by default.
|
|
977
|
+
*
|
|
956
978
|
* Supported values:
|
|
957
|
-
* -
|
|
958
|
-
* -
|
|
959
|
-
* -
|
|
960
|
-
* -
|
|
979
|
+
* - _left_, displayed to the left of the main button,
|
|
980
|
+
* - _right_, displayed to the right of the main button,
|
|
981
|
+
* - _top_, displayed above the main button,
|
|
982
|
+
* - _bottom_, displayed below the main button.
|
|
961
983
|
*/
|
|
962
984
|
position?: "left" | "right" | "top" | "bottom";
|
|
963
|
-
/**
|
|
985
|
+
/** _Readonly._ Shows whether the button is displaying a loading indicator. */
|
|
964
986
|
isProgressVisible: boolean;
|
|
965
987
|
/** A method to set the button text. */
|
|
966
988
|
setText(text: string): BottomButton;
|
|
967
989
|
/**
|
|
968
|
-
* A method that sets the button press event handler.
|
|
969
|
-
* Telegram.WebApp.onEvent('mainButtonClicked', callback)
|
|
990
|
+
* A method that sets the button's press event handler.
|
|
991
|
+
* An alias for `Telegram.WebApp.onEvent('mainButtonClicked', callback)`
|
|
970
992
|
*/
|
|
971
993
|
onClick(callback: () => void): BottomButton;
|
|
972
|
-
/**
|
|
994
|
+
/**
|
|
995
|
+
* A method that removes the button's press event handler.
|
|
996
|
+
* An alias for `Telegram.WebApp.offEvent('mainButtonClicked', callback)`
|
|
997
|
+
*/
|
|
973
998
|
offClick(callback: () => void): BottomButton;
|
|
974
999
|
/**
|
|
975
|
-
* A method to make the button visible.
|
|
976
|
-
*
|
|
977
|
-
* the Web App
|
|
1000
|
+
* A method to make the button visible.
|
|
1001
|
+
*
|
|
1002
|
+
* _Note that opening the Web App from
|
|
1003
|
+
* the {@link https://core.telegram.org/bots/webapps#launching-mini-apps-from-the-attachment-menu | attachment menu}
|
|
1004
|
+
* hides the main button until the user interacts with the Web App interface._
|
|
978
1005
|
*/
|
|
979
1006
|
show(): BottomButton;
|
|
980
1007
|
/** A method to hide the button. */
|
|
@@ -987,7 +1014,7 @@ export interface BottomButton {
|
|
|
987
1014
|
* A method to show a loading indicator on the button. It is recommended to
|
|
988
1015
|
* display loading progress if the action tied to the button may take a long
|
|
989
1016
|
* time. By default, the button is disabled while the action is in progress.
|
|
990
|
-
* If the parameter leaveActive=true is passed, the button remains enabled.
|
|
1017
|
+
* If the parameter `leaveActive=true` is passed, the button remains enabled.
|
|
991
1018
|
*/
|
|
992
1019
|
showProgress(leaveActive?: boolean): BottomButton;
|
|
993
1020
|
/** A method to hide the loading indicator. */
|
|
@@ -995,23 +1022,36 @@ export interface BottomButton {
|
|
|
995
1022
|
/**
|
|
996
1023
|
* A method to set the button parameters. The params parameter is an object
|
|
997
1024
|
* containing one or several fields that need to be changed:
|
|
1025
|
+
* - icon_custom_emoji_id - `Bot API 9.5+` button icon emoji id;
|
|
998
1026
|
* - text - button text;
|
|
999
1027
|
* - color - button color;
|
|
1000
1028
|
* - text_color - button text color;
|
|
1029
|
+
* - has_shine_effect - `Bot API 7.10+` enable shine effect;
|
|
1030
|
+
* - position - position of the secondary button;
|
|
1001
1031
|
* - is_active - enable the button;
|
|
1002
1032
|
* - is_visible - show the button.
|
|
1003
1033
|
*/
|
|
1004
|
-
setParams(params:
|
|
1034
|
+
setParams(params: BottomButtonParams): BottomButton;
|
|
1005
1035
|
}
|
|
1006
1036
|
|
|
1007
|
-
export interface
|
|
1037
|
+
export interface BottomButtonParams {
|
|
1038
|
+
/**
|
|
1039
|
+
* **Bot API 9.5+**
|
|
1040
|
+
*
|
|
1041
|
+
* button icon emoji id
|
|
1042
|
+
*/
|
|
1043
|
+
icon_custom_emoji_id?: string;
|
|
1008
1044
|
/** button text */
|
|
1009
1045
|
text?: string;
|
|
1010
1046
|
/** button color */
|
|
1011
1047
|
color?: Color;
|
|
1012
1048
|
/** button text color */
|
|
1013
1049
|
text_color?: Color;
|
|
1014
|
-
/**
|
|
1050
|
+
/**
|
|
1051
|
+
* **Bot API 7.10+**
|
|
1052
|
+
*
|
|
1053
|
+
* enable shine effect
|
|
1054
|
+
*/
|
|
1015
1055
|
has_shine_effect?: boolean;
|
|
1016
1056
|
/** position of the secondary button */
|
|
1017
1057
|
position?: "left" | "right" | "top" | "bottom";
|
telegram-web-app/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/telegram-web-app",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.5.0",
|
|
4
4
|
"description": "TypeScript definitions for telegram-web-app",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/telegram-web-app",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,6 +36,6 @@
|
|
|
36
36
|
"scripts": {},
|
|
37
37
|
"dependencies": {},
|
|
38
38
|
"peerDependencies": {},
|
|
39
|
-
"typesPublisherContentHash": "
|
|
39
|
+
"typesPublisherContentHash": "2701a4ce49f8447e59bf026b0b3b99b9446a2461993d76c4e4ea186fd712936e",
|
|
40
40
|
"typeScriptVersion": "5.2"
|
|
41
41
|
}
|