add shortcuts for telegram and webApp in webapps

This commit is contained in:
InsanusMokrassar 2022-04-19 15:17:07 +06:00
parent c74df3960c
commit 0a27d9bf28
1 changed files with 7 additions and 0 deletions

View File

@ -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