PeerTube/server/typings/models/video/video-blacklist.ts

31 lines
1.0 KiB
TypeScript
Raw Normal View History

2019-08-15 11:53:26 +02:00
import { VideoBlacklistModel } from '../../../models/video/video-blacklist'
import { PickWith } from '@server/typings/utils'
import { MVideo, MVideoFormattable } from './video'
2019-08-15 11:53:26 +02:00
2019-08-20 13:52:49 +02:00
type Use<K extends keyof VideoBlacklistModel, M> = PickWith<VideoBlacklistModel, K, M>
// ############################################################################
2019-08-15 11:53:26 +02:00
export type MVideoBlacklist = Omit<VideoBlacklistModel, 'Video'>
export type MVideoBlacklistLight = Pick<MVideoBlacklist, 'id' | 'reason' | 'unfederated'>
export type MVideoBlacklistUnfederated = Pick<MVideoBlacklist, 'unfederated'>
2019-08-20 13:52:49 +02:00
// ############################################################################
2020-01-31 16:56:52 +01:00
export type MVideoBlacklistLightVideo =
MVideoBlacklistLight &
Use<'Video', MVideo>
2020-01-31 16:56:52 +01:00
export type MVideoBlacklistVideo =
MVideoBlacklist &
2019-08-20 13:52:49 +02:00
Use<'Video', MVideo>
2019-08-20 19:05:31 +02:00
// ############################################################################
// Format for API or AP object
2020-01-31 16:56:52 +01:00
export type MVideoBlacklistFormattable =
MVideoBlacklist &
2019-08-20 19:05:31 +02:00
Use<'Video', MVideoFormattable>