1 import { PickWith } from '../../utils'
2 import { VideoChannelModel } from '../../../models/video/video-channel'
11 MActorAccountChannelId,
18 import { MVideo } from './video'
20 type Use<K extends keyof VideoChannelModel, M> = PickWith<VideoChannelModel, K, M>
22 // ############################################################################
24 export type MChannel = Omit<VideoChannelModel, 'Actor' | 'Account' | 'Videos' | 'VideoPlaylists'>
26 // ############################################################################
28 export type MChannelId = Pick<MChannel, 'id'>
30 // ############################################################################
32 export type MChannelIdActor = MChannelId &
33 Use<'Actor', MActorAccountChannelId>
35 export type MChannelUserId = Pick<MChannel, 'accountId'> &
36 Use<'Account', MAccountUserId>
38 export type MChannelActor = MChannel &
42 export type MChannelDefault = MChannel &
43 Use<'Actor', MActorDefault>
45 // ############################################################################
47 // Not all association attributes
49 export type MChannelLight = MChannel &
50 Use<'Actor', MActorDefaultLight>
52 export type MChannelActorLight = MChannel &
53 Use<'Actor', MActorLight>
55 export type MChannelAccountLight = MChannel &
56 Use<'Actor', MActorDefaultLight> &
57 Use<'Account', MAccountLight>
59 // ############################################################################
61 // Account associations
63 export type MChannelAccountActor = MChannel &
64 Use<'Account', MAccountActor>
66 export type MChannelAccountDefault = MChannel &
67 Use<'Actor', MActorDefault> &
68 Use<'Account', MAccountDefault>
70 export type MChannelActorAccountActor = MChannel &
71 Use<'Account', MAccountActor> &
74 // ############################################################################
76 // Videos associations
77 export type MChannelVideos = MChannel &
78 Use<'Videos', MVideo[]>
80 export type MChannelActorAccountDefaultVideos = MChannel &
81 Use<'Actor', MActorDefault> &
82 Use<'Account', MAccountDefault> &
83 Use<'Videos', MVideo[]>
85 // ############################################################################
89 export type MChannelSummary = Pick<MChannel, 'id' | 'name' | 'description' | 'actorId'> &
90 Use<'Actor', MActorSummary>
92 export type MChannelSummaryAccount = MChannelSummary &
93 Use<'Account', MAccountSummaryBlocks>
95 export type MChannelAPI = MChannel &
96 Use<'Actor', MActorAPI> &
97 Use<'Account', MAccountAPI>