aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/video/video-file.ts
blob: 484351a8d03fdf4d4aaeaeb57104acc38038bf95 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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[]>