Skip to main content

telegram_webapp_sdk/
lib.rs

1#![warn(missing_docs)]
2// SPDX-FileCopyrightText: 2025-2026 RAprogramm <andrey.rozanov.vl@gmail.com>
3// SPDX-License-Identifier: MIT
4#![doc = include_str!("../README.md")]
5#![cfg_attr(all(docsrs, has_doc_cfg), feature(doc_cfg))]
6#![cfg_attr(all(docsrs, not(has_doc_cfg), has_doc_auto_cfg), feature(doc_auto_cfg))]
7
8/// High-level, ergonomic wrappers over the Telegram WebApp JavaScript API.
9pub mod api;
10/// Core primitives: launch parameters, init data, theme parameters and the
11/// global [`core::context::TelegramContext`].
12pub mod core;
13/// Thin helpers for interacting with the browser DOM from WebAssembly.
14pub mod dom;
15/// Logging helpers that forward messages to the browser console.
16pub mod logger;
17
18#[cfg(feature = "mock")]
19pub mod mock;
20/// Utility helpers, including environment detection for the Telegram WebApp.
21pub mod utils;
22/// Safe Rust bindings for `window.Telegram.WebApp` and its sub-objects.
23pub mod webapp;
24#[cfg(feature = "macros")]
25pub use inventory;
26pub use webapp::TelegramWebApp;
27#[cfg(feature = "macros")]
28mod macros;
29/// Registry of routable pages collected via the `#[page]` macro.
30#[cfg(feature = "macros")]
31pub mod pages;
32#[cfg(feature = "macros")]
33#[allow(unused_imports)]
34pub use crate::macros::*;
35pub mod router;
36
37/// Yew components and hooks for building Telegram mini apps.
38#[cfg(feature = "yew")]
39pub mod yew;
40
41/// Leptos components and hooks for building Telegram mini apps.
42#[cfg(feature = "leptos")]
43pub mod leptos;