1
0
Fork 0
peertube/server/typings/models/video/video-comment.ts

44 lines
1.5 KiB
TypeScript
Raw Normal View History

2019-08-15 05:53:26 -04:00
import { VideoCommentModel } from '../../../models/video/video-comment'
import { PickWith } from '../../utils'
import { MAccountDefault } from '../account'
2019-08-20 07:52:49 -04:00
import { MVideoAccountLight, MVideoFeed, MVideoIdUrl } from './video'
type Use<K extends keyof VideoCommentModel, M> = PickWith<VideoCommentModel, K, M>
// ############################################################################
2019-08-15 05:53:26 -04:00
export type MComment = Omit<VideoCommentModel, 'OriginVideoComment' | 'InReplyToVideoComment' | 'Video' | 'Account'>
export type MCommentId = Pick<MComment, 'id'>
2019-08-20 07:52:49 -04:00
// ############################################################################
2019-08-15 05:53:26 -04:00
export type MCommentOwner = MComment &
2019-08-20 07:52:49 -04:00
Use<'Account', MAccountDefault>
2019-08-15 05:53:26 -04:00
export type MCommentVideo = MComment &
2019-08-20 07:52:49 -04:00
Use<'Video', MVideoAccountLight>
2019-08-15 05:53:26 -04:00
export type MCommentReply = MComment &
2019-08-20 07:52:49 -04:00
Use<'InReplyToVideoComment', MComment>
export type MCommentOwnerVideo = MComment &
Use<'Account', MAccountDefault> &
Use<'Video', MVideoAccountLight>
2019-08-15 05:53:26 -04:00
2019-08-20 07:52:49 -04:00
export type MCommentOwnerVideoReply = MComment &
Use<'Account', MAccountDefault> &
Use<'Video', MVideoAccountLight> &
Use<'InReplyToVideoComment', MComment>
2019-08-15 05:53:26 -04:00
2019-08-20 07:52:49 -04:00
export type MCommentOwnerReplyVideoLight = MComment &
Use<'Account', MAccountDefault> &
Use<'InReplyToVideoComment', MComment> &
Use<'Video', MVideoIdUrl>
2019-08-15 05:53:26 -04:00
export type MCommentOwnerVideoFeed = MCommentOwner &
2019-08-20 07:52:49 -04:00
Use<'Video', MVideoFeed>
// ############################################################################
export type MCommentAPI = MComment & { totalReplies: number }