Repository navigation
Expand file tree
/
Copy pathtypes.ts
More file actions
154 lines (128 loc) · 2.52 KB
/
Copy pathtypes.ts
File metadata and controls
154 lines (128 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
import type { RTCIceCandidate } from "../util/validation/receive.js";
export type RESPONSE_CREATE_SESSION = {
id: number;
};
export type RESPONSE_ATTACH_HANDLE = {
id: number;
};
export type RESPONSE_CREATE_ROOM = {
audiobridge: "created";
room: number;
permanent: boolean;
};
export type RESPONSE_LEAVE_ROOM = {
audiobridge: "left";
room: number;
id: number;
};
type JANUS_PARTICIPANT = {
id: number;
display?: string;
setup: boolean;
muted: boolean;
suspended: boolean;
talking: boolean;
spatial_position: boolean;
};
export type RESPONSE_JOIN_ROOM = {
audiobridge: "joined";
room: number;
id: number;
display: string;
participants: JANUS_PARTICIPANT[];
};
export type RESPONSE_CONFIGURE = {
audiobridge: "event";
result: "ok";
jsep: { type: "answer"; sdp: string };
};
export type JANUS_RESPONSE_DATA =
| RESPONSE_LEAVE_ROOM
| RESPONSE_CONFIGURE
| RESPONSE_JOIN_ROOM
| RESPONSE_CREATE_ROOM
| RESPONSE_CREATE_SESSION
| RESPONSE_ATTACH_HANDLE;
type JANUS_ACK = {
janus: "ack";
session_id: number;
transaction: string;
};
type JANUS_SUCCESS<T extends JANUS_RESPONSE_DATA> = {
janus: "success" | "event";
transaction: string;
session_id?: number;
sender?: number;
data: T;
plugindata?: T;
jsep?: { type: "answer"; sdp: string };
};
export type JANUS_RESPONSE<T extends JANUS_RESPONSE_DATA> = JANUS_SUCCESS<T> | JANUS_ACK;
type REQUEST_KEEPALIVE = {
janus: "keepalive";
session_id: number;
};
type REQUEST_TRICKLE = {
janus: "trickle";
candidates: Array<RTCIceCandidate | null>;
session_id: number;
handle_id: number;
};
type REQUEST_CONFIGURE = {
janus: "message";
body: {
request: "configure";
};
jsep?: {
type: string;
sdp: string;
};
session_id: number;
handle_id: number;
};
type REQUEST_JOIN_ROOM = {
janus: "message";
body: {
request: "join";
room: number;
display?: string;
// TODO
};
session_id: number;
handle_id: number;
};
type REQUEST_LEAVE_ROOM = {
janus: "message";
body: {
request: "leave";
};
session_id: number;
handle_id: number;
};
type REQUEST_CREATE_ROOM = {
janus: "message";
body: {
request: "create";
room?: number;
audiolevel_event?: boolean;
};
session_id: number;
handle_id: number;
};
type REQUEST_CREATE_SESSION = {
janus: "create";
};
type REQUEST_ATTACH_HANDLE = {
janus: "attach";
session_id: number;
plugin: string;
};
export type JANUS_REQUEST =
| REQUEST_LEAVE_ROOM
| REQUEST_KEEPALIVE
| REQUEST_TRICKLE
| REQUEST_JOIN_ROOM
| REQUEST_CONFIGURE
| REQUEST_CREATE_SESSION
| REQUEST_ATTACH_HANDLE
| REQUEST_CREATE_ROOM;