mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
69 lines
1.5 KiB
TypeScript
69 lines
1.5 KiB
TypeScript
/// <reference types="vite/client" />
|
|
|
|
interface ImportMetaEnv {
|
|
readonly VITE_API_URL: string
|
|
readonly VITE_TELEGRAM_BOT_USERNAME?: string
|
|
readonly VITE_APP_NAME?: string
|
|
readonly VITE_APP_LOGO?: string
|
|
}
|
|
|
|
interface ImportMeta {
|
|
readonly env: ImportMetaEnv
|
|
}
|
|
|
|
// Telegram WebApp types
|
|
interface TelegramWebApp {
|
|
initData: string
|
|
initDataUnsafe: {
|
|
user?: {
|
|
id: number
|
|
first_name: string
|
|
last_name?: string
|
|
username?: string
|
|
language_code?: string
|
|
}
|
|
auth_date: number
|
|
hash: string
|
|
}
|
|
ready: () => void
|
|
expand: () => void
|
|
close: () => void
|
|
openLink: (url: string, options?: { try_instant_view?: boolean }) => void
|
|
openTelegramLink: (url: string) => void
|
|
openInvoice: (url: string, callback?: (status: 'paid' | 'cancelled' | 'failed' | 'pending') => void) => void
|
|
MainButton: {
|
|
text: string
|
|
color: string
|
|
textColor: string
|
|
isVisible: boolean
|
|
isActive: boolean
|
|
show: () => void
|
|
hide: () => void
|
|
enable: () => void
|
|
disable: () => void
|
|
onClick: (callback: () => void) => void
|
|
offClick: (callback: () => void) => void
|
|
}
|
|
BackButton: {
|
|
isVisible: boolean
|
|
show: () => void
|
|
hide: () => void
|
|
onClick: (callback: () => void) => void
|
|
offClick: (callback: () => void) => void
|
|
}
|
|
themeParams: {
|
|
bg_color?: string
|
|
text_color?: string
|
|
hint_color?: string
|
|
link_color?: string
|
|
button_color?: string
|
|
button_text_color?: string
|
|
}
|
|
}
|
|
|
|
interface Window {
|
|
Telegram?: {
|
|
WebApp: TelegramWebApp
|
|
}
|
|
}
|