-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
222 lines (205 loc) · 4.63 KB
/
types.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
export type Account = {
id: number,
username: string,
email: string,
token: string,
avatar_url: string,
is_premium: boolean,
created_at: string,
}
export type VideoType = {
id: number,
uuid: string,
file: string,
allow_comments: boolean,
show_likes: boolean,
likes?: number
liked_by_auth_user?: boolean
disliked_by_auth_user?: boolean
reported_by_auth_user?: boolean
report_at?: Date
dislikes?: number
default_comments_sort: CommentsSort,
title: string,
short_title : string
short_description : string
thumbnail: string,
duration: number,
formated_duration: string
views: number,
route: string
user: TinyUserType,
comments: number
publication_date: Date
first_comment?: {
content: string,
user_avatar: string
},
suggested: TinyVideoType[]
}
export type TinyVideoType = {
id: number,
uuid: string,
title: string,
short_title : string,
thumbnail: string,
formated_duration: string,
views: number,
route: string,
publication_date: string | number,
user: TinyUserType
is_private?: boolean
}
export type SearchVideoType = {
title: string,
user: string
views: string,
formated_duration: string,
publication_date: number,
thumbnail: string,
url: string,
uuid: string,
_formatted: {
title: string,
user: string,
views: string,
publication_date: string,
thumbnail: string,
url: string,
uuid: string
}
}
export type UserType = {
id: number,
username : string,
slug: string,
avatar: string,
banner: string,
show_subscribers: boolean
subscribers?: number
subscribed_by_auth_user?: boolean
videos_count: number
short_description: string
description: string | null
website: string | null
country_code: string | null
country?: string | null
views: number
created_at: Date,
pinned_video: TinyVideoType,
videos: TinyVideoType[],
playlists: [{
id: number,
title: string,
videos: TinyVideoType[],
}]
}
export type TinyUserType = {
id: number,
username : string,
slug: string,
avatar: string,
show_subscribers: boolean
subscribers?: number
subscribed_by_auth_user?: boolean
videos_count: number
created_at: Date,
}
export type PlaylistType = {
id: number,
uuid: string,
title: string,
thumbnail?: string,
description: string,
icon: string,
videos_count?: number
user: TinyUserType,
videos: TinyVideoType[]
}
export type TinyPlaylistType = {
id: number,
uuid: string,
title: string,
thumbnail?: string,
icon: string,
status: string,
has_video?: boolean,
videos_count?: number
}
export type CommentType = {
id: number,
content: string,
parsed_content: string,
short_content: string,
is_long: boolean,
user: {
id: number,
username: string,
avatar: string
route: string,
is_video_author: boolean
},
video_uuid: string,
created_at: Date
is_updated: boolean,
likes_count: number,
dislikes_count: number,
liked_by_auth_user?: boolean,
disliked_by_auth_user?: boolean,
can_delete?: boolean,
can_update?: boolean,
can_report?: boolean,
can_pin?: boolean,
is_reply: boolean,
parent_id?: number,
is_pinned?: boolean,
has_replies?: boolean,
replies_count?: number,
is_video_author_reply?: boolean,
is_video_author_like?: boolean,
video_author?: {
username: string,
avatar: string
},
reported_at?: string,
replies?: ResponsesPaginator,
}
export type UserVideosSort = 'latest' | 'popular' | 'oldest'
export type CommentsSort = 'top' | 'newest'
export type InteractionType = 'Video' | 'Comment'
export type Paginator<T> = {
data: T[],
links: {
next: string
},
meta: {
current_page: number,
from: number,
last_page: number,
per_page: number,
to: number,
total: number
}
}
export type ResponsesPaginator = {
data: CommentType[],
next_page: number | null,
total: number
}
export type Search = {
total: number,
items: SearchVideoType[]
}
export const REPORT_REASONS : string[] = [
"Sexual Content",
"Violent or repulsive content",
"Hateful or abusive content",
"Harassment or bullying",
"Harmful or dangerous acts",
"Misinformation",
"Child abuse",
"Promotes terrorism",
"Infringes my rights",
"Captions issue"
];
export type ReportReason = typeof REPORT_REASONS[number];