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

25 lines
961 B
TypeScript
Raw Normal View History

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