]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/typings/models/video/video-comment.ts
Add ability to disable webtorrent
[github/Chocobozzz/PeerTube.git] / server / typings / models / video / video-comment.ts
CommitLineData
453e83ea 1import { VideoCommentModel } from '../../../models/video/video-comment'
b5fecbf4 2import { PickWith, PickWithOpt } from '../../utils'
d7a25329 3import { MAccountDefault, MAccountFormattable, MAccountUrl } from '../account'
b5fecbf4 4import { MVideoAccountLight, MVideoFeed, MVideoIdUrl, MVideoUrl } from './video'
0283eaac
C
5
6type Use<K extends keyof VideoCommentModel, M> = PickWith<VideoCommentModel, K, M>
7
8// ############################################################################
453e83ea
C
9
10export type MComment = Omit<VideoCommentModel, 'OriginVideoComment' | 'InReplyToVideoComment' | 'Video' | 'Account'>
1ca9f7c3 11export type MCommentTotalReplies = MComment & { totalReplies?: number }
453e83ea 12export type MCommentId = Pick<MComment, 'id'>
b5fecbf4 13export type MCommentUrl = Pick<MComment, 'url'>
453e83ea 14
0283eaac 15// ############################################################################
453e83ea
C
16
17export type MCommentOwner = MComment &
0283eaac 18 Use<'Account', MAccountDefault>
453e83ea
C
19
20export type MCommentVideo = MComment &
0283eaac 21 Use<'Video', MVideoAccountLight>
453e83ea
C
22
23export type MCommentReply = MComment &
0283eaac
C
24 Use<'InReplyToVideoComment', MComment>
25
26export type MCommentOwnerVideo = MComment &
27 Use<'Account', MAccountDefault> &
28 Use<'Video', MVideoAccountLight>
453e83ea 29
0283eaac
C
30export type MCommentOwnerVideoReply = MComment &
31 Use<'Account', MAccountDefault> &
32 Use<'Video', MVideoAccountLight> &
33 Use<'InReplyToVideoComment', MComment>
453e83ea 34
0283eaac
C
35export type MCommentOwnerReplyVideoLight = MComment &
36 Use<'Account', MAccountDefault> &
37 Use<'InReplyToVideoComment', MComment> &
38 Use<'Video', MVideoIdUrl>
453e83ea
C
39
40export type MCommentOwnerVideoFeed = MCommentOwner &
0283eaac
C
41 Use<'Video', MVideoFeed>
42
43// ############################################################################
44
45export type MCommentAPI = MComment & { totalReplies: number }
1ca9f7c3
C
46
47// ############################################################################
48
49// Format for API or AP object
50
51export type MCommentFormattable = MCommentTotalReplies &
52 Use<'Account', MAccountFormattable>
b5fecbf4
C
53
54export type MCommentAP = MComment &
55 Use<'Account', MAccountUrl> &
56 PickWithOpt<VideoCommentModel, 'Video', MVideoUrl> &
57 PickWithOpt<VideoCommentModel, 'InReplyToVideoComment', MCommentUrl>