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