video-abuse.ts 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. import { VideoAbuseModel } from '../../../models/video/video-abuse'
  2. import { PickWith } from '../../utils'
  3. import { MVideo } from './video'
  4. import { MAccountDefault, MAccountFormattable } from '../account'
  5. type Use<K extends keyof VideoAbuseModel, M> = PickWith<VideoAbuseModel, K, M>
  6. // ############################################################################
  7. export type MVideoAbuse = Omit<VideoAbuseModel, 'Account' | 'Video' | 'toActivityPubObject'>
  8. // ############################################################################
  9. export type MVideoAbuseId = Pick<VideoAbuseModel, 'id'>
  10. export type MVideoAbuseVideo = MVideoAbuse &
  11. Pick<VideoAbuseModel, 'toActivityPubObject'> &
  12. Use<'Video', MVideo>
  13. export type MVideoAbuseAccountVideo = MVideoAbuse &
  14. Pick<VideoAbuseModel, 'toActivityPubObject'> &
  15. Use<'Video', MVideo> &
  16. Use<'Account', MAccountDefault>
  17. // ############################################################################
  18. // Format for API or AP object
  19. export type MVideoAbuseFormattable = MVideoAbuse &
  20. Use<'Account', MAccountFormattable> &
  21. Use<'Video', Pick<MVideo, 'id' | 'uuid' | 'name'>>