From 453e83ea5d81d203ba34bc43cd5c2c750ba40568 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 15 Aug 2019 11:53:26 +0200 Subject: Stronger model typings --- server/typings/models/video/video.ts | 103 +++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 server/typings/models/video/video.ts (limited to 'server/typings/models/video/video.ts') diff --git a/server/typings/models/video/video.ts b/server/typings/models/video/video.ts new file mode 100644 index 000000000..0ffd0c302 --- /dev/null +++ b/server/typings/models/video/video.ts @@ -0,0 +1,103 @@ +import { VideoModel } from '../../../models/video/video' +import { PickWith, PickWithOpt } from '../../utils' +import { MChannelAccountLight, MChannelActor, MChannelActorAccountDefault, MChannelUserId } from './video-channels' +import { MTag } from './tag' +import { MVideoCaptionLanguage } from './video-caption' +import { MStreamingPlaylist, MStreamingPlaylistRedundancies } from './video-streaming-playlist' +import { MVideoFile, MVideoFileRedundanciesOpt } from './video-file' +import { MThumbnail } from './thumbnail' +import { MVideoBlacklistLight, MVideoBlacklistUnfederated } from './video-blacklist' +import { MScheduleVideoUpdate } from './schedule-video-update' +import { MUserVideoHistoryTime } from '../user/user-video-history' + +export type MVideo = Omit + +export type MVideoId = Pick +export type MVideoUrl = Pick +export type MVideoUUID = Pick + +export type MVideoIdUrl = MVideoId & MVideoUrl +export type MVideoFeed = Pick + +export type MVideoWithFile = MVideo & + PickWith + +export type MVideoThumbnail = MVideo & + PickWith +export type MVideoIdThumbnail = MVideoThumbnail & MVideoId + +export type MVideoTag = MVideo & + PickWith + +export type MVideoWithSchedule = MVideo & + PickWithOpt + +export type MVideoWithFileThumbnail = MVideoWithFile & MVideoThumbnail + +export type MVideoUser = MVideo & + PickWith + +export type MVideoWithCaptions = MVideo & + PickWith + +export type MVideoWithBlacklistLight = MVideo & + PickWith + +export type MVideoAccountLight = MVideo & + PickWith + +export type MVideoWithRights = MVideoWithBlacklistLight & MVideoThumbnail & MVideoUser + +export type MVideoWithStreamingPlaylist = MVideo & + PickWith + +export type MVideoWithAllFiles = MVideoWithFileThumbnail & MVideoWithStreamingPlaylist + +export type MVideoAccountAllFiles = MVideoWithAllFiles & MVideoAccountLight & MVideoWithBlacklistLight +export type MVideoAccountAllFilesCaptions = MVideoAccountAllFiles & MVideoWithCaptions + +export type MVideoUserHistory = MVideo & + PickWith + +export type MVideoWithBlacklistThumbnailScheduled = MVideoWithSchedule & MVideoWithBlacklistLight & MVideoWithFileThumbnail + +export type MVideoAccountDefault = MVideo & + PickWith + +export type MVideoThumbnailAccountDefault = MVideoThumbnail & + PickWith + +export type MVideoWithChannelActor = MVideo & + PickWith + +export type MVideoFullLight = MVideoThumbnail & + MVideoWithBlacklistLight & + MVideoTag & + MVideoAccountLight & + MVideoUserHistory & + MVideoWithFile & + MVideoWithSchedule & + MVideoWithStreamingPlaylist & + MVideoUserHistory + +export type MVideoAP = MVideo & + MVideoTag & + MVideoAccountLight & + MVideoWithStreamingPlaylist & + MVideoWithCaptions & + PickWith & + PickWith + +export type MVideoAPWithoutCaption = Omit + +export type MVideoDetails = MVideo & + MVideoWithBlacklistLight & + MVideoTag & + MVideoAccountLight & + MVideoWithSchedule & + MVideoThumbnail & + MVideoUserHistory & + PickWith & + PickWith -- cgit v1.2.3