]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/typings/models/video/video-redundancy.ts
Cleanup model types
[github/Chocobozzz/PeerTube.git] / server / typings / models / video / video-redundancy.ts
1 import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy'
2 import { PickWith } from '@server/typings/utils'
3 import { MStreamingPlaylistVideo, MVideoFile, MVideoFileVideo } from '@server/typings/models'
4
5 type Use<K extends keyof VideoRedundancyModel, M> = PickWith<VideoRedundancyModel, K, M>
6
7 // ############################################################################
8
9 export type MVideoRedundancy = Omit<VideoRedundancyModel, 'VideoFile' | 'VideoStreamingPlaylist' | 'Actor'>
10
11 export type MVideoRedundancyFileUrl = Pick<MVideoRedundancy, 'fileUrl'>
12
13 // ############################################################################
14
15 export type MVideoRedundancyFile = MVideoRedundancy &
16 Use<'VideoFile', MVideoFile>
17
18 export type MVideoRedundancyFileVideo = MVideoRedundancy &
19 Use<'VideoFile', MVideoFileVideo>
20
21 export type MVideoRedundancyStreamingPlaylistVideo = MVideoRedundancy &
22 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>
23
24 export type MVideoRedundancyVideo = MVideoRedundancy &
25 Use<'VideoFile', MVideoFileVideo> &
26 Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo>