import { Gender } from '@/pages/sys/user/constants.ts'

export {}

declare global {
  namespace UserTypes {
    interface SysUserAccount {
      id?: string
      username?: string
      email?: string
      phone?: string
      secret?: string
    }

    interface SysUser {
      id?: string
      nickname?: string
      avatar?: string
      gender?: Gender
      genderTxt?: string
      account?: SysUserAccount
      tenantId?: string
      roles?: { id?: string }[]
    }

    type SearchForm = Pick<SysUser, 'nickname'> | Pick<SysUserAccount, 'username'>
    type ModifyData = Partial<Pick<SysUser, 'nickname' | 'gender' | 'avatar'>> & Pick<SysUser, 'id'>
    type AddForm = Omit<SysUser, 'id'>
  }
}

