]>
Commit | Line | Data |
---|---|---|
1 | import { ServerBlocklistModel } from '@server/models/server/server-blocklist' | |
2 | import { PickWith } from '@server/typings/utils' | |
3 | import { MAccountDefault, MAccountFormattable, MServer, MServerFormattable } from '@server/typings/models' | |
4 | ||
5 | type Use<K extends keyof ServerBlocklistModel, M> = PickWith<ServerBlocklistModel, K, M> | |
6 | ||
7 | // ############################################################################ | |
8 | ||
9 | export type MServerBlocklist = Omit<ServerBlocklistModel, 'ByAccount' | 'BlockedServer'> | |
10 | ||
11 | // ############################################################################ | |
12 | ||
13 | export type MServerBlocklistAccountServer = MServerBlocklist & | |
14 | Use<'ByAccount', MAccountDefault> & | |
15 | Use<'BlockedServer', MServer> | |
16 | ||
17 | // ############################################################################ | |
18 | ||
19 | // Format for API or AP object | |
20 | ||
21 | export type MServerBlocklistFormattable = Pick<MServerBlocklist, 'createdAt'> & | |
22 | Use<'ByAccount', MAccountFormattable> & | |
23 | Use<'BlockedServer', MServerFormattable> |