import { Observable } from 'rxjs'; import { UserIdentity, AccessToken } from '../../misc/types'; import { AuthenticationServiceOptions } from './authenticationServiceOptions.interface'; import * as i0 from "@angular/core"; /** * Authentication service managing authentication */ export declare class AuthenticationService { private _options; /** * Authentication promise that was used for authentication */ private _authenticationPromise; /** * Resolved function for isInitialized */ private _isInitializedResolver; /** * Subject used for indicating authenticationChanged */ private _authenticationChangedSubject; /** * Last value of obtained user identity */ private _userIdentity; /** * Indication whether is authentication module initialized or not */ isInitialized: Promise; /** * Gets observable that indicates when authentication has changed */ get authenticationChanged(): Observable>; /** * Gets last value of obtained user identity, recomended to use only after authenticationChanged was emitted */ get userIdentity(): UserIdentity | null; constructor(_options: AuthenticationServiceOptions); /** * Tests whether is used authorized for specified permission * @param permission - Permission name that is tested * @returns Promise True if user is authorized otherwise false */ isAuthorizedSync(permission: string): boolean; /** * Tests whether is used authorized for specified permission * @param permission - Permission name that is tested * @returns Promise True if user is authorized otherwise false */ isAuthorized(permission: string): Promise; /** * Gets user identity * @param refresh - Indication that server get user identity should be called, otherwise cached response will be used */ getUserIdentity(refresh?: boolean): Promise>; /** * Method logs user into system * @param accessToken - Access token holding authentication information * @returns Observable */ login(accessToken: AccessToken): Observable; /** * Methods logs out user out of system * @returns Observable */ logout(): Observable; /** * Redirects current page to authentication page */ showAuthPage(): Promise; /** * Redirects current page to access denied page */ showAccessDenied(): Promise; /** * Gets indication whether current state of app is displaying auth page or provided path is checked * @param path - Path to be tested whether is auth page, if not set, current page is checked */ isAuthPage(path?: string): boolean; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵprov: i0.ɵɵInjectableDeclaration>; } //# sourceMappingURL=authentication.service.d.ts.map