diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-20 13:52:49 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-20 14:53:42 +0200 |
commit | 0283eaac2a8e73006c66df3cf5bb9012e37450e5 (patch) | |
tree | 1fb73aeef57f984a77f47828ade23c6365ce8eb0 /server/typings/models/video/video-import.ts | |
parent | 96ca24f00e5ae5471dee9ee596489fe50af2b46f (diff) | |
download | PeerTube-0283eaac2a8e73006c66df3cf5bb9012e37450e5.tar.gz PeerTube-0283eaac2a8e73006c66df3cf5bb9012e37450e5.tar.zst PeerTube-0283eaac2a8e73006c66df3cf5bb9012e37450e5.zip |
Cleanup model types
Diffstat (limited to 'server/typings/models/video/video-import.ts')
-rw-r--r-- | server/typings/models/video/video-import.ts | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/server/typings/models/video/video-import.ts b/server/typings/models/video/video-import.ts index 51be900d6..ada723713 100644 --- a/server/typings/models/video/video-import.ts +++ b/server/typings/models/video/video-import.ts | |||
@@ -2,14 +2,23 @@ import { VideoImportModel } from '@server/models/video/video-import' | |||
2 | import { PickWith } from '@server/typings/utils' | 2 | import { PickWith } from '@server/typings/utils' |
3 | import { MUser, MVideo, MVideoAccountLight, MVideoTag, MVideoThumbnail, MVideoWithFile } from '@server/typings/models' | 3 | import { MUser, MVideo, MVideoAccountLight, MVideoTag, MVideoThumbnail, MVideoWithFile } from '@server/typings/models' |
4 | 4 | ||
5 | export type MVideoImport = Omit<VideoImportModel, 'User' | 'Video'> | 5 | type Use<K extends keyof VideoImportModel, M> = PickWith<VideoImportModel, K, M> |
6 | 6 | ||
7 | export type MVideoImportDefault = MVideoImport & | 7 | // ############################################################################ |
8 | PickWith<VideoImportModel, 'User', MUser> & | ||
9 | PickWith<VideoImportModel, 'Video', MVideoTag & MVideoAccountLight & MVideoThumbnail> | ||
10 | 8 | ||
11 | export type MVideoImportDefaultFiles = MVideoImportDefault & | 9 | export type MVideoImport = Omit<VideoImportModel, 'User' | 'Video'> |
12 | PickWith<VideoImportModel, 'Video', MVideoTag & MVideoAccountLight & MVideoThumbnail & MVideoWithFile> | ||
13 | 10 | ||
14 | export type MVideoImportVideo = MVideoImport & | 11 | export type MVideoImportVideo = MVideoImport & |
15 | PickWith<VideoImportModel, 'Video', MVideo> | 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> | ||