Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions types/telegram-web-app/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,13 @@ export interface WebApp {
* called and the invoice status will be passed as the first argument.
*/
openInvoice(url: string, callback: (status: "paid" | "cancelled" | "failed" | "pending") => void): void;
/**
* **Bot API 9.1+**
*
* A method that hides the on-screen keyboard, if it is currently visible.
* Does nothing if the keyboard is not active.
*/
hideKeyboard(): void;
/**
* 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
Expand Down Expand Up @@ -795,23 +802,31 @@ export interface BackButton {
*/
isVisible: boolean;
/**
* A method that sets the button press event handler. An alias for
* Telegram.WebApp.onEvent('backButtonClicked', callback)
* **Bot API 6.1+**
*
* A method that sets the button press event handler.
* An alias for `Telegram.WebApp.onEvent('backButtonClicked', callback)`
*/
onClick(callback: () => void): BackButton;
/**
* A method that removes the button press event handler. An alias for
* Telegram.WebApp.offEvent('backButtonClicked', callback)
* **Bot API 6.1+**
*
* A method that removes the button press event handler.
* An alias for `Telegram.WebApp.offEvent('backButtonClicked', callback)`
*/
offClick(callback: () => void): BackButton;
/**
* **Bot API 6.1+**
*
* A method to make the button active and visible.
*/
show(): void;
show(): BackButton;
/**
* **Bot API 6.1+**
*
* A method to hide the button.
*/
hide(): void;
hide(): BackButton;
}

/**
Expand Down
6 changes: 5 additions & 1 deletion types/telegram-web-app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@types/telegram-web-app",
"version": "9.0.9999",
"version": "9.1.9999",
"nonNpm": "conflict",
"nonNpmDescription": "telegram-web-app",
"projects": ["https://telegram.org/js/telegram-web-app.js"],
Expand All @@ -20,6 +20,10 @@
{
"name": "deptyped",
"githubUsername": "deptyped"
},
{
"name": "sidorko",
"githubUsername": "sidorko"
}
]
}
2 changes: 2 additions & 0 deletions types/telegram-web-app/telegram-web-app-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ app.onEvent("viewportChanged", (e) => {
else console.log("Changing, currently at ", app.viewportHeight);
});

app.hideKeyboard();

app.showPopup(
{
message: "Hello",
Expand Down
5 changes: 5 additions & 0 deletions types/zerobounce__zero-bounce-sdk/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!**/*.d.ts
!**/*.d.cts
!**/*.d.mts
!**/*.d.*.ts
Loading