add shortcuts for telegram and webApp in webapps

This commit is contained in:
InsanusMokrassar committed 2022-04-23 12:34:26 +06:00
1 parent c74df3960c
commit 0a27d9bf28
1 file changed
+7
@@ -1,5 +1,6 @@
package dev.inmo.tgbotapi.webapps
import kotlinx.browser.window
import org.w3c.dom.Window
external interface Telegram {
@@ -8,3 +9,9 @@ external interface Telegram {
val Window.Telegram
get() = asDynamic().Telegram.unsafeCast<Telegram>()
val telegram: Telegram
get() = window.Telegram
val webApp: WebApp
get() = telegram.WebApp