]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/typings/models/video/video-channels.ts
Stronger model typings
[github/Chocobozzz/PeerTube.git] / server / typings / models / video / video-channels.ts
CommitLineData
453e83ea
C
1import { FunctionProperties, PickWith } from '../../utils'
2import { VideoChannelModel } from '../../../models/video/video-channel'
3import {
4 MAccountActor,
5 MAccountAPI,
6 MAccountBlocks,
7 MAccountDefault,
8 MAccountLight,
9 MAccountUserId,
10 MActor,
11 MActorAccountChannelId,
12 MActorAPI,
13 MActorDefault,
14 MActorDefaultLight, MActorLight,
15 MActorSummary
16} from '../account'
17import { MVideo } from './video'
18
19export type MChannelId = FunctionProperties<VideoChannelModel>
20export type MChannelIdActor = MChannelId &
21 PickWith<VideoChannelModel, 'Actor', MActorAccountChannelId>
22
23export type MChannel = Omit<VideoChannelModel, 'Actor' | 'Account' | 'Videos' | 'VideoPlaylists'>
24
25export type MChannelUserId = Pick<MChannel, 'accountId'> &
26 PickWith<VideoChannelModel, 'Account', MAccountUserId>
27
28// Default scope
29export type MChannelDefault = MChannel &
30 PickWith<VideoChannelModel, 'Actor', MActorDefault>
31
32export type MChannelLight = MChannel &
33 PickWith<VideoChannelModel, 'Actor', MActorDefaultLight>
34
35export type MChannelAccountLight = MChannel &
36 PickWith<VideoChannelModel, 'Actor', MActorDefaultLight> &
37 PickWith<VideoChannelModel, 'Account', MAccountLight>
38
39export type MChannelSummary = Pick<MChannel, 'id' | 'name' | 'description' | 'actorId'> &
40 PickWith<VideoChannelModel, 'Actor', MActorSummary>
41
42export type MChannelSummaryAccount = MChannelSummary &
43 PickWith<VideoChannelModel, 'Account', MAccountBlocks>
44
45export type MChannelAPI = MChannel &
46 PickWith<VideoChannelModel, 'Actor', MActorAPI> &
47 PickWith<VideoChannelModel, 'Account', MAccountAPI>
48
49export type MChannelAccountActor = MChannel &
50 PickWith<VideoChannelModel, 'Account', MAccountActor>
51export type MChannelAccountDefault = MChannelActor &
52 PickWith<VideoChannelModel, 'Account', MAccountDefault>
53
54export type MChannelVideos = MChannel &
55 PickWith<VideoChannelModel, 'Videos', MVideo[]>
56
57export type MChannelActor = MChannel &
58 PickWith<VideoChannelModel, 'Actor', MActor>
59export type MChannelActorLight = MChannel &
60 PickWith<VideoChannelModel, 'Actor', MActorLight>
61export type MChannelActorDefault = MChannel &
62 PickWith<VideoChannelModel, 'Actor', MActorDefault>
63
64export type MChannelActorAccountActor = MChannelAccountActor & MChannelActor
65
66export type MChannelActorAccountDefault = MChannel &
67 PickWith<VideoChannelModel, 'Actor', MActorDefault> &
68 PickWith<VideoChannelModel, 'Account', MAccountDefault>
69
70export type MChannelActorAccountDefaultVideos = MChannelActorAccountDefault & MChannelVideos