import { IHttpClient } from "./IHttpClient"; export interface UserParams { /** * `true` if user is an administrator */ isAdmin?: boolean; /** * User name */ userName?: string; /** * First name */ firstName?: string; /** * Last name */ lastName?: string; /** * `true` if user is allowed to create a project */ canCreateProject?: boolean; /** * The maximum number of projects that the user can create */ projectsLimit?: number; /** * The size of the file storage available to the user */ storageLimit?: number; } /** * The class representing a `user` entity. */ export declare class User { private _data; protected httpClient: IHttpClient; /** * @param data - An object that implements user data storage. * @param httpClient - Http client. */ constructor(data: any, httpClient: IHttpClient); /** * User avatar image URL. Use {@link User#setAvatar | setAvatar()} to change avatar image. * * @readonly */ get avatarUrl(): string; /** * `true` if user is allowed to create a project. * * @readonly */ get canCreateProject(): boolean; /** * User account registration time (UTC) in the format specified in ISO 8601. * * @readonly */ get createAt(): string; /** * User custom fields object, to store custom data. */ get customFields(): any; set customFields(value: any); /** * Raw user data received from the server. * * @readonly */ get data(): any; private set data(value); /** * User email. * * @readonly */ get email(): string; /** * The user's email confirmation code, or an empty string if the email has already been confirmed. * * @readonly */ get emailConfirmationId(): string; /** * First name. */ get firstName(): string; set firstName(value: string); /** * Full name. Returns the user's first and last name. If first name and last names are empty, * returns the user name. */ get fullName(): string; /** * Unique user ID. * * @readonly */ get id(): string; /** * User initials. Returns a first letters of the user's first and last names. If first name * and last names are empty, returns the first letter of the user name. */ get initials(): string; /** * `false` if the user has not yet confirmed his email address. * * @readonly */ get isEmailConfirmed(): boolean; /** * User last update time (UTC) in the format specified in ISO 8601. */ get lastModified(): string; /** * Last name. */ get lastName(): string; set lastName(value: string); /** * User last sign in time (UTC) in the format specified in ISO 8601. */ get lastSignIn(): string; /** * The maximum number of projects that a user can create. * * @readonly */ get projectsLimit(): number; /** * The user's API key. * * @readonly */ get token(): string; /** * User name. */ get userName(): string; set userName(value: string); /** * Refresh user data. Only admins can checkout other users, if the current logged in user * does not have administrator rights, hi can only checkout himself, otherwise an exception * will be thrown. */ checkout(): Promise; /** * Update user data on the server. Only admins can update other users, if the current logged * in user does not have administrator rights, hi can only update himself, otherwise an * exception will be thrown. * * @async * @param data - Raw user data. */ update(data: any): Promise; /** * Delete a user from the server. Only admins can delete users, if the current logged in user * does not have administrator rights, an exception will be thrown. * * Admins can delete themselves or other admins. An admin can only delete himself if he is * not the last administrator. * * You need to re-login to continue working after deleting the current logged in user. * * @async * @returns Returns the raw data of a deleted user. */ delete(): Promise; /** * Save user data changes to the server. Call this method to update user data on the server * after any changes. * * @async */ save(): Promise; /** * Set or remove the user avatar. Only admins can set the avatar of other users, if the * current logged in user does not have administrator rights, he can only set his own avatar, * otherwise an exception will be thrown. * * @async * @param image - Avatar image. Can be a Data URL string, ArrayBuffer, Blob or * Web API File object. Setting the `image` to `null` will remove the avatar. */ setAvatar(image?: ArrayBuffer | Blob | globalThis.File | FormData | string | null): Promise; } //# sourceMappingURL=User.d.ts.map