-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.d.ts
435 lines (403 loc) · 8.07 KB
/
types.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
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
export type HomeContext = {
page: number
page_size: number
}
export type URLContext = {
url: string
page: number
page_size: number
}
export type LiveEventsContext = {
login: string
channel_id: number
chatroom_id: number
emojis: { [key: string]: string }
events: LiveEvent[]
lastFetch: number
}
export type Category = {
category: {
icon: string
id: number
name: string
slug: string
}
category_id: number
deleted_at?: string
description?: string
id: number
name: string
slug: string
tags: string[]
viewers: number
banner: {
responsive: string
url: string
}
}
type User = {
agreed_to_terms: boolean
bio: string
city?: string
country?: string
discord?: string
email_verified_at?: string
facebook?: string
id: number
instagram?: string
profile_pic: string
state?: string
tiktok?: string
twitter?: string
username: string
youtube?: string
}
export type Channel = {
can_host: boolean
id: number
is_banned: boolean
name_updated_at?: string
playback_url: string
slug: string
subscription_enabled: boolean
user: User
user_id: number
vod_enabled: boolean
}
export type Stream = {
categories: Category[]
channel: Channel
channel_id: number
created_at: string
duration: number
id: number
is_live: boolean
is_mature: boolean
language: string
order: number
risk_level_id?: number
session_title: string
slug: string
source?: string
thumbnail: {
src: string
srcset: string
}
twitch_channel?: number
viewer_count: number
viewers: number
}
type HighlightObject = {
username: {
matched_tokens: string[]
snippet: string
}
}
export type SearchResult = {
document: {
followers_count: number
id: string
is_banned: boolean
is_live: boolean
slug: string
username: string
verified: boolean
}
highlight: HighlightObject
highlights: HighlightObject[]
text_match: number
text_match_info: {
best_field_score: string
best_field_weight: number
fields_matched: number
score: string
tokens_matched: number
}
}
export type ResultsObject = {
facet_counts: any[]
found: number
hits: SearchResult[]
out_of: number
page: number
request_params: {
collection_name: 'channel'
per_page: number
q: string
}
search_cutoff: boolean
search_time_ms: number
}
export type MultiSearchResponse = {
results: ResultsObject[]
}
type ListWrapper<T> = {
current_page: number
data: T[]
first_page_url: string
from: number
next_page_url: string
path: string
per_page: number
prev_page_url: string
to: number
}
export type FeaturedStreamResponse = ListWrapper<Stream>
type Badge = {
id: number
channel_id: number
months: number
badge_image: {
src: string
srcset: string
}
}
type Chatroom = {
id: number
chatable_type: string
channel_id: number
created_at: string
updated_at: string
chat_mode_old: string
chat_mode: string
slow_mode: boolean
chatable_id: number
followers_mode: boolean
subscribers_mode: boolean
emotes_mode: boolean
message_interval: number
following_min_duration: number
}
type AscendingLink = {
id: number
channel_id: number
description?: string
link: string
created_at: string
updated_at: string
order: number
title: string
}
type Vod = {
id: number
live_stream_id: number
slug?: string
thumb?: string
s3?: string
trading_platform_id?: number
created_at: string
updated_at: string
uuid: string
views: number
deleted_at?: string
}
type PreviousLivestream = {
id: number
slug: string
channel_id: number
created_at: string
session_title: string
is_live: boolean
risk_level_id?: number
source?: string
twitch_channel?: string
duration: number
language: string
is_mature: boolean
viewer_count: number
thumbnail: {
src: string
srcset: string
}
views: number
tags: string[]
categories: Category[]
video: Vod
}
type Media = {
id: number
model_type: string
model_id: number
collection_name: string
name: string
file_name: string
mime_type: string
disk: string
size: number
manipulations: any[]
custom_properties: any
}
type InsertedCategory = {
id: number
icon: string
name: string
slug: string
}
type SmallCategory = {
category: InsertedCategory
tags: string[]
}
type SearchCategory = {
id: number
category_id: number
name: string
slug: string
tags: string[]
description?: string
deleted_at?: string
viewers: number
banner: {
src: string
srcset: string
}
category: InsertedCategory
}
type SmallUser = {
id: number
username: string
agreed_to_terms: boolean
email_verified_at?: string
bio: string
profilePic: string
}
type SearchChannel = {
id: number
user_id: number
slug: string
is_banned: boolean
playback_url: string
name_updated_at?: string
vod_enabled: boolean
subscription_enabled: boolean
userId: number
followersCount: number
following: boolean
subscription: boolean
isLive: boolean
recentCategories: SmallCategory[]
canHost: boolean
user: SmallUser
verified: {
id: number
channel_id: number
created_at: string
updated_at: string
}
}
export type SearchResponse = {
channels: SearchChannel[]
categories: SearchCategory[]
}
export type ChannelResponse = {
id: number
user_id: number
slug: string
is_banned: boolean
playback_url: string
name_updated_at?: string
vod_enabled: boolean
subscription_enabled: boolean
followersCount: number
subscriber_badges: Badge[]
banner_image: {
responsive: string
url: string
}
recent_categories: Category[]
livestream?: Stream
role?: string
muted: boolean
follower_badges: Badge[]
offline_banner_image?: {
responsive: string
url: string
}
can_host: boolean
user: User
chatroom: Chatroom
ascending_links: AscendingLink[]
plan: {
id: number
channel_id: number
stripe_plan_id: string
amount: string
created_at: string
updated_at: string
}
previous_livestreams: PreviousLivestream[]
verified: {
id: number
channel_id: number
created_at: string
updated_at: string
}
media: Media[]
}
export type VideoResponse = Vod & {
source: string
livestream: Stream
}
export type ChatroomResponse = {
id: number
slow_mode: {
enabled: boolean
message_interval: number
}
subscribers_mode: {
enabled: boolean
}
followers_mode: {
enabled: boolean
min_duration: number
}
emotes_mode: {
enabled: boolean
}
pinned_message?: {
id: number
chatroom_id: number
}
}
export type ChatroomMessageResponse = {
channel: string
data: string
event: string
}
export type ChatroomMessage = {
id: string
chatroom_id: number
content: string
type: string
created_at: string
sender: {
id: number
username: string
slug: string
identity: {
color: string
badges: string[]
}
}
}
export type PrepopulateChatResponse = {
status: {
error: boolean
code: number
message: string
}
data: {
cursor: string
messages: ChatroomMessage[]
}
}
type FollowedChannel = {
is_live: boolean
profile_picture: string
channel_slug: string
viewer_count: number
category_name: string
user_username: string
}
export type FollowedChannelResponse = {
channels: FollowedChannel[]
}