From 26d6bf6533023326fa017812cf31bbe20c752d36 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 18 Jun 2020 10:45:25 +0200 Subject: Split types and typings --- server/types/models/video/video-redundancy.ts | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 server/types/models/video/video-redundancy.ts (limited to 'server/types/models/video/video-redundancy.ts') diff --git a/server/types/models/video/video-redundancy.ts b/server/types/models/video/video-redundancy.ts new file mode 100644 index 000000000..7c7d52035 --- /dev/null +++ b/server/types/models/video/video-redundancy.ts @@ -0,0 +1,43 @@ +import { VideoRedundancyModel } from '../../../models/redundancy/video-redundancy' +import { PickWith, PickWithOpt } from '@server/types/utils' +import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' +import { VideoFileModel } from '@server/models/video/video-file' +import { MVideoFile, MVideoFileVideo } from './video-file' +import { MStreamingPlaylistVideo } from './video-streaming-playlist' +import { MVideoUrl } from './video' + +type Use = PickWith + +// ############################################################################ + +export type MVideoRedundancy = Omit + +export type MVideoRedundancyFileUrl = Pick + +// ############################################################################ + +export type MVideoRedundancyFile = + MVideoRedundancy & + Use<'VideoFile', MVideoFile> + +export type MVideoRedundancyFileVideo = + MVideoRedundancy & + Use<'VideoFile', MVideoFileVideo> + +export type MVideoRedundancyStreamingPlaylistVideo = + MVideoRedundancy & + Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo> + +export type MVideoRedundancyVideo = + MVideoRedundancy & + Use<'VideoFile', MVideoFileVideo> & + Use<'VideoStreamingPlaylist', MStreamingPlaylistVideo> + +// ############################################################################ + +// Format for API or AP object + +export type MVideoRedundancyAP = + MVideoRedundancy & + PickWithOpt> & + PickWithOpt> -- cgit v1.2.3