Skip to content

Commit ef9a569

Browse files
committed
return Events.ts
1 parent 945cff2 commit ef9a569

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

packages/mini-app/src/Events.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Event types that can be received by the mini app from the client.
3+
*
4+
* @see https://core.telegram.org/api/bots/webapps#incoming-events-client-to-mini-app
5+
*/
6+
export interface IncomingEventMap {
7+
back_button_pressed: void
8+
9+
settings_button_pressed: void
10+
}
11+
12+
/**
13+
* Event types that can be emitted by the mini app to the client.
14+
*
15+
* @see https://core.telegram.org/api/web-events#event-apis
16+
*/
17+
export interface OutgoingEventMap {
18+
web_app_setup_back_button: {
19+
is_visible: boolean
20+
}
21+
22+
web_app_setup_settings_button: {
23+
is_visible: boolean
24+
}
25+
26+
web_app_trigger_haptic_feedback:
27+
| { type: 'impact', impact_style: 'light' | 'medium' | 'heavy' | 'rigid' | 'soft' }
28+
| { type: 'notification', notification_type: 'error' | 'success' | 'warning' }
29+
| { type: 'selection_change' }
30+
}

0 commit comments

Comments
 (0)