PeerTube/server/typings/models/video/video-streaming-playlist.ts

20 lines
911 B
TypeScript
Raw Normal View History

2019-08-15 11:53:26 +02:00
import { VideoStreamingPlaylistModel } from '../../../models/video/video-streaming-playlist'
2019-08-21 14:31:57 +02:00
import { PickWith, PickWithOpt } from '../../utils'
2019-08-15 11:53:26 +02:00
import { MVideoRedundancyFileUrl } from './video-redundancy'
2019-08-21 14:31:57 +02:00
import { MVideo, MVideoUrl } from '@server/typings/models'
2019-08-15 11:53:26 +02:00
2019-08-20 13:52:49 +02:00
type Use<K extends keyof VideoStreamingPlaylistModel, M> = PickWith<VideoStreamingPlaylistModel, K, M>
// ############################################################################
2019-08-15 11:53:26 +02:00
export type MStreamingPlaylist = Omit<VideoStreamingPlaylistModel, 'Video' | 'RedundancyVideos'>
export type MStreamingPlaylistVideo = MStreamingPlaylist &
2019-08-20 13:52:49 +02:00
Use<'Video', MVideo>
2019-08-15 11:53:26 +02:00
export type MStreamingPlaylistRedundancies = MStreamingPlaylist &
2019-08-20 13:52:49 +02:00
Use<'RedundancyVideos', MVideoRedundancyFileUrl[]>
2019-08-21 14:31:57 +02:00
export type MStreamingPlaylistRedundanciesOpt = MStreamingPlaylist &
PickWithOpt<VideoStreamingPlaylistModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]>