-
Notifications
You must be signed in to change notification settings - Fork 3
/
telegram-types.d.ts
78 lines (78 loc) · 2.45 KB
/
telegram-types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// more info here https://core.telegram.org/bots/webapps#initializing-mini-apps
interface Window {
Telegram: {
WebApp: {
initData: string,
initDataUnsafe: {
query_id: string,
user: {
id: 699381957,
first_name: string,
last_name: string,
username: string,
language_code: string,
is_premium: boolean,
allows_write_to_pm: boolean
},
auth_date: number,
hash: string
},
version: string,
platform: string,
colorScheme: string,
themeParams: any,
isExpanded: boolean,
viewportHeight: number,
viewportStableHeight: number,
isClosingConfirmationEnabled: boolean,
BackButton: {
isVisible: boolean
},
MainButton: {
text: string,
color: string,
textColor: string,
isVisible: boolean,
isProgressVisible: boolean,
isActive: boolean
},
SettingsButton: {
isVisible: boolean
},
HapticFeedback: any,
CloudStorage: any,
BiometricManager: {
isInited: boolean,
isBiometricAvailable: boolean,
biometricType: string,
isAccessRequested: boolean,
isAccessGranted: boolean,
isBiometricTokenSaved: boolean,
deviceId: string
},
isVersionAtLeast: (version: string) => boolean,
setHeaderColor: (color: string) => void,
setBackgroundColor: (color: string) => void,
enableClosingConfirmation: () => void,
disableClosingConfirmation: () => void,
onEvent: (eventType: any, eventHandler: any) => void,
offEvent: (eventType: any, eventHandler: any) => void,
sendData: (data: any) => void,
switchInlineQuery: (query: string, choose_chat_types?: any) => void,
openLink: (url: string, options?: any) => void,
openTelegramLink: (url: string) => void,
openInvoice: (url: string, callback?: any) => void,
showPopup: (params: any, callback?: any) => void,
showAlert: (message: any, callback?: any) => void,
showConfirm: (message: any, callback?: any) => void,
showScanQrPopup: (params: any, callback?: any) => void,
closeScanQrPopup: () => void,
readTextFromClipboard: (callback?: any) => void,
requestWriteAccess: (callback?: any) => void,
requestContact: (callback?: any) => void,
ready: () => void,
expand: () => void,
close: () => void,
}
},
}