Add Telegram WebApp support: initialize app, enhance layout with fullscreen toggle, and improve polling mechanism in Wheel component

This commit is contained in:
PEDZEO
2026-01-20 00:13:11 +03:00
parent c96ec5ecf6
commit 8753000a03
6 changed files with 219 additions and 16 deletions

23
src/vite-env.d.ts vendored
View File

@@ -25,12 +25,35 @@ interface TelegramWebApp {
auth_date: number
hash: string
}
version: string
platform: string
isExpanded: boolean
isClosingConfirmationEnabled: boolean
isVerticalSwipesEnabled: boolean
isFullscreen: boolean
isOrientationLocked: boolean
safeAreaInset: { top: number; bottom: number; left: number; right: number }
contentSafeAreaInset: { top: number; bottom: number; left: number; right: number }
ready: () => void
expand: () => void
close: () => void
openLink: (url: string, options?: { try_instant_view?: boolean; try_browser?: boolean }) => void
openTelegramLink: (url: string) => void
openInvoice: (url: string, callback?: (status: 'paid' | 'cancelled' | 'failed' | 'pending') => void) => void
// Fullscreen API (Bot API 8.0+)
requestFullscreen: () => void
exitFullscreen: () => void
lockOrientation: () => void
unlockOrientation: () => void
// Vertical swipes control
disableVerticalSwipes: () => void
enableVerticalSwipes: () => void
// Closing confirmation
enableClosingConfirmation: () => void
disableClosingConfirmation: () => void
// Event handlers
onEvent: (eventType: string, callback: () => void) => void
offEvent: (eventType: string, callback: () => void) => void
MainButton: {
text: string
color: string