]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/typings/models/server/server-blocklist.ts
Type toFormattedJSON
[github/Chocobozzz/PeerTube.git] / server / typings / models / server / server-blocklist.ts
CommitLineData
453e83ea
C
1import { ServerBlocklistModel } from '@server/models/server/server-blocklist'
2import { PickWith } from '@server/typings/utils'
1ca9f7c3 3import { MAccountDefault, MAccountFormattable, MServer, MServerFormattable } from '@server/typings/models'
453e83ea 4
0283eaac
C
5type Use<K extends keyof ServerBlocklistModel, M> = PickWith<ServerBlocklistModel, K, M>
6
7// ############################################################################
8
453e83ea
C
9export type MServerBlocklist = Omit<ServerBlocklistModel, 'ByAccount' | 'BlockedServer'>
10
0283eaac
C
11// ############################################################################
12
453e83ea 13export type MServerBlocklistAccountServer = MServerBlocklist &
0283eaac
C
14 Use<'ByAccount', MAccountDefault> &
15 Use<'BlockedServer', MServer>
1ca9f7c3
C
16
17// ############################################################################
18
19// Format for API or AP object
20
21export type MServerBlocklistFormattable = Pick<MServerBlocklist, 'createdAt'> &
22 Use<'ByAccount', MAccountFormattable> &
23 Use<'BlockedServer', MServerFormattable>