import * as i0 from '@angular/core'; import { TemplateRef, ViewContainerRef } from '@angular/core'; import { ClaimLike, UserCondition } from '@bootkit/ng1/common'; /** User */ declare class User { readonly claims: i0.WritableSignal; constructor(claims: string[]); addClaim(claim: string): boolean; removeClaim(claim: string): boolean; hasAllClaims(claims: string[]): boolean; hasAnyClaim(claims: string[]): boolean; hasClaim(claim: ClaimLike): boolean; } /** * Service to manage the current user state. */ declare class UserStore { readonly user: i0.WritableSignal; /** * Check if the given condition is met by the current user. * If there is no user, only 'false' condition is met. * If there is a user, 'true' conditions and claims will be checked. * @param condition The user condition to check * @returns Whether the condition is met */ checkCondition(condition: UserCondition): boolean; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵprov: i0.ɵɵInjectableDeclaration>; } /** * @deprecated use *ng1User instead */ declare class ClaimDirective { private _viewCreated; private _templateRef; private _viewContainer; private _userStore; /** * Claim to check */ readonly claim: i0.InputSignal; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * @deprecated use *ng1User directive instead */ declare class GuestUserDirective { private _created; constructor(templateRef: TemplateRef, viewContainer: ViewContainerRef, userStore: UserStore); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class SecurityModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * Directive to conditionally display content based on user claims or conditions. * If there is no condition provided, the content is always shown. * If a condition is provided, it checks against the current user. * @example * ```html * * This content is shown only if there is a logged-in user, regardless of claims. * * * This content is shown only if there is no logged-in user. * * * This content is shown only if the user has the 'admin' claim. * * * This content is shown only if the user has both 'read' and 'write' claims. * * * This content is shown if the user has either 'editor' or 'contributor' claims. * * * This content is always shown, regardless of user state. * * ``` */ declare class UserDirective { private _viewCreated; private readonly _templateRef; private readonly _viewContainer; private readonly _userStore; /** * Show condition to check * */ readonly condition: i0.InputSignal; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } export { ClaimDirective, GuestUserDirective, SecurityModule, User, UserDirective, UserStore };