@apiteam/twa-bridge 8.0.13 → 9.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -32
- package/package.json +25 -22
- package/solid/index.d.ts +562 -220
- package/solid/index.js +1 -1
- package/solid/index.mjs +1 -1
- package/solid/package.json +15 -15
package/solid/index.d.ts
CHANGED
|
@@ -1,204 +1,9 @@
|
|
|
1
1
|
import * as solid_js from 'solid-js';
|
|
2
2
|
import { Context, JSX, Component } from 'solid-js';
|
|
3
3
|
|
|
4
|
-
type Sender = (eventType: string, eventData?:
|
|
4
|
+
type Sender = (eventType: string, eventData?: unknown) => void;
|
|
5
5
|
declare const sender: Sender;
|
|
6
6
|
|
|
7
|
-
declare const EventBackButtonPressed = "back_button_pressed";
|
|
8
|
-
declare const EventClipboardTextReceived = "clipboard_text_received";
|
|
9
|
-
declare const EventCustomMethodInvoked = "custom_method_invoked";
|
|
10
|
-
declare const EventInvoiceClosed = "invoice_closed";
|
|
11
|
-
declare const EventMainButtonPressed = "main_button_pressed";
|
|
12
|
-
declare const EventPhoneRequested = "phone_requested";
|
|
13
|
-
declare const EventPopupClosed = "popup_closed";
|
|
14
|
-
declare const EventReloadIframe = "reload_iframe";
|
|
15
|
-
declare const EventQrTextReceived = "qr_text_received";
|
|
16
|
-
declare const EventScanQrPopupClosed = "scan_qr_popup_closed";
|
|
17
|
-
declare const EventSetCustomStyle = "set_custom_style";
|
|
18
|
-
declare const EventSettingsButtonPressed = "settings_button_pressed";
|
|
19
|
-
declare const EventThemeChanged = "theme_changed";
|
|
20
|
-
declare const EventViewportChanged = "viewport_changed";
|
|
21
|
-
declare const EventWriteAccessRequested = "write_access_requested";
|
|
22
|
-
declare const EventSafeAreaChanged = "safe_area_changed";
|
|
23
|
-
declare const EventContentSafeAreaChanged = "content_safe_area_changed";
|
|
24
|
-
declare const EventPreparedMessageSent = "prepared_message_sent";
|
|
25
|
-
declare const EventPreparedMessageFailed = "prepared_message_failed";
|
|
26
|
-
declare const EventEmojiStatusSet = "emoji_status_set";
|
|
27
|
-
declare const EventEmojiStatusFailed = "emoji_status_failed";
|
|
28
|
-
declare const EventEmojiStatusAccessRequested = "emoji_status_access_requested";
|
|
29
|
-
declare const EventFileDownloadRequested = "file_download_requested";
|
|
30
|
-
declare const EventAccelerometerChanged = "accelerometer_changed";
|
|
31
|
-
declare const EventAccelerometerFailed = "accelerometer_failed";
|
|
32
|
-
declare const EventAccelerometerStarted = "accelerometer_started";
|
|
33
|
-
declare const EventAccelerometerStopped = "accelerometer_stopped";
|
|
34
|
-
declare const EventBiometryAuthRequested = "biometry_auth_requested";
|
|
35
|
-
declare const EventBiometryInfoReceived = "biometry_info_received";
|
|
36
|
-
declare const EventBiometryTokenUpdated = "biometry_token_updated";
|
|
37
|
-
declare const EventDeviceOrientationChanged = "device_orientation_changed";
|
|
38
|
-
declare const EventDeviceOrientationFailed = "device_orientation_failed";
|
|
39
|
-
declare const EventDeviceOrientationStarted = "device_orientation_started";
|
|
40
|
-
declare const EventDeviceOrientationStopped = "device_orientation_stopped";
|
|
41
|
-
declare const EventFullscreenChanged = "fullscreen_changed";
|
|
42
|
-
declare const EventFullscreenFailed = "fullscreen_failed";
|
|
43
|
-
declare const EventGyroscopeChanged = "gyroscope_changed";
|
|
44
|
-
declare const EventGyroscopeFailed = "gyroscope_failed";
|
|
45
|
-
declare const EventGyroscopeStarted = "gyroscope_started";
|
|
46
|
-
declare const EventGyroscopeStopped = "gyroscope_stopped";
|
|
47
|
-
declare const EventHomeScreenAdded = "home_screen_added";
|
|
48
|
-
declare const EventHomeScreenChecked = "home_screen_checked";
|
|
49
|
-
declare const EventHomeScreenFailed = "home_screen_failed";
|
|
50
|
-
declare const EventLocationChecked = "location_checked";
|
|
51
|
-
declare const EventLocationRequested = "location_requested";
|
|
52
|
-
declare const EventSecondaryButtonPressed = "secondary_button_pressed";
|
|
53
|
-
declare const EventVisibilityChanged = "visibility_changed";
|
|
54
|
-
|
|
55
|
-
type GetPlatform = () => 'phone' | 'web' | 'desktop';
|
|
56
|
-
declare const TG_WEB = "web";
|
|
57
|
-
declare const TG_PHONE = "phone";
|
|
58
|
-
declare const TG_DESKTOP = "desktop";
|
|
59
|
-
declare const getPlatform: GetPlatform;
|
|
60
|
-
|
|
61
|
-
declare const NOT_SUPPORTED = "not_supported";
|
|
62
|
-
|
|
63
|
-
type ThemeParams = {
|
|
64
|
-
bg_color: string;
|
|
65
|
-
text_color: string;
|
|
66
|
-
hint_color: string;
|
|
67
|
-
link_color: string;
|
|
68
|
-
button_color: string;
|
|
69
|
-
button_text_color: string;
|
|
70
|
-
secondary_bg_color: string;
|
|
71
|
-
header_bg_color: string;
|
|
72
|
-
bottom_bar_bg_color: string;
|
|
73
|
-
accent_text_color: string;
|
|
74
|
-
section_bg_color: string;
|
|
75
|
-
section_header_text_color: string;
|
|
76
|
-
section_separator_color: string;
|
|
77
|
-
subtitle_text_color: string;
|
|
78
|
-
destructive_text_color: string;
|
|
79
|
-
};
|
|
80
|
-
declare const getThemeParams: (theme_params?: ThemeParams) => ThemeParams;
|
|
81
|
-
|
|
82
|
-
type EventsData = {
|
|
83
|
-
back_button_pressed: undefined;
|
|
84
|
-
clipboard_text_received: {
|
|
85
|
-
req_id: string;
|
|
86
|
-
data?: string | null;
|
|
87
|
-
};
|
|
88
|
-
custom_method_invoked: {
|
|
89
|
-
req_id: string;
|
|
90
|
-
result?: unknown;
|
|
91
|
-
error?: string;
|
|
92
|
-
};
|
|
93
|
-
invoice_closed: {
|
|
94
|
-
slug: string;
|
|
95
|
-
status: 'paid' | 'failed' | 'pending' | 'cancelled';
|
|
96
|
-
};
|
|
97
|
-
main_button_pressed: undefined;
|
|
98
|
-
phone_requested: {
|
|
99
|
-
status: 'sent';
|
|
100
|
-
};
|
|
101
|
-
popup_closed: {
|
|
102
|
-
button_id?: string;
|
|
103
|
-
};
|
|
104
|
-
reload_iframe: undefined;
|
|
105
|
-
qr_text_received: {
|
|
106
|
-
data?: string;
|
|
107
|
-
};
|
|
108
|
-
scan_qr_popup_closed: undefined;
|
|
109
|
-
set_custom_style: undefined;
|
|
110
|
-
settings_button_pressed: undefined;
|
|
111
|
-
theme_changed: {
|
|
112
|
-
theme_params: ThemeParams;
|
|
113
|
-
};
|
|
114
|
-
viewport_changed: {
|
|
115
|
-
height: number;
|
|
116
|
-
width?: number;
|
|
117
|
-
is_expanded: boolean;
|
|
118
|
-
is_state_stable: boolean;
|
|
119
|
-
};
|
|
120
|
-
[EventHomeScreenChecked]: {
|
|
121
|
-
status: 'unsupported' | 'unknown' | 'added' | 'missed';
|
|
122
|
-
};
|
|
123
|
-
[EventSafeAreaChanged]: {
|
|
124
|
-
top: number;
|
|
125
|
-
bottom: number;
|
|
126
|
-
left: number;
|
|
127
|
-
right: number;
|
|
128
|
-
};
|
|
129
|
-
[EventContentSafeAreaChanged]: {
|
|
130
|
-
top: number;
|
|
131
|
-
bottom: number;
|
|
132
|
-
left: number;
|
|
133
|
-
right: number;
|
|
134
|
-
};
|
|
135
|
-
[EventPreparedMessageSent]: undefined;
|
|
136
|
-
[EventPreparedMessageFailed]: undefined;
|
|
137
|
-
[EventEmojiStatusSet]: undefined;
|
|
138
|
-
[EventEmojiStatusFailed]: undefined;
|
|
139
|
-
[EventEmojiStatusAccessRequested]: {
|
|
140
|
-
status: 'allowed';
|
|
141
|
-
};
|
|
142
|
-
[EventFileDownloadRequested]: {
|
|
143
|
-
status: 'downloading';
|
|
144
|
-
};
|
|
145
|
-
[EventWriteAccessRequested]: {
|
|
146
|
-
status: 'allowed';
|
|
147
|
-
};
|
|
148
|
-
[EventBiometryInfoReceived]: {
|
|
149
|
-
available: boolean;
|
|
150
|
-
access_requested: boolean;
|
|
151
|
-
access_granted: boolean;
|
|
152
|
-
device_id: string;
|
|
153
|
-
token_saved: boolean;
|
|
154
|
-
type: 'face' | 'finger' | 'unknown';
|
|
155
|
-
};
|
|
156
|
-
[EventBiometryTokenUpdated]: {
|
|
157
|
-
status: 'updated' | 'removed';
|
|
158
|
-
};
|
|
159
|
-
[EventBiometryAuthRequested]: {
|
|
160
|
-
status: 'failed';
|
|
161
|
-
token: undefined;
|
|
162
|
-
} | {
|
|
163
|
-
status: 'authorized';
|
|
164
|
-
token: string;
|
|
165
|
-
};
|
|
166
|
-
[EventVisibilityChanged]: {
|
|
167
|
-
is_visible: boolean;
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
interface TelegramGameProxy {
|
|
171
|
-
receiveEvent: (event: string, data: string) => void;
|
|
172
|
-
}
|
|
173
|
-
interface TelegramWebviewProxy {
|
|
174
|
-
postEvent: (event: string, data: string) => void;
|
|
175
|
-
}
|
|
176
|
-
declare global {
|
|
177
|
-
interface External {
|
|
178
|
-
notify: (event: string) => void;
|
|
179
|
-
}
|
|
180
|
-
interface Window {
|
|
181
|
-
TelegramWebviewProxy: TelegramWebviewProxy;
|
|
182
|
-
TelegramGameProxy: TelegramGameProxy;
|
|
183
|
-
TelegramGameProxy_receiveEvent: TelegramGameProxy['receiveEvent'];
|
|
184
|
-
Telegram: {
|
|
185
|
-
WebView: TelegramGameProxy;
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
type Listened = <T extends EventsData, E extends keyof T, D extends T[E]>(eventName: E, callback: (eventData: D) => void) => void;
|
|
190
|
-
declare const on: Listened;
|
|
191
|
-
declare const off: Listened;
|
|
192
|
-
declare const once: Listened;
|
|
193
|
-
|
|
194
|
-
type listener_EventsData = EventsData;
|
|
195
|
-
declare const listener_off: typeof off;
|
|
196
|
-
declare const listener_on: typeof on;
|
|
197
|
-
declare const listener_once: typeof once;
|
|
198
|
-
declare namespace listener {
|
|
199
|
-
export { type listener_EventsData as EventsData, listener_off as off, listener_on as on, listener_once as once };
|
|
200
|
-
}
|
|
201
|
-
|
|
202
7
|
declare const MethodInvokeCustomMethod = "web_app_invoke_custom_method";
|
|
203
8
|
declare const MethodOpenScanQrPopup = "web_app_open_scan_qr_popup";
|
|
204
9
|
declare const MethodReadTextFromClipboard = "web_app_read_text_from_clipboard";
|
|
@@ -254,6 +59,15 @@ declare const MethodStopAccelerometer = "web_app_stop_accelerometer";
|
|
|
254
59
|
declare const MethodStopDeviceOrientation = "web_app_stop_device_orientation";
|
|
255
60
|
declare const MethodStopGyroscope = "web_app_stop_gyroscope";
|
|
256
61
|
declare const MethodSetupSecondaryButton = "web_app_setup_secondary_button";
|
|
62
|
+
declare const MethodDeviceStorageSaveKey = "web_app_device_storage_save_key";
|
|
63
|
+
declare const MethodDeviceStorageGetKey = "web_app_device_storage_get_key";
|
|
64
|
+
declare const MethodDeviceStorageClear = "web_app_device_storage_clear";
|
|
65
|
+
declare const MethodSecureStorageSaveKey = "web_app_secure_storage_save_key";
|
|
66
|
+
declare const MethodSecureStorageGetKey = "web_app_secure_storage_get_key";
|
|
67
|
+
declare const MethodSecureStorageRestoreKey = "web_app_secure_storage_restore_key";
|
|
68
|
+
declare const MethodSecureStorageClear = "web_app_secure_storage_clear";
|
|
69
|
+
declare const MethodHideKeyboard = "web_app_hide_keyboard";
|
|
70
|
+
declare const MethodRequestChat = "web_app_request_chat";
|
|
257
71
|
declare enum Method {
|
|
258
72
|
InvokeCustomMethod = "web_app_invoke_custom_method",
|
|
259
73
|
OpenScanQrPopup = "web_app_open_scan_qr_popup",
|
|
@@ -294,12 +108,40 @@ declare enum Method {
|
|
|
294
108
|
SendPreparedMessage = "web_app_send_prepared_message",
|
|
295
109
|
SetEmojiStatus = "web_app_set_emoji_status",
|
|
296
110
|
RequestEmojiStatusAccess = "web_app_request_emoji_status_access",
|
|
297
|
-
RequestFileDownload = "web_app_request_file_download"
|
|
111
|
+
RequestFileDownload = "web_app_request_file_download",
|
|
112
|
+
BiometryGetInfo = "web_app_biometry_get_info",
|
|
113
|
+
BiometryOpenSettings = "web_app_biometry_open_settings",
|
|
114
|
+
BiometryRequestAccess = "web_app_biometry_request_access",
|
|
115
|
+
BiometryRequestAuth = "web_app_biometry_request_auth",
|
|
116
|
+
BiometryUpdateToken = "web_app_biometry_update_token",
|
|
117
|
+
CheckLocation = "web_app_check_location",
|
|
118
|
+
OpenLocationSettings = "web_app_open_location_settings",
|
|
119
|
+
RequestLocation = "web_app_request_location",
|
|
120
|
+
StartAccelerometer = "web_app_start_accelerometer",
|
|
121
|
+
StartDeviceOrientation = "web_app_start_device_orientation",
|
|
122
|
+
StartGyroscope = "web_app_start_gyroscope",
|
|
123
|
+
StopAccelerometer = "web_app_stop_accelerometer",
|
|
124
|
+
StopDeviceOrientation = "web_app_stop_device_orientation",
|
|
125
|
+
StopGyroscope = "web_app_stop_gyroscope",
|
|
126
|
+
SetupSecondaryButton = "web_app_setup_secondary_button",
|
|
127
|
+
DeviceStorageSaveKey = "web_app_device_storage_save_key",
|
|
128
|
+
DeviceStorageGetKey = "web_app_device_storage_get_key",
|
|
129
|
+
DeviceStorageClear = "web_app_device_storage_clear",
|
|
130
|
+
SecureStorageSaveKey = "web_app_secure_storage_save_key",
|
|
131
|
+
SecureStorageGetKey = "web_app_secure_storage_get_key",
|
|
132
|
+
SecureStorageRestoreKey = "web_app_secure_storage_restore_key",
|
|
133
|
+
SecureStorageClear = "web_app_secure_storage_clear",
|
|
134
|
+
HideKeyboard = "web_app_hide_keyboard",
|
|
135
|
+
RequestChat = "web_app_request_chat"
|
|
298
136
|
}
|
|
299
137
|
type PopupButton = {
|
|
300
|
-
id
|
|
301
|
-
type
|
|
138
|
+
id?: string;
|
|
139
|
+
type?: 'default' | 'destructive';
|
|
302
140
|
text: string;
|
|
141
|
+
} | {
|
|
142
|
+
id?: string;
|
|
143
|
+
type: 'ok' | 'close' | 'cancel';
|
|
144
|
+
text?: string;
|
|
303
145
|
};
|
|
304
146
|
type SenderData = {
|
|
305
147
|
[MethodInvokeCustomMethod]: {
|
|
@@ -334,9 +176,9 @@ type SenderData = {
|
|
|
334
176
|
try_browser?: boolean;
|
|
335
177
|
};
|
|
336
178
|
[MethodOpenPopup]: {
|
|
337
|
-
title
|
|
179
|
+
title?: string;
|
|
338
180
|
message: string;
|
|
339
|
-
buttons
|
|
181
|
+
buttons?: PopupButton[];
|
|
340
182
|
};
|
|
341
183
|
[MethodOpenTgLink]: {
|
|
342
184
|
path_full: string;
|
|
@@ -376,6 +218,8 @@ type SenderData = {
|
|
|
376
218
|
text?: string;
|
|
377
219
|
color?: string;
|
|
378
220
|
text_color?: string;
|
|
221
|
+
has_shine_effect?: boolean;
|
|
222
|
+
icon_custom_emoji_id?: string;
|
|
379
223
|
};
|
|
380
224
|
[MethodSetupSettingsButton]: {
|
|
381
225
|
is_visible: boolean;
|
|
@@ -399,7 +243,7 @@ type SenderData = {
|
|
|
399
243
|
allow_vertical_swipe: boolean;
|
|
400
244
|
};
|
|
401
245
|
[MethodShareToStory]: {
|
|
402
|
-
|
|
246
|
+
media_url: string;
|
|
403
247
|
text?: string;
|
|
404
248
|
widget_link?: {
|
|
405
249
|
url: string;
|
|
@@ -408,19 +252,15 @@ type SenderData = {
|
|
|
408
252
|
};
|
|
409
253
|
[MethodRequestSafeArea]: undefined;
|
|
410
254
|
[MethodRequestContentSafeArea]: undefined;
|
|
411
|
-
[MethodRequestFullscreen]:
|
|
412
|
-
|
|
413
|
-
};
|
|
414
|
-
[MethodExitFullscreen]: {
|
|
415
|
-
is_full: boolean;
|
|
416
|
-
};
|
|
255
|
+
[MethodRequestFullscreen]: undefined;
|
|
256
|
+
[MethodExitFullscreen]: undefined;
|
|
417
257
|
[MethodToggleOrientationLock]: {
|
|
418
258
|
locked: boolean;
|
|
419
259
|
};
|
|
420
260
|
[MethodAddToHomeScreen]: undefined;
|
|
421
261
|
[MethodCheckHomeScreen]: undefined;
|
|
422
262
|
[MethodSendPreparedMessage]: {
|
|
423
|
-
|
|
263
|
+
id: string;
|
|
424
264
|
};
|
|
425
265
|
[MethodSetEmojiStatus]: {
|
|
426
266
|
custom_emoji_id: string;
|
|
@@ -441,11 +281,380 @@ type SenderData = {
|
|
|
441
281
|
token: string;
|
|
442
282
|
};
|
|
443
283
|
[MethodBiometryOpenSettings]: undefined;
|
|
284
|
+
[MethodBiometryGetInfo]: undefined;
|
|
285
|
+
[MethodCheckLocation]: undefined;
|
|
286
|
+
[MethodOpenLocationSettings]: undefined;
|
|
287
|
+
[MethodRequestLocation]: undefined;
|
|
288
|
+
[MethodStartAccelerometer]: {
|
|
289
|
+
refresh_rate?: number;
|
|
290
|
+
};
|
|
291
|
+
[MethodStartDeviceOrientation]: {
|
|
292
|
+
refresh_rate?: number;
|
|
293
|
+
need_absolute?: boolean;
|
|
294
|
+
};
|
|
295
|
+
[MethodStartGyroscope]: {
|
|
296
|
+
refresh_rate?: number;
|
|
297
|
+
};
|
|
298
|
+
[MethodStopAccelerometer]: undefined;
|
|
299
|
+
[MethodStopDeviceOrientation]: undefined;
|
|
300
|
+
[MethodStopGyroscope]: undefined;
|
|
301
|
+
[MethodSetupSecondaryButton]: {
|
|
302
|
+
is_visible?: boolean;
|
|
303
|
+
is_active?: boolean;
|
|
304
|
+
is_progress_visible?: boolean;
|
|
305
|
+
text?: string;
|
|
306
|
+
color?: string;
|
|
307
|
+
text_color?: string;
|
|
308
|
+
has_shine_effect?: boolean;
|
|
309
|
+
position?: 'left' | 'right' | 'top' | 'bottom';
|
|
310
|
+
icon_custom_emoji_id?: string;
|
|
311
|
+
};
|
|
312
|
+
[MethodDeviceStorageSaveKey]: {
|
|
313
|
+
req_id?: string;
|
|
314
|
+
key: string;
|
|
315
|
+
value: string | null;
|
|
316
|
+
};
|
|
317
|
+
[MethodDeviceStorageGetKey]: {
|
|
318
|
+
req_id?: string;
|
|
319
|
+
key: string;
|
|
320
|
+
};
|
|
321
|
+
[MethodDeviceStorageClear]: {
|
|
322
|
+
req_id?: string;
|
|
323
|
+
};
|
|
324
|
+
[MethodSecureStorageSaveKey]: {
|
|
325
|
+
req_id?: string;
|
|
326
|
+
key: string;
|
|
327
|
+
value: string | null;
|
|
328
|
+
};
|
|
329
|
+
[MethodSecureStorageGetKey]: {
|
|
330
|
+
req_id?: string;
|
|
331
|
+
key: string;
|
|
332
|
+
};
|
|
333
|
+
[MethodSecureStorageRestoreKey]: {
|
|
334
|
+
req_id?: string;
|
|
335
|
+
key: string;
|
|
336
|
+
};
|
|
337
|
+
[MethodSecureStorageClear]: {
|
|
338
|
+
req_id?: string;
|
|
339
|
+
};
|
|
340
|
+
[MethodHideKeyboard]: undefined;
|
|
341
|
+
[MethodRequestChat]: {
|
|
342
|
+
req_id: string;
|
|
343
|
+
};
|
|
444
344
|
};
|
|
445
345
|
|
|
346
|
+
declare const send: <E extends keyof SenderData>(name: E, data?: SenderData[E]) => Promise<unknown>;
|
|
347
|
+
|
|
446
348
|
type Debug = (methondName: string, errorId: number) => void;
|
|
447
349
|
declare const debug: Debug;
|
|
448
350
|
|
|
351
|
+
declare const EventBackButtonPressed = "back_button_pressed";
|
|
352
|
+
declare const EventClipboardTextReceived = "clipboard_text_received";
|
|
353
|
+
declare const EventCustomMethodInvoked = "custom_method_invoked";
|
|
354
|
+
declare const EventInvoiceClosed = "invoice_closed";
|
|
355
|
+
declare const EventMainButtonPressed = "main_button_pressed";
|
|
356
|
+
declare const EventPhoneRequested = "phone_requested";
|
|
357
|
+
declare const EventPopupClosed = "popup_closed";
|
|
358
|
+
declare const EventReloadIframe = "reload_iframe";
|
|
359
|
+
declare const EventQrTextReceived = "qr_text_received";
|
|
360
|
+
declare const EventScanQrPopupClosed = "scan_qr_popup_closed";
|
|
361
|
+
declare const EventSetCustomStyle = "set_custom_style";
|
|
362
|
+
declare const EventSettingsButtonPressed = "settings_button_pressed";
|
|
363
|
+
declare const EventThemeChanged = "theme_changed";
|
|
364
|
+
declare const EventViewportChanged = "viewport_changed";
|
|
365
|
+
declare const EventWriteAccessRequested = "write_access_requested";
|
|
366
|
+
declare const EventSafeAreaChanged = "safe_area_changed";
|
|
367
|
+
declare const EventContentSafeAreaChanged = "content_safe_area_changed";
|
|
368
|
+
declare const EventPreparedMessageSent = "prepared_message_sent";
|
|
369
|
+
declare const EventPreparedMessageFailed = "prepared_message_failed";
|
|
370
|
+
declare const EventEmojiStatusSet = "emoji_status_set";
|
|
371
|
+
declare const EventEmojiStatusFailed = "emoji_status_failed";
|
|
372
|
+
declare const EventEmojiStatusAccessRequested = "emoji_status_access_requested";
|
|
373
|
+
declare const EventFileDownloadRequested = "file_download_requested";
|
|
374
|
+
declare const EventAccelerometerChanged = "accelerometer_changed";
|
|
375
|
+
declare const EventAccelerometerFailed = "accelerometer_failed";
|
|
376
|
+
declare const EventAccelerometerStarted = "accelerometer_started";
|
|
377
|
+
declare const EventAccelerometerStopped = "accelerometer_stopped";
|
|
378
|
+
declare const EventBiometryAuthRequested = "biometry_auth_requested";
|
|
379
|
+
declare const EventBiometryInfoReceived = "biometry_info_received";
|
|
380
|
+
declare const EventBiometryTokenUpdated = "biometry_token_updated";
|
|
381
|
+
declare const EventDeviceOrientationChanged = "device_orientation_changed";
|
|
382
|
+
declare const EventDeviceOrientationFailed = "device_orientation_failed";
|
|
383
|
+
declare const EventDeviceOrientationStarted = "device_orientation_started";
|
|
384
|
+
declare const EventDeviceOrientationStopped = "device_orientation_stopped";
|
|
385
|
+
declare const EventFullscreenChanged = "fullscreen_changed";
|
|
386
|
+
declare const EventFullscreenFailed = "fullscreen_failed";
|
|
387
|
+
declare const EventGyroscopeChanged = "gyroscope_changed";
|
|
388
|
+
declare const EventGyroscopeFailed = "gyroscope_failed";
|
|
389
|
+
declare const EventGyroscopeStarted = "gyroscope_started";
|
|
390
|
+
declare const EventGyroscopeStopped = "gyroscope_stopped";
|
|
391
|
+
declare const EventHomeScreenAdded = "home_screen_added";
|
|
392
|
+
declare const EventHomeScreenChecked = "home_screen_checked";
|
|
393
|
+
declare const EventLocationChecked = "location_checked";
|
|
394
|
+
declare const EventLocationRequested = "location_requested";
|
|
395
|
+
declare const EventSecondaryButtonPressed = "secondary_button_pressed";
|
|
396
|
+
declare const EventDeviceStorageKeySaved = "device_storage_key_saved";
|
|
397
|
+
declare const EventDeviceStorageKeyReceived = "device_storage_key_received";
|
|
398
|
+
declare const EventDeviceStorageCleared = "device_storage_cleared";
|
|
399
|
+
declare const EventDeviceStorageFailed = "device_storage_failed";
|
|
400
|
+
declare const EventSecureStorageKeySaved = "secure_storage_key_saved";
|
|
401
|
+
declare const EventSecureStorageKeyReceived = "secure_storage_key_received";
|
|
402
|
+
declare const EventSecureStorageKeyRestored = "secure_storage_key_restored";
|
|
403
|
+
declare const EventSecureStorageCleared = "secure_storage_cleared";
|
|
404
|
+
declare const EventSecureStorageFailed = "secure_storage_failed";
|
|
405
|
+
declare const EventRequestedChatSent = "requested_chat_sent";
|
|
406
|
+
declare const EventRequestedChatFailed = "requested_chat_failed";
|
|
407
|
+
declare const EventVisibilityChanged = "visibility_changed";
|
|
408
|
+
|
|
409
|
+
type GetPlatform = () => 'phone' | 'web' | 'desktop';
|
|
410
|
+
declare const TG_WEB = "web";
|
|
411
|
+
declare const TG_PHONE = "phone";
|
|
412
|
+
declare const TG_DESKTOP = "desktop";
|
|
413
|
+
declare const getPlatform: GetPlatform;
|
|
414
|
+
|
|
415
|
+
declare const NOT_SUPPORTED = "not_supported";
|
|
416
|
+
|
|
417
|
+
type ThemeParams = {
|
|
418
|
+
bg_color: string;
|
|
419
|
+
text_color: string;
|
|
420
|
+
hint_color: string;
|
|
421
|
+
link_color: string;
|
|
422
|
+
button_color: string;
|
|
423
|
+
button_text_color: string;
|
|
424
|
+
secondary_bg_color: string;
|
|
425
|
+
header_bg_color: string;
|
|
426
|
+
bottom_bar_bg_color: string;
|
|
427
|
+
accent_text_color: string;
|
|
428
|
+
section_bg_color: string;
|
|
429
|
+
section_header_text_color: string;
|
|
430
|
+
section_separator_color: string;
|
|
431
|
+
subtitle_text_color: string;
|
|
432
|
+
destructive_text_color: string;
|
|
433
|
+
};
|
|
434
|
+
declare const getThemeParams: (theme_params?: ThemeParams) => ThemeParams;
|
|
435
|
+
|
|
436
|
+
type EventsData = {
|
|
437
|
+
back_button_pressed: undefined;
|
|
438
|
+
clipboard_text_received: {
|
|
439
|
+
req_id: string;
|
|
440
|
+
data?: string | null;
|
|
441
|
+
};
|
|
442
|
+
custom_method_invoked: {
|
|
443
|
+
req_id: string;
|
|
444
|
+
result?: unknown;
|
|
445
|
+
error?: string;
|
|
446
|
+
};
|
|
447
|
+
invoice_closed: {
|
|
448
|
+
slug: string;
|
|
449
|
+
status: 'paid' | 'failed' | 'pending' | 'cancelled';
|
|
450
|
+
};
|
|
451
|
+
main_button_pressed: undefined;
|
|
452
|
+
phone_requested: {
|
|
453
|
+
status: 'sent' | 'cancelled';
|
|
454
|
+
};
|
|
455
|
+
popup_closed: {
|
|
456
|
+
button_id?: string;
|
|
457
|
+
};
|
|
458
|
+
reload_iframe: undefined;
|
|
459
|
+
qr_text_received: {
|
|
460
|
+
data?: string;
|
|
461
|
+
};
|
|
462
|
+
scan_qr_popup_closed: undefined;
|
|
463
|
+
set_custom_style: undefined;
|
|
464
|
+
settings_button_pressed: undefined;
|
|
465
|
+
theme_changed: {
|
|
466
|
+
theme_params: ThemeParams;
|
|
467
|
+
};
|
|
468
|
+
viewport_changed: {
|
|
469
|
+
height: number;
|
|
470
|
+
width?: number;
|
|
471
|
+
is_expanded: boolean;
|
|
472
|
+
is_state_stable: boolean;
|
|
473
|
+
};
|
|
474
|
+
[EventHomeScreenChecked]: {
|
|
475
|
+
status: 'unsupported' | 'unknown' | 'added' | 'missed';
|
|
476
|
+
};
|
|
477
|
+
[EventHomeScreenAdded]: undefined;
|
|
478
|
+
[EventFullscreenChanged]: {
|
|
479
|
+
is_fullscreen: boolean;
|
|
480
|
+
};
|
|
481
|
+
[EventFullscreenFailed]: {
|
|
482
|
+
error: string;
|
|
483
|
+
};
|
|
484
|
+
[EventVisibilityChanged]: {
|
|
485
|
+
is_visible: boolean;
|
|
486
|
+
};
|
|
487
|
+
[EventSafeAreaChanged]: {
|
|
488
|
+
top: number;
|
|
489
|
+
bottom: number;
|
|
490
|
+
left: number;
|
|
491
|
+
right: number;
|
|
492
|
+
};
|
|
493
|
+
[EventContentSafeAreaChanged]: {
|
|
494
|
+
top: number;
|
|
495
|
+
bottom: number;
|
|
496
|
+
left: number;
|
|
497
|
+
right: number;
|
|
498
|
+
};
|
|
499
|
+
[EventPreparedMessageSent]: undefined;
|
|
500
|
+
[EventPreparedMessageFailed]: {
|
|
501
|
+
error: string;
|
|
502
|
+
};
|
|
503
|
+
[EventEmojiStatusSet]: undefined;
|
|
504
|
+
[EventEmojiStatusFailed]: {
|
|
505
|
+
error: string;
|
|
506
|
+
};
|
|
507
|
+
[EventEmojiStatusAccessRequested]: {
|
|
508
|
+
status: 'allowed' | 'cancelled';
|
|
509
|
+
};
|
|
510
|
+
[EventFileDownloadRequested]: {
|
|
511
|
+
status: 'downloading' | 'cancelled';
|
|
512
|
+
};
|
|
513
|
+
[EventWriteAccessRequested]: {
|
|
514
|
+
status: 'allowed' | 'cancelled';
|
|
515
|
+
};
|
|
516
|
+
[EventBiometryInfoReceived]: {
|
|
517
|
+
available: boolean;
|
|
518
|
+
access_requested: boolean;
|
|
519
|
+
access_granted: boolean;
|
|
520
|
+
device_id: string;
|
|
521
|
+
token_saved: boolean;
|
|
522
|
+
type: 'face' | 'finger' | 'unknown';
|
|
523
|
+
};
|
|
524
|
+
[EventBiometryTokenUpdated]: {
|
|
525
|
+
status: 'updated' | 'removed';
|
|
526
|
+
};
|
|
527
|
+
[EventBiometryAuthRequested]: {
|
|
528
|
+
status: 'failed';
|
|
529
|
+
token: undefined;
|
|
530
|
+
} | {
|
|
531
|
+
status: 'authorized';
|
|
532
|
+
token: string;
|
|
533
|
+
};
|
|
534
|
+
[EventLocationChecked]: {
|
|
535
|
+
available: boolean;
|
|
536
|
+
access_requested: boolean;
|
|
537
|
+
access_granted: boolean;
|
|
538
|
+
};
|
|
539
|
+
[EventLocationRequested]: {
|
|
540
|
+
available: false;
|
|
541
|
+
} | {
|
|
542
|
+
available: true;
|
|
543
|
+
latitude: number;
|
|
544
|
+
longitude: number;
|
|
545
|
+
altitude?: number | null;
|
|
546
|
+
course?: number | null;
|
|
547
|
+
speed?: number | null;
|
|
548
|
+
horizontal_accuracy?: number | null;
|
|
549
|
+
vertical_accuracy?: number | null;
|
|
550
|
+
course_accuracy?: number | null;
|
|
551
|
+
speed_accuracy?: number | null;
|
|
552
|
+
};
|
|
553
|
+
[EventAccelerometerStarted]: undefined;
|
|
554
|
+
[EventAccelerometerStopped]: undefined;
|
|
555
|
+
[EventAccelerometerChanged]: {
|
|
556
|
+
x: number;
|
|
557
|
+
y: number;
|
|
558
|
+
z: number;
|
|
559
|
+
};
|
|
560
|
+
[EventAccelerometerFailed]: {
|
|
561
|
+
error: string;
|
|
562
|
+
};
|
|
563
|
+
[EventDeviceOrientationStarted]: undefined;
|
|
564
|
+
[EventDeviceOrientationStopped]: undefined;
|
|
565
|
+
[EventDeviceOrientationChanged]: {
|
|
566
|
+
absolute: boolean;
|
|
567
|
+
alpha: number;
|
|
568
|
+
beta: number;
|
|
569
|
+
gamma: number;
|
|
570
|
+
};
|
|
571
|
+
[EventDeviceOrientationFailed]: {
|
|
572
|
+
error: string;
|
|
573
|
+
};
|
|
574
|
+
[EventGyroscopeStarted]: undefined;
|
|
575
|
+
[EventGyroscopeStopped]: undefined;
|
|
576
|
+
[EventGyroscopeChanged]: {
|
|
577
|
+
x: number;
|
|
578
|
+
y: number;
|
|
579
|
+
z: number;
|
|
580
|
+
};
|
|
581
|
+
[EventGyroscopeFailed]: {
|
|
582
|
+
error: string;
|
|
583
|
+
};
|
|
584
|
+
[EventSecondaryButtonPressed]: undefined;
|
|
585
|
+
[EventDeviceStorageKeySaved]: {
|
|
586
|
+
req_id: string;
|
|
587
|
+
};
|
|
588
|
+
[EventDeviceStorageKeyReceived]: {
|
|
589
|
+
req_id: string;
|
|
590
|
+
value: string | null;
|
|
591
|
+
};
|
|
592
|
+
[EventDeviceStorageCleared]: {
|
|
593
|
+
req_id: string;
|
|
594
|
+
};
|
|
595
|
+
[EventDeviceStorageFailed]: {
|
|
596
|
+
req_id: string;
|
|
597
|
+
error: string;
|
|
598
|
+
};
|
|
599
|
+
[EventSecureStorageKeySaved]: {
|
|
600
|
+
req_id: string;
|
|
601
|
+
};
|
|
602
|
+
[EventSecureStorageKeyReceived]: {
|
|
603
|
+
req_id: string;
|
|
604
|
+
value: string | null;
|
|
605
|
+
can_restore?: boolean;
|
|
606
|
+
};
|
|
607
|
+
[EventSecureStorageKeyRestored]: {
|
|
608
|
+
req_id: string;
|
|
609
|
+
value: string;
|
|
610
|
+
};
|
|
611
|
+
[EventSecureStorageCleared]: {
|
|
612
|
+
req_id: string;
|
|
613
|
+
};
|
|
614
|
+
[EventSecureStorageFailed]: {
|
|
615
|
+
req_id: string;
|
|
616
|
+
error: string;
|
|
617
|
+
};
|
|
618
|
+
[EventRequestedChatSent]: undefined;
|
|
619
|
+
[EventRequestedChatFailed]: {
|
|
620
|
+
error: string;
|
|
621
|
+
};
|
|
622
|
+
};
|
|
623
|
+
interface TelegramGameProxy {
|
|
624
|
+
receiveEvent: (event: string, data: string) => void;
|
|
625
|
+
}
|
|
626
|
+
interface TelegramWebviewProxy {
|
|
627
|
+
postEvent: (event: string, data: string) => void;
|
|
628
|
+
}
|
|
629
|
+
declare global {
|
|
630
|
+
interface External {
|
|
631
|
+
notify: (event: string) => void;
|
|
632
|
+
}
|
|
633
|
+
interface Window {
|
|
634
|
+
TelegramWebviewProxy: TelegramWebviewProxy;
|
|
635
|
+
TelegramGameProxy: TelegramGameProxy;
|
|
636
|
+
TelegramGameProxy_receiveEvent: TelegramGameProxy['receiveEvent'];
|
|
637
|
+
Telegram: {
|
|
638
|
+
WebView: TelegramGameProxy;
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
declare let TelegramIsIframe: boolean;
|
|
643
|
+
type Listened = <E extends keyof EventsData>(eventName: E, callback: (eventData: EventsData[E]) => void) => void;
|
|
644
|
+
declare const on: Listened;
|
|
645
|
+
declare const off: Listened;
|
|
646
|
+
declare const once: Listened;
|
|
647
|
+
|
|
648
|
+
type listener_EventsData = EventsData;
|
|
649
|
+
declare const listener_TelegramIsIframe: typeof TelegramIsIframe;
|
|
650
|
+
declare const listener_off: typeof off;
|
|
651
|
+
declare const listener_on: typeof on;
|
|
652
|
+
declare const listener_once: typeof once;
|
|
653
|
+
declare namespace listener {
|
|
654
|
+
export { listener_TelegramIsIframe as TelegramIsIframe, listener_off as off, listener_on as on, listener_once as once };
|
|
655
|
+
export type { listener_EventsData as EventsData };
|
|
656
|
+
}
|
|
657
|
+
|
|
449
658
|
declare const createIsViewportChanged: () => solid_js.Accessor<{
|
|
450
659
|
height: number;
|
|
451
660
|
width?: number;
|
|
@@ -583,6 +792,12 @@ type SetBottomBarColor = (eventData: SenderData[typeof MethodSetBottomBarColor])
|
|
|
583
792
|
declare const setBottomBarColor: SetBottomBarColor;
|
|
584
793
|
declare const supportSetBottomBarColor: () => boolean;
|
|
585
794
|
|
|
795
|
+
type SetupSecondaryButton = (eventData: SenderData[typeof MethodSetupSecondaryButton]) => {
|
|
796
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
797
|
+
};
|
|
798
|
+
declare const setupSecondaryButton: SetupSecondaryButton;
|
|
799
|
+
declare const supportSetupSecondaryButton: () => boolean;
|
|
800
|
+
|
|
586
801
|
type SetupBackButton = (eventData: SenderData[typeof MethodSetupBackButton]) => {
|
|
587
802
|
status: boolean | typeof NOT_SUPPORTED;
|
|
588
803
|
};
|
|
@@ -621,7 +836,7 @@ declare const supportTriggerHapticFeedback: () => boolean;
|
|
|
621
836
|
|
|
622
837
|
type SessionStorageSet = ({ key, value }: {
|
|
623
838
|
key: string;
|
|
624
|
-
value:
|
|
839
|
+
value: unknown;
|
|
625
840
|
}) => {
|
|
626
841
|
status: boolean | typeof NOT_SUPPORTED;
|
|
627
842
|
};
|
|
@@ -633,7 +848,7 @@ type SessionStorageGet = ({ key }: {
|
|
|
633
848
|
}) => {
|
|
634
849
|
is_json: boolean;
|
|
635
850
|
status: boolean | typeof NOT_SUPPORTED;
|
|
636
|
-
value?:
|
|
851
|
+
value?: unknown;
|
|
637
852
|
};
|
|
638
853
|
declare const sessionStorageGet: SessionStorageGet;
|
|
639
854
|
declare const supportSessionStorageGet: () => boolean;
|
|
@@ -644,7 +859,7 @@ type SetupSwipeBehavior = (eventData: SenderData[typeof MethodSetupSwipeBehavior
|
|
|
644
859
|
declare const setupSwipeBehavior: SetupSwipeBehavior;
|
|
645
860
|
declare const supportSetupSwipeBehavior: () => boolean;
|
|
646
861
|
|
|
647
|
-
type ShareToStory = (eventData
|
|
862
|
+
type ShareToStory = (eventData: SenderData[typeof MethodShareToStory]) => {
|
|
648
863
|
status: boolean | typeof NOT_SUPPORTED;
|
|
649
864
|
error_id?: number;
|
|
650
865
|
};
|
|
@@ -676,7 +891,9 @@ type RequestContentSafeAreaInset = (eventData?: SenderData[typeof MethodRequestC
|
|
|
676
891
|
declare const requestContentSafeAreaInset: RequestContentSafeAreaInset;
|
|
677
892
|
declare const supportRequestContentSafeAreaInset: () => boolean;
|
|
678
893
|
|
|
679
|
-
type SetupFullScreen = (eventData?:
|
|
894
|
+
type SetupFullScreen = (eventData?: {
|
|
895
|
+
is_full?: boolean;
|
|
896
|
+
}) => {
|
|
680
897
|
status: boolean | typeof NOT_SUPPORTED;
|
|
681
898
|
};
|
|
682
899
|
declare const setupFullScreen: SetupFullScreen;
|
|
@@ -694,19 +911,21 @@ type RequestEmojiStatus = (eventData?: SenderData[typeof MethodRequestEmojiStatu
|
|
|
694
911
|
declare const requestEmojiStatus: RequestEmojiStatus;
|
|
695
912
|
declare const supportRequestEmojiStatus: () => boolean;
|
|
696
913
|
|
|
697
|
-
type SetEmojiStatus = (eventData
|
|
914
|
+
type SetEmojiStatus = (eventData: SenderData[typeof MethodSetEmojiStatus]) => Promise<{
|
|
698
915
|
status: boolean | typeof NOT_SUPPORTED;
|
|
916
|
+
data?: EventsData[typeof EventEmojiStatusFailed];
|
|
699
917
|
}>;
|
|
700
918
|
declare const setEmojiStatus: SetEmojiStatus;
|
|
701
919
|
declare const supportSetEmojiStatus: () => boolean;
|
|
702
920
|
|
|
703
|
-
type ShareMessage = (eventData
|
|
921
|
+
type ShareMessage = (eventData: SenderData[typeof MethodSendPreparedMessage]) => Promise<{
|
|
704
922
|
status: boolean | typeof NOT_SUPPORTED;
|
|
923
|
+
data?: EventsData[typeof EventPreparedMessageFailed];
|
|
705
924
|
}>;
|
|
706
925
|
declare const shareMessage: ShareMessage;
|
|
707
926
|
declare const supportShareMessage: () => boolean;
|
|
708
927
|
|
|
709
|
-
type DownloadFile = (eventData
|
|
928
|
+
type DownloadFile = (eventData: SenderData[typeof MethodRequestFileDownload]) => Promise<{
|
|
710
929
|
status: boolean | typeof NOT_SUPPORTED;
|
|
711
930
|
}>;
|
|
712
931
|
declare const downloadFile: DownloadFile;
|
|
@@ -753,6 +972,130 @@ declare const BiometricManager: BiometricManager;
|
|
|
753
972
|
|
|
754
973
|
declare const supportBiometricManager: () => boolean;
|
|
755
974
|
|
|
975
|
+
type CheckLocation = (eventData?: SenderData[typeof MethodCheckLocation]) => Promise<{
|
|
976
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
977
|
+
data?: EventsData[typeof EventLocationChecked];
|
|
978
|
+
}>;
|
|
979
|
+
declare const checkLocation: CheckLocation;
|
|
980
|
+
declare const supportCheckLocation: () => boolean;
|
|
981
|
+
|
|
982
|
+
type OpenLocationSettings = (eventData?: SenderData[typeof MethodOpenLocationSettings]) => {
|
|
983
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
984
|
+
};
|
|
985
|
+
declare const openLocationSettings: OpenLocationSettings;
|
|
986
|
+
declare const supportOpenLocationSettings: () => boolean;
|
|
987
|
+
|
|
988
|
+
type RequestLocation = (eventData?: SenderData[typeof MethodRequestLocation]) => Promise<{
|
|
989
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
990
|
+
data?: EventsData[typeof EventLocationRequested];
|
|
991
|
+
}>;
|
|
992
|
+
declare const requestLocation: RequestLocation;
|
|
993
|
+
declare const supportRequestLocation: () => boolean;
|
|
994
|
+
|
|
995
|
+
type StartAccelerometer = (eventData?: SenderData[typeof MethodStartAccelerometer]) => Promise<{
|
|
996
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
997
|
+
data?: EventsData[typeof EventAccelerometerFailed];
|
|
998
|
+
}>;
|
|
999
|
+
declare const startAccelerometer: StartAccelerometer;
|
|
1000
|
+
declare const supportStartAccelerometer: () => boolean;
|
|
1001
|
+
|
|
1002
|
+
type StopAccelerometer = (eventData?: SenderData[typeof MethodStopAccelerometer]) => Promise<{
|
|
1003
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
1004
|
+
}>;
|
|
1005
|
+
declare const stopAccelerometer: StopAccelerometer;
|
|
1006
|
+
declare const supportStopAccelerometer: () => boolean;
|
|
1007
|
+
|
|
1008
|
+
type StartDeviceOrientation = (eventData?: SenderData[typeof MethodStartDeviceOrientation]) => Promise<{
|
|
1009
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
1010
|
+
data?: EventsData[typeof EventDeviceOrientationFailed];
|
|
1011
|
+
}>;
|
|
1012
|
+
declare const startDeviceOrientation: StartDeviceOrientation;
|
|
1013
|
+
declare const supportStartDeviceOrientation: () => boolean;
|
|
1014
|
+
|
|
1015
|
+
type StopDeviceOrientation = (eventData?: SenderData[typeof MethodStopDeviceOrientation]) => Promise<{
|
|
1016
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
1017
|
+
}>;
|
|
1018
|
+
declare const stopDeviceOrientation: StopDeviceOrientation;
|
|
1019
|
+
declare const supportStopDeviceOrientation: () => boolean;
|
|
1020
|
+
|
|
1021
|
+
type StartGyroscope = (eventData?: SenderData[typeof MethodStartGyroscope]) => Promise<{
|
|
1022
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
1023
|
+
data?: EventsData[typeof EventGyroscopeFailed];
|
|
1024
|
+
}>;
|
|
1025
|
+
declare const startGyroscope: StartGyroscope;
|
|
1026
|
+
declare const supportStartGyroscope: () => boolean;
|
|
1027
|
+
|
|
1028
|
+
type StopGyroscope = (eventData?: SenderData[typeof MethodStopGyroscope]) => Promise<{
|
|
1029
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
1030
|
+
}>;
|
|
1031
|
+
declare const stopGyroscope: StopGyroscope;
|
|
1032
|
+
declare const supportStopGyroscope: () => boolean;
|
|
1033
|
+
|
|
1034
|
+
type DeviceStorage = {
|
|
1035
|
+
setItem: (eventData: SenderData[typeof MethodDeviceStorageSaveKey]) => Promise<{
|
|
1036
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
1037
|
+
data?: EventsData[typeof EventDeviceStorageKeySaved] | EventsData[typeof EventDeviceStorageFailed];
|
|
1038
|
+
}>;
|
|
1039
|
+
getItem: (eventData: SenderData[typeof MethodDeviceStorageGetKey]) => Promise<{
|
|
1040
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
1041
|
+
data?: EventsData[typeof EventDeviceStorageKeyReceived] | EventsData[typeof EventDeviceStorageFailed];
|
|
1042
|
+
}>;
|
|
1043
|
+
removeItem: (eventData: {
|
|
1044
|
+
key: string;
|
|
1045
|
+
req_id?: string;
|
|
1046
|
+
}) => Promise<{
|
|
1047
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
1048
|
+
data?: EventsData[typeof EventDeviceStorageKeySaved] | EventsData[typeof EventDeviceStorageFailed];
|
|
1049
|
+
}>;
|
|
1050
|
+
clear: (eventData?: SenderData[typeof MethodDeviceStorageClear]) => Promise<{
|
|
1051
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
1052
|
+
data?: EventsData[typeof EventDeviceStorageCleared] | EventsData[typeof EventDeviceStorageFailed];
|
|
1053
|
+
}>;
|
|
1054
|
+
};
|
|
1055
|
+
declare const deviceStorage: DeviceStorage;
|
|
1056
|
+
declare const supportDeviceStorage: () => boolean;
|
|
1057
|
+
|
|
1058
|
+
type SecureStorage = {
|
|
1059
|
+
setItem: (eventData: SenderData[typeof MethodSecureStorageSaveKey]) => Promise<{
|
|
1060
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
1061
|
+
data?: EventsData[typeof EventSecureStorageKeySaved] | EventsData[typeof EventSecureStorageFailed];
|
|
1062
|
+
}>;
|
|
1063
|
+
getItem: (eventData: SenderData[typeof MethodSecureStorageGetKey]) => Promise<{
|
|
1064
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
1065
|
+
data?: EventsData[typeof EventSecureStorageKeyReceived] | EventsData[typeof EventSecureStorageFailed];
|
|
1066
|
+
}>;
|
|
1067
|
+
restoreItem: (eventData: SenderData[typeof MethodSecureStorageRestoreKey]) => Promise<{
|
|
1068
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
1069
|
+
data?: EventsData[typeof EventSecureStorageKeyRestored] | EventsData[typeof EventSecureStorageFailed];
|
|
1070
|
+
}>;
|
|
1071
|
+
removeItem: (eventData: {
|
|
1072
|
+
key: string;
|
|
1073
|
+
req_id?: string;
|
|
1074
|
+
}) => Promise<{
|
|
1075
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
1076
|
+
data?: EventsData[typeof EventSecureStorageKeySaved] | EventsData[typeof EventSecureStorageFailed];
|
|
1077
|
+
}>;
|
|
1078
|
+
clear: (eventData?: SenderData[typeof MethodSecureStorageClear]) => Promise<{
|
|
1079
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
1080
|
+
data?: EventsData[typeof EventSecureStorageCleared] | EventsData[typeof EventSecureStorageFailed];
|
|
1081
|
+
}>;
|
|
1082
|
+
};
|
|
1083
|
+
declare const secureStorage: SecureStorage;
|
|
1084
|
+
declare const supportSecureStorage: () => boolean;
|
|
1085
|
+
|
|
1086
|
+
type HideKeyboard = (eventData?: SenderData[typeof MethodHideKeyboard]) => {
|
|
1087
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
1088
|
+
};
|
|
1089
|
+
declare const hideKeyboard: HideKeyboard;
|
|
1090
|
+
declare const supportHideKeyboard: () => boolean;
|
|
1091
|
+
|
|
1092
|
+
type RequestChat = (eventData: SenderData[typeof MethodRequestChat]) => Promise<{
|
|
1093
|
+
status: boolean | typeof NOT_SUPPORTED;
|
|
1094
|
+
data?: EventsData[typeof EventRequestedChatFailed];
|
|
1095
|
+
}>;
|
|
1096
|
+
declare const requestChat: RequestChat;
|
|
1097
|
+
declare const supportRequestChat: () => boolean;
|
|
1098
|
+
|
|
756
1099
|
type User = {
|
|
757
1100
|
added_to_attachment_menu?: boolean;
|
|
758
1101
|
allows_write_to_pm?: boolean;
|
|
@@ -789,9 +1132,7 @@ declare const getInitData: () => GetInitData;
|
|
|
789
1132
|
declare const getAppData: () => string | null;
|
|
790
1133
|
|
|
791
1134
|
type Value = {
|
|
792
|
-
viewport?: EventsData[typeof EventViewportChanged]
|
|
793
|
-
safe_area_bottom: number;
|
|
794
|
-
};
|
|
1135
|
+
viewport?: EventsData[typeof EventViewportChanged];
|
|
795
1136
|
theme?: EventsData[typeof EventThemeChanged];
|
|
796
1137
|
init?: GetInitData;
|
|
797
1138
|
};
|
|
@@ -800,4 +1141,5 @@ interface ProviderTWA extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
|
800
1141
|
}
|
|
801
1142
|
declare const ProviderTWA: Component<ProviderTWA>;
|
|
802
1143
|
|
|
803
|
-
export { ContextTwa, EventAccelerometerChanged, EventAccelerometerFailed, EventAccelerometerStarted, EventAccelerometerStopped, EventBackButtonPressed, EventBiometryAuthRequested, EventBiometryInfoReceived, EventBiometryTokenUpdated, EventClipboardTextReceived, EventContentSafeAreaChanged, EventCustomMethodInvoked, EventDeviceOrientationChanged, EventDeviceOrientationFailed, EventDeviceOrientationStarted, EventDeviceOrientationStopped, EventEmojiStatusAccessRequested, EventEmojiStatusFailed, EventEmojiStatusSet, EventFileDownloadRequested, EventFullscreenChanged, EventFullscreenFailed, EventGyroscopeChanged, EventGyroscopeFailed, EventGyroscopeStarted, EventGyroscopeStopped, EventHomeScreenAdded, EventHomeScreenChecked,
|
|
1144
|
+
export { ContextTwa, EventAccelerometerChanged, EventAccelerometerFailed, EventAccelerometerStarted, EventAccelerometerStopped, EventBackButtonPressed, EventBiometryAuthRequested, EventBiometryInfoReceived, EventBiometryTokenUpdated, EventClipboardTextReceived, EventContentSafeAreaChanged, EventCustomMethodInvoked, EventDeviceOrientationChanged, EventDeviceOrientationFailed, EventDeviceOrientationStarted, EventDeviceOrientationStopped, EventDeviceStorageCleared, EventDeviceStorageFailed, EventDeviceStorageKeyReceived, EventDeviceStorageKeySaved, EventEmojiStatusAccessRequested, EventEmojiStatusFailed, EventEmojiStatusSet, EventFileDownloadRequested, EventFullscreenChanged, EventFullscreenFailed, EventGyroscopeChanged, EventGyroscopeFailed, EventGyroscopeStarted, EventGyroscopeStopped, EventHomeScreenAdded, EventHomeScreenChecked, EventInvoiceClosed, EventLocationChecked, EventLocationRequested, EventMainButtonPressed, EventPhoneRequested, EventPopupClosed, EventPreparedMessageFailed, EventPreparedMessageSent, EventQrTextReceived, EventReloadIframe, EventRequestedChatFailed, EventRequestedChatSent, EventSafeAreaChanged, EventScanQrPopupClosed, EventSecondaryButtonPressed, EventSecureStorageCleared, EventSecureStorageFailed, EventSecureStorageKeyReceived, EventSecureStorageKeyRestored, EventSecureStorageKeySaved, EventSetCustomStyle, EventSettingsButtonPressed, EventThemeChanged, EventViewportChanged, EventVisibilityChanged, EventWriteAccessRequested, Method, MethodAddToHomeScreen, MethodBiometryGetInfo, MethodBiometryOpenSettings, MethodBiometryRequestAccess, MethodBiometryRequestAuth, MethodBiometryUpdateToken, MethodCheckHomeScreen, MethodCheckLocation, MethodClose, MethodCloseScanQrPopup, MethodDataSend, MethodDeviceStorageClear, MethodDeviceStorageGetKey, MethodDeviceStorageSaveKey, MethodExitFullscreen, MethodExpand, MethodHideKeyboard, MethodIframeReady, MethodIframeWillReload, MethodInvokeCustomMethod, MethodOpenInvoice, MethodOpenLink, MethodOpenLocationSettings, MethodOpenPopup, MethodOpenScanQrPopup, MethodOpenTgLink, MethodReadTextFromClipboard, MethodReady, MethodRequestChat, MethodRequestContentSafeArea, MethodRequestEmojiStatusAccess, MethodRequestFileDownload, MethodRequestFullscreen, MethodRequestLocation, MethodRequestPhone, MethodRequestSafeArea, MethodRequestTheme, MethodRequestViewport, MethodRequestWriteAccess, MethodSecureStorageClear, MethodSecureStorageGetKey, MethodSecureStorageRestoreKey, MethodSecureStorageSaveKey, MethodSendPreparedMessage, MethodSetBackgroundColor, MethodSetBottomBarColor, MethodSetEmojiStatus, MethodSetHeaderColor, MethodSetupBackButton, MethodSetupClosingBehavior, MethodSetupMainButton, MethodSetupSecondaryButton, MethodSetupSettingsButton, MethodSetupSwipeBehavior, MethodShareToStory, MethodStartAccelerometer, MethodStartDeviceOrientation, MethodStartGyroscope, MethodStopAccelerometer, MethodStopDeviceOrientation, MethodStopGyroscope, MethodSwitchInlineQuery, MethodToggleOrientationLock, MethodTriggerHapticFeedback, NOT_SUPPORTED, ProviderTWA, TG_DESKTOP, TG_PHONE, TG_WEB, addToHomeScreen as bridgeAddToHomeScreen, BiometricManager as bridgeBiometricManager, checkHomeScreen as bridgeCheckHomeScreen, checkLocation as bridgeCheckLocation, close as bridgeClose, closeScanQrPopup as bridgeCloseScanQrPopup, dataSend as bridgeDataSend, deviceStorage as bridgeDeviceStorage, downloadFile as bridgeDownloadFile, expand as bridgeExpand, getInitData as bridgeGetInitData, getThemeParams as bridgeGetThemeParams, hideKeyboard as bridgeHideKeyboard, iframeReady as bridgeIframeReady, iframeWillReload as bridgeIframeWillReload, invokeCustomMethod as bridgeInvokeCustomMethod, openInvoice as bridgeOpenInvoice, openLink as bridgeOpenLink, openLocationSettings as bridgeOpenLocationSettings, openPopup as bridgeOpenPopup, openScanQrPopup as bridgeOpenScanQrPopup, openTgLink as bridgeOpenTgLink, readTextFromClipboard as bridgeReadTextFromClipboard, ready as bridgeReady, requestChat as bridgeRequestChat, requestContentSafeAreaInset as bridgeRequestContentSafeAreaInset, requestEmojiStatus as bridgeRequestEmojiStatus, requestLocation as bridgeRequestLocation, requestPhone as bridgeRequestPhone, requestSafeAreaInset as bridgeRequestSafeAreaInset, requestTheme as bridgeRequestTheme, requestViewport as bridgeRequestViewport, requestWriteAccess as bridgeRequestWriteAccess, secureStorage as bridgeSecureStorage, send as bridgeSend, sessionStorageGet as bridgeSessionStorageGet, sessionStorageSet as bridgeSessionStorageSet, setBackgroundColor as bridgeSetBackgroundColor, setBottomBarColor as bridgeSetBottomBarColor, setEmojiStatus as bridgeSetEmojiStatus, setHeaderColor as bridgeSetHeaderColor, setupBackButton as bridgeSetupBackButton, setupClosingBehavior as bridgeSetupClosingBehavior, setupFullScreen as bridgeSetupFullScreen, setupMainButton as bridgeSetupMainButton, setupOrientation as bridgeSetupOrientation, setupSecondaryButton as bridgeSetupSecondaryButton, setupSettingsButton as bridgeSetupSettingsButton, setupSwipeBehavior as bridgeSetupSwipeBehavior, shareMessage as bridgeShareMessage, shareToStory as bridgeShareToStory, startAccelerometer as bridgeStartAccelerometer, startDeviceOrientation as bridgeStartDeviceOrientation, startGyroscope as bridgeStartGyroscope, stopAccelerometer as bridgeStopAccelerometer, stopDeviceOrientation as bridgeStopDeviceOrientation, stopGyroscope as bridgeStopGyroscope, switchInlineQuery as bridgeSwitchInlineQuery, triggerHapticFeedback as bridgeTriggerHapticFeedback, createIsViewportChanged, debug, getAppData, getPlatform, listener, sender, supportAddToHomeScreen, supportBiometricManager, supportCheckHomeScreen, supportCheckLocation, supportClose, supportCloseScanQrPopup, supportDataSend, supportDeviceStorage, supportDownloadFile, supportExpand, supportHideKeyboard, supportIframeReady, supportIframeWillReload, supportInvokeCustomMethod, supportOpenInvoice, supportOpenLink, supportOpenLocationSettings, supportOpenPopup, supportOpenScanQrPopup, supportOpenTgLink, supportReadTextFromClipboard, supportReady, supportRequestChat, supportRequestContentSafeAreaInset, supportRequestEmojiStatus, supportRequestLocation, supportRequestPhone, supportRequestSafeAreaInset, supportRequestTheme, supportRequestViewport, supportRequestWriteAccess, supportSecureStorage, supportSessionStorageGet, supportSessionStorageSet, supportSetBackgroundColor, supportSetBottomBarColor, supportSetEmojiStatus, supportSetHeaderColor, supportSetupBackButton, supportSetupClosingBehavior, supportSetupFullScreen, supportSetupMainButton, supportSetupOrientation, supportSetupSecondaryButton, supportSetupSettingsButton, supportSetupSwipeBehavior, supportShareMessage, supportShareToStory, supportStartAccelerometer, supportStartDeviceOrientation, supportStartGyroscope, supportStopAccelerometer, supportStopDeviceOrientation, supportStopGyroscope, supportSwitchInlineQuery, supportTriggerHapticFeedback };
|
|
1145
|
+
export type { EventsData, GetInitData, PopupButton, SenderData, ThemeParams };
|