aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/user/user.ts
blob: b91eed8d91c4de556044a832c525756093c9c206 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { UserModel } from '../../../models/account/user'
import { PickWith } from '../../utils'
import { MAccount, MAccountDefault, MAccountDefaultChannelDefault, MAccountId, MAccountIdActorId, MAccountUrl } from '../account'
import { MNotificationSetting } from './user-notification-setting'

export type MUser = Omit<UserModel, 'Account' | 'NotificationSetting' | 'VideoImports' | 'OAuthTokens'>

export type MUserId = Pick<UserModel, 'id'>

export type MUserWithNotificationSetting = MUser &
  PickWith<UserModel, 'NotificationSetting', MNotificationSetting>

export type MUserAccountDefault = MUser &
  PickWith<UserModel, 'Account', MAccountDefault>

export type MUserAccount = MUser &
  PickWith<UserModel, 'Account', MAccount>

export type MUserAccountId = MUser &
  PickWith<UserModel, 'Account', MAccountId>

export type MUserNotifSettingAccount = MUserWithNotificationSetting & MUserAccount

export type MUserDefault = MUser &
  MUserWithNotificationSetting &
  MUserAccountDefault

export type MUserChannel = MUserWithNotificationSetting &
  PickWith<UserModel, 'Account', MAccountDefaultChannelDefault>

export type MUserAccountUrl = MUser &
  PickWith<UserModel, 'Account', MAccountUrl & MAccountIdActorId>