UNPKG

@enonic/mock-xp

Version:

Mock Enonic XP API JavaScript Library

45 lines (37 loc) 788 B
import type { UserWithProfile as UserWithProfileInterface, } from '@enonic-types/lib-auth'; import type {UserConstructorParams} from './User'; import {User} from './User'; export declare interface UserWithProfileConstructorParams extends UserConstructorParams { profile?: Record<string, unknown> } export class UserWithProfile extends User implements UserWithProfileInterface { // Extend UserWithProfile profile?: Record<string, unknown>; constructor({ // User displayName, key, modifiedTime, email, idProvider, login, disabled = false, // Extensions profile }: UserWithProfileConstructorParams) { super({ displayName, key, modifiedTime, email, idProvider, login, disabled }); if (profile) { this.profile = profile; } } }