// SPDX-FileCopyrightText: 2025 RAprogramm <andrey.rozanov.vl@gmail.com>
// SPDX-License-Identifier: MIT
use JsValue;
use crateTelegramContext;
/// Accesses the global [`TelegramContext`] and applies `f` to it.
///
/// This is the fallible counterpart to [`TelegramContext::get`]: instead of
/// returning [`None`] when the context has not been initialized, it returns a
/// [`JsValue`] error suitable for propagation across the WASM boundary.
///
/// # Errors
///
/// Returns `Err(JsValue)` if the global context has not been initialized via
/// [`crate::core::init::init_sdk`].