PeerTube/server/types/models/video/video-caption.ts

28 lines
979 B
TypeScript
Raw Normal View History

2021-02-15 14:08:16 +01:00
import { PickWith } from '@shared/core-utils'
2019-08-15 11:53:26 +02:00
import { VideoCaptionModel } from '../../../models/video/video-caption'
import { MVideo, MVideoUUID } from './video'
2019-08-15 11:53:26 +02:00
2019-08-20 13:52:49 +02:00
type Use<K extends keyof VideoCaptionModel, M> = PickWith<VideoCaptionModel, K, M>
// ############################################################################
2019-08-15 11:53:26 +02:00
export type MVideoCaption = Omit<VideoCaptionModel, 'Video'>
2019-08-20 13:52:49 +02:00
// ############################################################################
2019-08-15 11:53:26 +02:00
export type MVideoCaptionLanguage = Pick<MVideoCaption, 'language'>
export type MVideoCaptionLanguageUrl = Pick<MVideoCaption, 'language' | 'fileUrl' | 'getFileUrl'>
2019-08-15 11:53:26 +02:00
2020-01-31 16:56:52 +01:00
export type MVideoCaptionVideo =
MVideoCaption &
2019-08-20 19:05:31 +02:00
Use<'Video', Pick<MVideo, 'id' | 'remote' | 'uuid'>>
// ############################################################################
// Format for API or AP object
2020-01-31 16:56:52 +01:00
export type MVideoCaptionFormattable =
2021-02-15 14:08:16 +01:00
MVideoCaption &
2019-08-20 19:05:31 +02:00
Pick<MVideoCaption, 'language'> &
Use<'Video', MVideoUUID>