aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/video/video-redundancy.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-redundancy.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-redundancy.ts')
-rw-r--r--server/typings/models/video/video-redundancy.ts16
1 files changed, 12 insertions, 4 deletions
diff --git a/server/typings/models/video/video-redundancy.ts b/server/typings/models/video/video-redundancy.ts
index ec61bfb68..c25eb9c09 100644
--- a/server/typings/models/video/video-redundancy.ts
+++ b/server/typings/models/video/video-redundancy.ts
@@ -2,17 +2,25 @@ import { VideoRedundancyModel } from '../../../models/redundancy/video-redundanc
2import { PickWith } from '@server/typings/utils' 2import { PickWith } from '@server/typings/utils'
3import { MStreamingPlaylistVideo, MVideoFile, MVideoFileVideo } from '@server/typings/models' 3import { MStreamingPlaylistVideo, MVideoFile, MVideoFileVideo } from '@server/typings/models'
4 4
5type Use<K extends keyof VideoRedundancyModel, M> = PickWith<VideoRedundancyModel, K, M>
6
7// ############################################################################
8
5export type MVideoRedundancy = Omit<VideoRedundancyModel, 'VideoFile' | 'VideoStreamingPlaylist' | 'Actor'> 9export type MVideoRedundancy = Omit<VideoRedundancyModel, 'VideoFile' | 'VideoStreamingPlaylist' | 'Actor'>
6 10
7export type MVideoRedundancyFileUrl = Pick<MVideoRedundancy, 'fileUrl'> 11export type MVideoRedundancyFileUrl = Pick<MVideoRedundancy, 'fileUrl'>
8 12
13// ############################################################################
14
9export type MVideoRedundancyFile = MVideoRedundancy & 15export type MVideoRedundancyFile = MVideoRedundancy &
10 PickWith<VideoRedundancyModel, 'VideoFile', MVideoFile> 16 Use<'VideoFile', MVideoFile>
11 17
12export type MVideoRedundancyFileVideo = MVideoRedundancy & 18export type MVideoRedundancyFileVideo = MVideoRedundancy &
13 PickWith<VideoRedundancyModel, 'VideoFile', MVideoFileVideo> 19 Use<'VideoFile', MVideoFileVideo>
14 20
15export type MVideoRedundancyStreamingPlaylistVideo = MVideoRedundancy & 21export type MVideoRedundancyStreamingPlaylistVideo = MVideoRedundancy &
16 PickWith<VideoRedundancyModel, 'VideoStreamingPlaylist', MStreamingPlaylistVideo> 22 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>
17 23
18export type MVideoRedundancyVideo = MVideoRedundancyFileVideo | MVideoRedundancyStreamingPlaylistVideo 24export type MVideoRedundancyVideo = MVideoRedundancy &
25 Use<'VideoFile', MVideoFileVideo> &
26 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>