]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/typings/models/video/video-file.ts
Merge branch 'release/1.4.0' into develop
[github/Chocobozzz/PeerTube.git] / server / typings / models / video / video-file.ts
1 import { VideoFileModel } from '../../../models/video/video-file'
2 import { PickWith, PickWithOpt } from '../../utils'
3 import { MVideo, MVideoUUID } from './video'
4 import { MVideoRedundancyFileUrl } from './video-redundancy'
5
6 type Use<K extends keyof VideoFileModel, M> = PickWith<VideoFileModel, K, M>
7
8 // ############################################################################
9
10 export type MVideoFile = Omit<VideoFileModel, 'Video' | 'RedundancyVideos'>
11
12 export type MVideoFileVideo = MVideoFile &
13 Use<'Video', MVideo>
14
15 export type MVideoFileVideoUUID = MVideoFile &
16 Use<'Video', MVideoUUID>
17
18 export type MVideoFileRedundanciesOpt = MVideoFile &
19 PickWithOpt<VideoFileModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]>