]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/typings/models/video/video-rate.ts
Merge branch 'release/1.4.0' into develop
[github/Chocobozzz/PeerTube.git] / server / typings / models / video / video-rate.ts
1 import { AccountVideoRateModel } from '@server/models/account/account-video-rate'
2 import { PickWith } from '@server/typings/utils'
3 import { MAccountAudience, MAccountUrl, MVideo, MVideoFormattable } from '..'
4
5 type Use<K extends keyof AccountVideoRateModel, M> = PickWith<AccountVideoRateModel, K, M>
6
7 // ############################################################################
8
9 export type MAccountVideoRate = Omit<AccountVideoRateModel, 'Video' | 'Account'>
10
11 export type MAccountVideoRateAccountUrl = MAccountVideoRate &
12 Use<'Account', MAccountUrl>
13
14 export type MAccountVideoRateAccountVideo = MAccountVideoRate &
15 Use<'Account', MAccountAudience> &
16 Use<'Video', MVideo>
17
18 // ############################################################################
19
20 // Format for API or AP object
21
22 export type MAccountVideoRateFormattable = Pick<MAccountVideoRate, 'type'> &
23 Use<'Video', MVideoFormattable>