@apiteam/twa-bridge 8.0.12 → 9.6.0

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/solid/index.d.ts CHANGED
@@ -1,201 +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?: any) => void;
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
- };
167
- interface TelegramGameProxy {
168
- receiveEvent: (event: string, data: string) => void;
169
- }
170
- interface TelegramWebviewProxy {
171
- postEvent: (event: string, data: string) => void;
172
- }
173
- declare global {
174
- interface External {
175
- notify: (event: string) => void;
176
- }
177
- interface Window {
178
- TelegramWebviewProxy: TelegramWebviewProxy;
179
- TelegramGameProxy: TelegramGameProxy;
180
- TelegramGameProxy_receiveEvent: TelegramGameProxy['receiveEvent'];
181
- Telegram: {
182
- WebView: TelegramGameProxy;
183
- };
184
- }
185
- }
186
- type Listened = <T extends EventsData, E extends keyof T, D extends T[E]>(eventName: E, callback: (eventData: D) => void) => void;
187
- declare const on: Listened;
188
- declare const off: Listened;
189
- declare const once: Listened;
190
-
191
- type listener_EventsData = EventsData;
192
- declare const listener_off: typeof off;
193
- declare const listener_on: typeof on;
194
- declare const listener_once: typeof once;
195
- declare namespace listener {
196
- export { type listener_EventsData as EventsData, listener_off as off, listener_on as on, listener_once as once };
197
- }
198
-
199
7
  declare const MethodInvokeCustomMethod = "web_app_invoke_custom_method";
200
8
  declare const MethodOpenScanQrPopup = "web_app_open_scan_qr_popup";
201
9
  declare const MethodReadTextFromClipboard = "web_app_read_text_from_clipboard";
@@ -251,6 +59,15 @@ declare const MethodStopAccelerometer = "web_app_stop_accelerometer";
251
59
  declare const MethodStopDeviceOrientation = "web_app_stop_device_orientation";
252
60
  declare const MethodStopGyroscope = "web_app_stop_gyroscope";
