diff --git a/data/table-data.json b/data/table-data.json index 54ac45e..f766042 100644 --- a/data/table-data.json +++ b/data/table-data.json @@ -3,12 +3,12 @@ { "0": "initData", "1": "String", - "2": "A string with raw data transferred to the Web App, convenient for validating data.
WARNING: Validate data from this field before using it on the bot's server." + "2": "A string with raw data transferred to the Mini App, convenient for validating data.
WARNING: Validate data from this field before using it on the bot's server." }, { "0": "initDataUnsafe", "1": "WebAppInitData", - "2": "An object with input data transferred to the Web App.
WARNING: Data from this field should not be trusted. You should only use data from initData on the bot's server and only after it has been validated." + "2": "An object with input data transferred to the Mini App.
WARNING: Data from this field should not be trusted. You should only use data from initData on the bot's server and only after it has been validated." }, { "0": "version", @@ -33,17 +33,17 @@ { "0": "isExpanded", "1": "Boolean", - "2": "True, if the Web App is expanded to the maximum available height. False, if the Web App occupies part of the screen and can be expanded to the full height using the expand() method." + "2": "True, if the Mini App is expanded to the maximum available height. False, if the Mini App occupies part of the screen and can be expanded to the full height using the expand() method." }, { "0": "viewportHeight", "1": "Float", - "2": "The current height of the visible area of the Web App. Also available in CSS as the variable var(--tg-viewport-height).

The application can display just the top part of the Web App, with its lower part remaining outside the screen area. From this position, the user can “pull” the Web App to its maximum height, while the bot can do the same by calling the expand() method. As the position of the Web App changes, the current height value of the visible area will be updated in real time.

Please note that the refresh rate of this value is not sufficient to smoothly follow the lower border of the window. It should not be used to pin interface elements to the bottom of the visible area. It's more appropriate to use the value of the viewportStableHeight field for this purpose." + "2": "The current height of the visible area of the Mini App. Also available in CSS as the variable var(--tg-viewport-height).

The application can display just the top part of the Mini App, with its lower part remaining outside the screen area. From this position, the user can “pull” the Mini App to its maximum height, while the bot can do the same by calling the expand() method. As the position of the Mini App changes, the current height value of the visible area will be updated in real time.

Please note that the refresh rate of this value is not sufficient to smoothly follow the lower border of the window. It should not be used to pin interface elements to the bottom of the visible area. It's more appropriate to use the value of the viewportStableHeight field for this purpose." }, { "0": "viewportStableHeight", "1": "Float", - "2": "The height of the visible area of the Web App in its last stable state. Also available in CSS as a variable var(--tg-viewport-stable-height).

The application can display just the top part of the Web App, with its lower part remaining outside the screen area. From this position, the user can “pull” the Web App to its maximum height, while the bot can do the same by calling the expand() method. Unlike the value of viewportHeight, the value of viewportStableHeight does not change as the position of the Web App changes with user gestures or during animations. The value of viewportStableHeight will be updated after all gestures and animations are completed and the Web App reaches its final size.

Note the event viewportChanged with the passed parameter isStateStable=true, which will allow you to track when the stable state of the height of the visible area changes." + "2": "The height of the visible area of the Mini App in its last stable state. Also available in CSS as a variable var(--tg-viewport-stable-height).

The application can display just the top part of the Mini App, with its lower part remaining outside the screen area. From this position, the user can “pull” the Mini App to its maximum height, while the bot can do the same by calling the expand() method. Unlike the value of viewportHeight, the value of viewportStableHeight does not change as the position of the Mini App changes with user gestures or during animations. The value of viewportStableHeight will be updated after all gestures and animations are completed and the Mini App reaches its final size.

Note the event viewportChanged with the passed parameter isStateStable=true, which will allow you to track when the stable state of the height of the visible area changes." }, { "0": "headerColor", @@ -58,23 +58,28 @@ { "0": "isClosingConfirmationEnabled", "1": "Boolean", - "2": "True, if the confirmation dialog is enabled while the user is trying to close the Web App. False, if the confirmation dialog is disabled." + "2": "True, if the confirmation dialog is enabled while the user is trying to close the Mini App. False, if the confirmation dialog is disabled." }, { "0": "BackButton", "1": "BackButton", - "2": "An object for controlling the back button which can be displayed in the header of the Web App in the Telegram interface." + "2": "An object for controlling the back button which can be displayed in the header of the Mini App in the Telegram interface." }, { "0": "MainButton", "1": "MainButton", - "2": "An object for controlling the main button, which is displayed at the bottom of the Web App in the Telegram interface." + "2": "An object for controlling the main button, which is displayed at the bottom of the Mini App in the Telegram interface." }, { "0": "HapticFeedback", "1": "HapticFeedback", "2": "An object for controlling haptic feedback." }, + { + "0": "CloudStorage NEW", + "1": "CloudStorage", + "2": "An object for controlling cloud storage." + }, { "0": "isVersionAtLeast(version)", "1": "Function", @@ -83,27 +88,27 @@ { "0": "setHeaderColor(color)", "1": "Function", - "2": "Bot API 6.1+ A method that sets the app header color. You can only pass Telegram.WebApp.themeParams.bg_color or Telegram.WebApp.themeParams.secondary_bg_color as a color or you can use keywords bg_color, secondary_bg_color instead." + "2": "Bot API 6.1+ A method that sets the app header color in the #RRGGBB format. You can also use keywords bg_color and secondary_bg_color.

Up to Bot API 6.9 You can only pass Telegram.WebApp.themeParams.bg_color or Telegram.WebApp.themeParams.secondary_bg_color as a color or bg_color, secondary_bg_color keywords." }, { "0": "setBackgroundColor(color)", "1": "Function", - "2": "Bot API 6.1+ A method that sets the app background color in the #RRGGBB format or you can use keywords bg_color, secondary_bg_color instead." + "2": "Bot API 6.1+ A method that sets the app background color in the #RRGGBB format. You can also use keywords bg_color and secondary_bg_color." }, { "0": "enableClosingConfirmation()", "1": "Function", - "2": "Bot API 6.2+ A method that enables a confirmation dialog while the user is trying to close the Web App." + "2": "Bot API 6.2+ A method that enables a confirmation dialog while the user is trying to close the Mini App." }, { "0": "disableClosingConfirmation()", "1": "Function", - "2": "Bot API 6.2+ A method that disables the confirmation dialog while the user is trying to close the Web App." + "2": "Bot API 6.2+ A method that disables the confirmation dialog while the user is trying to close the Mini App." }, { "0": "onEvent(eventType, eventHandler)", "1": "Function", - "2": "A method that sets the app event handler. Check the list of available events." + "2": "A method that sets the app event handler. Check the list of available events." }, { "0": "offEvent(eventType, eventHandler)", @@ -113,32 +118,32 @@ { "0": "sendData(data)", "1": "Function", - "2": "A method used to send data to the bot. When this method is called, a service message is sent to the bot containing the data data of the length up to 4096 bytes, and the Web App is closed. See the field web_app_data in the class Message.

This method is only available for Web Apps launched via a Keyboard button." + "2": "A method used to send data to the bot. When this method is called, a service message is sent to the bot containing the data data of the length up to 4096 bytes, and the Mini App is closed. See the field web_app_data in the class Message.

This method is only available for Mini Apps launched via a Keyboard button." }, { - "0": "switchInlineQuery(query[, choose_chat_types]) NEW", + "0": "switchInlineQuery(query[, choose_chat_types])", "1": "Function", "2": "Bot API 6.7+ A method that inserts the bot's username and the specified inline query in the current chat's input field. Query may be empty, in which case only the bot's username will be inserted. If an optional choose_chat_types parameter was passed, the client prompts the user to choose a specific chat, then opens that chat and inserts the bot's username and the specified inline query in the input field. You can specify which types of chats the user will be able to choose from. It can be one or more of the following types: users, bots, groups, channels." }, { "0": "openLink(url[, options])", "1": "Function", - "2": "A method that opens a link in an external browser. The Web App will not be closed.
Bot API 6.4+ If the optional options parameter is passed with the field try_instant_view=true, the link will be opened in Instant View mode if possible.

Note that this method can be called only in response to user interaction with the Web App interface (e.g. a click inside the Web App or on the main button)" + "2": "A method that opens a link in an external browser. The Mini App will not be closed.
Bot API 6.4+ If the optional options parameter is passed with the field try_instant_view=true, the link will be opened in Instant View mode if possible.

Note that this method can be called only in response to user interaction with the Mini App interface (e.g. a click inside the Mini App or on the main button)" }, { "0": "openTelegramLink(url)", "1": "Function", - "2": "A method that opens a telegram link inside Telegram app. The Web App will be closed." + "2": "A method that opens a telegram link inside Telegram app. The Mini App will be closed." }, { "0": "openInvoice(url[, callback])", "1": "Function", - "2": "Bot API 6.1+ A method that opens an invoice using the link url. The Web App will receive the event invoiceClosed when the invoice is closed. If an optional callback parameter was passed, the callback function will be called and the invoice status will be passed as the first argument." + "2": "Bot API 6.1+ A method that opens an invoice using the link url. The Mini App will receive the event invoiceClosed when the invoice is closed. If an optional callback parameter was passed, the callback function will be called and the invoice status will be passed as the first argument." }, { "0": "showPopup(params[, callback])", "1": "Function", - "2": "Bot API 6.2+ A method that shows a native popup described by the params argument of the type PopupParams. The Web App will receive the event popupClosed when the popup is closed. If an optional callback parameter was passed, the callback function will be called and the field id of the pressed button will be passed as the first argument." + "2": "Bot API 6.2+ A method that shows a native popup described by the params argument of the type PopupParams. The Mini App will receive the event popupClosed when the popup is closed. If an optional callback parameter was passed, the callback function will be called and the field id of the pressed button will be passed as the first argument." }, { "0": "showAlert(message[, callback])", @@ -153,32 +158,42 @@ { "0": "showScanQrPopup(params[, callback])", "1": "Function", - "2": "Bot API 6.4+ A method that shows a native popup for scanning a QR code described by the params argument of the type ScanQrPopupParams. The Web App will receive the event qrTextReceived every time the scanner catches a code with text data. If an optional callback parameter was passed, the callback function will be called and the text from the QR code will be passed as the first argument. Returning true inside this callback function causes the popup to be closed." + "2": "Bot API 6.4+ A method that shows a native popup for scanning a QR code described by the params argument of the type ScanQrPopupParams. The Mini App will receive the event qrTextReceived every time the scanner catches a code with text data. If an optional callback parameter was passed, the callback function will be called and the text from the QR code will be passed as the first argument. Returning true inside this callback function causes the popup to be closed." }, { "0": "closeScanQrPopup()", "1": "Function", - "2": "Bot API 6.4+ A method that closes the native popup for scanning a QR code opened with the showScanQrPopup method. Run it if you received valid data in the event qrTextReceived." + "2": "Bot API 6.4+ A method that closes the native popup for scanning a QR code opened with the showScanQrPopup method. Run it if you received valid data in the event qrTextReceived." }, { "0": "readTextFromClipboard([callback])", "1": "Function", - "2": "Bot API 6.4+ A method that requests text from the clipboard. The Web App will receive the event clipboardTextReceived. If an optional callback parameter was passed, the callback function will be called and the text from the clipboard will be passed as the first argument.

Note: this method can be called only for Web Apps launched from the attachment menu and only in response to a user interaction with the Web App interface (e.g. a click inside the Web App or on the main button)." + "2": "Bot API 6.4+ A method that requests text from the clipboard. The Mini App will receive the event clipboardTextReceived. If an optional callback parameter was passed, the callback function will be called and the text from the clipboard will be passed as the first argument.

Note: this method can be called only for Mini Apps launched from the attachment menu and only in response to a user interaction with the Mini App interface (e.g. a click inside the Mini App or on the main button)." + }, + { + "0": "requestWriteAccess([callback]) NEW", + "1": "Function", + "2": "Bot API 6.9+ A method that shows a native popup requesting permission for the bot to send messages to the user. If an optional callback parameter was passed, the callback function will be called when the popup is closed and the first argument will be a boolean indicating whether the user granted this access." + }, + { + "0": "requestContact([callback]) NEW", + "1": "Function", + "2": "Bot API 6.9+ A method that shows a native popup prompting the user for their phone number. If an optional callback parameter was passed, the callback function will be called when the popup is closed and the first argument will be a boolean indicating whether the user shared its phone number." }, { "0": "ready()", "1": "Function", - "2": "A method that informs the Telegram app that the Web App is ready to be displayed.
It is recommended to call this method as early as possible, as soon as all essential interface elements are loaded. Once this method is called, the loading placeholder is hidden and the Web App is shown.
If the method is not called, the placeholder will be hidden only when the page is fully loaded." + "2": "A method that informs the Telegram app that the Mini App is ready to be displayed.
It is recommended to call this method as early as possible, as soon as all essential interface elements are loaded. Once this method is called, the loading placeholder is hidden and the Mini App is shown.
If the method is not called, the placeholder will be hidden only when the page is fully loaded." }, { "0": "expand()", "1": "Function", - "2": "A method that expands the Web App to the maximum available height. To find out if the Web App is expanded to the maximum height, refer to the value of the Telegram.WebApp.isExpanded parameter" + "2": "A method that expands the Mini App to the maximum available height. To find out if the Mini App is expanded to the maximum height, refer to the value of the Telegram.WebApp.isExpanded parameter" }, { "0": "close()", "1": "Function", - "2": "A method that closes the Web App." + "2": "A method that closes the Mini App." } ], "eventsData": [ @@ -188,7 +203,7 @@ }, { "0": "viewportChanged", - "1": "Occurs when the visible section of the Web App is changed.
eventHandler receives an object with the single field isStateStable. If isStateStable is true, the resizing of the Web App is finished. If it is false, the resizing is ongoing (the user is expanding or collapsing the Web App or an animated object is playing). The current value of the visible section’s height is available in this.viewportHeight." + "1": "Occurs when the visible section of the Mini App is changed.
eventHandler receives an object with the single field isStateStable. If isStateStable is true, the resizing of the Mini App is finished. If it is false, the resizing is ongoing (the user is expanding or collapsing the Mini App or an animated object is playing). The current value of the visible section’s height is available in this.viewportHeight." }, { "0": "mainButtonClicked", @@ -216,7 +231,15 @@ }, { "0": "clipboardTextReceived", - "1": "Bot API 6.4+ Occurrs when the readTextFromClipboard method is called.
eventHandler receives an object with the single field data containing text data from the clipboard. If the clipboard contains non-text data, the field data will be an empty string. If the Web App has no access to the clipboard, the field data will be null." + "1": "Bot API 6.4+ Occurrs when the readTextFromClipboard method is called.
eventHandler receives an object with the single field data containing text data from the clipboard. If the clipboard contains non-text data, the field data will be an empty string. If the Mini App has no access to the clipboard, the field data will be null." + }, + { + "0": "writeAccessRequested NEW", + "1": "Bot API 6.9+ Occurs when the write permission was requested.
eventHandler receives an object with the single field status containing one of the statuses:
- allowed – user granted write permission to the bot,
- cancelled – user declined this request." + }, + { + "0": "contactRequested NEW", + "1": "Bot API 6.9+ Occurrs when the user's phone number was requested.
eventHandler receives an object with the single field status containing one of the statuses:
- sent – user shared their phone number with the bot,
- cancelled – user declined this request." } ] } \ No newline at end of file diff --git a/src/lib/FunctionPlayground.svelte b/src/lib/FunctionPlayground.svelte index 83d47fb..f1f7399 100644 --- a/src/lib/FunctionPlayground.svelte +++ b/src/lib/FunctionPlayground.svelte @@ -24,7 +24,7 @@ ? (...props: unknown[]) => { inputs[name] = JSON.stringify(props); } - : inputs[name] + : inputs[argName] ); updateWebAppStore();