aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/video/video-channels.ts
blob: e10bd68426f8dfd2ce07fa4196efb6285c07dd32 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import { FunctionProperties, PickWith } from '../../utils'
import { VideoChannelModel } from '../../../models/video/video-channel'
import {
  MAccountActor,
  MAccountAPI,
  MAccountBlocks,
  MAccountDefault,
  MAccountLight,
  MAccountUserId,
  MActor,
  MActorAccountChannelId,
  MActorAPI,
  MActorDefault,
  MActorDefaultLight, MActorLight,
  MActorSummary
} from '../account'
import { MVideo } from './video'

export type MChannelId = FunctionProperties<VideoChannelModel>
export type MChannelIdActor = MChannelId &
  PickWith<VideoChannelModel, 'Actor', MActorAccountChannelId>

export type MChannel = Omit<VideoChannelModel, 'Actor' | 'Account' | 'Videos' | 'VideoPlaylists'>

export type MChannelUserId = Pick<MChannel, 'accountId'> &
  PickWith<VideoChannelModel, 'Account', MAccountUserId>

// Default scope
export type MChannelDefault = MChannel &
  PickWith<VideoChannelModel, 'Actor', MActorDefault>

export type MChannelLight = MChannel &
  PickWith<VideoChannelModel, 'Actor', MActorDefaultLight>

export type MChannelAccountLight = MChannel &
  PickWith<VideoChannelModel, 'Actor', MActorDefaultLight> &
  PickWith<VideoChannelModel, 'Account', MAccountLight>

export type MChannelSummary = Pick<MChannel, 'id' | 'name' | 'description' | 'actorId'> &
  PickWith<VideoChannelModel, 'Actor', MActorSummary>

export type MChannelSummaryAccount = MChannelSummary &
  PickWith<VideoChannelModel, 'Account', MAccountBlocks>

export type MChannelAPI = MChannel &
  PickWith<VideoChannelModel, 'Actor', MActorAPI> &
  PickWith<VideoChannelModel, 'Account', MAccountAPI>

export type MChannelAccountActor = MChannel &
  PickWith<VideoChannelModel, 'Account', MAccountActor>
export type MChannelAccountDefault = MChannelActor &
  PickWith<VideoChannelModel, 'Account', MAccountDefault>

export type MChannelVideos = MChannel &
  PickWith<VideoChannelModel, 'Videos', MVideo[]>

export type MChannelActor = MChannel &
  PickWith<VideoChannelModel, 'Actor', MActor>
export type MChannelActorLight = MChannel &
  PickWith<VideoChannelModel, 'Actor', MActorLight>
export type MChannelActorDefault = MChannel &
  PickWith<VideoChannelModel, 'Actor', MActorDefault>

export type MChannelActorAccountActor = MChannelAccountActor & MChannelActor

export type MChannelActorAccountDefault = MChannel &
  PickWith<VideoChannelModel, 'Actor', MActorDefault> &
  PickWith<VideoChannelModel, 'Account', MAccountDefault>

export type MChannelActorAccountDefaultVideos = MChannelActorAccountDefault & MChannelVideos