/** * Module: Models for Users. */ import { LibraryItemID } from './library'; /** * Represents {@link User} identifier type. */ export type UserID = number; /** * Represents user detailed information. * Some information should only be accessible to authorized users */ export interface IUser { id: UserID; username: string; is_staff: boolean; email: string; first_name: string; last_name: string; } /** * Represents CurrentUser information. */ export interface ICurrentUser extends Pick { editor: LibraryItemID[]; } /** * Represents signup data, used to create new users. */ export interface IUserSignupData extends Omit { password: string; password2: string; } /** * Represents user profile for viewing and editing {@link IUser}. */ export interface IUserProfile extends Omit {} /** * Represents user reference information. */ export interface IUserInfo extends Omit {} /** * Represents user access mode. */ export enum UserRole { READER = 0, EDITOR, OWNER, ADMIN }