@types/telegram-web-app 6.4.0 → 6.7.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 +2 -2
- telegram-web-app/index.d.ts +25 -2
- telegram-web-app/package.json +8 -3
telegram-web-app/README.md
CHANGED
|
@@ -8,9 +8,9 @@ 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: Wed,
|
|
11
|
+
* Last updated: Wed, 26 Apr 2023 21:02:48 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `Telegram`
|
|
14
14
|
|
|
15
15
|
# Credits
|
|
16
|
-
These definitions were written by [KnorpelSenf](https://github.com/KnorpelSenf),
|
|
16
|
+
These definitions were written by [KnorpelSenf](https://github.com/KnorpelSenf), [MKRhere](https://github.com/MKRhere), and [deptyped](https://github.com/deptyped).
|
telegram-web-app/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
// Type definitions for non-npm package telegram-web-app 6.
|
|
1
|
+
// Type definitions for non-npm package telegram-web-app 6.7
|
|
2
2
|
// Project: https://telegram.org/js/telegram-web-app.js
|
|
3
|
-
// Definitions by: KnorpelSenf <https://github.com/KnorpelSenf
|
|
3
|
+
// Definitions by: KnorpelSenf <https://github.com/KnorpelSenf>
|
|
4
|
+
// MKRhere <https://github.com/MKRhere>
|
|
5
|
+
// deptyped <https://github.com/deptyped>
|
|
4
6
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
5
7
|
|
|
6
8
|
declare var Telegram: Telegram;
|
|
@@ -168,6 +170,15 @@ interface WebApp {
|
|
|
168
170
|
* This method is only available for Web Apps launched via a Keyboard button.
|
|
169
171
|
*/
|
|
170
172
|
sendData(data: string): void;
|
|
173
|
+
/**
|
|
174
|
+
* A method that inserts the bot's username and the specified inline query in the current chat's input field.
|
|
175
|
+
* Query may be empty, in which case only the bot's username will be inserted.
|
|
176
|
+
* If an optional choose_chat_types parameter was passed, the client prompts the user to choose a specific chat,
|
|
177
|
+
* then opens that chat and inserts the bot's username and the specified inline query in the input field.
|
|
178
|
+
* You can specify which types of chats the user will be able to choose from.
|
|
179
|
+
* It can be one or more of the following types: users, bots, groups, channels.
|
|
180
|
+
*/
|
|
181
|
+
switchInlineQuery(query: string, choose_chat_types?: Array<'users' | 'bots' | 'groups' | 'channels'>): void;
|
|
171
182
|
/**
|
|
172
183
|
* A method that opens a link in an external browser.
|
|
173
184
|
* The Web App will not be closed.
|
|
@@ -507,6 +518,18 @@ interface WebAppInitData {
|
|
|
507
518
|
* only for Web Apps launched via the attachment menu.
|
|
508
519
|
*/
|
|
509
520
|
chat?: WebAppChat;
|
|
521
|
+
/**
|
|
522
|
+
* Type of the chat from which the Web App was opened.
|
|
523
|
+
* Can be either “sender” for a private chat with the user opening the link,
|
|
524
|
+
* “private”, “group”, “supergroup”, or “channel”.
|
|
525
|
+
* Returned only for Web Apps launched from direct links.
|
|
526
|
+
*/
|
|
527
|
+
chat_type?: 'sender' | 'private' | 'group' | 'supergroup' | 'channel';
|
|
528
|
+
/**
|
|
529
|
+
* Global identifier, uniquely corresponding to the chat from which the Web App was opened.
|
|
530
|
+
* Returned only for Web Apps launched from a direct link.
|
|
531
|
+
*/
|
|
532
|
+
chat_instance?: string;
|
|
510
533
|
/**
|
|
511
534
|
* The value of the startattach parameter, passed via link. Only returned for
|
|
512
535
|
* Web Apps when launched from the attachment menu via link. The value of the
|
telegram-web-app/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/telegram-web-app",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.7.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",
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
"name": "MKRhere",
|
|
15
15
|
"url": "https://github.com/MKRhere",
|
|
16
16
|
"githubUsername": "MKRhere"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "deptyped",
|
|
20
|
+
"url": "https://github.com/deptyped",
|
|
21
|
+
"githubUsername": "deptyped"
|
|
17
22
|
}
|
|
18
23
|
],
|
|
19
24
|
"main": "",
|
|
@@ -25,6 +30,6 @@
|
|
|
25
30
|
},
|
|
26
31
|
"scripts": {},
|
|
27
32
|
"dependencies": {},
|
|
28
|
-
"typesPublisherContentHash": "
|
|
29
|
-
"typeScriptVersion": "4.
|
|
33
|
+
"typesPublisherContentHash": "087c84405ec21f5ea2663c05b6ff92799f58e740cd633c419e95f197342d36bc",
|
|
34
|
+
"typeScriptVersion": "4.3"
|
|
30
35
|
}
|