import { Auth, Rank, User, RPCPermission, UserRecord } from "../../Types/Types"
import { Tiers } from "../../Types/Items"

export class IUserManager{
    login: (username:string, pwHash:string) => Promise<Auth>
    logout: (username: string, tokenValue :string) => Promise<void>
    getAuth: (tokenValue: string) => Promise<Auth | void>
    createUser: (user:User) => Promise<User>
    setPermission: (perm: RPCPermission) => Promise<void>
    getPermissions: () => Promise<RPCPermission[]>
    checkToken: (token: string, rank: Rank) => boolean
    getUserRecordByToken: (tokenValue: string) => UserRecord | void
    getUser: (username: string) => Promise<User | void>

    decrementCurrency: (user: User, tier:Tiers, value: number) => Promise<void>
    incrementCurrency: (user: User, tier:Tiers, value: number) => Promise<void>
    setCurrency: (user: User, tier:Tiers, value: number) => Promise<void>
    getCurrency: (user:User, tier:Tiers) => Promise<number>
    changeRank: (user:User, rank: Rank) => Promise<User>
    wipeCurrency: () => Promise<void>
}