export type UserData = { plugins: { [pluginName: string]: any; }; }; export type AuthToken = { userId: number; timestamp: number; signature: string; }; export type SanitizedUser = { id: number; username: string; money: number; xp: number; right: number; data: UserData; }; /** * A SkyChatUser is an user stored in the database */ export declare class User { /** * Default user data object. */ static readonly DEFAULT_DATA_OBJECT: UserData; /** * Username regexp (including guests) */ static USERNAME_REGEXP: RegExp; /** * Valid username regexp */ static USERNAME_LOGGED_REGEXP: RegExp; /** * Valid email regexp */ static EMAIL_REGEXP: RegExp; readonly id: number; username: string; email: string | null; private password; money: number; xp: number; right: number; data: UserData; storage: any; constructor(id: number, username: string, email: string | null, password: string, money: number, xp: number, right: number, data?: UserData, storage?: any); /** * Whether this user represents the system */ isSystem(): boolean; /** * Whether this user is a guest */ isGuest(): boolean; /** * Test if a given password is the current one * @param hashed */ testHashedPassword(hashed: string): boolean; /** * Set new password * @param newHashedPassword */ setHashedPassword(newHashedPassword: string): void; /** * What will be sent to the client */ sanitized(): SanitizedUser; }