From 1ca9f7c3f7afac2af4c4c25b98426731f7e789c6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 20 Aug 2019 19:05:31 +0200 Subject: Type toFormattedJSON --- server/typings/models/video/video-channels.ts | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'server/typings/models/video/video-channels.ts') diff --git a/server/typings/models/video/video-channels.ts b/server/typings/models/video/video-channels.ts index b6506ed9f..2be7dd7ed 100644 --- a/server/typings/models/video/video-channels.ts +++ b/server/typings/models/video/video-channels.ts @@ -1,19 +1,23 @@ -import { PickWith } from '../../utils' +import { FunctionProperties, PickWith, PickWithOpt } from '../../utils' import { VideoChannelModel } from '../../../models/video/video-channel' import { MAccountActor, MAccountAPI, MAccountDefault, + MAccountFormattable, MAccountLight, MAccountSummaryBlocks, + MAccountSummaryFormattable, MAccountUserId, MActor, MActorAccountChannelId, MActorAPI, MActorDefault, MActorDefaultLight, + MActorFormattable, MActorLight, - MActorSummary + MActorSummary, + MActorSummaryFormattable } from '../account' import { MVideo } from './video' @@ -86,7 +90,8 @@ export type MChannelActorAccountDefaultVideos = MChannel & // For API -export type MChannelSummary = Pick & +export type MChannelSummary = FunctionProperties & + Pick & Use<'Actor', MActorSummary> export type MChannelSummaryAccount = MChannelSummary & @@ -95,3 +100,19 @@ export type MChannelSummaryAccount = MChannelSummary & export type MChannelAPI = MChannel & Use<'Actor', MActorAPI> & Use<'Account', MAccountAPI> + +// ############################################################################ + +// Format for API or AP object + +export type MChannelSummaryFormattable = FunctionProperties & + Pick & + Use<'Actor', MActorSummaryFormattable> + +export type MChannelAccountSummaryFormattable = MChannelSummaryFormattable & + Use<'Account', MAccountSummaryFormattable> + +export type MChannelFormattable = FunctionProperties & + Pick & + Use<'Actor', MActorFormattable> & + PickWithOpt -- cgit v1.2.3