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-rate.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-rate.ts')
-rw-r--r-- | server/types/models/video/video-rate.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/server/types/models/video/video-rate.ts b/server/types/models/video/video-rate.ts new file mode 100644 index 000000000..a7682ef31 --- /dev/null +++ b/server/types/models/video/video-rate.ts | |||
@@ -0,0 +1,27 @@ | |||
1 | import { AccountVideoRateModel } from '@server/models/account/account-video-rate' | ||
2 | import { PickWith } from '@server/types/utils' | ||
3 | import { MAccountAudience, MAccountUrl } from '../account/account' | ||
4 | import { MVideo, MVideoFormattable } from './video' | ||
5 | |||
6 | type Use<K extends keyof AccountVideoRateModel, M> = PickWith<AccountVideoRateModel, K, M> | ||
7 | |||
8 | // ############################################################################ | ||
9 | |||
10 | export type MAccountVideoRate = Omit<AccountVideoRateModel, 'Video' | 'Account'> | ||
11 | |||
12 | export type MAccountVideoRateAccountUrl = | ||
13 | MAccountVideoRate & | ||
14 | Use<'Account', MAccountUrl> | ||
15 | |||
16 | export type MAccountVideoRateAccountVideo = | ||
17 | MAccountVideoRate & | ||
18 | Use<'Account', MAccountAudience> & | ||
19 | Use<'Video', MVideo> | ||
20 | |||
21 | // ############################################################################ | ||
22 | |||
23 | // Format for API or AP object | ||
24 | |||
25 | export type MAccountVideoRateFormattable = | ||
26 | Pick<MAccountVideoRate, 'type'> & | ||
27 | Use<'Video', MVideoFormattable> | ||