diff options
author | Chocobozzz <me@florianbigard.com> | 2020-06-18 10:45:25 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-06-18 10:46:27 +0200 |
commit | 26d6bf6533023326fa017812cf31bbe20c752d36 (patch) | |
tree | 9c4e3ecdc344420190f17d429bdf05d78fae7a8c /server/types/models/account/account-blocklist.ts | |
parent | d6d951ddc0c492f3261065b5dcb4df0534d252fc (diff) | |
download | PeerTube-26d6bf6533023326fa017812cf31bbe20c752d36.tar.gz PeerTube-26d6bf6533023326fa017812cf31bbe20c752d36.tar.zst PeerTube-26d6bf6533023326fa017812cf31bbe20c752d36.zip |
Split types and typings
Diffstat (limited to 'server/types/models/account/account-blocklist.ts')
-rw-r--r-- | server/types/models/account/account-blocklist.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/server/types/models/account/account-blocklist.ts b/server/types/models/account/account-blocklist.ts new file mode 100644 index 000000000..0d8bf11bd --- /dev/null +++ b/server/types/models/account/account-blocklist.ts | |||
@@ -0,0 +1,27 @@ | |||
1 | import { AccountBlocklistModel } from '../../../models/account/account-blocklist' | ||
2 | import { PickWith } from '../../utils' | ||
3 | import { MAccountDefault, MAccountFormattable } from './account' | ||
4 | |||
5 | type Use<K extends keyof AccountBlocklistModel, M> = PickWith<AccountBlocklistModel, K, M> | ||
6 | |||
7 | // ############################################################################ | ||
8 | |||
9 | export type MAccountBlocklist = Omit<AccountBlocklistModel, 'ByAccount' | 'BlockedAccount'> | ||
10 | |||
11 | // ############################################################################ | ||
12 | |||
13 | export type MAccountBlocklistId = Pick<AccountBlocklistModel, 'id'> | ||
14 | |||
15 | export type MAccountBlocklistAccounts = | ||
16 | MAccountBlocklist & | ||
17 | Use<'ByAccount', MAccountDefault> & | ||
18 | Use<'BlockedAccount', MAccountDefault> | ||
19 | |||
20 | // ############################################################################ | ||
21 | |||
22 | // Format for API or AP object | ||
23 | |||
24 | export type MAccountBlocklistFormattable = | ||
25 | Pick<MAccountBlocklist, 'createdAt'> & | ||
26 | Use<'ByAccount', MAccountFormattable> & | ||
27 | Use<'BlockedAccount', MAccountFormattable> | ||