1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// SPDX-FileCopyrightText: 2025 RAprogramm <andrey.rozanov.vl@gmail.com>
// SPDX-License-Identifier: MIT
/// [`back_button::BackButton`] component driving `WebApp.BackButton`.
/// [`bottom_button::BottomButton`] component driving the main/secondary button.
/// [`safe_area::use_safe_area`] hook exposing safe-area insets reactively.
/// [`settings_button::SettingsButton`] component driving
/// `WebApp.SettingsButton`.
/// [`theme::use_theme`] hook exposing Telegram theme parameters reactively.
/// [`viewport::use_viewport`] hook exposing viewport size and state reactively.
pub use BackButton;
pub use BottomButton;
use provide_context;
pub use ;
pub use SettingsButton;
pub use ;
pub use ;
use JsValue;
use crate;
/// Provides the [`TelegramContext`] to the Leptos reactive system.
///
/// # Errors
///
/// Returns an error if the global context has not been initialized with
/// [`TelegramContext::init`].
///
/// # Examples
///
/// ```no_run
/// use leptos::prelude::*;
/// use telegram_webapp_sdk::{core::context::TelegramContext, leptos::provide_telegram_context};
///
/// #[component]
/// fn App() -> impl IntoView {
/// provide_telegram_context().expect("context");
/// let ctx = use_context::<TelegramContext>().expect("context");
/// view! { <span>{ ctx.init_data.auth_date }</span> }
/// }
/// ```