aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/video/video-comment.ts
blob: 675613804ee2c9e534f1aec76715c664c1c1acd2 (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
28
29
import { VideoCommentModel } from '../../../models/video/video-comment'
import { PickWith } from '../../utils'
import { MAccountDefault } from '../account'
import { MVideoAccountDefault, MVideoAccountLight, MVideoFeed, MVideoIdUrl } from './video'

export type MComment = Omit<VideoCommentModel, 'OriginVideoComment' | 'InReplyToVideoComment' | 'Video' | 'Account'>
export type MCommentId = Pick<MComment, 'id'>

export type MCommentAPI = MComment & { totalReplies: number }

export type MCommentOwner = MComment &
  PickWith<VideoCommentModel, 'Account', MAccountDefault>

export type MCommentVideo = MComment &
  PickWith<VideoCommentModel, 'Video', MVideoAccountLight>

export type MCommentReply = MComment &
  PickWith<VideoCommentModel, 'InReplyToVideoComment', MComment>

export type MCommentOwnerReply = MCommentOwner & MCommentReply
export type MCommentOwnerVideo = MCommentOwner & MCommentVideo
export type MCommentReplyVideo = MCommentReply & MCommentVideo
export type MCommentOwnerVideoReply = MCommentOwnerVideo & MCommentReply

export type MCommentOwnerReplyVideoLight = MCommentOwnerReply &
  PickWith<VideoCommentModel, 'Video', MVideoIdUrl>

export type MCommentOwnerVideoFeed = MCommentOwner &
  PickWith<VideoCommentModel, 'Video', MVideoFeed>