@types/telegram-web-app 7.3.1 → 7.8.1

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.
@@ -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: Sun, 07 Jul 2024 16:36:47 GMT
11
+ * Last updated: Tue, 27 Aug 2024 08:38:05 GMT
12
12
  * Dependencies: none
13
13
 
14
14
  # Credits
@@ -226,7 +226,7 @@ interface WebApp {
226
226
  */
227
227
  openInvoice(
228
228
  url: string,
229
- callback: (url: string, status: "paid" | "cancelled" | "failed" | "pending") => void,
229
+ callback: (status: "paid" | "cancelled" | "failed" | "pending") => void,
230
230
  ): void;
231
231
  /**
232
232
  * A method that shows a native popup described by the params argument of
@@ -268,6 +268,10 @@ interface WebApp {
268
268
  * event qrTextReceived.
269
269
  */
270
270
  closeScanQrPopup(): void;
271
+ /** A method that opens the native story editor with the media specified in
272
+ * the media_url parameter as an HTTPS URL. An optional params argument of
273
+ * the type StoryShareParams describes additional sharing settings. */
274
+ shareToStory(media_url: string, params?: StoryShareParams): void;
271
275
  /**
272
276
  * A method that requests text from the clipboard. The Web App will receive
273
277
  * the event clipboardTextReceived. If an optional callback parameter was
@@ -1046,3 +1050,22 @@ interface RequestContactResponseCancelled {
1046
1050
  }
1047
1051
 
1048
1052
  type RequestContactResponse = RequestContactResponseSent | RequestContactResponseCancelled;
1053
+
1054
+ /** This object describes additional sharing settings for the native story
1055
+ * editor. */
1056
+ interface StoryShareParams {
1057
+ /** The caption to be added to the media, 0-200 characters for regular users
1058
+ * and 0-2048 characters for premium subscribers. */
1059
+ text?: string;
1060
+ /** An object that describes a widget link to be included in the story. Note
1061
+ * that only premium subscribers can post stories with links. */
1062
+ widget_link?: StoryWidgetLink;
1063
+ }
1064
+
1065
+ /** This object describes a widget link to be included in the story. */
1066
+ interface StoryWidgetLink {
1067
+ /** The URL to be included in the story. */
1068
+ url: string;
1069
+ /** The name to be displayed for the widget link, 0-48 characters. */
1070
+ name?: string;
1071
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/telegram-web-app",
3
- "version": "7.3.1",
3
+ "version": "7.8.1",
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",
@@ -30,6 +30,6 @@
30
30
  },
31
31
  "scripts": {},
32
32
  "dependencies": {},
33
- "typesPublisherContentHash": "9fcc5a91b3a09ca84a2f4cad0107ca63464a781a4cc3dfbf0a3eb9aa5d908916",
33
+ "typesPublisherContentHash": "3f9df69fcf7dbdf27910ae44891131cb0bbdfa364e1428ffd8371500c55a5f4c",
34
34
  "typeScriptVersion": "4.8"
35
35
  }