]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/typings/models/video/video-rate.ts
Merge branch 'release/2.1.0' into develop
[github/Chocobozzz/PeerTube.git] / server / typings / models / video / video-rate.ts
index fc932999354c06385dcaabbb369e212c14628538..64ce4965b9c6c2614ea60441d729cb030d6a3e22 100644 (file)
@@ -1,6 +1,7 @@
 import { AccountVideoRateModel } from '@server/models/account/account-video-rate'
 import { PickWith } from '@server/typings/utils'
-import { MAccountAudience, MAccountUrl, MVideo } from '..'
+import { MAccountAudience, MAccountUrl } from '../account/account'
+import { MVideo, MVideoFormattable } from './video'
 
 type Use<K extends keyof AccountVideoRateModel, M> = PickWith<AccountVideoRateModel, K, M>
 
@@ -8,9 +9,19 @@ type Use<K extends keyof AccountVideoRateModel, M> = PickWith<AccountVideoRateMo
 
 export type MAccountVideoRate = Omit<AccountVideoRateModel, 'Video' | 'Account'>
 
-export type MAccountVideoRateAccountUrl = MAccountVideoRate &
+export type MAccountVideoRateAccountUrl =
+  MAccountVideoRate &
   Use<'Account', MAccountUrl>
 
-export type MAccountVideoRateAccountVideo = MAccountVideoRate &
+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>