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