aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/types/models/video/video-import.ts
blob: 650c293f79c8bdee93fb8fdcfef2c47c3b596068 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                                    
                                                                
                                    
                                                                                                                   
 
                                                                                
 
                                                                               
 
                                                                   
 

                               





                                                                               

                                 


                                

                                      

                                                 




                                                                               

                                     
                                                                       
import { VideoImportModel } from '@server/models/video/video-import'
import { PickWith, PickWithOpt } from '@shared/typescript-utils'
import { MUser } from '../user/user'
import { MVideo, MVideoAccountLight, MVideoFormattable, MVideoTag, MVideoThumbnail, MVideoWithFile } from './video'

type Use<K extends keyof VideoImportModel, M> = PickWith<VideoImportModel, K, M>

// ############################################################################

export type MVideoImport = Omit<VideoImportModel, 'User' | 'Video'>

export type MVideoImportVideo =
  MVideoImport &
  Use<'Video', MVideo>

// ############################################################################

type VideoAssociation = MVideoTag & MVideoAccountLight & MVideoThumbnail

export type MVideoImportDefault =
  MVideoImport &
  Use<'User', MUser> &
  Use<'Video', VideoAssociation>

export type MVideoImportDefaultFiles =
  MVideoImport &
  Use<'User', MUser> &
  Use<'Video', VideoAssociation & MVideoWithFile>

// ############################################################################

// Format for API or AP object

export type MVideoImportFormattable =
  MVideoImport &
  PickWithOpt<VideoImportModel, 'Video', MVideoFormattable & MVideoTag>