aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/types/models/video/video-rate.ts
blob: a7682ef31d8ab5aa37968f6d0162ffe86a1d5bf9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { AccountVideoRateModel } from '@server/models/account/account-video-rate'
import { PickWith } from '@server/types/utils'
import { MAccountAudience, MAccountUrl } from '../account/account'
import { MVideo, MVideoFormattable } from './video'

type Use<K extends keyof AccountVideoRateModel, M> = PickWith<AccountVideoRateModel, K, M>

// ############################################################################

export type MAccountVideoRate = Omit<AccountVideoRateModel, 'Video' | 'Account'>

export type MAccountVideoRateAccountUrl =
  MAccountVideoRate &
  Use<'Account', MAccountUrl>

export type MAccountVideoRateAccountVideo =
  MAccountVideoRate &
  Use<'Account', MAccountAudience> &
  Use<'Video', MVideo>

// ############################################################################

// Format for API or AP object

export type MAccountVideoRateFormattable =
  Pick<MAccountVideoRate, 'type'> &
  Use<'Video', MVideoFormattable>