aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/videos
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-07-10 19:43:21 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-07-10 19:43:21 +0200
commit4771e0008dd26eadbb7eaff64255a6ec914fdadb (patch)
tree4fd58f8a3f3c2d674b936c99817b4f5fb958c5d8 /shared/models/videos
parent7a214f746bf420defbf17fa218d90d6233551bf8 (diff)
downloadPeerTube-4771e0008dd26eadbb7eaff64255a6ec914fdadb.tar.gz
PeerTube-4771e0008dd26eadbb7eaff64255a6ec914fdadb.tar.zst
PeerTube-4771e0008dd26eadbb7eaff64255a6ec914fdadb.zip
Better typescript typing for a better world
Diffstat (limited to 'shared/models/videos')
-rw-r--r--shared/models/videos/index.ts10
-rw-r--r--shared/models/videos/user-video-rate-update.model.ts5
-rw-r--r--shared/models/videos/user-video-rate.model.ts6
-rw-r--r--shared/models/videos/user-video-rate.type.ts1
-rw-r--r--shared/models/videos/video-abuse-create.model.ts3
-rw-r--r--shared/models/videos/video-abuse.model.ts8
-rw-r--r--shared/models/videos/video-blacklist.model.ts5
-rw-r--r--shared/models/videos/video-create.model.ts9
-rw-r--r--shared/models/videos/video-rate.type.ts1
-rw-r--r--shared/models/videos/video-update.model.ts9
-rw-r--r--shared/models/videos/video.model.ts23
11 files changed, 80 insertions, 0 deletions
diff --git a/shared/models/videos/index.ts b/shared/models/videos/index.ts
new file mode 100644
index 000000000..64d1676c5
--- /dev/null
+++ b/shared/models/videos/index.ts
@@ -0,0 +1,10 @@
1export * from './user-video-rate-update.model'
2export * from './user-video-rate.model'
3export * from './user-video-rate.type'
4export * from './video-abuse-create.model'
5export * from './video-abuse.model'
6export * from './video-blacklist.model'
7export * from './video-create.model'
8export * from './video-rate.type'
9export * from './video-update.model'
10export * from './video.model'
diff --git a/shared/models/videos/user-video-rate-update.model.ts b/shared/models/videos/user-video-rate-update.model.ts
new file mode 100644
index 000000000..85e89271a
--- /dev/null
+++ b/shared/models/videos/user-video-rate-update.model.ts
@@ -0,0 +1,5 @@
1import { UserVideoRateType } from './user-video-rate.type'
2
3export interface UserVideoRateUpdate {
4 rating: UserVideoRateType
5}
diff --git a/shared/models/videos/user-video-rate.model.ts b/shared/models/videos/user-video-rate.model.ts
new file mode 100644
index 000000000..4b9c574d8
--- /dev/null
+++ b/shared/models/videos/user-video-rate.model.ts
@@ -0,0 +1,6 @@
1import { UserVideoRateType } from './user-video-rate.type'
2
3export interface UserVideoRate {
4 videoId: string
5 rating: UserVideoRateType
6}
diff --git a/shared/models/videos/user-video-rate.type.ts b/shared/models/videos/user-video-rate.type.ts
new file mode 100644
index 000000000..a4d9c7e39
--- /dev/null
+++ b/shared/models/videos/user-video-rate.type.ts
@@ -0,0 +1 @@
export type UserVideoRateType = 'like' | 'dislike' | 'none'
diff --git a/shared/models/videos/video-abuse-create.model.ts b/shared/models/videos/video-abuse-create.model.ts
new file mode 100644
index 000000000..db6458275
--- /dev/null
+++ b/shared/models/videos/video-abuse-create.model.ts
@@ -0,0 +1,3 @@
1export interface VideoAbuseCreate {
2 reason: string
3}
diff --git a/shared/models/videos/video-abuse.model.ts b/shared/models/videos/video-abuse.model.ts
new file mode 100644
index 000000000..72e32cbc7
--- /dev/null
+++ b/shared/models/videos/video-abuse.model.ts
@@ -0,0 +1,8 @@
1export interface VideoAbuse {
2 id: number
3 reporterPodHost: string
4 reason: string
5 reporterUsername: string
6 videoId: string
7 createdAt: Date
8}
diff --git a/shared/models/videos/video-blacklist.model.ts b/shared/models/videos/video-blacklist.model.ts
new file mode 100644
index 000000000..f894bb065
--- /dev/null
+++ b/shared/models/videos/video-blacklist.model.ts
@@ -0,0 +1,5 @@
1export interface BlacklistedVideo {
2 id: number
3 videoId: string
4 createdAt: Date
5}
diff --git a/shared/models/videos/video-create.model.ts b/shared/models/videos/video-create.model.ts
new file mode 100644
index 000000000..5c0b498ce
--- /dev/null
+++ b/shared/models/videos/video-create.model.ts
@@ -0,0 +1,9 @@
1export interface VideoCreate {
2 category: number
3 licence: number
4 language: number
5 description: string
6 nsfw: boolean
7 name: string
8 tags: string[]
9}
diff --git a/shared/models/videos/video-rate.type.ts b/shared/models/videos/video-rate.type.ts
new file mode 100644
index 000000000..d48774a4b
--- /dev/null
+++ b/shared/models/videos/video-rate.type.ts
@@ -0,0 +1 @@
export type VideoRateType = 'like' | 'dislike'
diff --git a/shared/models/videos/video-update.model.ts b/shared/models/videos/video-update.model.ts
new file mode 100644
index 000000000..29a82621b
--- /dev/null
+++ b/shared/models/videos/video-update.model.ts
@@ -0,0 +1,9 @@
1export interface VideoUpdate {
2 name?: string
3 category?: number
4 licence?: number
5 language?: number
6 description?: string
7 tags?: string[]
8 nsfw?: boolean
9}
diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts
new file mode 100644
index 000000000..2e35f005c
--- /dev/null
+++ b/shared/models/videos/video.model.ts
@@ -0,0 +1,23 @@
1export interface Video {
2 id: string
3 author: string
4 createdAt: Date
5 categoryLabel: string
6 category: number
7 licenceLabel: string
8 licence: number
9 languageLabel: string
10 language: number
11 description: string
12 duration: number
13 isLocal: boolean
14 magnetUri: string
15 name: string
16 podHost: string
17 tags: string[]
18 thumbnailPath: string
19 views: number
20 likes: number
21 dislikes: number
22 nsfw: boolean
23}