]>
Commit | Line | Data |
---|---|---|
1 | import { VideoImportModel } from '@server/models/video/video-import' | |
2 | import { PickWith, PickWithOpt } from '@shared/typescript-utils' | |
3 | import { MUser } from '../user/user' | |
4 | import { MVideo, MVideoAccountLight, MVideoFormattable, MVideoTag, MVideoThumbnail, MVideoWithFile } from './video' | |
5 | ||
6 | type Use<K extends keyof VideoImportModel, M> = PickWith<VideoImportModel, K, M> | |
7 | ||
8 | // ############################################################################ | |
9 | ||
10 | export type MVideoImport = Omit<VideoImportModel, 'User' | 'Video'> | |
11 | ||
12 | export type MVideoImportVideo = | |
13 | MVideoImport & | |
14 | Use<'Video', MVideo> | |
15 | ||
16 | // ############################################################################ | |
17 | ||
18 | type VideoAssociation = MVideoTag & MVideoAccountLight & MVideoThumbnail | |
19 | ||
20 | export type MVideoImportDefault = | |
21 | MVideoImport & | |
22 | Use<'User', MUser> & | |
23 | Use<'Video', VideoAssociation> | |
24 | ||
25 | export type MVideoImportDefaultFiles = | |
26 | MVideoImport & | |
27 | Use<'User', MUser> & | |
28 | Use<'Video', VideoAssociation & MVideoWithFile> | |
29 | ||
30 | // ############################################################################ | |
31 | ||
32 | // Format for API or AP object | |
33 | ||
34 | export type MVideoImportFormattable = | |
35 | MVideoImport & | |
36 | PickWithOpt<VideoImportModel, 'Video', MVideoFormattable & MVideoTag> |