]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/types/models/video/video-import.ts
Merge branch 'master' into release/3.3.0
[github/Chocobozzz/PeerTube.git] / server / types / models / video / video-import.ts
CommitLineData
453e83ea 1import { VideoImportModel } from '@server/models/video/video-import'
67ed6552 2import { PickWith, PickWithOpt } from '@shared/core-utils'
d7a25329
C
3import { MVideo, MVideoAccountLight, MVideoFormattable, MVideoTag, MVideoThumbnail, MVideoWithFile } from './video'
4import { MUser } from '../user/user'
453e83ea 5
0283eaac 6type Use<K extends keyof VideoImportModel, M> = PickWith<VideoImportModel, K, M>
453e83ea 7
0283eaac 8// ############################################################################
453e83ea 9
0283eaac 10export type MVideoImport = Omit<VideoImportModel, 'User' | 'Video'>
453e83ea 11
a1587156
C
12export type MVideoImportVideo =
13 MVideoImport &
0283eaac
C
14 Use<'Video', MVideo>
15
16// ############################################################################
17
18type VideoAssociation = MVideoTag & MVideoAccountLight & MVideoThumbnail
19
a1587156
C
20export type MVideoImportDefault =
21 MVideoImport &
0283eaac
C
22 Use<'User', MUser> &
23 Use<'Video', VideoAssociation>
24
a1587156
C
25export type MVideoImportDefaultFiles =
26 MVideoImport &
0283eaac
C
27 Use<'User', MUser> &
28 Use<'Video', VideoAssociation & MVideoWithFile>
1ca9f7c3
C
29
30// ############################################################################
31
32// Format for API or AP object
33
a1587156
C
34export type MVideoImportFormattable =
35 MVideoImport &
1ca9f7c3 36 PickWithOpt<VideoImportModel, 'Video', MVideoFormattable & MVideoTag>