From 016cfcb7cd25605f62aa6c16f352e5dcc49fb8fa Mon Sep 17 00:00:00 2001 From: SuLG-k Date: Thu, 11 Jul 2024 20:33:59 +0700 Subject: [PATCH 1/2] remove internal modifier from MainButton.onClick and MainButton.offClick --- .../src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/MainButton.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/MainButton.kt b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/MainButton.kt index 2cb4ab06dc..984d3221e0 100644 --- a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/MainButton.kt +++ b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/MainButton.kt @@ -22,8 +22,8 @@ external class MainButton { fun showProgress(leaveActive: Boolean = definedExternally): MainButton fun hideProgress(): MainButton - internal fun onClick(eventHandler: () -> Unit): MainButton - internal fun offClick(eventHandler: () -> Unit): MainButton + fun onClick(eventHandler: () -> Unit): MainButton + fun offClick(eventHandler: () -> Unit): MainButton internal fun setParams(params: Json): MainButton } From 40613e3418cacf4ffabe60ec65bf739d5ca2e270 Mon Sep 17 00:00:00 2001 From: SuLG-k Date: Thu, 11 Jul 2024 20:35:22 +0700 Subject: [PATCH 2/2] add @Deprecated on MainButton.onClick(EventHandler) --- .../src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/MainButton.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/MainButton.kt b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/MainButton.kt index 984d3221e0..502879a4b9 100644 --- a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/MainButton.kt +++ b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/MainButton.kt @@ -36,6 +36,7 @@ data class MainButtonParams( val isVisible: Boolean? = null ) +@Deprecated(message="Use onClick without EventHandler") fun MainButton.onClick(eventHandler: EventHandler) = onClick { val that = js("this").unsafeCast() that.eventHandler()