diff options
Diffstat (limited to 'server/typings/models/video/video-playlist-element.ts')
-rw-r--r-- | server/typings/models/video/video-playlist-element.ts | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/server/typings/models/video/video-playlist-element.ts b/server/typings/models/video/video-playlist-element.ts index d1b8a18a0..5a039d7b1 100644 --- a/server/typings/models/video/video-playlist-element.ts +++ b/server/typings/models/video/video-playlist-element.ts | |||
@@ -2,14 +2,27 @@ import { VideoPlaylistElementModel } from '@server/models/video/video-playlist-e | |||
2 | import { PickWith } from '@server/typings/utils' | 2 | import { PickWith } from '@server/typings/utils' |
3 | import { MVideoPlaylistPrivacy, MVideoThumbnail, MVideoUrl } from '@server/typings/models' | 3 | import { MVideoPlaylistPrivacy, MVideoThumbnail, MVideoUrl } from '@server/typings/models' |
4 | 4 | ||
5 | type Use<K extends keyof VideoPlaylistElementModel, M> = PickWith<VideoPlaylistElementModel, K, M> | ||
6 | |||
7 | // ############################################################################ | ||
8 | |||
5 | export type MVideoPlaylistElement = Omit<VideoPlaylistElementModel, 'VideoPlaylist' | 'Video'> | 9 | export type MVideoPlaylistElement = Omit<VideoPlaylistElementModel, 'VideoPlaylist' | 'Video'> |
10 | |||
11 | // ############################################################################ | ||
12 | |||
6 | export type MVideoPlaylistElementId = Pick<MVideoPlaylistElement, 'id'> | 13 | export type MVideoPlaylistElementId = Pick<MVideoPlaylistElement, 'id'> |
7 | 14 | ||
8 | export type MVideoPlaylistElementLight = Pick<MVideoPlaylistElement, 'id' | 'videoId' | 'startTimestamp' | 'stopTimestamp'> | 15 | export type MVideoPlaylistElementLight = Pick<MVideoPlaylistElement, 'id' | 'videoId' | 'startTimestamp' | 'stopTimestamp'> |
9 | 16 | ||
17 | // ############################################################################ | ||
18 | |||
10 | export type MVideoPlaylistVideoThumbnail = MVideoPlaylistElement & | 19 | export type MVideoPlaylistVideoThumbnail = MVideoPlaylistElement & |
11 | PickWith<VideoPlaylistElementModel, 'Video', MVideoThumbnail> | 20 | Use<'Video', MVideoThumbnail> |
21 | |||
22 | // ############################################################################ | ||
23 | |||
24 | // For API | ||
12 | 25 | ||
13 | export type MVideoPlaylistAP = MVideoPlaylistElement & | 26 | export type MVideoPlaylistAP = MVideoPlaylistElement & |
14 | PickWith<VideoPlaylistElementModel, 'Video', MVideoUrl> & | 27 | Use<'Video', MVideoUrl> & |
15 | PickWith<VideoPlaylistElementModel, 'VideoPlaylist', MVideoPlaylistPrivacy> | 28 | Use<'VideoPlaylist', MVideoPlaylistPrivacy> |