1
0
Fork 0
peertube/server/typings/models/video/video-channels.ts
2019-08-19 17:26:35 +02:00

70 lines
2.4 KiB
TypeScript

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