aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/video/video-import.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-20 13:52:49 +0200
committerChocobozzz <me@florianbigard.com>2019-08-20 14:53:42 +0200
commit0283eaac2a8e73006c66df3cf5bb9012e37450e5 (patch)
tree1fb73aeef57f984a77f47828ade23c6365ce8eb0 /server/typings/models/video/video-import.ts
parent96ca24f00e5ae5471dee9ee596489fe50af2b46f (diff)
downloadPeerTube-0283eaac2a8e73006c66df3cf5bb9012e37450e5.tar.gz
PeerTube-0283eaac2a8e73006c66df3cf5bb9012e37450e5.tar.zst
PeerTube-0283eaac2a8e73006c66df3cf5bb9012e37450e5.zip
Cleanup model types
Diffstat (limited to 'server/typings/models/video/video-import.ts')
-rw-r--r--server/typings/models/video/video-import.ts23
1 files changed, 16 insertions, 7 deletions
diff --git a/server/typings/models/video/video-import.ts b/server/typings/models/video/video-import.ts
index 51be900d6..ada723713 100644
--- a/server/typings/models/video/video-import.ts
+++ b/server/typings/models/video/video-import.ts
@@ -2,14 +2,23 @@ import { VideoImportModel } from '@server/models/video/video-import'
2import { PickWith } from '@server/typings/utils' 2import { PickWith } from '@server/typings/utils'
3import { MUser, MVideo, MVideoAccountLight, MVideoTag, MVideoThumbnail, MVideoWithFile } from '@server/typings/models' 3import { MUser, MVideo, MVideoAccountLight, MVideoTag, MVideoThumbnail, MVideoWithFile } from '@server/typings/models'
4 4
5export type MVideoImport = Omit<VideoImportModel, 'User' | 'Video'> 5type Use<K extends keyof VideoImportModel, M> = PickWith<VideoImportModel, K, M>
6 6
7export type MVideoImportDefault = MVideoImport & 7// ############################################################################
8 PickWith<VideoImportModel, 'User', MUser> &
9 PickWith<VideoImportModel, 'Video', MVideoTag & MVideoAccountLight & MVideoThumbnail>
10 8
11export type MVideoImportDefaultFiles = MVideoImportDefault & 9export type MVideoImport = Omit<VideoImportModel, 'User' | 'Video'>
12 PickWith<VideoImportModel, 'Video', MVideoTag & MVideoAccountLight & MVideoThumbnail & MVideoWithFile>
13 10
14export type MVideoImportVideo = MVideoImport & 11export type MVideoImportVideo = MVideoImport &
15 PickWith<VideoImportModel, 'Video', MVideo> 12 Use<'Video', MVideo>
13
14// ############################################################################
15
16type VideoAssociation = MVideoTag & MVideoAccountLight & MVideoThumbnail
17
18export type MVideoImportDefault = MVideoImport &
19 Use<'User', MUser> &
20 Use<'Video', VideoAssociation>
21
22export type MVideoImportDefaultFiles = MVideoImport &
23 Use<'User', MUser> &
24 Use<'Video', VideoAssociation & MVideoWithFile>