253
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";
254
71
  declare enum Method {
255
72
  InvokeCustomMethod = "web_app_invoke_custom_method",
256
73
  OpenScanQrPopup = "web_app_open_scan_qr_popup",
@@ -291,12 +108,40 @@ declare enum Method {
291
108
  SendPreparedMessage = "web_app_send_prepared_message",
292
109
  SetEmojiStatus = "web_app_set_emoji_status",
293
110
  RequestEmojiStatusAccess = "web_app_request_emoji_status_access",
294
- 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"
295
136
  }
296
137
  type PopupButton = {
297
- id: string;
298
- type: 'default' | 'destructive' | 'ok' | 'close' | 'cancel';
138
+ id?: string;
139
+ type?: 'default' | 'destructive';
299
140
  text: string;
141
+ } | {
142
+ id?: string;
143
+ type: 'ok' | 'close' | 'cancel';
144
+ text?: string;
300
145
  };
301
146
  type SenderData = {
302
147
  [MethodInvokeCustomMethod]: {
@@ -331,9 +176,9 @@ type SenderData = {
331
176
  try_browser?: boolean;
332
177
  };
333
178
  [MethodOpenPopup]: {
334
- title: string;
179
+ title?: string;
335
180
  message: string;
336
- buttons: PopupButton[];
181
+ buttons?: PopupButton[];
337
182
  };
338
183
  [MethodOpenTgLink]: {
339
184
  path_full: string;
@@ -373,6 +218,8 @@ type SenderData = {
373
218
  text?: string;
374
219
  color?: string;
375
220
  text_color?: string;
221
+ has_shine_effect?: boolean;
222
+ icon_custom_emoji_id?: string;
376
223
  };
377
224
  [MethodSetupSettingsButton]: {
378
225
  is_visible: boolean;
@@ -396,7 +243,7 @@ type SenderData = {
396
243
  allow_vertical_swipe: boolean;
397
244
  };
398
245
  [MethodShareToStory]: {
399
- media: string;
246
+ media_url: string;
400
247
  text?: string;
401
248
  widget_link?: {
402
249
  url: string;
@@ -405,19 +252,15 @@ type SenderData = {
405
252
  };
406
253
  [MethodRequestSafeArea]: undefined;
407
254
  [MethodRequestContentSafeArea]: undefined;
408
- [MethodRequestFullscreen]: {
409
- is_full: boolean;
410
- };
411
- [MethodExitFullscreen]: {
412
- is_full: boolean;
413
- };
255
+ [MethodRequestFullscreen]: undefined;
256
+ [MethodExitFullscreen]: undefined;
414
257
  [MethodToggleOrientationLock]: {
415
258
  locked: boolean;
416
259
  };
417
260
  [MethodAddToHomeScreen]: undefined;
418
261
  [MethodCheckHomeScreen]: undefined;
419
262
  [MethodSendPreparedMessage]: {
420
- msg_id: number;
263
+ id: string;
421
264
  };
422
265
  [MethodSetEmojiStatus]: {
423
266
  custom_emoji_id: string;
@@ -438,11 +281,378 @@ type SenderData = {
438
281
  token: string;
439
282
  };
440
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
+ };
441
344
  };
442
345
 
346
+ declare const send: <E extends keyof SenderData>(name: E, data?: SenderData[E]) => Promise<unknown>;
347
+
443
348
  type Debug = (methondName: string, errorId: number) => void;
444
349
  declare const debug: Debug;
445
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
+ type Listened = <E extends keyof EventsData>(eventName: E, callback: (eventData: EventsData[E]) => void) => void;
643
+ declare const on: Listened;
644
+ declare const off: Listened;
645
+ declare const once: Listened;
646
+
647
+ type listener_EventsData = EventsData;
648
+ declare const listener_off: typeof off;
649
+ declare const listener_on: typeof on;
650
+ declare const listener_once: typeof once;
651
+ declare namespace listener {
652
+ export { listener_off as off, listener_on as on, listener_once as once };
653
+ export type { listener_EventsData as EventsData };
654
+ }
655
+
446
656
  declare const createIsViewportChanged: () => solid_js.Accessor<{
447
657
  height: number;
448
658
  width?: number;
@@ -580,6 +790,12 @@ type SetBottomBarColor = (eventData: SenderData[typeof MethodSetBottomBarColor])
580
790
  declare const setBottomBarColor: SetBottomBarColor;
581
791
  declare const supportSetBottomBarColor: () => boolean;
582
792
 
793
+ type SetupSecondaryButton = (eventData: SenderData[typeof MethodSetupSecondaryButton]) => {
794
+ status: boolean | typeof NOT_SUPPORTED;
795
+ };
796
+ declare const setupSecondaryButton: SetupSecondaryButton;
797
+ declare const supportSetupSecondaryButton: () => boolean;
798
+
583
799
  type SetupBackButton = (eventData: SenderData[typeof MethodSetupBackButton]) => {
584
800
  status: boolean | typeof NOT_SUPPORTED;
585
801
  };
@@ -618,7 +834,7 @@ declare const supportTriggerHapticFeedback: () => boolean;
618
834
 
619
835
  type SessionStorageSet = ({ key, value }: {
620
836
  key: string;
621
- value: any;
837
+ value: unknown;
622
838
  }) => {
623
839
  status: boolean | typeof NOT_SUPPORTED;
624
840
  };
@@ -630,7 +846,7 @@ type SessionStorageGet = ({ key }: {
630
846
  }) => {
631
847
  is_json: boolean;
632
848
  status: boolean | typeof NOT_SUPPORTED;
633
- value?: any;
849
+ value?: unknown;
634
850
  };
635
851
  declare const sessionStorageGet: SessionStorageGet;
636
852
  declare const supportSessionStorageGet: () => boolean;
@@ -641,7 +857,7 @@ type SetupSwipeBehavior = (eventData: SenderData[typeof MethodSetupSwipeBehavior
641
857
  declare const setupSwipeBehavior: SetupSwipeBehavior;
642
858
  declare const supportSetupSwipeBehavior: () => boolean;
643
859
 
644
- type ShareToStory = (eventData?: SenderData[typeof MethodShareToStory]) => {
860
+ type ShareToStory = (eventData: SenderData[typeof MethodShareToStory]) => {
645
861
  status: boolean | typeof NOT_SUPPORTED;
646
862
  error_id?: number;
647
863
  };
@@ -673,7 +889,9 @@ type RequestContentSafeAreaInset = (eventData?: SenderData[typeof MethodRequestC
673
889
  declare const requestContentSafeAreaInset: RequestContentSafeAreaInset;
674
890
  declare const supportRequestContentSafeAreaInset: () => boolean;
675
891
 
676
- type SetupFullScreen = (eventData?: SenderData[typeof MethodRequestFullscreen]) => {
892
+ type SetupFullScreen = (eventData?: {
893
+ is_full?: boolean;
894
+ }) => {
677
895
  status: boolean | typeof NOT_SUPPORTED;
678
896
  };
679
897
  declare const setupFullScreen: SetupFullScreen;
@@ -691,19 +909,21 @@ type RequestEmojiStatus = (eventData?: SenderData[typeof MethodRequestEmojiStatu
691
909
  declare const requestEmojiStatus: RequestEmojiStatus;
692
910
  declare const supportRequestEmojiStatus: () => boolean;
693
911
 
694
- type SetEmojiStatus = (eventData?: SenderData[typeof MethodSetEmojiStatus]) => Promise<{
912
+ type SetEmojiStatus = (eventData: SenderData[typeof MethodSetEmojiStatus]) => Promise<{
695
913
  status: boolean | typeof NOT_SUPPORTED;
914
+ data?: EventsData[typeof EventEmojiStatusFailed];
696
915
  }>;
697
916
  declare const setEmojiStatus: SetEmojiStatus;
698
917
  declare const supportSetEmojiStatus: () => boolean;
699
918
 
700
- type ShareMessage = (eventData?: SenderData[typeof MethodSendPreparedMessage]) => Promise<{
919
+ type ShareMessage = (eventData: SenderData[typeof MethodSendPreparedMessage]) => Promise<{
701
920
  status: boolean | typeof NOT_SUPPORTED;
921
+ data?: EventsData[typeof EventPreparedMessageFailed];
702
922
  }>;
703
923
  declare const shareMessage: ShareMessage;
704
924
  declare const supportShareMessage: () => boolean;
705
925
 
706
- type DownloadFile = (eventData?: SenderData[typeof MethodRequestFileDownload]) => Promise<{
926
+ type DownloadFile = (eventData: SenderData[typeof MethodRequestFileDownload]) => Promise<{
707
927
  status: boolean | typeof NOT_SUPPORTED;
708
928
  }>;
709
929
  declare const downloadFile: DownloadFile;
@@ -750,6 +970,130 @@ declare const BiometricManager: BiometricManager;
750
970
 
751
971
  declare const supportBiometricManager: () => boolean;
752
972
 
973
+ type CheckLocation = (eventData?: SenderData[typeof MethodCheckLocation]) => Promise<{
974
+ status: boolean | typeof NOT_SUPPORTED;
975
+ data?: EventsData[typeof EventLocationChecked];
976
+ }>;
977
+ declare const checkLocation: CheckLocation;
978
+ declare const supportCheckLocation: () => boolean;
979
+
980
+ type OpenLocationSettings = (eventData?: SenderData[typeof MethodOpenLocationSettings]) => {
981
+ status: boolean | typeof NOT_SUPPORTED;
982
+ };
983
+ declare const openLocationSettings: OpenLocationSettings;
984
+ declare const supportOpenLocationSettings: () => boolean;
985
+
986
+ type RequestLocation = (eventData?: SenderData[typeof MethodRequestLocation]) => Promise<{
987
+ status: boolean | typeof NOT_SUPPORTED;
988
+ data?: EventsData[typeof EventLocationRequested];
989
+ }>;
990
+ declare const requestLocation: RequestLocation;
991
+ declare const supportRequestLocation: () => boolean;
992
+
993
+ type StartAccelerometer = (eventData?: SenderData[typeof MethodStartAccelerometer]) => Promise<{
994
+ status: boolean | typeof NOT_SUPPORTED;
995
+ data?: EventsData[typeof EventAccelerometerFailed];
996
+ }>;
997
+ declare const startAccelerometer: StartAccelerometer;
998
+ declare const supportStartAccelerometer: () => boolean;
999
+
1000
+ type StopAccelerometer = (eventData?: SenderData[typeof MethodStopAccelerometer]) => Promise<{
1001
+ status: boolean | typeof NOT_SUPPORTED;
1002
+ }>;
1003
+ declare const stopAccelerometer: StopAccelerometer;
1004
+ declare const supportStopAccelerometer: () => boolean;
1005
+
1006
+ type StartDeviceOrientation = (eventData?: SenderData[typeof MethodStartDeviceOrientation]) => Promise<{
1007
+ status: boolean | typeof NOT_SUPPORTED;
1008
+ data?: EventsData[typeof EventDeviceOrientationFailed];
1009
+ }>;
1010
+ declare const startDeviceOrientation: StartDeviceOrientation;
1011
+ declare const supportStartDeviceOrientation: () => boolean;
1012
+
1013
+ type StopDeviceOrientation = (eventData?: SenderData[typeof MethodStopDeviceOrientation]) => Promise<{
1014
+ status: boolean | typeof NOT_SUPPORTED;
1015
+ }>;
1016
+ declare const stopDeviceOrientation: StopDeviceOrientation;
1017
+ declare const supportStopDeviceOrientation: () => boolean;
1018
+
1019
+ type StartGyroscope = (eventData?: SenderData[typeof MethodStartGyroscope]) => Promise<{
1020
+ status: boolean | typeof NOT_SUPPORTED;
1021
+ data?: EventsData[typeof EventGyroscopeFailed];
1022
+ }>;
1023
+ declare const startGyroscope: StartGyroscope;
1024
+ declare const supportStartGyroscope: () => boolean;
1025
+
1026
+ type StopGyroscope = (eventData?: SenderData[typeof MethodStopGyroscope]) => Promise<{
1027
+ status: boolean | typeof NOT_SUPPORTED;
1028
+ }>;
1029
+ declare const stopGyroscope: StopGyroscope;
1030
+ declare const supportStopGyroscope: () => boolean;
1031
+
1032
+ type DeviceStorage = {
1033
+ setItem: (eventData: SenderData[typeof MethodDeviceStorageSaveKey]) => Promise<{
1034
+ status: boolean | typeof NOT_SUPPORTED;
1035
+ data?: EventsData[typeof EventDeviceStorageKeySaved] | EventsData[typeof EventDeviceStorageFailed];
1036
+ }>;
1037
+ getItem: (eventData: SenderData[typeof MethodDeviceStorageGetKey]) => Promise<{
1038
+ status: boolean | typeof NOT_SUPPORTED;
1039
+ data?: EventsData[typeof EventDeviceStorageKeyReceived] | EventsData[typeof EventDeviceStorageFailed];
1040
+ }>;
1041
+ removeItem: (eventData: {
1042
+ key: string;
1043
+ req_id?: string;
1044
+ }) => Promise<{
1045
+ status: boolean | typeof NOT_SUPPORTED;
1046
+ data?: EventsData[typeof EventDeviceStorageKeySaved] | EventsData[typeof EventDeviceStorageFailed];
1047
+ }>;
1048
+ clear: (eventData?: SenderData[typeof MethodDeviceStorageClear]) => Promise<{
1049
+ status: boolean | typeof NOT_SUPPORTED;
1050
+ data?: EventsData[typeof EventDeviceStorageCleared] | EventsData[typeof EventDeviceStorageFailed];
1051
+ }>;
1052
+ };
1053
+ declare const deviceStorage: DeviceStorage;
1054
+ declare const supportDeviceStorage: () => boolean;
1055
+
1056
+ type SecureStorage = {
1057
+ setItem: (eventData: SenderData[typeof MethodSecureStorageSaveKey]) => Promise<{
1058
+ status: boolean | typeof NOT_SUPPORTED;
1059
+ data?: EventsData[typeof EventSecureStorageKeySaved] | EventsData[typeof EventSecureStorageFailed];
1060
+ }>;
1061
+ getItem: (eventData: SenderData[typeof MethodSecureStorageGetKey]) => Promise<{
1062
+ status: boolean | typeof NOT_SUPPORTED;
1063
+ data?: EventsData[typeof EventSecureStorageKeyReceived] | EventsData[typeof EventSecureStorageFailed];
1064
+ }>;
1065
+ restoreItem: (eventData: SenderData[typeof MethodSecureStorageRestoreKey]) => Promise<{
1066
+ status: boolean | typeof NOT_SUPPORTED;
1067
+ data?: EventsData[typeof EventSecureStorageKeyRestored] | EventsData[typeof EventSecureStorageFailed];
1068
+ }>;
1069
+ removeItem: (eventData: {
1070
+ key: string;
1071
+ req_id?: string;
1072
+ }) => Promise<{
1073
+ status: boolean | typeof NOT_SUPPORTED;
1074
+ data?: EventsData[typeof EventSecureStorageKeySaved] | EventsData[typeof EventSecureStorageFailed];
1075
+ }>;
1076
+ clear: (eventData?: SenderData[typeof MethodSecureStorageClear]) => Promise<{
1077
+ status: boolean | typeof NOT_SUPPORTED;
1078
+ data?: EventsData[typeof EventSecureStorageCleared] | EventsData[typeof EventSecureStorageFailed];
1079
+ }>;
1080
+ };
1081
+ declare const secureStorage: SecureStorage;
1082
+ declare const supportSecureStorage: () => boolean;
1083
+
1084
+ type HideKeyboard = (eventData?: SenderData[typeof MethodHideKeyboard]) => {
1085
+ status: boolean | typeof NOT_SUPPORTED;
1086
+ };
1087
+ declare const hideKeyboard: HideKeyboard;
1088
+ declare const supportHideKeyboard: () => boolean;
1089
+
1090
+ type RequestChat = (eventData: SenderData[typeof MethodRequestChat]) => Promise<{
1091
+ status: boolean | typeof NOT_SUPPORTED;
1092
+ data?: EventsData[typeof EventRequestedChatFailed];
1093
+ }>;
1094
+ declare const requestChat: RequestChat;
1095
+ declare const supportRequestChat: () => boolean;
1096
+
753
1097
  type User = {
754
1098
  added_to_attachment_menu?: boolean;
755
1099
  allows_write_to_pm?: boolean;
@@ -786,9 +1130,7 @@ declare const getInitData: () => GetInitData;
786
1130
  declare const getAppData: () => string | null;
787
1131
 
788
1132
  type Value = {
789
- viewport?: EventsData[typeof EventViewportChanged] & {
790
- safe_area_bottom: number;
791
- };
1133
+ viewport?: EventsData[typeof EventViewportChanged];
792
1134
  theme?: EventsData[typeof EventThemeChanged];
793
1135
  init?: GetInitData;
794
1136
  };
@@ -797,4 +1139,5 @@ interface ProviderTWA extends JSX.HTMLAttributes<HTMLDivElement> {
797
1139
  }
798
1140
  declare const ProviderTWA: Component<ProviderTWA>;
799
1141
 
800
- 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, EventHomeScreenFailed, EventInvoiceClosed, EventLocationChecked, EventLocationRequested, EventMainButtonPressed, EventPhoneRequested, EventPopupClosed, EventPreparedMessageFailed, EventPreparedMessageSent, EventQrTextReceived, EventReloadIframe, EventSafeAreaChanged, EventScanQrPopupClosed, EventSecondaryButtonPressed, EventSetCustomStyle, EventSettingsButtonPressed, EventThemeChanged, EventViewportChanged, EventVisibilityChanged, EventWriteAccessRequested, type EventsData, type GetInitData, Method, MethodAddToHomeScreen, MethodBiometryGetInfo, MethodBiometryOpenSettings, MethodBiometryRequestAccess, MethodBiometryRequestAuth, MethodBiometryUpdateToken, MethodCheckHomeScreen, MethodCheckLocation, MethodClose, MethodCloseScanQrPopup, MethodDataSend, MethodExitFullscreen, MethodExpand, MethodIframeReady, MethodIframeWillReload, MethodInvokeCustomMethod, MethodOpenInvoice, MethodOpenLink, MethodOpenLocationSettings, MethodOpenPopup, MethodOpenScanQrPopup, MethodOpenTgLink, MethodReadTextFromClipboard, MethodReady, MethodRequestContentSafeArea, MethodRequestEmojiStatusAccess, MethodRequestFileDownload, MethodRequestFullscreen, MethodRequestLocation, MethodRequestPhone, MethodRequestSafeArea, MethodRequestTheme, MethodRequestViewport, MethodRequestWriteAccess, MethodSendPreparedMessage, MethodSetBackgroundColor, MethodSetBottomBarColor, MethodSetEmojiStatus, MethodSetHeaderColor, MethodSetupBackButton, MethodSetupClosingBehavior, MethodSetupMainButton, MethodSetupSecondaryButton, MethodSetupSettingsButton, MethodSetupSwipeBehavior, MethodShareToStory, MethodStartAccelerometer, MethodStartDeviceOrientation, MethodStartGyroscope, MethodStopAccelerometer, MethodStopDeviceOrientation, MethodStopGyroscope, MethodSwitchInlineQuery, MethodToggleOrientationLock, MethodTriggerHapticFeedback, NOT_SUPPORTED, type PopupButton, ProviderTWA, type SenderData, TG_DESKTOP, TG_PHONE, TG_WEB, type ThemeParams, addToHomeScreen as bridgeAddToHomeScreen, BiometricManager as bridgeBiometricManager, checkHomeScreen as bridgeCheckHomeScreen, close as bridgeClose, closeScanQrPopup as bridgeCloseScanQrPopup, dataSend as bridgeDataSend, downloadFile as bridgeDownloadFile, expand as bridgeExpand, getInitData as bridgeGetInitData, getThemeParams as bridgeGetThemeParams, iframeReady as bridgeIframeReady, iframeWillReload as bridgeIframeWillReload, invokeCustomMethod as bridgeInvokeCustomMethod, openInvoice as bridgeOpenInvoice, openLink as bridgeOpenLink, openPopup as bridgeOpenPopup, openScanQrPopup as bridgeOpenScanQrPopup, openTgLink as bridgeOpenTgLink, readTextFromClipboard as bridgeReadTextFromClipboard, ready as bridgeReady, requestContentSafeAreaInset as bridgeRequestContentSafeAreaInset, requestEmojiStatus as bridgeRequestEmojiStatus, requestPhone as bridgeRequestPhone, requestSafeAreaInset as bridgeRequestSafeAreaInset, requestTheme as bridgeRequestTheme, requestViewport as bridgeRequestViewport, requestWriteAccess as bridgeRequestWriteAccess, sender 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, setupSettingsButton as bridgeSetupSettingsButton, setupSwipeBehavior as bridgeSetupSwipeBehavior, shareMessage as bridgeShareMessage, shareToStory as bridgeShareToStory, switchInlineQuery as bridgeSwitchInlineQuery, triggerHapticFeedback as bridgeTriggerHapticFeedback, createIsViewportChanged, debug, getAppData, getPlatform, listener, sender, supportAddToHomeScreen, supportBiometricManager, supportCheckHomeScreen, supportClose, supportCloseScanQrPopup, supportDataSend, supportDownloadFile, supportExpand, supportIframeReady, supportIframeWillReload, supportInvokeCustomMethod, supportOpenInvoice, supportOpenLink, supportOpenPopup, supportOpenScanQrPopup, supportOpenTgLink, supportReadTextFromClipboard, supportReady, supportRequestContentSafeAreaInset, supportRequestEmojiStatus, supportRequestPhone, supportRequestSafeAreaInset, supportRequestTheme, supportRequestViewport, supportRequestWriteAccess, supportSessionStorageGet, supportSessionStorageSet, supportSetBackgroundColor, supportSetBottomBarColor, supportSetEmojiStatus, supportSetHeaderColor, supportSetupBackButton, supportSetupClosingBehavior, supportSetupFullScreen, supportSetupMainButton, supportSetupOrientation, supportSetupSettingsButton, supportSetupSwipeBehavior, supportShareMessage, supportShareToStory, supportSwitchInlineQuery, supportTriggerHapticFeedback };
1142
+ 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 };
1143
+ export type { EventsData, GetInitData, PopupButton, SenderData, ThemeParams };