diff --git a/types/telegram-web-app/index.d.ts b/types/telegram-web-app/index.d.ts index 79ea147d6a4aec..26eafdc6b690d4 100644 --- a/types/telegram-web-app/index.d.ts +++ b/types/telegram-web-app/index.d.ts @@ -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 diff --git a/types/telegram-web-app/package.json b/types/telegram-web-app/package.json index 6e079b07cc7638..db11de3f7ed09c 100644 --- a/types/telegram-web-app/package.json +++ b/types/telegram-web-app/package.json @@ -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"], diff --git a/types/telegram-web-app/telegram-web-app-tests.ts b/types/telegram-web-app/telegram-web-app-tests.ts index b0aeedd3de9c13..b490fbe5e40b3a 100644 --- a/types/telegram-web-app/telegram-web-app-tests.ts +++ b/types/telegram-web-app/telegram-web-app-tests.ts @@ -27,6 +27,8 @@ app.onEvent("viewportChanged", (e) => { else console.log("Changing, currently at ", app.viewportHeight); }); +app.hideKeyboard(); + app.showPopup( { message: "Hello",