diff options
author | Chocobozzz <me@florianbigard.com> | 2020-06-18 10:45:25 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-06-18 10:46:27 +0200 |
commit | 26d6bf6533023326fa017812cf31bbe20c752d36 (patch) | |
tree | 9c4e3ecdc344420190f17d429bdf05d78fae7a8c /server/types/models/video/video-blacklist.ts | |
parent | d6d951ddc0c492f3261065b5dcb4df0534d252fc (diff) | |
download | PeerTube-26d6bf6533023326fa017812cf31bbe20c752d36.tar.gz PeerTube-26d6bf6533023326fa017812cf31bbe20c752d36.tar.zst PeerTube-26d6bf6533023326fa017812cf31bbe20c752d36.zip |
Split types and typings
Diffstat (limited to 'server/types/models/video/video-blacklist.ts')
-rw-r--r-- | server/types/models/video/video-blacklist.ts | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/server/types/models/video/video-blacklist.ts b/server/types/models/video/video-blacklist.ts new file mode 100644 index 000000000..08e59284a --- /dev/null +++ b/server/types/models/video/video-blacklist.ts | |||
@@ -0,0 +1,30 @@ | |||
1 | import { VideoBlacklistModel } from '../../../models/video/video-blacklist' | ||
2 | import { PickWith } from '@server/types/utils' | ||
3 | import { MVideo, MVideoFormattable } from './video' | ||
4 | |||
5 | type Use<K extends keyof VideoBlacklistModel, M> = PickWith<VideoBlacklistModel, K, M> | ||
6 | |||
7 | // ############################################################################ | ||
8 | |||
9 | export type MVideoBlacklist = Omit<VideoBlacklistModel, 'Video'> | ||
10 | |||
11 | export type MVideoBlacklistLight = Pick<MVideoBlacklist, 'id' | 'reason' | 'unfederated'> | ||
12 | export type MVideoBlacklistUnfederated = Pick<MVideoBlacklist, 'unfederated'> | ||
13 | |||
14 | // ############################################################################ | ||
15 | |||
16 | export type MVideoBlacklistLightVideo = | ||
17 | MVideoBlacklistLight & | ||
18 | Use<'Video', MVideo> | ||
19 | |||
20 | export type MVideoBlacklistVideo = | ||
21 | MVideoBlacklist & | ||
22 | Use<'Video', MVideo> | ||
23 | |||
24 | // ############################################################################ | ||
25 | |||
26 | // Format for API or AP object | ||
27 | |||
28 | export type MVideoBlacklistFormattable = | ||
29 | MVideoBlacklist & | ||
30 | Use<'Video', MVideoFormattable> | ||