import { Message, MessageConstructorOptions } from './Message.js'; import { AuthToken, User } from './User.js'; export declare class UserController { /** * Validity of the auth token in seconds */ static readonly AUTH_TOKEN_VALIDITY: number; /** * */ static getPluginDefaultData(pluginName: string): any; /** */ static getPluginsDefaultData(): { [pluginName: string]: any; }; /** * Get a neutral user used for sending information messages */ static getNeutralUser(identifier?: string): User; /** * Create a neutral message */ static createNeutralMessage(options: Partial, identifier?: string): Message; /** * Hash a specific user's password */ static hashPassword(userId: number, username: string, password: string): string; /** * Get an user in the database from its id */ static getUserByUsername(username: string): Promise; /** * Get an user in the database from its id */ static getUserById(userId: number): Promise; /** * Get all users */ static getAllUsers(): Promise; /** * Convert a user row fetched from sql to an user object */ static userRowToObject(row: any): User; /** * Store a new user in the database */ static register(username: string, password: string): Promise; /** * Login attempt. If login is successful, updates the username case in the database. */ static login(username: string, password: string): Promise; /** * Build an auth token */ static getAuthToken(userId: number, timestamp?: number): AuthToken; /** * Verify an auth token */ static verifyAuthToken(token: AuthToken): Promise; /** * Get a plugin stored data */ static getUserPluginData(user: User, pluginName: string): T; /** * Remove money from an user account */ static buy(user: User, amount: number): Promise; /** * Give money to an user */ static giveMoney(user: User, amount: number): Promise; /** * Give XP to an user */ static giveXP(user: User, amount: number): Promise; /** * Save plugin data */ static savePluginData(user: User, pluginName: string, data: any): Promise; /** * Sync an user to the the database */ static sync(user: User): Promise; static changeUsernameCase(user: User, newUsernameCase: string): Promise; /** * Change one's username */ static changeUsername(user: User, newUsername: string, currentPassword: string): Promise; /** * Change one's password */ static changePassword(user: User, newPassword: string): Promise; }