import { Router } from '@angular/router'; import { Observable } from 'rxjs'; import { VedraxApiService } from './vedrax-api.service'; import { LocalStorageService } from './local-storage.service'; import { User } from '../shared/user.model'; import { UserDto } from '../shared/user-dto'; import { Role } from '../shared/role.enum'; import * as i0 from "@angular/core"; export declare class AuthenticationService { private apiService; private localStorageService; private router; /** * Hold the authenticated user that needs to be share with other components */ private currentUserSubject; /** * An Observable of the authenticated user */ currentUserObs: Observable; constructor(apiService: VedraxApiService, localStorageService: LocalStorageService, router: Router); /** * Helper method for getting user from local storage otherwise it creates a user as visitor * @returns user */ private getUserFromLocalStorage; /** * Helper method for detecting if the user is logged in */ get isLoggedIn(): boolean; /** * Helper method for detecting if a user has permission * @param roles the authorized roles * @returns true if the user has the role contains in the provided authorized roles, otherwise false */ hasPermission(roles?: Role[]): boolean; /** * Get authenticated user */ get currentUserValue(): User; /** * Set authentication by passing user to subject */ setAuthentication(user: User): void; /** * Sign in a user * @param email * @param password */ login(dto: UserDto, path: string): Observable; /** * Log user out by removing user from local storage */ logout(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }