diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-20 13:52:49 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-20 14:53:42 +0200 |
commit | 0283eaac2a8e73006c66df3cf5bb9012e37450e5 (patch) | |
tree | 1fb73aeef57f984a77f47828ade23c6365ce8eb0 /server/typings/models/video/video-redundancy.ts | |
parent | 96ca24f00e5ae5471dee9ee596489fe50af2b46f (diff) | |
download | PeerTube-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.ts | 16 |
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 | |||
2 | import { PickWith } from '@server/typings/utils' | 2 | import { PickWith } from '@server/typings/utils' |
3 | import { MStreamingPlaylistVideo, MVideoFile, MVideoFileVideo } from '@server/typings/models' | 3 | import { MStreamingPlaylistVideo, MVideoFile, MVideoFileVideo } from '@server/typings/models' |
4 | 4 | ||
5 | type Use<K extends keyof VideoRedundancyModel, M> = PickWith<VideoRedundancyModel, K, M> | ||
6 | |||
7 | // ############################################################################ | ||
8 | |||
5 | export type MVideoRedundancy = Omit<VideoRedundancyModel, 'VideoFile' | 'VideoStreamingPlaylist' | 'Actor'> | 9 | export type MVideoRedundancy = Omit<VideoRedundancyModel, 'VideoFile' | 'VideoStreamingPlaylist' | 'Actor'> |
6 | 10 | ||
7 | export type MVideoRedundancyFileUrl = Pick<MVideoRedundancy, 'fileUrl'> | 11 | export type MVideoRedundancyFileUrl = Pick<MVideoRedundancy, 'fileUrl'> |
8 | 12 | ||
13 | // ############################################################################ | ||
14 | |||
9 | export type MVideoRedundancyFile = MVideoRedundancy & | 15 | export type MVideoRedundancyFile = MVideoRedundancy & |
10 | PickWith<VideoRedundancyModel, 'VideoFile', MVideoFile> | 16 | Use<'VideoFile', MVideoFile> |
11 | 17 | ||
12 | export type MVideoRedundancyFileVideo = MVideoRedundancy & | 18 | export type MVideoRedundancyFileVideo = MVideoRedundancy & |
13 | PickWith<VideoRedundancyModel, 'VideoFile', MVideoFileVideo> | 19 | Use<'VideoFile', MVideoFileVideo> |
14 | 20 | ||
15 | export type MVideoRedundancyStreamingPlaylistVideo = MVideoRedundancy & | 21 | export type MVideoRedundancyStreamingPlaylistVideo = MVideoRedundancy & |
16 | PickWith<VideoRedundancyModel, 'VideoStreamingPlaylist', MStreamingPlaylistVideo> | 22 | Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo> |
17 | 23 | ||
18 | export type MVideoRedundancyVideo = MVideoRedundancyFileVideo | MVideoRedundancyStreamingPlaylistVideo | 24 | export type MVideoRedundancyVideo = MVideoRedundancy & |
25 | Use<'VideoFile', MVideoFileVideo> & | ||
26 | Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo> | ||