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