1
0
Fork 0
peertube/server/typings/models/video/video-file.ts
2019-08-20 14:53:42 +02:00

19 lines
733 B
TypeScript

import { VideoFileModel } from '../../../models/video/video-file'
import { PickWith, PickWithOpt } from '../../utils'
import { MVideo, MVideoUUID } from './video'
import { MVideoRedundancyFileUrl } from './video-redundancy'
type Use<K extends keyof VideoFileModel, M> = PickWith<VideoFileModel, K, M>
// ############################################################################
export type MVideoFile = Omit<VideoFileModel, 'Video' | 'RedundancyVideos'>
export type MVideoFileVideo = MVideoFile &
Use<'Video', MVideo>
export type MVideoFileVideoUUID = MVideoFile &
Use<'Video', MVideoUUID>
export type MVideoFileRedundanciesOpt = MVideoFile &
PickWithOpt<VideoFileModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]>