Cleanup model types
[oweals/peertube.git] / server / typings / models / server / server.ts
index 6be7bf9bb5344a8c2458f29258136013169ec242..c059cff792e154b46c413dda0ab75979b9c60e9d 100644 (file)
@@ -2,9 +2,15 @@ import { ServerModel } from '../../../models/server/server'
 import { PickWith } from '../../utils'
 import { MAccountBlocklistId } from '../account'
 
+type Use<K extends keyof ServerModel, M> = PickWith<ServerModel, K, M>
+
+// ############################################################################
+
 export type MServer = Omit<ServerModel, 'Actors' | 'BlockedByAccounts'>
 
+// ############################################################################
+
 export type MServerHost = Pick<MServer, 'host'>
 
 export type MServerHostBlocks = MServerHost &
-  PickWith<ServerModel, 'BlockedByAccounts', MAccountBlocklistId[]>
+  Use<'BlockedByAccounts', MAccountBlocklistId[]>