import { InitData, InitDataUnsafe, WebApp } from '../types'; /** * React hook that resolves the Telegram `WebApp` object from * `window.Telegram.WebApp`, calls `ready()`, and optionally expands the * viewport on iOS/Android when the current `pageProcessor` is * `'telegram_expanded'`. * * When Telegram is not present (SSR, regular browsers, embedded previews) * the hook silently returns `null`. Any error thrown by `ready()` is * swallowed and forwarded to the caller-provided `onError` callback so * that a failed init does not crash the tree. * * Accepts a single options object with an optional `onError` handler that * fires when `wApp.ready()` throws. * * @returns The Telegram WebApp instance, or `null` when unavailable. */ export declare const useWebApp: ({ onError, }?: { onError?: () => void; }) => WebApp | null; /** * Convenience hook returning the Telegram WebApp init payload as a tuple of * `[initDataUnsafe, initData]`. Both values are `undefined` on the server * and while Telegram is still initializing. */ export declare const useInitData: () => readonly [InitDataUnsafe | undefined, InitData | undefined]; //# sourceMappingURL=useWebApp.d.ts.map