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

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, value: number) => Promise<void>
    incrementCurrency: (user: User, value: number) => Promise<void>
    setCurrency: (user: User, value: number) => Promise<void>
    getCurrency: (user:User) => Promise<number>
    changeRank: (user:User, rank: Rank) => Promise<User>
    wipeCurrency: () => Promise<void>
}