1 import { VideoCommentModel } from '../../../models/video/video-comment'
2 import { PickWith } from '../../utils'
3 import { MAccountDefault, MAccountFormattable } from '../account'
4 import { MVideoAccountLight, MVideoFeed, MVideoIdUrl } from './video'
6 type Use<K extends keyof VideoCommentModel, M> = PickWith<VideoCommentModel, K, M>
8 // ############################################################################
10 export type MComment = Omit<VideoCommentModel, 'OriginVideoComment' | 'InReplyToVideoComment' | 'Video' | 'Account'>
11 export type MCommentTotalReplies = MComment & { totalReplies?: number }
12 export type MCommentId = Pick<MComment, 'id'>
14 // ############################################################################
16 export type MCommentOwner = MComment &
17 Use<'Account', MAccountDefault>
19 export type MCommentVideo = MComment &
20 Use<'Video', MVideoAccountLight>
22 export type MCommentReply = MComment &
23 Use<'InReplyToVideoComment', MComment>
25 export type MCommentOwnerVideo = MComment &
26 Use<'Account', MAccountDefault> &
27 Use<'Video', MVideoAccountLight>
29 export type MCommentOwnerVideoReply = MComment &
30 Use<'Account', MAccountDefault> &
31 Use<'Video', MVideoAccountLight> &
32 Use<'InReplyToVideoComment', MComment>
34 export type MCommentOwnerReplyVideoLight = MComment &
35 Use<'Account', MAccountDefault> &
36 Use<'InReplyToVideoComment', MComment> &
37 Use<'Video', MVideoIdUrl>
39 export type MCommentOwnerVideoFeed = MCommentOwner &
40 Use<'Video', MVideoFeed>
42 // ############################################################################
44 export type MCommentAPI = MComment & { totalReplies: number }
46 // ############################################################################
48 // Format for API or AP object
50 export type MCommentFormattable = MCommentTotalReplies &
51 Use<'Account', MAccountFormattable>