import { ChangeDetectorRef, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef, ViewContainerRef } from '@angular/core'; import { Subscription } from 'rxjs'; import { AuthenticationService } from '../../services'; import type { UserIdentity } from '../../misc/types'; import * as i0 from "@angular/core"; /** * Context used withing template of LetAuthorizedDirective (if used as structural directive) */ export interface LetAuthorizedContext { $implicit: boolean; letAuthorized: boolean; } /** * Directive that can be used both as structural and attribute directive, allows getting 'authorized' result in template for specified condition */ export declare class LetAuthorizedDirective implements OnInit, OnChanges, OnDestroy { protected _viewContainerRef: ViewContainerRef; protected _authSvc: AuthenticationService; protected _changeDetector: ChangeDetectorRef; protected _templateRef?: TemplateRef | undefined; /** * Current evaluated value of authorized condition */ protected _value: boolean; /** * Subscription for changes in authentication */ protected _subscription: Subscription | null; /** * Current evaluated value of authorized condition */ get value(): boolean; /** * Condition that should be evaluated and used for obtaining authorized result */ condition: string | string[]; /** * Indication that AND condition should be used instead of OR condition if multiple permissions are provided */ andCondition: boolean; /** * Indication that provided string is set of loggical operations among permission names, if this is true andCondition is ignored */ conditionString: boolean; /** * Additional condition that is added to evaluation of permission */ addCondition: boolean; constructor(_viewContainerRef: ViewContainerRef, _authSvc: AuthenticationService, _changeDetector: ChangeDetectorRef, _templateRef?: TemplateRef | undefined); /** * Initialize component */ ngOnInit(): void; /** * Called when input value changes */ ngOnChanges(changes: SimpleChanges): void; /** * Called when component is destroyed */ ngOnDestroy(): void; /** * Process authorization * @param userIdentity - Current user identity instance */ protected _processAuthorization(userIdentity: UserIdentity | null): void; /** * Evaluates authorization condition * @param userIdentity - Current user identity instance */ protected _evaluateAuthorization(userIdentity: UserIdentity | null): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } //# sourceMappingURL=letAuthorized.directive.d.ts.map