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