aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/types/models/video/video-caption.ts
blob: 9bb067001ecc9704d399c42e79e50c4b0e66f26f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { VideoCaptionModel } from '../../../models/video/video-caption'
import { FunctionProperties, PickWith } from '@server/types/utils'
import { MVideo, MVideoUUID } from './video'

type Use<K extends keyof VideoCaptionModel, M> = PickWith<VideoCaptionModel, K, M>

// ############################################################################

export type MVideoCaption = Omit<VideoCaptionModel, 'Video'>

// ############################################################################

export type MVideoCaptionLanguage = Pick<MVideoCaption, 'language'>
export type MVideoCaptionLanguageUrl = Pick<MVideoCaption, 'language' | 'fileUrl' | 'getFileUrl'>

export type MVideoCaptionVideo =
  MVideoCaption &
  Use<'Video', Pick<MVideo, 'id' | 'remote' | 'uuid'>>

// ############################################################################

// Format for API or AP object

export type MVideoCaptionFormattable =
  FunctionProperties<MVideoCaption> &
  Pick<MVideoCaption, 'language'> &
  Use<'Video', MVideoUUID>