aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/types/models/account/account-blocklist.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-06-18 10:45:25 +0200
committerChocobozzz <me@florianbigard.com>2020-06-18 10:46:27 +0200
commit26d6bf6533023326fa017812cf31bbe20c752d36 (patch)
tree9c4e3ecdc344420190f17d429bdf05d78fae7a8c /server/types/models/account/account-blocklist.ts
parentd6d951ddc0c492f3261065b5dcb4df0534d252fc (diff)
downloadPeerTube-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.ts27
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 @@
1import { AccountBlocklistModel } from '../../../models/account/account-blocklist'
2import { PickWith } from '../../utils'
3import { MAccountDefault, MAccountFormattable } from './account'
4
5type Use<K extends keyof AccountBlocklistModel, M> = PickWith<AccountBlocklistModel, K, M>
6
7// ############################################################################
8
9export type MAccountBlocklist = Omit<AccountBlocklistModel, 'ByAccount' | 'BlockedAccount'>
10
11// ############################################################################
12
13export type MAccountBlocklistId = Pick<AccountBlocklistModel, 'id'>
14
15export type MAccountBlocklistAccounts =
16 MAccountBlocklist &
17 Use<'ByAccount', MAccountDefault> &
18 Use<'BlockedAccount', MAccountDefault>
19
20// ############################################################################
21
22// Format for API or AP object
23
24export type MAccountBlocklistFormattable =
25 Pick<MAccountBlocklist, 'createdAt'> &
26 Use<'ByAccount', MAccountFormattable> &
27 Use<'BlockedAccount', MAccountFormattable>