forked from mml-io/mml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevents.d.ts
42 lines (38 loc) · 921 Bytes
/
events.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* A class that extends {@link Event | `Event`}.
*/
export interface RemoteEvent extends Event {
readonly detail: {
/**
* The unique numeric id of the connection that sent the event.
*/
readonly connectionId: number;
};
}
export interface ConnectionEvent extends RemoteEvent {
readonly type: "disconnected" | "connected";
}
/**
* Received when a user interacts with an m-interaction.
*/
export interface MMLInteractionEvent extends RemoteEvent {
readonly type: "interact";
}
/**
* Received when a user triggers a prompt with a value.
*/
export interface MMLPromptEvent extends RemoteEvent {
readonly type: "prompt";
readonly detail: {
/**
* The value of the prompt.
*/
readonly value: string;
} & RemoteEvent["detail"];
}
/**
* Received when a user clicks on a 3D object.
*/
export interface MMLClickEvent extends RemoteEvent {
readonly type: "click";
}