PeerTube/server/typings/models/video/video-file.ts

20 lines
733 B
TypeScript
Raw Normal View History

2019-08-15 09:53:26 +00:00
import { VideoFileModel } from '../../../models/video/video-file'
import { PickWith, PickWithOpt } from '../../utils'
import { MVideo, MVideoUUID } from './video'
import { MVideoRedundancyFileUrl } from './video-redundancy'
2019-08-20 11:52:49 +00:00
type Use<K extends keyof VideoFileModel, M> = PickWith<VideoFileModel, K, M>
// ############################################################################
2019-08-15 09:53:26 +00:00
export type MVideoFile = Omit<VideoFileModel, 'Video' | 'RedundancyVideos'>
export type MVideoFileVideo = MVideoFile &
2019-08-20 11:52:49 +00:00
Use<'Video', MVideo>
2019-08-15 09:53:26 +00:00
export type MVideoFileVideoUUID = MVideoFile &
2019-08-20 11:52:49 +00:00
Use<'Video', MVideoUUID>
2019-08-15 09:53:26 +00:00
export type MVideoFileRedundanciesOpt = MVideoFile &
PickWithOpt<VideoFileModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]>