let username: string = $state("");
let role: string = $state("");
let id: string = $state("");

export type UserObj = {
    username: string;
    role: string;
    _id: string;
};

export default {
    get username(): string {
        return username;
    },
    set username(uname: string) {
        username = uname;
    },
    get role(): string {
        return role;
    },
    set role(newrole: string) {
        role = newrole;
    },
    get id(): string {
        return id;
    },
    set id(newid: string) {
        id = newid;
    },
    set user(userobj: UserObj) {
        username = userobj.username;
        role = userobj.role;
        id = userobj._id;
    }
};
