From 0283eaac2a8e73006c66df3cf5bb9012e37450e5 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 20 Aug 2019 13:52:49 +0200 Subject: Cleanup model types --- server/typings/models/video/video-redundancy.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'server/typings/models/video/video-redundancy.ts') diff --git a/server/typings/models/video/video-redundancy.ts b/server/typings/models/video/video-redundancy.ts index ec61bfb68..c25eb9c09 100644 --- a/server/typings/models/video/video-redundancy.ts +++ b/server/typings/models/video/video-redundancy.ts @@ -2,17 +2,25 @@ import { VideoRedundancyModel } from '../../../models/redundancy/video-redundanc import { PickWith } from '@server/typings/utils' import { MStreamingPlaylistVideo, MVideoFile, MVideoFileVideo } from '@server/typings/models' +type Use = PickWith + +// ############################################################################ + export type MVideoRedundancy = Omit export type MVideoRedundancyFileUrl = Pick +// ############################################################################ + export type MVideoRedundancyFile = MVideoRedundancy & - PickWith + Use<'VideoFile', MVideoFile> export type MVideoRedundancyFileVideo = MVideoRedundancy & - PickWith + Use<'VideoFile', MVideoFileVideo> export type MVideoRedundancyStreamingPlaylistVideo = MVideoRedundancy & - PickWith + Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo> -export type MVideoRedundancyVideo = MVideoRedundancyFileVideo | MVideoRedundancyStreamingPlaylistVideo +export type MVideoRedundancyVideo = MVideoRedundancy & + Use<'VideoFile', MVideoFileVideo> & + Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo> -- cgit v1.2.3