2019-08-15 11:53:26 +02:00
|
|
|
import { VideoPlaylistElementModel } from '@server/models/video/video-playlist-element'
|
|
|
|
import { PickWith } from '@server/typings/utils'
|
2019-11-15 15:06:03 +01:00
|
|
|
import { MVideoFormattable, MVideoThumbnail, MVideoUrl } from './video'
|
|
|
|
import { MVideoPlaylistPrivacy } from './video-playlist'
|
2019-08-15 11:53:26 +02:00
|
|
|
|
2019-08-20 13:52:49 +02:00
|
|
|
type Use<K extends keyof VideoPlaylistElementModel, M> = PickWith<VideoPlaylistElementModel, K, M>
|
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
2019-08-15 11:53:26 +02:00
|
|
|
export type MVideoPlaylistElement = Omit<VideoPlaylistElementModel, 'VideoPlaylist' | 'Video'>
|
2019-08-20 13:52:49 +02:00
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
2019-08-15 11:53:26 +02:00
|
|
|
export type MVideoPlaylistElementId = Pick<MVideoPlaylistElement, 'id'>
|
|
|
|
|
|
|
|
export type MVideoPlaylistElementLight = Pick<MVideoPlaylistElement, 'id' | 'videoId' | 'startTimestamp' | 'stopTimestamp'>
|
|
|
|
|
2019-08-20 13:52:49 +02:00
|
|
|
// ############################################################################
|
|
|
|
|
2019-08-15 11:53:26 +02:00
|
|
|
export type MVideoPlaylistVideoThumbnail = MVideoPlaylistElement &
|
2019-08-20 13:52:49 +02:00
|
|
|
Use<'Video', MVideoThumbnail>
|
|
|
|
|
2019-08-21 14:31:57 +02:00
|
|
|
export type MVideoPlaylistElementVideoUrlPlaylistPrivacy = MVideoPlaylistElement &
|
2019-08-20 13:52:49 +02:00
|
|
|
Use<'Video', MVideoUrl> &
|
|
|
|
Use<'VideoPlaylist', MVideoPlaylistPrivacy>
|
2019-08-20 19:05:31 +02:00
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
|
|
|
// Format for API or AP object
|
|
|
|
|
|
|
|
export type MVideoPlaylistElementFormattable = MVideoPlaylistElement &
|
|
|
|
Use<'Video', MVideoFormattable>
|
2019-08-21 14:31:57 +02:00
|
|
|
|
|
|
|
export type MVideoPlaylistElementAP = MVideoPlaylistElement &
|
|
|
|
Use<'Video', MVideoUrl>
|