aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/video/video-comment.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-21 14:31:57 +0200
committerChocobozzz <me@florianbigard.com>2019-08-21 15:23:04 +0200
commitb5fecbf44192144d1ca27c23a0b53922de288c10 (patch)
tree03e4f1048273e6de60b8eb642fb52b2a4c68e60c /server/typings/models/video/video-comment.ts
parentf92e7f76d43cbad173be87f47105b9a02032318a (diff)
downloadPeerTube-b5fecbf44192144d1ca27c23a0b53922de288c10.tar.gz
PeerTube-b5fecbf44192144d1ca27c23a0b53922de288c10.tar.zst
PeerTube-b5fecbf44192144d1ca27c23a0b53922de288c10.zip
Type toActivityPubObject functions
Diffstat (limited to 'server/typings/models/video/video-comment.ts')
-rw-r--r--server/typings/models/video/video-comment.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/server/typings/models/video/video-comment.ts b/server/typings/models/video/video-comment.ts
index e8bccba0f..4fd1c29e8 100644
--- a/server/typings/models/video/video-comment.ts
+++ b/server/typings/models/video/video-comment.ts
@@ -1,7 +1,7 @@
1import { VideoCommentModel } from '../../../models/video/video-comment' 1import { VideoCommentModel } from '../../../models/video/video-comment'
2import { PickWith } from '../../utils' 2import { PickWith, PickWithOpt } from '../../utils'
3import { MAccountDefault, MAccountFormattable } from '../account' 3import { MAccountDefault, MAccountFormattable, MAccountUrl, MActorUrl } from '../account'
4import { MVideoAccountLight, MVideoFeed, MVideoIdUrl } from './video' 4import { MVideoAccountLight, MVideoFeed, MVideoIdUrl, MVideoUrl } from './video'
5 5
6type Use<K extends keyof VideoCommentModel, M> = PickWith<VideoCommentModel, K, M> 6type Use<K extends keyof VideoCommentModel, M> = PickWith<VideoCommentModel, K, M>
7 7
@@ -10,6 +10,7 @@ type Use<K extends keyof VideoCommentModel, M> = PickWith<VideoCommentModel, K,
10export type MComment = Omit<VideoCommentModel, 'OriginVideoComment' | 'InReplyToVideoComment' | 'Video' | 'Account'> 10export type MComment = Omit<VideoCommentModel, 'OriginVideoComment' | 'InReplyToVideoComment' | 'Video' | 'Account'>
11export type MCommentTotalReplies = MComment & { totalReplies?: number } 11export type MCommentTotalReplies = MComment & { totalReplies?: number }
12export type MCommentId = Pick<MComment, 'id'> 12export type MCommentId = Pick<MComment, 'id'>
13export type MCommentUrl = Pick<MComment, 'url'>
13 14
14// ############################################################################ 15// ############################################################################
15 16
@@ -49,3 +50,8 @@ export type MCommentAPI = MComment & { totalReplies: number }
49 50
50export type MCommentFormattable = MCommentTotalReplies & 51export type MCommentFormattable = MCommentTotalReplies &
51 Use<'Account', MAccountFormattable> 52 Use<'Account', MAccountFormattable>
53
54export type MCommentAP = MComment &
55 Use<'Account', MAccountUrl> &
56 PickWithOpt<VideoCommentModel, 'Video', MVideoUrl> &
57 PickWithOpt<VideoCommentModel, 'InReplyToVideoComment', MCommentUrl>